@ranger-testing/ranger-cli 3.1.2-alpha.b450a14-41 → 3.1.3-alpha.2c5eb8e-44

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 +2 -2
@@ -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
+ const _0x2767ba=_0x475f;(function(_0x45ddae,_0xbb1663){const _0x5dbd01=_0x475f,_0x489a25=_0x45ddae();while(!![]){try{const _0xd8ab67=parseInt(_0x5dbd01(0x265))/0x1*(parseInt(_0x5dbd01(0x26e))/0x2)+parseInt(_0x5dbd01(0x212))/0x3*(parseInt(_0x5dbd01(0x201))/0x4)+parseInt(_0x5dbd01(0x275))/0x5*(parseInt(_0x5dbd01(0x1e9))/0x6)+parseInt(_0x5dbd01(0x1e7))/0x7+parseInt(_0x5dbd01(0x25c))/0x8*(-parseInt(_0x5dbd01(0x21f))/0x9)+parseInt(_0x5dbd01(0x20b))/0xa*(-parseInt(_0x5dbd01(0x238))/0xb)+-parseInt(_0x5dbd01(0x1e8))/0xc;if(_0xd8ab67===_0xbb1663)break;else _0x489a25['push'](_0x489a25['shift']());}catch(_0x3a1db6){_0x489a25['push'](_0x489a25['shift']());}}}(_0x2444,0x2eafc));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x246a00 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(_0x3b8231){const _0xd1b98e=_0x475f,_0x322dfb={'EsuGc':_0xd1b98e(0x1f1)};try{return new URL(_0x3b8231)[_0xd1b98e(0x256)];}catch{return _0x322dfb[_0xd1b98e(0x1df)];}}function errorMessageForTelemetry(_0x593d2f){const _0x32e626=_0x475f,_0x358677={'HAMJm':function(_0x4c9bee,_0xfb5873){return _0x4c9bee instanceof _0xfb5873;}};return _0x358677['HAMJm'](_0x593d2f,Error)?_0x593d2f[_0x32e626(0x229)]:undefined;}function trackBridgeEvent(_0x476a3d,_0x2023d8){const _0x5d8819=_0x475f,_0x5f9b5={'MpaXg':'tunnel_bridge_event','ScIkK':_0x5d8819(0x25b)};if(!_0x476a3d)return;const _0x3cb7c6={'tunnelSessionId':_0x2023d8[_0x5d8819(0x1e5)],'tunnelEventType':_0x2023d8[_0x5d8819(0x233)],'connectionId':_0x2023d8[_0x5d8819(0x24b)],'code':_0x2023d8['code'],'reason':_0x2023d8[_0x5d8819(0x21d)],'error':_0x2023d8['error'],'elapsedMs':_0x2023d8['elapsedMs'],'activeLocalConnections':_0x2023d8[_0x5d8819(0x269)],'pendingLocalConnections':_0x2023d8['pendingLocalConnections']};_0x476a3d[_0x5d8819(0x1fb)](_0x5f9b5['MpaXg'],_0x3cb7c6),(_0x2023d8['type']==='tunnel_error'||_0x2023d8['type']===_0x5d8819(0x20d))&&void _0x476a3d['trackPhaseError'](_0x5f9b5['ScIkK'],new Error(_0x2023d8[_0x5d8819(0x1f2)]??_0x2023d8['type']),_0x3cb7c6);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x22e9c8=_0x475f,_0x163194={'kXTXA':function(_0x4f8ea4){return _0x4f8ea4();},'oEKSe':_0x22e9c8(0x252)},_0x11b56d=await _0x163194['kXTXA'](getToken);if(!_0x11b56d)throw new Error(_0x163194['oEKSe']);return _0x11b56d;}async function apiRequest(_0x1741dc,_0x5ba180={}){const _0xf96677=_0x475f,_0x2d07be={'rUjlI':function(_0x3e23f7){return _0x3e23f7();},'JZpoe':_0xf96677(0x236),'Jyagq':function(_0x1e9ab2,_0x926bb1){return _0x1e9ab2===_0x926bb1;},'QYWQZ':_0xf96677(0x23d)},_0x589cb7=await requireToken(),_0x3fbe2f=_0x2d07be['rUjlI'](getApiBaseUrl),_0x1f7893=await fetch(''+_0x3fbe2f+_0x1741dc,{..._0x5ba180,'headers':{'Authorization':'Bearer\x20'+_0x589cb7,'Content-Type':_0x2d07be['JZpoe'],..._0x5ba180[_0xf96677(0x1f3)]??{}}});if(!_0x1f7893['ok']){let _0x6a8ab7='',_0x1afecd;try{const _0x5b22e5=await _0x1f7893[_0xf96677(0x278)](),_0x250b5a=(_0x2d07be['Jyagq'](typeof _0x5b22e5[_0xf96677(0x1f2)],_0x2d07be['QYWQZ'])?_0x5b22e5['error']:undefined)??JSON[_0xf96677(0x273)](_0x5b22e5);_0x6a8ab7=_0x250b5a;_0x2d07be[_0xf96677(0x1f5)](typeof _0x5b22e5['test_output'],_0xf96677(0x23d))&&_0x5b22e5['test_output']&&(_0x6a8ab7=_0x6a8ab7+'\x0a'+_0x5b22e5[_0xf96677(0x270)]);if(_0x2d07be[_0xf96677(0x1f5)](typeof _0x5b22e5['code'],_0x2d07be[_0xf96677(0x1fc)]))_0x1afecd=_0x5b22e5[_0xf96677(0x279)];}catch{_0x6a8ab7=_0x1f7893[_0xf96677(0x21a)];}throw new ApiError(_0xf96677(0x254)+_0x1741dc+_0xf96677(0x205)+_0x1f7893[_0xf96677(0x22d)]+_0xf96677(0x213)+_0x6a8ab7,_0x1f7893['status'],_0x6a8ab7,_0x1afecd);}if(_0x1f7893['status']===0xcc)return undefined;return _0x1f7893[_0xf96677(0x278)]();}export class ApiError extends Error{[_0x2767ba(0x22d)];[_0x2767ba(0x20e)];[_0x2767ba(0x279)];constructor(_0x1abf50,_0x593b83,_0x21ccc2,_0x5a7ac8){const _0x1622a0=_0x2767ba,_0x789ba4={'TIiss':'2|1|3|4|0'},_0x369099=_0x789ba4[_0x1622a0(0x220)][_0x1622a0(0x200)]('|');let _0x24f51a=0x0;while(!![]){switch(_0x369099[_0x24f51a++]){case'0':this['name']='ApiError';continue;case'1':this['status']=_0x593b83;continue;case'2':super(_0x1abf50);continue;case'3':this['detail']=_0x21ccc2;continue;case'4':this['code']=_0x5a7ac8;continue;}break;}}}export async function fetchCloudProfile(_0x57993e){const _0x5c7aeb=_0x2767ba;try{return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x57993e));}catch(_0x1f21d3){if(_0x1f21d3 instanceof ApiError&&_0x1f21d3[_0x5c7aeb(0x22d)]===0x194)return null;throw _0x1f21d3;}}export async function listCloudProfiles(){const _0x42d152=_0x2767ba,_0x62d4c=await apiRequest('/api/v1/profiles');return _0x62d4c[_0x42d152(0x1f0)];}export async function deleteCloudProfile(_0x145380){const _0x1f8df0=_0x2767ba,_0x239b5f={'ZlpTS':function(_0x1d1dc8,_0xcd040f,_0x96b8ca){return _0x1d1dc8(_0xcd040f,_0x96b8ca);},'ZvKcq':function(_0x561ff9,_0x5ab126){return _0x561ff9(_0x5ab126);},'yHPEQ':'DELETE'};try{await _0x239b5f[_0x1f8df0(0x21b)](apiRequest,'/api/v1/profiles/'+_0x239b5f[_0x1f8df0(0x23f)](encodeURIComponent,_0x145380),{'method':_0x239b5f[_0x1f8df0(0x276)]});}catch(_0x9007fc){if(_0x9007fc instanceof ApiError&&_0x9007fc['status']===0x194)throw new Error(_0x1f8df0(0x27b)+_0x145380+_0x1f8df0(0x253));throw _0x9007fc;}}export async function createCloudProfile(_0x3b3833,_0x4a7451,_0x3b1410={}){const _0x351892=_0x2767ba,_0x1df474={'name':_0x3b3833};if(_0x4a7451)_0x1df474[_0x351892(0x230)]=_0x4a7451;_0x3b1410['settings']&&Object['keys'](_0x3b1410[_0x351892(0x23a)])[_0x351892(0x26f)]>0x0&&(_0x1df474['settings']=_0x3b1410[_0x351892(0x23a)]);if(_0x3b1410['username'])_0x1df474['username']=_0x3b1410['username'];if(_0x3b1410['password'])_0x1df474[_0x351892(0x22c)]=_0x3b1410[_0x351892(0x22c)];return await apiRequest(_0x351892(0x239),{'method':'POST','body':JSON['stringify'](_0x1df474)});}export async function uploadCloudProfileSession(_0x1d5042,_0x25d60f){const _0x5a1301=_0x2767ba,_0x3c8978={'PsiOJ':function(_0x1e82bc,_0x13e96d,_0x57bc3f){return _0x1e82bc(_0x13e96d,_0x57bc3f);},'qrEIX':function(_0x3a8b05,_0x233fc0){return _0x3a8b05(_0x233fc0);}};return await _0x3c8978[_0x5a1301(0x27a)](apiRequest,'/api/v1/profiles/'+_0x3c8978['qrEIX'](encodeURIComponent,_0x1d5042)+'/session',{'method':'POST','body':JSON[_0x5a1301(0x273)]({'session_state':_0x25d60f})});}export async function saveCloudProfileCredentials(_0x1b5f3e,_0x5e79f5,_0x540e4d){const _0x279ca2=_0x2767ba,_0x3a581f={'eLYZm':function(_0x188313,_0x56f54e){return _0x188313(_0x56f54e);}};await apiRequest('/api/v1/profiles/'+_0x3a581f[_0x279ca2(0x237)](encodeURIComponent,_0x1b5f3e),{'method':'PUT','body':JSON[_0x279ca2(0x273)]({'username':_0x5e79f5,'password':_0x540e4d})});}export async function fetchAuthConfig(){const _0x3acf9f=_0x2767ba,_0x2063c4={'KiQJd':function(_0x5e4dda,_0x1a1d49){return _0x5e4dda(_0x1a1d49);},'lvTRG':'/api/v1/profiles/auth-config'};try{const _0x18664d=await _0x2063c4['KiQJd'](apiRequest,_0x2063c4[_0x3acf9f(0x1fa)]);return _0x18664d[_0x3acf9f(0x235)];}catch(_0x41039f){return _0x41039f instanceof ApiError&&_0x41039f['status']!==0x194&&console['error'](_0x3acf9f(0x255)+_0x41039f['message']),null;}}async function createTunnelSession(_0x1c63f5){const _0x207eb9=_0x2767ba,_0x52faa6={'ZlYqU':function(_0xa7defb,_0x458ed8,_0x44f849){return _0xa7defb(_0x458ed8,_0x44f849);}};return await _0x52faa6[_0x207eb9(0x271)](apiRequest,_0x207eb9(0x240),{'method':_0x207eb9(0x22a),'body':JSON[_0x207eb9(0x273)]({'targetUrl':_0x1c63f5,'mode':'agent'})});}async function deleteTunnelSession(_0x12fe61){const _0x167467=_0x2767ba,_0x2320a7={'DzNOp':function(_0x31c655,_0x3e89ac,_0x5018c9){return _0x31c655(_0x3e89ac,_0x5018c9);},'gHfSV':'DELETE'};await _0x2320a7['DzNOp'](apiRequest,'/api/v1/tunnel/sessions/'+_0x12fe61,{'method':_0x2320a7[_0x167467(0x259)]});}function _0x2444(){const _0x458c91=['tunnel','environment_key','\x22\x20for\x20','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','type','confirm','auth_config','application/json','eLYZm','868934iCLLOG','/api/v1/profiles','settings','environmentKey','isArray','string','/api/v1/profiles/','ZvKcq','/api/v1/tunnel/sessions','tunnel_login_cleanup','nyAgY','Browser\x20login\x20timed\x20out\x20after\x20','close','MLDqg','organizationId','qBpab','session_state','qfPiB','sessionState','connectionId','hVkQZ','/login','hTaaa','ojdbT','PreBP','invalidateOn','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','\x22\x20not\x20found.','API\x20request\x20','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','host','Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.','tunnel_login_request','gHfSV','forceLogin','tunnel_bridge','8jgRiHM','prompt','trackPhaseError','BIDOb','RANGER_TEST_USERNAME','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','sessionCheckPath','true','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','1cbqrWX','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','push','not_configured','activeLocalConnections','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','oyWgi','raw','bGwBx','542584VnIIWX','length','test_output','ZlYqU','rXUOt','stringify','targetUrl','1965hSCNir','yHPEQ','loginInstructions','json','code','PsiOJ','Cloud\x20profile\x20\x22','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','LqDyU','browserOptions','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','some','djFay','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','EsuGc','FBWSS','force','mXTJP','domains','url','sessionId','env','2074345Nljywr','4677624drVSUl','3066IsSHMf','cookies','tunnel_session_id','telemetry','ySNpE',').\x20','tunnelUrl','profiles','invalid-url','error','headers','\x20\x20No\x20live\x20session\x20for\x20\x22','Jyagq','\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...','\x22\x20failed\x20validation\x20—\x20refreshing...','\x20\x20Created\x20cloud\x20profile\x20\x22','\x22.\x0a','lvTRG','trackPhaseEnd','QYWQZ','name','WtFNc','vVJAU','split','128168CnfskI','LnTfT','trackPhaseStart','\x22,\x20attempting\x20login...','\x20failed\x20(','log','\x22,\x20cached\x20locally','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','RANGER_TUNNEL_LOGIN_HEADED','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','10bxwZKM','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','local_ws_error','detail','TwVgx','RANGER_TEST_PASSWORD','YDTaG','9nYOMKx','):\x20','DtwKI','cBDmT','newPage','userAgent','tunnel_login_setup','pwEndpoint','statusText','ZlpTS','PUT','reason','newContext','1840968VKDOkY','TIiss','join','kwrtW','\x20\x20Cached\x20session\x20for\x20\x22','origin','HfxrV','username','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','launch','message','POST','then','password','status','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:'];_0x2444=function(){return _0x458c91;};return _0x2444();}export function pickAdHocEnvKey(_0x15732c){const _0x417176=_0x2767ba,_0x56ed8f={'qBpab':function(_0x37fd9d,_0xd4e98f){return _0x37fd9d===_0xd4e98f;}};if(!_0x15732c)return null;if(_0x15732c['defaultEnvironmentKey'])return _0x15732c['defaultEnvironmentKey'];const _0x955179=Object['keys'](_0x15732c['environments']??{});if(_0x56ed8f[_0x417176(0x247)](_0x955179[_0x417176(0x26f)],0x1))return _0x955179[0x0];if(_0x955179[_0x417176(0x26f)]===0x0)return null;throw new Error(_0x417176(0x266)+_0x955179[_0x417176(0x221)](',\x20')+_0x417176(0x1ee)+_0x417176(0x257));}export async function resolveAdHocProfile(_0x1fae8e=process['env']){const _0x50aef4=_0x2767ba,_0x1bb33d={'TwVgx':function(_0x40f41c,_0x255527,_0x32bff8,_0x1ad68d){return _0x40f41c(_0x255527,_0x32bff8,_0x1ad68d);}},_0x8c16cc=_0x1fae8e['RANGER_TEST_USERNAME'];if(!_0x8c16cc)return null;const _0x55be14=await fetchCloudProfile(_0x8c16cc);if(_0x55be14)return{'name':_0x55be14['name'],'profile':_0x55be14};const _0x80d2c2=await fetchAuthConfig(),_0x3eb711=pickAdHocEnvKey(_0x80d2c2),_0x192175=_0x1fae8e['RANGER_TEST_PASSWORD'],_0x7c4f27=await _0x1bb33d[_0x50aef4(0x20f)](createCloudProfile,_0x8c16cc,_0x3eb711??undefined,{'username':_0x8c16cc,'password':_0x192175});return console['log'](_0x50aef4(0x1f8)+_0x7c4f27['name']+_0x50aef4(0x231)+_0x8c16cc),{'name':_0x7c4f27['name'],'profile':_0x7c4f27};}function _0x475f(_0x11a94c,_0x31a040){_0x11a94c=_0x11a94c-0x1dd;const _0x244463=_0x2444();let _0x475f19=_0x244463[_0x11a94c];return _0x475f19;}export async function writeSessionToLocalCache(_0x2a5e46,_0x2c9cef,_0x570fc1,_0x315cd9,_0xa4a97c,_0x5dc51d,_0x28a132){const _0x13e734=_0x2767ba,_0x5d67f8={'YDTaG':function(_0x5af3eb,_0x4e9ca2,_0x462f95){return _0x5af3eb(_0x4e9ca2,_0x462f95);},'TmkDc':function(_0xc1cf0f){return _0xc1cf0f();},'gomCl':function(_0x2ebd8f,_0x58f98c){return _0x2ebd8f(_0x58f98c);},'hVkQZ':function(_0x335a25,_0x28aef4,_0x2823ae){return _0x335a25(_0x28aef4,_0x2823ae);}},_0x57e1cb=sessionCacheHash({'orgId':_0x2c9cef,'profileName':_0x2a5e46,'effectiveBaseUrl':_0x570fc1,'setupHeaders':_0x315cd9,'invalidateOn':_0x28a132?.['invalidateOn'],'userAgent':_0x28a132?.[_0x13e734(0x217)],'clientIp':_0x28a132?.['clientIp']}),_0x354e04=_0x5d67f8[_0x13e734(0x211)](getSessionCachePath,_0x57e1cb,_0x2a5e46),_0x1d4746=join(_0x5d67f8['TmkDc'](getRangerHomeDir),'auth');!_0x5d67f8['gomCl'](existsSync,_0x1d4746)&&await mkdir(_0x1d4746,{'recursive':!![]});const _0x7d12d9={..._0xa4a97c};_0x5dc51d&&_0x5dc51d['length']>0x0&&Array[_0x13e734(0x23c)](_0x7d12d9['cookies'])&&(_0x7d12d9[_0x13e734(0x1ea)]=_0x5d67f8[_0x13e734(0x211)](duplicateCookiesForDomains,_0x7d12d9[_0x13e734(0x1ea)],_0x5dc51d));const _0x22c690={'cached_at':new Date()['toISOString'](),'session_state':_0x7d12d9};await _0x5d67f8[_0x13e734(0x24c)](writeFile,_0x354e04,JSON[_0x13e734(0x273)](_0x22c690,null,0x2));const _0x8f7675=getStorageStatePath(_0x354e04);return await writeFile(_0x8f7675,JSON[_0x13e734(0x273)](_0x7d12d9,null,0x2)),_0x8f7675;}export async function checkLocalCache(_0x50741a,_0x579a98,_0x4d4fde,_0x531be5,_0x5b94f0){const _0x4614e8=_0x2767ba,_0x27d6f6={'FxMVP':function(_0x20494c,_0x473df1){return _0x20494c(_0x473df1);},'KMneh':'utf-8'},_0xf34de6=sessionCacheHash({'orgId':_0x579a98,'profileName':_0x50741a,'effectiveBaseUrl':_0x4d4fde,'setupHeaders':_0x531be5,'invalidateOn':_0x5b94f0?.[_0x4614e8(0x251)],'userAgent':_0x5b94f0?.[_0x4614e8(0x217)],'clientIp':_0x5b94f0?.['clientIp']}),_0x4a7407=getSessionCachePath(_0xf34de6,_0x50741a),_0x397f04=getStorageStatePath(_0x4a7407);if(!existsSync(_0x4a7407)||!_0x27d6f6['FxMVP'](existsSync,_0x397f04))return null;try{const _0x53a7a3=await readFile(_0x4a7407,_0x27d6f6['KMneh']);return JSON['parse'](_0x53a7a3),{'storageStatePath':_0x397f04};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x431586,_0x9296a6){const _0x1da595=_0x2767ba,_0x380476={'VXCDf':function(_0x3ef423,_0x56137e){return _0x3ef423===_0x56137e;}};if(!_0x9296a6||!_0x9296a6['domains']?.['length'])return;let _0x2e7608;try{_0x2e7608=new URL(_0x431586);}catch{return;}const _0x5ba297=[];for(const _0x2e46a2 of _0x9296a6[_0x1da595(0x1e3)]){try{_0x5ba297[_0x1da595(0x267)]({'raw':_0x2e46a2,'url':new URL(_0x2e46a2)});}catch{}}if(_0x380476['VXCDf'](_0x5ba297['length'],0x0))return;if(_0x5ba297[_0x1da595(0x280)](_0x12ffad=>_0x12ffad[_0x1da595(0x1e4)][_0x1da595(0x224)]===_0x2e7608['origin']))return;const _0x5d9202=_0x5ba297['map'](_0x2357b0=>'\x22'+_0x2357b0[_0x1da595(0x26c)]+'\x22')[_0x1da595(0x221)](',\x20');console['log'](_0x1da595(0x264)+_0x5d9202+';\x20'+('you\x27re\x20now\x20at\x20\x22'+_0x431586+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20')+'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.');}export async function serverSideLogin(_0x2bb4d0,_0x3fe8fd){const _0x393008=_0x2767ba,_0x7682e2={'cBDmT':_0x393008(0x22a),'DtwKI':function(_0x31d8e4,_0x20898d){return _0x31d8e4 instanceof _0x20898d;},'WtFNc':function(_0x32da8f,_0x348df0){return _0x32da8f===_0x348df0;},'SQoQI':_0x393008(0x268)},_0x3c41a6=process['env'][_0x393008(0x260)],_0x565b47=process[_0x393008(0x1e6)][_0x393008(0x210)],_0x15d3b5={};if(_0x3c41a6)_0x15d3b5[_0x393008(0x226)]=_0x3c41a6;if(_0x565b47)_0x15d3b5[_0x393008(0x22c)]=_0x565b47;if(_0x3fe8fd?.[_0x393008(0x1e1)])_0x15d3b5['force']=!![];if(_0x3fe8fd?.[_0x393008(0x274)])_0x15d3b5['target_url']=_0x3fe8fd[_0x393008(0x274)];_0x3fe8fd?.[_0x393008(0x22f)]&&(_0x15d3b5[_0x393008(0x1eb)]=_0x3fe8fd[_0x393008(0x22f)][_0x393008(0x1e5)],_0x15d3b5['pw_endpoint']=_0x3fe8fd[_0x393008(0x22f)][_0x393008(0x219)]);try{return await apiRequest(_0x393008(0x23e)+encodeURIComponent(_0x2bb4d0)+_0x393008(0x24d),{'method':_0x7682e2[_0x393008(0x215)],'body':JSON['stringify'](_0x15d3b5)});}catch(_0x44faad){if(_0x7682e2[_0x393008(0x214)](_0x44faad,ApiError)&&_0x44faad['status']===0x190&&_0x7682e2[_0x393008(0x1fe)](_0x44faad[_0x393008(0x279)],_0x7682e2['SQoQI']))return{'status':'not_configured','error':_0x44faad['detail']};throw _0x44faad;}}async function serverSideLoginWithOptionalTunnel(_0x376a33,_0x53838c,_0x5bb62e={}){const _0x3d62c6=_0x2767ba,_0xe9c8ba={'hTaaa':'tunnel_login_request','BIDOb':function(_0x3901fb,_0x666fcb){return _0x3901fb(_0x666fcb);},'ojdbT':function(_0x326f3c,_0x428e90,_0x25a416){return _0x326f3c(_0x428e90,_0x25a416);},'ukalM':function(_0x126cfe,_0x275081){return _0x126cfe===_0x275081;},'yeZNp':function(_0x56ac89,_0x1ddd35){return _0x56ac89===_0x1ddd35;},'PreBP':_0x3d62c6(0x263),'hsIMC':function(_0x30de80,_0x52e44c){return _0x30de80(_0x52e44c);},'SgAks':_0x3d62c6(0x1f6),'HfxrV':function(_0x2e484b,_0x3d25b4){return _0x2e484b(_0x3d25b4);},'nyAgY':function(_0x588944){return _0x588944();},'JuenS':function(_0x3bbb04,_0x3d989f){return _0x3bbb04(_0x3d989f);},'djFay':_0x3d62c6(0x218),'pXVTE':function(_0x263986,_0x5a1c2c){return _0x263986??_0x5a1c2c;},'UqckE':_0x3d62c6(0x241)};if(!_0xe9c8ba['BIDOb'](needsTunnel,_0x53838c))return await _0xe9c8ba[_0x3d62c6(0x24f)](serverSideLogin,_0x376a33,{'force':_0x5bb62e[_0x3d62c6(0x1e1)]});let _0x1bea0a=null,_0x2adf8f=null,_0x3901da=null,_0x287b85=null,_0x2659d8=![];const _0x398584=process['env'][_0x3d62c6(0x209)]?.['toLowerCase'](),_0x478401=_0xe9c8ba['ukalM'](_0x398584,'1')||_0xe9c8ba['yeZNp'](_0x398584,_0xe9c8ba[_0x3d62c6(0x250)]),_0x5bfa7f={'profileName':_0x376a33,'targetUrlHost':_0xe9c8ba[_0x3d62c6(0x25f)](targetHostForTelemetry,_0x53838c),'tunnelRequired':!![],'forceLogin':_0xe9c8ba['hsIMC'](Boolean,_0x5bb62e[_0x3d62c6(0x1e1)]),'localBrowserServerHeaded':_0x478401};try{_0x5bb62e['telemetry']?.[_0x3d62c6(0x203)]('tunnel_login_setup',_0x5bfa7f);_0x478401&&console['log'](_0xe9c8ba['SgAks']);_0x1bea0a=await _0xe9c8ba[_0x3d62c6(0x225)](launchBrowserServer,{'headless':!_0x478401}),_0x2adf8f=await createTunnelSession(_0x53838c);const _0x16ab5d=await _0xe9c8ba[_0x3d62c6(0x242)](requireToken);_0x3901da=await _0xe9c8ba['JuenS'](createTunnelBridge,{'localWsUrl':_0x1bea0a['wsEndpoint'],'tunnelServerUrl':_0x2adf8f[_0x3d62c6(0x1ef)],'sessionId':_0x2adf8f[_0x3d62c6(0x1e5)],'apiKey':_0x16ab5d,'onError':_0x2e90c4=>{_0x287b85=_0x2e90c4;},'onClose':()=>{const _0x562e1a=_0x3d62c6;_0x287b85??=new Error(_0x562e1a(0x26a)+_0x376a33);},'onEvent':_0x5cfa92=>trackBridgeEvent(_0x5bb62e[_0x3d62c6(0x1ec)],_0x5cfa92)}),_0x5bb62e[_0x3d62c6(0x1ec)]?.['trackPhaseEnd'](_0xe9c8ba[_0x3d62c6(0x1dd)],{..._0x5bfa7f,'tunnelSessionId':_0x2adf8f['sessionId'],'localBrowserServer':!![],'localBrowserServerHeaded':_0x478401}),_0x2659d8=!![];try{return _0x5bb62e[_0x3d62c6(0x1ec)]?.['trackPhaseStart'](_0x3d62c6(0x258),{..._0x5bfa7f,'tunnelSessionId':_0x2adf8f[_0x3d62c6(0x1e5)]}),await _0xe9c8ba[_0x3d62c6(0x24f)](serverSideLogin,_0x376a33,{'force':_0x5bb62e['force'],'targetUrl':_0x53838c,'tunnel':{'sessionId':_0x2adf8f['sessionId'],'pwEndpoint':_0x2adf8f[_0x3d62c6(0x219)]}})[_0x3d62c6(0x22b)](_0x374bf3=>{const _0x2f3ee1=_0x3d62c6;return _0x5bb62e[_0x2f3ee1(0x1ec)]?.['trackPhaseEnd'](_0xe9c8ba[_0x2f3ee1(0x24e)],{..._0x5bfa7f,'tunnelSessionId':_0x2adf8f?.[_0x2f3ee1(0x1e5)],'loginStatus':_0x374bf3[_0x2f3ee1(0x22d)],'hasSessionState':Boolean(_0x374bf3['session_state']),'hasTestOutput':Boolean(_0x374bf3['test_output']),'bridgeError':errorMessageForTelemetry(_0x287b85)}),_0x374bf3;});}catch(_0xf2b52c){await _0x5bb62e['telemetry']?.['trackPhaseError'](_0xe9c8ba['hTaaa'],_0xe9c8ba['pXVTE'](_0x287b85,_0xf2b52c),{..._0x5bfa7f,'tunnelSessionId':_0x2adf8f['sessionId'],'bridgeError':errorMessageForTelemetry(_0x287b85)});throw _0x287b85??_0xf2b52c;}}catch(_0x516e84){!_0x2659d8&&await _0x5bb62e['telemetry']?.[_0x3d62c6(0x25e)](_0xe9c8ba[_0x3d62c6(0x1dd)],_0x516e84,{..._0x5bfa7f,'tunnelSessionId':_0x2adf8f?.[_0x3d62c6(0x1e5)]});throw _0x516e84;}finally{(_0x2adf8f||_0x1bea0a||_0x3901da)&&(_0x5bb62e[_0x3d62c6(0x1ec)]?.['trackPhaseStart'](_0xe9c8ba['UqckE'],{..._0x5bfa7f,'tunnelSessionId':_0x2adf8f?.['sessionId']}),_0x3901da?.['close'](),_0x1bea0a&&await _0x1bea0a['close']()['catch'](()=>{}),_0x2adf8f&&await _0xe9c8ba['HfxrV'](deleteTunnelSession,_0x2adf8f['sessionId'])['catch'](()=>{}),_0x5bb62e[_0x3d62c6(0x1ec)]?.[_0x3d62c6(0x1fb)](_0x3d62c6(0x241),{..._0x5bfa7f,'tunnelSessionId':_0x2adf8f?.['sessionId']}));}}export async function manualBrowserLogin(_0x3c96c7,_0x3c209e,_0x16eb75={}){const _0x5177b4=_0x2767ba,_0x383ac9={'BagGd':function(_0x2b606a,_0x297ad3){return _0x2b606a/_0x297ad3;},'LnTfT':function(_0x2ef4c3){return _0x2ef4c3();},'YVQYz':_0x5177b4(0x244),'YRRkG':function(_0x28d674,_0x8e3279){return _0x28d674+_0x8e3279;},'Qpcoj':function(_0x230416,_0x3518a0){return _0x230416+_0x3518a0;},'YVziG':'\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','rXUOt':function(_0x4f1b36,_0xf27ae7){return _0x4f1b36(_0xf27ae7);},'mXTJP':_0x5177b4(0x20a),'kwrtW':function(_0x2de4b5,_0x41842b){return _0x2de4b5!==_0x41842b;}};if(!_0x383ac9['LnTfT'](isInteractive))throw new Error(_0x383ac9['YRRkG'](_0x383ac9['Qpcoj']('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x3c96c7[_0x5177b4(0x1fd)]+_0x5177b4(0x1f9),_0x5177b4(0x27c)),_0x5177b4(0x232)));const _0x5eb5b8=_0x3c209e&&_0x3c209e[_0x5177b4(0x1e3)]['length']>0x0?_0x3c209e[_0x5177b4(0x1e3)][0x0]:'about:blank';console[_0x5177b4(0x206)](_0x383ac9['YVziG']),console[_0x5177b4(0x206)]('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x3bc4c3=>setTimeout(_0x3bc4c3,0x7d0));const _0xc2e8a1=await chromium[_0x5177b4(0x228)]({'headless':![]});let _0x3ad11e=null;try{const _0x2f53e6={'ignoreHTTPSErrors':!![]};_0x3c209e?.['setupHeaders']&&(_0x2f53e6['extraHTTPHeaders']=_0x3c209e['setupHeaders']);const _0x3a4159=await _0xc2e8a1[_0x5177b4(0x21e)](_0x2f53e6);await _0x383ac9[_0x5177b4(0x272)](addProfileSetupBanner,_0x3a4159);const _0x19b6ad=await _0x3a4159[_0x5177b4(0x216)]();await _0x19b6ad['goto'](_0x5eb5b8);let _0x455bc5=![];await new Promise(_0x5e1813=>{const _0x361f91=setTimeout(()=>{const _0xd13a7=_0x475f;_0x455bc5=!![],console[_0xd13a7(0x1f2)](_0xd13a7(0x243)+_0x383ac9['BagGd'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0xd13a7(0x208)),_0x5e1813();},MANUAL_LOGIN_TIMEOUT_MS);_0x19b6ad['on'](_0x383ac9['YVQYz'],async()=>{const _0x5a6e45=_0x475f;clearTimeout(_0x361f91);try{const _0x33f567=await _0x3a4159['storageState']();_0x3ad11e=_0x33f567;}catch{}_0x383ac9[_0x5a6e45(0x202)](_0x5e1813);});});if(_0x455bc5&&!_0x3ad11e)throw new Error('Browser\x20login\x20timed\x20out\x20before\x20completion.');}finally{await _0xc2e8a1['close']()['catch'](()=>{});}if(!_0x3ad11e)throw new Error(_0x383ac9[_0x5177b4(0x1e2)]);return _0x383ac9[_0x5177b4(0x222)](_0x16eb75['persistSessionState'],![])&&await apiRequest(_0x5177b4(0x23e)+_0x383ac9[_0x5177b4(0x272)](encodeURIComponent,_0x3c96c7[_0x5177b4(0x1fd)])+'/session',{'method':_0x5177b4(0x22a),'body':JSON[_0x5177b4(0x273)]({'session_state':_0x3ad11e,'updated_by':'cli:manual-login'})}),{'sessionState':_0x3ad11e};}export async function promptSaveCredentials(_0x9a0f18){const _0x16f2fa=_0x2767ba,_0x15b479={'ySNpE':_0x16f2fa(0x234),'MxoFF':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','MLDqg':function(_0x379ca3,_0x388f36,_0x1df977){return _0x379ca3(_0x388f36,_0x1df977);}},_0x1fda75=process['env'][_0x16f2fa(0x260)],_0x217b0e=process['env'][_0x16f2fa(0x210)];if(!_0x1fda75||!_0x217b0e)return;if(!isInteractive())return;const {save:_0x276210}=await _0x246a00[_0x16f2fa(0x25d)]([{'type':_0x15b479[_0x16f2fa(0x1ed)],'name':'save','message':_0x15b479['MxoFF'],'default':![]}]);if(!_0x276210)return;await _0x15b479[_0x16f2fa(0x245)](apiRequest,_0x16f2fa(0x23e)+encodeURIComponent(_0x9a0f18),{'method':_0x16f2fa(0x21c),'body':JSON['stringify']({'username':_0x1fda75,'password':_0x217b0e})}),console['log']('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x108da2,_0x5df7d4={}){const _0x203514=_0x2767ba,_0x35d7ed={'vVJAU':function(_0x361446){return _0x361446();},'rzeUC':function(_0x6abfde,_0x47fa24,_0x4bab33){return _0x6abfde(_0x47fa24,_0x4bab33);},'FBWSS':_0x203514(0x23d),'bGwBx':function(_0x466ca7,_0x46c6c1){return _0x466ca7||_0x46c6c1;},'oaahu':function(_0x2efa40,_0x2e8f34){return _0x2efa40(_0x2e8f34);},'pWSzE':function(_0x44fb1b,_0x47dba4,_0x524ee6,_0xc6be8e,_0x188ef2,_0x69c8b){return _0x44fb1b(_0x47dba4,_0x524ee6,_0xc6be8e,_0x188ef2,_0x69c8b);},'cIvYj':function(_0x26fdde,_0x5a8594){return _0x26fdde&&_0x5a8594;},'qfPiB':function(_0xdfe326,_0x55402f,_0x17a303,_0x3c068a,_0x31cca1){return _0xdfe326(_0x55402f,_0x17a303,_0x3c068a,_0x31cca1);},'oyWgi':function(_0x138159,_0x11c8f1){return _0x138159(_0x11c8f1);},'kyEHR':function(_0x1297ea,_0x2806b7){return _0x1297ea||_0x2806b7;},'gxCuy':function(_0x5082e1,_0x457010,_0x18c5a5,_0x51f7e5){return _0x5082e1(_0x457010,_0x18c5a5,_0x51f7e5);},'MvbBM':function(_0x3d9b57,_0x45bbb4){return _0x3d9b57===_0x45bbb4;},'FaEZn':'success','sulwK':_0x203514(0x20c),'LiTWc':function(_0x38e5bc,_0xd4266a){return _0x38e5bc(_0xd4266a);},'LqDyU':function(_0x29ae76,_0x2ef58b,_0x40b8cf,_0x11c887){return _0x29ae76(_0x2ef58b,_0x40b8cf,_0x11c887);}},_0x5b0f87=_0x108da2[_0x203514(0x23a)]??{},_0x5cae81=await _0x35d7ed[_0x203514(0x1ff)](fetchAuthConfig),_0x17b695=_0x5cae81?_0x35d7ed['rzeUC'](resolveAuthEnvironmentLocally,_0x5cae81,_0x108da2[_0x203514(0x23b)]):null,_0x5ca9a2=typeof _0x17b695?.[_0x203514(0x277)]===_0x35d7ed['FBWSS']&&_0x17b695['loginInstructions']['trim']()?_0x17b695[_0x203514(0x277)]:undefined,_0x2c6000=typeof _0x5b0f87[_0x203514(0x277)]===_0x35d7ed[_0x203514(0x1e0)]&&_0x5b0f87['loginInstructions']['trim']()?_0x5b0f87['loginInstructions']:undefined,_0x34cc10=_0x35d7ed[_0x203514(0x26d)](_0x2c6000,!_0x5ca9a2)?_0x5b0f87:{..._0x5b0f87,'loginInstructions':_0x5ca9a2},_0x385e31=Boolean(_0x34cc10[_0x203514(0x277)]?.['trim']()),_0x1f8444=Boolean(_0x5b0f87[_0x203514(0x25a)]||_0x17b695?.['forceLogin']),_0x19e3b4=_0x17b695?.['domains'],_0x2c5912=_0x5b0f87['setupHeaders'],_0x318d51=_0x2c5912??_0x17b695?.['setupHeaders'],_0x1cc5fb=_0x5df7d4['effectiveBaseUrl']??_0x5b0f87['baseUrl']??(_0x19e3b4&&_0x19e3b4['length']>0x0?_0x19e3b4[0x0]:''),_0x32f3f3=_0x1cc5fb?_0x35d7ed['oaahu'](needsTunnel,_0x1cc5fb):![],_0x322b4d={'invalidateOn':_0x17b695?.[_0x203514(0x251)],'userAgent':_0x17b695?.[_0x203514(0x27e)]?.['userAgent']??_0x5b0f87[_0x203514(0x217)]};_0x1f8444&&console['log']('\x20\x20forceLogin\x20enabled\x20for\x20\x22'+_0x108da2[_0x203514(0x1fd)]+'\x22,\x20refreshing\x20session...');if(!_0x1f8444){const _0x4977fd=await _0x35d7ed['pWSzE'](checkLocalCache,_0x108da2[_0x203514(0x1fd)],_0x108da2[_0x203514(0x246)],_0x1cc5fb,_0x318d51,_0x322b4d);if(_0x4977fd){if(_0x35d7ed['cIvYj'](_0x1cc5fb,!_0x32f3f3)){const _0x136882=await _0x35d7ed[_0x203514(0x249)](isCachedSessionLive,_0x4977fd['storageStatePath'],_0x1cc5fb,{'sessionCheckPath':_0x17b695?.['sessionCheckPath'],'setupHeaders':_0x318d51},{'launchBrowser':launchRealBrowser});if(_0x136882)return console[_0x203514(0x206)](_0x203514(0x261)+_0x108da2[_0x203514(0x1fd)]+'\x22'),{'authPath':_0x4977fd['storageStatePath'],'settings':_0x34cc10,'resolvedEnv':_0x17b695};console[_0x203514(0x206)](_0x203514(0x223)+_0x108da2['name']+_0x203514(0x1f7)),emitSessionValidationHint(_0x1cc5fb,_0x17b695);}else return _0x32f3f3&&console['log'](_0x203514(0x27f)+_0x108da2[_0x203514(0x1fd)]+'\x22'),{'authPath':_0x4977fd['storageStatePath'],'settings':_0x34cc10,'resolvedEnv':_0x17b695};}}if(!_0x1f8444&&_0x108da2['sessionState']){if(_0x32f3f3)console['log']('\x20\x20Skipping\x20cloud\x20session\x20for\x20local\x20target\x20\x22'+_0x1cc5fb+'\x22\x20on\x20profile\x20\x22'+_0x108da2[_0x203514(0x1fd)]+'\x22');else{const _0x3dc703=await writeSessionToLocalCache(_0x108da2['name'],_0x108da2[_0x203514(0x246)],_0x1cc5fb,_0x318d51,_0x108da2[_0x203514(0x24a)],_0x19e3b4,_0x322b4d);if(_0x1cc5fb){const _0x141263=await isCachedSessionLive(_0x3dc703,_0x1cc5fb,{'sessionCheckPath':_0x17b695?.[_0x203514(0x262)],'setupHeaders':_0x318d51},{'launchBrowser':launchRealBrowser});if(_0x141263)return console[_0x203514(0x206)](_0x203514(0x227)+_0x108da2[_0x203514(0x1fd)]+_0x203514(0x207)),{'authPath':_0x3dc703,'settings':_0x34cc10,'resolvedEnv':_0x17b695};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x108da2[_0x203514(0x1fd)]+_0x203514(0x1de)),_0x35d7ed['rzeUC'](emitSessionValidationHint,_0x1cc5fb,_0x17b695);}else return{'authPath':_0x3dc703,'settings':_0x34cc10,'resolvedEnv':_0x17b695};}}if(_0x385e31)return console[_0x203514(0x206)](_0x203514(0x1f4)+_0x108da2[_0x203514(0x1fd)]+'\x22;\x20proceeding\x20with\x20loginInstructions.'),{'authPath':undefined,'settings':_0x34cc10,'resolvedEnv':_0x17b695};console[_0x203514(0x206)](_0x203514(0x1f4)+_0x108da2['name']+_0x203514(0x204));const _0x1e607a=_0x35d7ed[_0x203514(0x26b)](Boolean,process[_0x203514(0x1e6)]['RANGER_TEST_USERNAME'])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x1124d0=_0x35d7ed['oyWgi'](Boolean,_0x108da2[_0x203514(0x226)]);if(_0x35d7ed['kyEHR'](_0x1e607a,_0x1124d0))try{const _0x1a3b10=_0x1cc5fb?await _0x35d7ed['gxCuy'](serverSideLoginWithOptionalTunnel,_0x108da2['name'],_0x1cc5fb,{'force':_0x1f8444,'telemetry':_0x5df7d4['telemetry']}):await serverSideLogin(_0x108da2['name'],{'force':_0x1f8444});if(_0x1a3b10[_0x203514(0x22d)]==='not_configured')console[_0x203514(0x206)]('\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...');else{if(_0x35d7ed['MvbBM'](_0x1a3b10['status'],_0x35d7ed['FaEZn'])&&_0x1a3b10[_0x203514(0x248)]){console['log']('\x20\x20Login\x20successful.\x20Session\x20cached.');const _0x73cf38=await writeSessionToLocalCache(_0x108da2['name'],_0x108da2[_0x203514(0x246)],_0x1cc5fb,_0x318d51,_0x1a3b10['session_state'],_0x19e3b4,_0x322b4d);return _0x35d7ed['cIvYj'](_0x1e607a,!_0x1124d0)&&await promptSaveCredentials(_0x108da2[_0x203514(0x1fd)]),{'authPath':_0x73cf38,'settings':_0x34cc10,'resolvedEnv':_0x17b695};}else _0x1a3b10['test_output']&&(console[_0x203514(0x206)](_0x203514(0x22e)),console['log'](_0x1a3b10[_0x203514(0x270)])),console[_0x203514(0x206)](_0x35d7ed['sulwK']);}}catch(_0x32bba0){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x32bba0 instanceof Error?_0x32bba0['message']:_0x35d7ed['LiTWc'](String,_0x32bba0))),console[_0x203514(0x206)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const _0x49703b=_0x17b695?{..._0x17b695,'setupHeaders':_0x318d51}:_0x1cc5fb?{'key':_0x108da2[_0x203514(0x23b)]??'','domains':[_0x1cc5fb],'setupHeaders':_0x318d51}:null,{sessionState:_0x31b289}=await _0x35d7ed[_0x203514(0x27d)](manualBrowserLogin,_0x108da2,_0x49703b,{'persistSessionState':!_0x32f3f3}),_0x4c096d=await writeSessionToLocalCache(_0x108da2[_0x203514(0x1fd)],_0x108da2['organizationId'],_0x1cc5fb,_0x318d51,_0x31b289,_0x19e3b4,_0x322b4d);return{'authPath':_0x4c096d,'settings':_0x34cc10,'resolvedEnv':_0x17b695};}
@@ -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 _0xa097d4=_0xb72a;function _0x3841(){const _0x5d3832=['YCQRn','toString','stdin','status','4251888poYerM','effectiveBaseUrl','pathname','7akAfcy','sha256','add','UclOa','VbWrj','localhost.','IgIwU','has','includes','17929980TqHdET','test','profileName','12XQBGqT','uilog','sessionCheckPath','setupHeaders','1031059RXaKYp','stdout','1928502qNoOyF','defaultEnvironmentKey','endsWith','zaYDH','port','Xvzib','stringify','keys','map','invalidateOn','.localhost','newContext','env','clientIp','userAgent','793074slxMbC','127.0.0.1','.json','7350552vZKVFr','6619835YsYIvi'];_0x3841=function(){return _0x5d3832;};return _0x3841();}(function(_0x36087b,_0x4b3f76){const _0x351ca8=_0xb72a,_0x4904ef=_0x36087b();while(!![]){try{const _0x12ee59=-parseInt(_0x351ca8(0x13e))/0x1+parseInt(_0x351ca8(0x167))/0x2*(-parseInt(_0x351ca8(0x14f))/0x3)+-parseInt(_0x351ca8(0x158))/0x4+parseInt(_0x351ca8(0x153))/0x5+parseInt(_0x351ca8(0x140))/0x6+parseInt(_0x351ca8(0x15b))/0x7*(parseInt(_0x351ca8(0x152))/0x8)+parseInt(_0x351ca8(0x164))/0x9;if(_0x12ee59===_0x4b3f76)break;else _0x4904ef['push'](_0x4904ef['shift']());}catch(_0x599586){_0x4904ef['push'](_0x4904ef['shift']());}}}(_0x3841,0xd5ed4));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x4c231b=process[_0xa097d4(0x14c)],_0xce5e9c={'stdin':process[_0xa097d4(0x156)],'stdout':process['stdout']}){const _0x1c035c=_0xa097d4;if(_0x4c231b['CI'])return![];return Boolean(_0xce5e9c[_0x1c035c(0x156)]['isTTY'])&&Boolean(_0xce5e9c[_0x1c035c(0x13f)]['isTTY']);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x326c9c){const _0x30edc0=_0xa097d4,_0x3e5215={'zZwQE':'baseUrl','PjuZY':_0x30edc0(0x14e),'UUAZO':function(_0x1e8f25,_0x5a5a2b){return _0x1e8f25(_0x5a5a2b);},'IgIwU':_0x30edc0(0x15c)},_0x211198=new Set(_0x326c9c[_0x30edc0(0x149)]??DEFAULT_INVALIDATE_ON),_0x1e85b8={'orgId':_0x326c9c['orgId'],'profileName':_0x326c9c[_0x30edc0(0x166)]};return _0x211198[_0x30edc0(0x162)](_0x3e5215['zZwQE'])&&(_0x1e85b8[_0x30edc0(0x159)]=_0x326c9c[_0x30edc0(0x159)]),_0x211198[_0x30edc0(0x162)](_0x30edc0(0x13d))&&(_0x1e85b8['setupHeaders']=_0x326c9c[_0x30edc0(0x13d)]?sortObjectKeys(_0x326c9c['setupHeaders']):_0x326c9c['setupHeaders']),_0x211198[_0x30edc0(0x162)]('port')&&(_0x1e85b8[_0x30edc0(0x144)]=extractPort(_0x326c9c[_0x30edc0(0x159)])),_0x211198['has'](_0x3e5215['PjuZY'])&&_0x326c9c[_0x30edc0(0x14e)]!==undefined&&(_0x1e85b8['userAgent']=_0x326c9c['userAgent']),_0x211198[_0x30edc0(0x162)](_0x30edc0(0x14d))&&_0x326c9c[_0x30edc0(0x14d)]!==undefined&&(_0x1e85b8[_0x30edc0(0x14d)]=_0x326c9c['clientIp']),_0x3e5215['UUAZO'](createHash,_0x3e5215[_0x30edc0(0x161)])['update'](JSON[_0x30edc0(0x146)](_0x1e85b8))['digest']('hex')['slice'](0x0,0xc);}function extractPort(_0x1f4e59){try{return new URL(_0x1f4e59)['port'];}catch{return'';}}function sortObjectKeys(_0x3ae0cf){const _0x1a30d3=_0xa097d4,_0x224e7a={};for(const _0x187075 of Object[_0x1a30d3(0x147)](_0x3ae0cf)['sort']()){_0x224e7a[_0x187075]=_0x3ae0cf[_0x187075];}return _0x224e7a;}export function getSessionCachePath(_0x456347,_0x210869){const _0x1a2012=_0xa097d4,_0x24fdeb={'UclOa':function(_0x153d55,_0x22a919,_0x526d50,_0x539cb6){return _0x153d55(_0x22a919,_0x526d50,_0x539cb6);},'pkxTT':function(_0x4184c9){return _0x4184c9();}};return _0x24fdeb[_0x1a2012(0x15e)](join,_0x24fdeb['pkxTT'](getRangerHomeDir),'auth',_0x456347+'-'+_0x210869+_0x1a2012(0x151));}export function getStorageStatePath(_0x36ae61){const _0x1ed014=_0xa097d4,_0x19dca0={'YCQRn':'.storageState.json'};return _0x36ae61['replace'](/\.json$/,_0x19dca0[_0x1ed014(0x154)]);}export function needsTunnel(_0x423b98){const _0x27daf0=_0xa097d4,_0x53605e={'Xvzib':function(_0x4701a4,_0x36bb1e){return _0x4701a4===_0x36bb1e;},'uilog':'localhost'};let _0x382a7d;try{_0x382a7d=new URL(_0x423b98)['hostname'];}catch{return![];}if(_0x53605e[_0x27daf0(0x145)](_0x382a7d,_0x53605e[_0x27daf0(0x13b)])||_0x382a7d===_0x27daf0(0x150))return!![];if(_0x382a7d[_0x27daf0(0x142)](_0x27daf0(0x14a)))return!![];if(_0x382a7d[_0x27daf0(0x163)](_0x27daf0(0x160)))return!![];return![];}export function hostnameOf(_0x4379ef){return new URL(_0x4379ef)['hostname'];}export function duplicateCookiesForDomains(_0x57231b,_0x550777){const _0x54b172=_0xa097d4,_0x35f768={'zaYDH':function(_0xac84a6,_0x3b27aa){return _0xac84a6(_0x3b27aa);}},_0x47db57=[..._0x57231b],_0x44a5bd=new Set(_0x57231b[_0x54b172(0x148)](_0x49b1fd=>_0x49b1fd['domain']));for(const _0x19b23d of _0x550777){let _0x2d0c3d;try{_0x2d0c3d=_0x35f768[_0x54b172(0x143)](hostnameOf,_0x19b23d);}catch{continue;}if(!_0x2d0c3d)continue;const _0x1a2d44=_0x2d0c3d['startsWith']('.')?_0x2d0c3d:'.'+_0x2d0c3d;if(_0x44a5bd[_0x54b172(0x162)](_0x2d0c3d)||_0x44a5bd[_0x54b172(0x162)](_0x1a2d44))continue;for(const _0x4ff768 of _0x57231b){_0x47db57['push']({..._0x4ff768,'domain':_0x1a2d44});}_0x44a5bd[_0x54b172(0x15d)](_0x1a2d44);}return _0x47db57;}export function resolveAuthEnvironmentLocally(_0xdca3eb,_0x234a36){const _0x17471d=_0xa097d4,_0x4d6d98={'CkYhw':function(_0x4ccaf1,_0x3b3cb9){return _0x4ccaf1===_0x3b3cb9;}},_0x174c33=_0xdca3eb['environments'];if(_0x234a36){const _0x41002f=_0x174c33[_0x234a36];if(!_0x41002f)return null;return{'key':_0x234a36,..._0x41002f};}if(_0xdca3eb['defaultEnvironmentKey']){const _0x5e927e=_0x174c33[_0xdca3eb[_0x17471d(0x141)]];if(!_0x5e927e)return null;return{'key':_0xdca3eb[_0x17471d(0x141)],..._0x5e927e};}const _0xab5781=Object[_0x17471d(0x147)](_0x174c33);if(_0x4d6d98['CkYhw'](_0xab5781['length'],0x1)){const _0x1e9556=_0xab5781[0x0];return{'key':_0x1e9556,..._0x174c33[_0x1e9556]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;function _0xb72a(_0x81db43,_0x27b7e7){_0x81db43=_0x81db43-0x13b;const _0x3841b0=_0x3841();let _0xb72a2c=_0x3841b0[_0x81db43];return _0xb72a2c;}export function buildSessionCheckUrl(_0x2b51ea,_0x59e993){const _0x26a351=_0xa097d4;try{if(_0x59e993)return new URL(_0x59e993,_0x2b51ea)[_0x26a351(0x155)]();return new URL(_0x2b51ea)[_0x26a351(0x155)]();}catch{return null;}}export function looksLikeLoginUrl(_0x252b6d){const _0x1cbbdf=_0xa097d4;try{const _0x3f4413=new URL(_0x252b6d);return LOGIN_URL_PATTERN[_0x1cbbdf(0x165)](_0x3f4413[_0x1cbbdf(0x15a)]);}catch{return LOGIN_URL_PATTERN['test'](_0x252b6d);}}export async function isCachedSessionLive(_0x3e5c12,_0x17923b,_0x562294={},_0x56c398={}){const _0x16637a=_0xa097d4,_0x579637={'VbWrj':function(_0x4ff632,_0x1031dc){return _0x4ff632===_0x1031dc;},'gwVue':function(_0x580751,_0x405f44){return _0x580751(_0x405f44);}},_0xd34295=buildSessionCheckUrl(_0x17923b,_0x562294[_0x16637a(0x13c)]);if(!_0xd34295)return!![];if(!_0x56c398['launchBrowser'])return!![];let _0x28b6db=null;try{_0x28b6db=await _0x56c398['launchBrowser']();const _0x1fd8be=await _0x28b6db[_0x16637a(0x14b)]({'storageState':_0x3e5c12,'ignoreHTTPSErrors':!![],..._0x562294['setupHeaders']?{'extraHTTPHeaders':_0x562294['setupHeaders']}:{}}),_0x3a4cda=await _0x1fd8be['newPage'](),_0x167add=await _0x3a4cda['goto'](_0xd34295,{'waitUntil':'domcontentloaded','timeout':0x3a98}),_0x2b913b=_0x167add?.[_0x16637a(0x157)]();if(_0x579637[_0x16637a(0x15f)](_0x2b913b,0x191)||_0x2b913b===0x193)return![];const _0x39ae56=_0x3a4cda['url']();if(_0x579637['gwVue'](looksLikeLoginUrl,_0x39ae56))return![];return!![];}catch{return![];}finally{if(_0x28b6db)await _0x28b6db['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 _0x34324d=_0x3334;(function(_0x1b486e,_0x381ad7){const _0x464336=_0x3334,_0x54271e=_0x1b486e();while(!![]){try{const _0x14c44c=-parseInt(_0x464336(0x9c))/0x1+-parseInt(_0x464336(0x8c))/0x2*(-parseInt(_0x464336(0x91))/0x3)+-parseInt(_0x464336(0x87))/0x4*(parseInt(_0x464336(0x89))/0x5)+parseInt(_0x464336(0x99))/0x6*(parseInt(_0x464336(0x9b))/0x7)+parseInt(_0x464336(0x94))/0x8+-parseInt(_0x464336(0x92))/0x9*(-parseInt(_0x464336(0x9a))/0xa)+-parseInt(_0x464336(0x8f))/0xb*(parseInt(_0x464336(0x98))/0xc);if(_0x14c44c===_0x381ad7)break;else _0x54271e['push'](_0x54271e['shift']());}catch(_0x1e9cd7){_0x54271e['push'](_0x54271e['shift']());}}}(_0x2a1f,0x36c3e));function _0x3334(_0x73f4f4,_0x18d64d){_0x73f4f4=_0x73f4f4-0x86;const _0x2a1f04=_0x2a1f();let _0x3334e6=_0x2a1f04[_0x73f4f4];return _0x3334e6;}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0x2a1f(){const _0x2f3f3c=['update','2150048pWRObj','aes-256-gcm','HsANY','ranger-auth-encryption','12624dHKTpU','876uTuuNi','338540PXwRJx','11221cawIId','167497kJRUae','AbCcP','52ONAMjf','gujQE','16355EVaZBQ','final','subarray','416910AWtzcU','TWsng','setAuthTag','8261zgbdqH','djAcQ','6HuCtZF','81ANVqsW'];_0x2a1f=function(){return _0x2f3f3c;};return _0x2a1f();}const ALGORITHM=_0x34324d(0x95),SALT=_0x34324d(0x97),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0xaeb548){const _0x460fce=_0x34324d,_0x59d6ef={'HsANY':function(_0x20fe14,_0x277362,_0x578d06,_0x2b9db4,_0x21f325,_0x5e6876){return _0x20fe14(_0x277362,_0x578d06,_0x2b9db4,_0x21f325,_0x5e6876);},'gujQE':'sha256'};return _0x59d6ef[_0x460fce(0x96)](pbkdf2Sync,_0xaeb548,SALT,0x186a0,KEY_LENGTH,_0x59d6ef[_0x460fce(0x88)]);}export function encrypt(_0x20af77,_0x455348){const _0x20fa32=_0x34324d,_0x3a12dd={'djAcQ':function(_0x504988,_0x4676ba){return _0x504988(_0x4676ba);}},_0x2310b7=deriveKey(_0x455348),_0x504a3c=_0x3a12dd[_0x20fa32(0x90)](randomBytes,IV_LENGTH),_0x2a8003=createCipheriv(ALGORITHM,_0x2310b7,_0x504a3c),_0x31b7ff=Buffer['concat']([_0x2a8003['update'](_0x20af77,'utf8'),_0x2a8003[_0x20fa32(0x8a)]()]),_0xb50ad2=_0x2a8003['getAuthTag']();return Buffer['concat']([_0x504a3c,_0xb50ad2,_0x31b7ff]);}export function decrypt(_0x319973,_0x4f3eeb){const _0x5e7f31=_0x34324d,_0x697bff={'CATbV':function(_0xa78b36,_0x131956){return _0xa78b36(_0x131956);},'AbCcP':function(_0x1ed2a8,_0x4c5fd8,_0x30a652,_0x4a378e){return _0x1ed2a8(_0x4c5fd8,_0x30a652,_0x4a378e);},'rFXBB':function(_0x5ba15c,_0x4248d9){return _0x5ba15c+_0x4248d9;},'TWsng':'utf8'},_0x407937=_0x697bff['CATbV'](deriveKey,_0x4f3eeb),_0x480ec3=_0x319973[_0x5e7f31(0x8b)](0x0,IV_LENGTH),_0x3a9e05=_0x319973[_0x5e7f31(0x8b)](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x4ddcca=_0x319973[_0x5e7f31(0x8b)](IV_LENGTH+TAG_LENGTH),_0x438d47=_0x697bff[_0x5e7f31(0x86)](createDecipheriv,ALGORITHM,_0x407937,_0x480ec3);return _0x438d47[_0x5e7f31(0x8e)](_0x3a9e05),_0x697bff['rFXBB'](_0x438d47[_0x5e7f31(0x93)](_0x4ddcca),_0x438d47['final'](_0x697bff[_0x5e7f31(0x8d)]));}
@@ -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
+ function _0xe664(_0xd6c6f,_0x720f62){_0xd6c6f=_0xd6c6f-0x1a1;const _0x2309b8=_0x2309();let _0xe6642b=_0x2309b8[_0xd6c6f];return _0xe6642b;}const _0xf9828c=_0xe664;(function(_0x4d33d7,_0x3b541d){const _0x1742f6=_0xe664,_0x1be5f2=_0x4d33d7();while(!![]){try{const _0x3d1b8b=-parseInt(_0x1742f6(0x1b5))/0x1+parseInt(_0x1742f6(0x1ab))/0x2+parseInt(_0x1742f6(0x1a2))/0x3+-parseInt(_0x1742f6(0x1c8))/0x4+-parseInt(_0x1742f6(0x1ad))/0x5+-parseInt(_0x1742f6(0x1ba))/0x6+parseInt(_0x1742f6(0x1be))/0x7;if(_0x3d1b8b===_0x3b541d)break;else _0x1be5f2['push'](_0x1be5f2['shift']());}catch(_0x3d41aa){_0x1be5f2['push'](_0x1be5f2['shift']());}}}(_0x2309,0xbfeae));import{getToken}from'./keychain.js';function _0x2309(){const _0x44c694=['Invalid\x20values','missing_required_argument','3104976pkvRJS','errorType','has','[desire-path]\x20Payload:\x20','length','--auth','PWfKu','slice','env','1779468aksEXo','--cookie','1809850xrBDit','=[REDACTED]','KUhXV','push','Afsno','indexOf','invalid_option_value','POST','1236797wMhfxW','unknown_command','--password','--header','catch','4563996VFJEKZ','Unknown\x20command','Not\x20enough\x20non-option\x20arguments','--pass','10990434hCyfxE','includes','runtime_error','iBIjW','--key','toLowerCase','stdout','--authorization','CRiAW','[REDACTED]','1397044aqzYaa','4|2|3|1|6|7|5|0','[desire-path]\x20Sending\x20log\x20to\x20','join','fBsmu','has_token','Missing\x20required\x20argument','Unknown\x20argument','Authorization','application/json','/api/v1/mcp/desire-path-logs','missing_option','sessionId'];_0x2309=function(){return _0x44c694;};return _0x2309();}import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t','--secret','--api-key','--apikey',_0xf9828c(0x1c2),_0xf9828c(0x1b7),_0xf9828c(0x1bd),_0xf9828c(0x1a7),_0xf9828c(0x1c5),_0xf9828c(0x1b8),_0xf9828c(0x1ac),'--credentials']),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x2252e1){return TOKEN_PATTERNS['some'](_0x7df799=>_0x7df799['test'](_0x2252e1));}export function sanitizeArgs(_0xd0b42c){const _0x565585=_0xf9828c,_0x16d47a={'YAXax':function(_0x22fba4,_0x143dda){return _0x22fba4<_0x143dda;},'KUhXV':_0x565585(0x1c7),'iBIjW':function(_0x406e90,_0x542999){return _0x406e90!==_0x542999;}},_0x3ae06f=[];let _0x1d30b8=![];for(let _0x3d08c7=0x0;_0x16d47a['YAXax'](_0x3d08c7,_0xd0b42c[_0x565585(0x1a6)]);_0x3d08c7++){const _0x1ff4af=_0xd0b42c[_0x3d08c7];if(_0x1d30b8){_0x3ae06f['push'](_0x16d47a[_0x565585(0x1af)]),_0x1d30b8=![];continue;}if(_0x1ff4af['startsWith']('--')||_0x1ff4af['startsWith']('-')){const _0x2b8235=_0x1ff4af[_0x565585(0x1b2)]('=');if(_0x16d47a[_0x565585(0x1c1)](_0x2b8235,-0x1)){const _0x3f8d54=_0x1ff4af[_0x565585(0x1a9)](0x0,_0x2b8235)['toLowerCase']();if(SENSITIVE_FLAGS[_0x565585(0x1a4)](_0x3f8d54)){_0x3ae06f[_0x565585(0x1b0)](_0x1ff4af['slice'](0x0,_0x2b8235)+_0x565585(0x1ae));continue;}}else{const _0x1d2588=_0x1ff4af[_0x565585(0x1c3)]();SENSITIVE_FLAGS['has'](_0x1d2588)&&(_0x1d30b8=!![]);}_0x3ae06f[_0x565585(0x1b0)](_0x1ff4af);}else looksLikeToken(_0x1ff4af)?_0x3ae06f[_0x565585(0x1b0)](_0x16d47a[_0x565585(0x1af)]):_0x3ae06f['push'](_0x1ff4af);}return _0x3ae06f[_0x565585(0x1cb)]('\x20');}export async function logDesirePath(_0x4ec2cd){const _0x473f61=_0xf9828c,_0x34f5b5={'SQXwr':'no_token','CRiAW':_0x473f61(0x1d1),'Afsno':_0x473f61(0x1b4)};try{const _0x444f22=await getToken()[_0x473f61(0x1b9)](()=>null),_0x2a58a9=getApiBaseUrl(),_0x310646=getCurrentVersion(),_0x4d746a=_0x444f22?_0x473f61(0x1cd):_0x34f5b5['SQXwr'],_0x3b543c={..._0x4ec2cd['metadata'],'authStatus':_0x4d746a,'isTty':process[_0x473f61(0x1c4)]['isTTY']??![]},_0x25c22c={'Content-Type':_0x34f5b5[_0x473f61(0x1c6)]};_0x444f22&&(_0x25c22c[_0x473f61(0x1d0)]='Bearer\x20'+_0x444f22);const _0x23bc50={'rawCommand':_0x4ec2cd['rawCommand'],'errorMessage':_0x4ec2cd['errorMessage'],'errorType':_0x4ec2cd[_0x473f61(0x1a3)],'featureId':_0x4ec2cd['featureId'],'sessionId':_0x4ec2cd[_0x473f61(0x1d4)],'metadata':_0x3b543c,'cliVersion':_0x310646};process['env']['DEBUG']&&(console['error'](_0x473f61(0x1ca)+_0x2a58a9+'/api/v1/mcp/desire-path-logs'),console['error'](_0x473f61(0x1a5)+JSON['stringify'](_0x23bc50,null,0x2))),await fetch(_0x2a58a9+_0x473f61(0x1d2),{'method':_0x34f5b5[_0x473f61(0x1b1)],'headers':_0x25c22c,'body':JSON['stringify'](_0x23bc50)});}catch(_0x5eb8e5){process[_0x473f61(0x1aa)]['DEBUG']&&console['error']('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x5eb8e5);}}export function getErrorType(_0x2dddbf,_0xb2469f){const _0x21bb08=_0xf9828c,_0x23ecab={'PWfKu':_0x21bb08(0x1c9),'kMZHp':'syntax_error','Xfwhw':_0x21bb08(0x1b6),'fBsmu':_0x21bb08(0x1d3),'AFfFx':_0x21bb08(0x1b3)},_0x17babf=_0x23ecab[_0x21bb08(0x1a8)]['split']('|');let _0x573b7c=0x0;while(!![]){switch(_0x17babf[_0x573b7c++]){case'0':return _0x23ecab['kMZHp'];case'1':if(_0x2dddbf['includes'](_0x21bb08(0x1cf)))return'unknown_argument';continue;case'2':if(!_0x2dddbf)return'unknown';continue;case'3':if(_0x2dddbf[_0x21bb08(0x1bf)](_0x21bb08(0x1bb)))return _0x23ecab['Xfwhw'];continue;case'4':if(_0xb2469f)return _0x21bb08(0x1c0);continue;case'5':if(_0x2dddbf[_0x21bb08(0x1bf)](_0x21bb08(0x1ce)))return _0x23ecab[_0x21bb08(0x1cc)];continue;case'6':if(_0x2dddbf['includes'](_0x21bb08(0x1bc)))return _0x21bb08(0x1a1);continue;case'7':if(_0x2dddbf[_0x21bb08(0x1bf)](_0x21bb08(0x1d5)))return _0x23ecab['AFfFx'];continue;}break;}}
@@ -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
+ const _0x3ed022=_0x341a;(function(_0x5786fc,_0x3171b7){const _0x5479a9=_0x341a,_0x4b5bad=_0x5786fc();while(!![]){try{const _0x3d52a7=parseInt(_0x5479a9(0x1d3))/0x1*(parseInt(_0x5479a9(0x1bc))/0x2)+-parseInt(_0x5479a9(0x1cd))/0x3*(parseInt(_0x5479a9(0x1fa))/0x4)+parseInt(_0x5479a9(0x1e3))/0x5+parseInt(_0x5479a9(0x1f4))/0x6+-parseInt(_0x5479a9(0x1a3))/0x7*(-parseInt(_0x5479a9(0x1c3))/0x8)+parseInt(_0x5479a9(0x1cf))/0x9+-parseInt(_0x5479a9(0x1da))/0xa;if(_0x3d52a7===_0x3171b7)break;else _0x4b5bad['push'](_0x4b5bad['shift']());}catch(_0x11c21e){_0x4b5bad['push'](_0x4b5bad['shift']());}}}(_0x208b,0xef3c5));import{spawn}from'child_process';import _0x177796 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x3ed022(0x1f1),WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x5e881e){const _0x52aecf=_0x3ed022,_0x4d054d={'pMhwT':_0x52aecf(0x1b4)},_0x16dc99=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x4d054d[_0x52aecf(0x1ea)],'headers':{'Content-Type':_0x52aecf(0x1b3)},'body':new URLSearchParams({'client_id':_0x5e881e})});if(!_0x16dc99['ok']){const _0x3e4f6c=await _0x16dc99['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x16dc99['status']+'\x20'+_0x3e4f6c);}return _0x16dc99['json']();}export async function pollForTokens(_0x2348e8,_0x193766,_0x503e60,_0x2adc59){const _0x30283d=_0x3ed022,_0x510411={'sxwMj':function(_0x424e4c,_0x4548a8){return _0x424e4c+_0x4548a8;},'Zxhhp':function(_0x13fe6e,_0x174366){return _0x13fe6e*_0x174366;},'JLZGV':function(_0x3be6b9,_0x44e883){return _0x3be6b9*_0x44e883;},'cdeOv':function(_0x4ae75a,_0x3d42f8,_0x23be05){return _0x4ae75a(_0x3d42f8,_0x23be05);},'fQtTd':_0x30283d(0x1a5),'rXkci':function(_0x43ef06,_0xa54ce0){return _0x43ef06===_0xa54ce0;},'onwtC':'slow_down','HFVYy':_0x30283d(0x1b1),'wssiM':_0x30283d(0x1ec)},_0x3aa080=_0x510411['sxwMj'](Date[_0x30283d(0x1c5)](),_0x510411[_0x30283d(0x1d9)](_0x2adc59,0x3e8));let _0x293217=_0x510411['JLZGV'](_0x503e60,0x3e8);while(Date[_0x30283d(0x1c5)]()<_0x3aa080){await sleep(_0x293217);const _0x469912=await _0x510411['cdeOv'](fetch,WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x2348e8,'device_code':_0x193766,'grant_type':_0x510411[_0x30283d(0x1e6)]})});if(_0x469912['ok'])return _0x469912['json']();const _0x326c1e=await _0x469912[_0x30283d(0x1d1)]();if(_0x326c1e[_0x30283d(0x1a4)]==='authorization_pending')continue;if(_0x510411[_0x30283d(0x1de)](_0x326c1e[_0x30283d(0x1a4)],_0x510411[_0x30283d(0x1d6)])){_0x293217+=0x3e8;continue;}throw new Error(_0x326c1e[_0x30283d(0x1c0)]||_0x326c1e[_0x30283d(0x1a4)]||_0x510411[_0x30283d(0x1d4)]);}throw new Error(_0x510411['wssiM']);}async function fetchUserProfile(_0x385c00){const _0xcddadb=_0x3ed022,_0x4cff2c=getApiBaseUrl();try{const _0x43a826=await fetch(_0x4cff2c+_0xcddadb(0x1ef),{'method':_0xcddadb(0x1ca),'headers':{'workos-token':_0x385c00}});if(_0x43a826['ok'])return _0x43a826['json']();}catch{}return null;}function _0x341a(_0x2e5059,_0x45efd8){_0x2e5059=_0x2e5059-0x1a0;const _0x208bfc=_0x208b();let _0x341a69=_0x208bfc[_0x2e5059];return _0x341a69;}function buildKeyName(_0x478111,_0x9ab513){const _0x14a31c=_0x3ed022,_0x4bf45d={'OdPaz':function(_0x119b8f,_0x36d3a9){return _0x119b8f===_0x36d3a9;}},_0x5d6915=_0x9ab513[_0x14a31c(0x1fd)](_0x86cf1b=>_0x86cf1b[_0x14a31c(0x1b9)]===_0x478111||_0x86cf1b[_0x14a31c(0x1b9)][_0x14a31c(0x1df)](_0x478111+'\x20('));if(_0x4bf45d[_0x14a31c(0x1b0)](_0x5d6915['length'],0x0))return _0x478111;return _0x478111+'\x20('+(_0x5d6915['length']+0x1)+')';}export async function provisionApiKey(_0x2f1308){const _0x151f16=_0x3ed022,_0x2c0d7c={'fpVBK':'CLI\x20Key','upuLZ':function(_0x4cb039,_0x5bc7b7,_0x4f5a66){return _0x4cb039(_0x5bc7b7,_0x4f5a66);},'TOvwH':'GET','ZnKnD':function(_0x58b8e2,_0x4381f7,_0x2a9a5b){return _0x58b8e2(_0x4381f7,_0x2a9a5b);},'TLVpW':'POST'},_0x7e3456=getApiBaseUrl(),_0x27e804={'Content-Type':'application/json','workos-token':_0x2f1308},_0x596325=await fetchUserProfile(_0x2f1308),_0x1e1483=_0x596325?.['firstName']||_0x596325?.['email']?.[_0x151f16(0x1e8)]('@')[0x0],_0x24c109=_0x1e1483?_0x1e1483+_0x151f16(0x1f5):_0x2c0d7c[_0x151f16(0x1fb)];let _0x3df052=[];try{const _0x26dcc3=await _0x2c0d7c['upuLZ'](fetch,_0x7e3456+_0x151f16(0x1b2),{'method':_0x2c0d7c[_0x151f16(0x1ba)],'headers':_0x27e804});if(_0x26dcc3['ok']){const _0x20a13c=await _0x26dcc3['json']();_0x3df052=_0x20a13c[_0x151f16(0x1f7)];}}catch{}const _0x5d9e67=_0x2c0d7c['ZnKnD'](buildKeyName,_0x24c109,_0x3df052),_0x1b2eb6=await fetch(_0x7e3456+'/api-keys',{'method':_0x2c0d7c['TLVpW'],'headers':_0x27e804,'body':JSON['stringify']({'name':_0x5d9e67,'scope':_0x151f16(0x1f6)})});if(!_0x1b2eb6['ok']){const _0x16fb38=await _0x1b2eb6['text']();throw new Error(_0x151f16(0x1a2)+_0x1b2eb6[_0x151f16(0x1a0)]+'\x20'+_0x16fb38);}const _0x56bf28=await _0x1b2eb6['json']();return _0x56bf28[_0x151f16(0x1f9)][_0x151f16(0x1ce)];}export function openBrowser(_0x335ddd){const _0x531358=_0x3ed022,_0x1757a5={'xBEHW':function(_0xa9aa40,_0x225c8e,_0x16180a,_0x592e1e){return _0xa9aa40(_0x225c8e,_0x16180a,_0x592e1e);},'vuZvw':'start','NHAte':'ignore','sLWCw':function(_0x148b87,_0x2575f2){return _0x148b87===_0x2575f2;},'JzOEF':_0x531358(0x1d2),'UAQDK':_0x531358(0x1f8),'eaMBV':function(_0x2a94c3,_0x2b3dc9,_0x3c27b7,_0x654c5f){return _0x2a94c3(_0x2b3dc9,_0x3c27b7,_0x654c5f);}};try{if(process['platform']==='win32'){const _0x5477b2=_0x1757a5['xBEHW'](spawn,_0x531358(0x1af),['/c',_0x1757a5['vuZvw'],'',_0x335ddd],{'detached':!![],'stdio':_0x1757a5[_0x531358(0x1d8)],'windowsHide':!![]});_0x5477b2[_0x531358(0x1c7)]();return;}const _0x2b9a49=_0x1757a5[_0x531358(0x1c1)](process['platform'],_0x1757a5['JzOEF'])?_0x1757a5['UAQDK']:'xdg-open',_0x5d00ba=_0x1757a5[_0x531358(0x1e9)](spawn,_0x2b9a49,[_0x335ddd],{'detached':!![],'stdio':_0x1757a5[_0x531358(0x1d8)]});_0x5d00ba[_0x531358(0x1c7)]();}catch{}}function decodeJwtPayload(_0xecff6d){const _0xf3135e=_0x3ed022,_0x309904={'nBbhy':function(_0x5a8db3,_0x11e1a1){return _0x5a8db3!==_0x11e1a1;},'HbdTW':_0xf3135e(0x1b5),'rpkdb':_0xf3135e(0x1d7)},_0x33afe8=_0xecff6d['split']('.');if(_0x309904[_0xf3135e(0x1be)](_0x33afe8[_0xf3135e(0x1ad)],0x3))throw new Error(_0x309904[_0xf3135e(0x1c8)]);const _0x8aeb6=Buffer[_0xf3135e(0x1dc)](_0x33afe8[0x1],_0x309904['rpkdb'])[_0xf3135e(0x1f0)](_0xf3135e(0x1e5));return JSON['parse'](_0x8aeb6);}async function selfServeSignup(_0x6ac584){const _0x2d1461=_0x3ed022,_0x5a264a={'vYFwZ':function(_0x14dd74){return _0x14dd74();},'gdnpH':'POST'},_0x29c011=_0x5a264a['vYFwZ'](getApiBaseUrl),_0x449510=await fetch(_0x29c011+'/organization/self-serve-signup',{'method':_0x5a264a['gdnpH'],'headers':{'Content-Type':'application/json','workos-token':_0x6ac584}});if(!_0x449510['ok']){const _0x2942a1=await _0x449510[_0x2d1461(0x1ab)]();throw new Error(_0x2d1461(0x1db)+_0x449510[_0x2d1461(0x1a0)]+'\x20'+_0x2942a1);}return _0x449510[_0x2d1461(0x1d1)]();}async function fetchMyMemberships(_0x385293){const _0x212349=_0x3ed022,_0x575311={'KomAX':function(_0xded6a6){return _0xded6a6();},'TCKQR':_0x212349(0x1ca)},_0x162a5d=_0x575311['KomAX'](getApiBaseUrl),_0x390ce7=await fetch(_0x162a5d+_0x212349(0x1ac),{'method':_0x575311['TCKQR'],'headers':{'workos-token':_0x385293}});if(!_0x390ce7['ok']){const _0x324cb9=await _0x390ce7['text']();throw new Error(_0x212349(0x1ed)+_0x390ce7['status']+'\x20'+_0x324cb9);}const _0x558576=await _0x390ce7['json']();return _0x558576[_0x212349(0x1b8)];}async function refreshTokenWithOrg(_0x5d6314,_0x1f438c,_0x48169c){const _0x4cc50f=_0x3ed022,_0x2d75c2={'ndHIR':_0x4cc50f(0x1b4),'invcM':_0x4cc50f(0x1b3),'Yzxwx':_0x4cc50f(0x1c2)},_0x503c1b=await fetch(WORKOS_TOKEN_URL,{'method':_0x2d75c2['ndHIR'],'headers':{'Content-Type':_0x2d75c2['invcM']},'body':new URLSearchParams({'client_id':_0x5d6314,'grant_type':_0x2d75c2[_0x4cc50f(0x1ee)],'refresh_token':_0x1f438c,'organization_id':_0x48169c})});if(!_0x503c1b['ok']){const _0x52a72e=await _0x503c1b[_0x4cc50f(0x1ab)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x503c1b[_0x4cc50f(0x1a0)]+'\x20'+_0x52a72e);}return _0x503c1b[_0x4cc50f(0x1d1)]();}async function provisionCliToken(_0x2946c8){const _0x2e5914=_0x3ed022,_0x4d2e16={'qIvpw':function(_0x284a31){return _0x284a31();},'EHrwr':function(_0x4388b,_0x47ad4e,_0x9f6ae2){return _0x4388b(_0x47ad4e,_0x9f6ae2);},'NyjrS':_0x2e5914(0x1b4),'votZD':_0x2e5914(0x1c6)},_0x12138e=_0x4d2e16[_0x2e5914(0x1e1)](getApiBaseUrl),_0x11a895=await _0x4d2e16[_0x2e5914(0x1f2)](fetch,_0x12138e+_0x2e5914(0x1cb),{'method':_0x4d2e16[_0x2e5914(0x1aa)],'headers':{'Content-Type':_0x4d2e16['votZD'],'workos-token':_0x2946c8}});if(!_0x11a895['ok']){const _0x2e1809=await _0x11a895[_0x2e5914(0x1ab)]();throw new Error(_0x2e5914(0x1b7)+_0x11a895['status']+'\x20'+_0x2e1809);}return _0x11a895['json']();}export async function runDeviceAuthFlow(){const _0x5646ba=_0x3ed022,_0x5b71c6={'xdzaU':function(_0x39ffca){return _0x39ffca();},'AsAHT':_0x5646ba(0x1bb),'WVCAD':_0x5646ba(0x1a7),'dKAPY':function(_0x8f1ddd,_0x1f84f2,_0x2d20ac,_0x6b1795,_0x11c058){return _0x8f1ddd(_0x1f84f2,_0x2d20ac,_0x6b1795,_0x11c058);},'ECjvZ':function(_0x558ac1,_0x1bdd19){return _0x558ac1(_0x1bdd19);},'BTfdP':function(_0x6401bf,_0x1bb31d){return _0x6401bf===_0x1bb31d;},'wASeR':_0x5646ba(0x1f3),'ZukNy':_0x5646ba(0x1e2),'ETvjs':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','halIE':_0x5646ba(0x1a6),'nrWRH':_0x5646ba(0x1e0),'bEIrv':function(_0x3c7429,_0x2671e1,_0x5b126e,_0x55626b){return _0x3c7429(_0x2671e1,_0x5b126e,_0x55626b);},'TVgRb':_0x5646ba(0x1bd),'mzRbS':function(_0x39cb9a,_0x2d646d){return _0x39cb9a(_0x2d646d);}},_0x189060=_0x5b71c6['xdzaU'](getCurrentEnvironment),_0x2b44b9=ENVIRONMENT_CONFIGS[_0x189060][_0x5646ba(0x1fc)],_0x4f7a0f=await requestDeviceCode(_0x2b44b9);console[_0x5646ba(0x1d5)]('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console['log'](_0x5b71c6['AsAHT']),openBrowser(_0x4f7a0f[_0x5646ba(0x1fe)]),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x4f7a0f[_0x5646ba(0x1fe)]),console['log']('Code:\x20'+_0x4f7a0f['user_code']+'\x0a'),process['stdout']['write'](_0x5b71c6[_0x5646ba(0x1b6)]);let _0x1a742f=await _0x5b71c6[_0x5646ba(0x1e4)](pollForTokens,_0x2b44b9,_0x4f7a0f['device_code'],_0x4f7a0f[_0x5646ba(0x1eb)],_0x4f7a0f['expires_in']);console[_0x5646ba(0x1d5)]('\x20✓');const _0x5d3e80=_0x5b71c6[_0x5646ba(0x1cc)](decodeJwtPayload,_0x1a742f['access_token']);if(!_0x5d3e80['org_id']){const _0x23bdf7=await _0x5b71c6[_0x5646ba(0x1cc)](fetchMyMemberships,_0x1a742f['access_token']);let _0x5d5fe0;if(_0x5b71c6['BTfdP'](_0x23bdf7['length'],0x0)){process[_0x5646ba(0x1ae)][_0x5646ba(0x1a8)](_0x5b71c6[_0x5646ba(0x1e7)]);const _0x400de9=await _0x5b71c6[_0x5646ba(0x1cc)](selfServeSignup,_0x1a742f['access_token']);_0x5d5fe0=_0x400de9[_0x5646ba(0x1d0)],console[_0x5646ba(0x1d5)]('\x20✓');}else{if(_0x23bdf7['length']===0x1)_0x5d5fe0=_0x23bdf7[0x0][_0x5646ba(0x1d0)],console['log']('Using\x20organization:\x20'+_0x23bdf7[0x0]['name']);else{const _0x2a7007=process['stdin']['isTTY']&&process[_0x5646ba(0x1ae)]['isTTY'];if(!_0x2a7007)throw new Error(_0x5b71c6['ZukNy']+_0x5b71c6['ETvjs']);const {selected:_0x152cb5}=await _0x177796[_0x5646ba(0x1a1)]([{'type':_0x5b71c6[_0x5646ba(0x1dd)],'name':_0x5646ba(0x1bf),'message':_0x5b71c6[_0x5646ba(0x1c9)],'choices':_0x23bdf7[_0x5646ba(0x1c4)](_0x34401f=>({'name':_0x34401f[_0x5646ba(0x1b9)],'value':_0x34401f[_0x5646ba(0x1d0)]}))}]);_0x5d5fe0=_0x152cb5;}}_0x1a742f=await _0x5b71c6[_0x5646ba(0x1a9)](refreshTokenWithOrg,_0x2b44b9,_0x1a742f[_0x5646ba(0x1c2)],_0x5d5fe0);}process['stdout']['write'](_0x5b71c6['TVgRb']);const _0x2786bd=await provisionCliToken(_0x1a742f['access_token']);return console[_0x5646ba(0x1d5)]('\x20✓'),await storeToken(_0x2786bd[_0x5646ba(0x1ce)]),_0x1a742f['refresh_token']&&await _0x5b71c6['mzRbS'](storeRefreshToken,_0x1a742f[_0x5646ba(0x1c2)]),_0x2786bd['token'];}function sleep(_0x228bcf){return new Promise(_0x49cdb7=>setTimeout(_0x49cdb7,_0x228bcf));}function _0x208b(){const _0x4f6348=['error_description','sLWCw','refresh_token','8WAHoTQ','map','now','application/json','unref','HbdTW','nrWRH','GET','/cli-auth/token','ECjvZ','21PjDJTN','token','16338780YeHHWp','organizationId','json','darwin','142ZSHvtz','HFVYy','log','onwtC','base64url','NHAte','Zxhhp','45186610bjrHTG','Failed\x20to\x20create\x20organization:\x20','from','halIE','rXkci','startsWith','Select\x20an\x20organization:','qIvpw','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','2386305fofsbJ','dKAPY','utf-8','fQtTd','wASeR','split','eaMBV','pMhwT','interval','Device\x20authorization\x20timed\x20out','Failed\x20to\x20fetch\x20memberships:\x20','Yzxwx','/organization/me','toString','https://api.workos.com/user_management/authorize/device','EHrwr','Setting\x20up\x20your\x20organization...','292230ZCZLWZ','\x27s\x20CLI\x20Key','mcp:write','apiKeys','open','apiKey','101788OOgtNC','fpVBK','workosClientId','filter','verification_uri_complete','status','prompt','Failed\x20to\x20provision\x20API\x20key:\x20','11361539BWlrCK','error','urn:ietf:params:oauth:grant-type:device_code','list','Waiting\x20for\x20authentication...','write','bEIrv','NyjrS','text','/organization/my-memberships','length','stdout','cmd','OdPaz','Authentication\x20failed','/api-keys','application/x-www-form-urlencoded','POST','Invalid\x20JWT\x20format','WVCAD','Failed\x20to\x20provision\x20CLI\x20token:\x20','memberships','name','TOvwH','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','24116BhANuJ','Provisioning\x20CLI\x20token...','nBbhy','selected'];_0x208b=function(){return _0x4f6348;};return _0x208b();}
@@ -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 _0x563031=_0x164b;(function(_0x46ae17,_0x56e5ce){const _0x4186df=_0x164b,_0x5dbe5f=_0x46ae17();while(!![]){try{const _0x119430=parseInt(_0x4186df(0x135))/0x1+parseInt(_0x4186df(0x124))/0x2*(-parseInt(_0x4186df(0x131))/0x3)+parseInt(_0x4186df(0x121))/0x4+parseInt(_0x4186df(0x12d))/0x5*(parseInt(_0x4186df(0x138))/0x6)+-parseInt(_0x4186df(0x129))/0x7+parseInt(_0x4186df(0x12a))/0x8*(parseInt(_0x4186df(0x13f))/0x9)+-parseInt(_0x4186df(0x122))/0xa;if(_0x119430===_0x56e5ce)break;else _0x5dbe5f['push'](_0x5dbe5f['shift']());}catch(_0x2a91e7){_0x5dbe5f['push'](_0x5dbe5f['shift']());}}}(_0x22da,0xdafde));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x563031(0x118),'workosClientId':_0x563031(0x134),'aiProxyUrl':_0x563031(0x13a),'mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x563031(0x126),'mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':_0x563031(0x123),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'http://localhost:8090','mcpAuthUrl':_0x563031(0x127)}};export const DEFAULT_ENVIRONMENT=_0x563031(0x13c);export function isValidEnvironment(_0x2ce39f){const _0xfb5914=_0x563031,_0xd26078={'EMMkF':_0xfb5914(0x137),'RaCnn':_0xfb5914(0x12f)};return _0x2ce39f==='prod'||_0x2ce39f===_0xd26078[_0xfb5914(0x12e)]||_0x2ce39f===_0xd26078[_0xfb5914(0x11d)];}function _0x164b(_0x23bf41,_0x2943af){_0x23bf41=_0x23bf41-0x116;const _0x22da5f=_0x22da();let _0x164b76=_0x22da5f[_0x23bf41];return _0x164b76;}export function getCurrentEnvironment(){const _0x3be1e0=process['env']['RANGER_CLI_ENV'];if(_0x3be1e0&&isValidEnvironment(_0x3be1e0))return _0x3be1e0;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x4922cc=_0x563031,_0x474831={'sCCVQ':function(_0x55dc10){return _0x55dc10();}};return ENVIRONMENT_CONFIGS[_0x474831['sCCVQ'](getCurrentEnvironment)][_0x4922cc(0x11a)];}export function getAiProxyUrl(){const _0x517b47=_0x563031,_0xc3ec24={'dxZsa':function(_0xa26f39){return _0xa26f39();}};return ENVIRONMENT_CONFIGS[_0xc3ec24['dxZsa'](getCurrentEnvironment)][_0x517b47(0x11f)];}export function getMcpAuthUrl(){const _0x50d79a=_0x563031;return process['env']['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x50d79a(0x12c)];}export function isByokEnabled(){const _0x2cd4c0=_0x563031,_0x504079={'OMMcY':'true'};return process['env'][_0x2cd4c0(0x13e)]===_0x504079['OMMcY'];}function isVerificationTransport(_0x5c7a37){const _0x5cdbb4=_0x563031,_0x22b9ed={'Bygcx':function(_0x3056df,_0x550302){return _0x3056df===_0x550302;}};return _0x5c7a37==='mcp'||_0x22b9ed[_0x5cdbb4(0x13b)](_0x5c7a37,_0x5cdbb4(0x117))||_0x5c7a37==='nova-act-cli'||_0x5c7a37==='rangerwright-cli';}const LEGACY_TRANSPORT_ENV_VARS=[_0x563031(0x139),_0x563031(0x136)];export function getVerificationTransport(){const _0x14e2a9=_0x563031,_0x3b5c4b={'iUrLL':function(_0x52f586,_0x31e037){return _0x52f586(_0x31e037);}},_0x494480=process['env']['RANGER_TRANSPORT']?.['trim']();if(_0x494480){if(_0x3b5c4b['iUrLL'](isVerificationTransport,_0x494480))return _0x494480;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x494480+_0x14e2a9(0x11b));}const _0x4f74a3=LEGACY_TRANSPORT_ENV_VARS[_0x14e2a9(0x119)](_0x5f29b5=>process['env'][_0x5f29b5]);if(_0x4f74a3)throw new Error(_0x4f74a3+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return _0x14e2a9(0x116);}function _0x22da(){const _0x59df0c=['mcp','playwright-cli','https://api.ranger.net','find','apiBaseUrl','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','RANGER_HOOKS','RaCnn','toLowerCase','aiProxyUrl','off','1562756GpeMMS','28988090UFLANa','http://localhost:8080','12wXMbFx','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.','https://ai-proxy-301751771437.us-central1.run.app','http://localhost:8080/mcp','rQYHg','1195467TNftSJ','136JFFiUp','env','mcpAuthUrl','7252970hKNzuB','EMMkF','local','DIRSa','26079wFcxtN','zArMd','\x22.\x20','client_01J9CBYM7M5ZETCF7G6614DXR2','1263977FJRfLc','RANGER_DISABLE_MCP','staging','6FglWXQ','RANGER_USE_NOVA_ACT','https://ai-proxy-716115358910.us-central1.run.app','Bygcx','prod','auto','RANGER_BYOK','483606YerDQs'];_0x22da=function(){return _0x59df0c;};return _0x22da();}export function resolveHookMode(_0x3a7e51=process[_0x563031(0x12b)]){const _0x28bcc7=_0x563031,_0x4e4b2e={'zArMd':_0x28bcc7(0x13d),'DIRSa':function(_0x4783e1,_0x3e18e3){return _0x4783e1===_0x3e18e3;},'rKYMU':function(_0xea6071,_0x3460c7){return _0xea6071===_0x3460c7;},'rQYHg':function(_0x41128d,_0x413e71){return _0x41128d===_0x413e71;}},_0x3a4a2b=_0x3a7e51[_0x28bcc7(0x11c)]?.['trim']()[_0x28bcc7(0x11e)]();if(!_0x3a4a2b)return _0x4e4b2e[_0x28bcc7(0x132)];if(_0x4e4b2e[_0x28bcc7(0x130)](_0x3a4a2b,_0x28bcc7(0x120))||_0x4e4b2e['rKYMU'](_0x3a4a2b,'on')||_0x4e4b2e[_0x28bcc7(0x128)](_0x3a4a2b,'auto'))return _0x3a4a2b;return console['error']('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x3a7e51[_0x28bcc7(0x11c)]+_0x28bcc7(0x133)+_0x28bcc7(0x125)),'auto';}
@@ -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 _0x5eba(_0x263bd2,_0x11f9ee){_0x263bd2=_0x263bd2-0xdb;const _0x20a4fa=_0x20a4();let _0x5eba66=_0x20a4fa[_0x263bd2];return _0x5eba66;}(function(_0x2fa6bf,_0x382c03){const _0xcc2a17=_0x5eba,_0x255f96=_0x2fa6bf();while(!![]){try{const _0x41d3b0=parseInt(_0xcc2a17(0x10f))/0x1+parseInt(_0xcc2a17(0x106))/0x2+-parseInt(_0xcc2a17(0xea))/0x3*(-parseInt(_0xcc2a17(0x114))/0x4)+-parseInt(_0xcc2a17(0x10a))/0x5*(-parseInt(_0xcc2a17(0x10b))/0x6)+-parseInt(_0xcc2a17(0x109))/0x7*(-parseInt(_0xcc2a17(0xec))/0x8)+parseInt(_0xcc2a17(0x110))/0x9*(parseInt(_0xcc2a17(0x11b))/0xa)+-parseInt(_0xcc2a17(0x122))/0xb;if(_0x41d3b0===_0x382c03)break;else _0x255f96['push'](_0x255f96['shift']());}catch(_0x243d78){_0x255f96['push'](_0x255f96['shift']());}}}(_0x20a4,0xc5a61));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x20a4(){const _0x3818b9=['No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','nEtre','Feature\x20limit\x20exceeded','lwnqj','/sessions/','eiXch','ejwuO','/conclude','xCYSA','message','PATCH','3KziAsm','NjOOv','177712pzSRaN','wSYLf','Failed\x20to\x20get\x20action\x20items:\x20','Bearer\x20','limit','BxVRM','Failed\x20to\x20create\x20feature\x20review:\x20','POST','ruweZ','/checklist/','itemIds','Failed\x20to\x20delete\x20feature\x20review:\x20','QzLSh','Failed\x20to\x20list\x20sessions:\x20','application/json','Failed\x20to\x20list\x20feature\x20reviews:\x20','WVoYf','length','updateChecklistItem','TnsLm','XzGzi','json','uukSv','dqRzm','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','OPPtH','1818658haxxLF','/api/v1/mcp/features/','SDUYf','455eOYDuH','24195YkLIrR','1140DDpKAl','eHMsy','style','gitRepoUrl','1388540TsJSRm','2853BZdzVG','/report','gitBranch','sessionId','4606124oBrvhg','text','otsDs','WCRKe','LNNDQ','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','/api/v1/mcp/features','12940PZqvwt','toString','status','/report/markdown','uCrwk','offset','set','59546839MUPMNU','NCAei','vvjuR','vDABt','GET','Failed\x20to\x20get\x20feature\x20review:\x20'];_0x20a4=function(){return _0x3818b9;};return _0x20a4();}import{withRetry}from'./retry.js';export async function createFeature(_0x592b0){const _0x285ef8=_0x5eba,_0x593f1e={'vvjuR':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','YJTlv':function(_0x22c78f,_0x5b023d,_0x5ea3a5){return _0x22c78f(_0x5b023d,_0x5ea3a5);},'kqXjW':_0x285ef8(0xf3),'eiXch':_0x285ef8(0xfa),'dqRzm':function(_0x2ad782,_0x51d21a){return _0x2ad782===_0x51d21a;}},_0x12ec41=await getToken();if(!_0x12ec41)throw new Error(_0x593f1e[_0x285ef8(0xdb)]);const _0x58e1c9=getApiBaseUrl(),_0x5c6c76=await _0x593f1e['YJTlv'](fetch,_0x58e1c9+'/api/v1/mcp/features',{'method':_0x593f1e['kqXjW'],'headers':{'Authorization':'Bearer\x20'+_0x12ec41,'Content-Type':_0x593f1e[_0x285ef8(0xe4)]},'body':JSON['stringify'](_0x592b0)});if(!_0x5c6c76['ok']){if(_0x593f1e[_0x285ef8(0x103)](_0x5c6c76[_0x285ef8(0x11d)],0x192)){const _0x50979c=await _0x5c6c76['json'](),_0x43b98f=_0x50979c['billingUrl']||'https://dashboard.ranger.net/billing';throw new Error((_0x50979c[_0x285ef8(0xe8)]||_0x285ef8(0xe1))+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x43b98f);}const _0xe302b2=await _0x5c6c76['text']();throw new Error(_0x285ef8(0xf2)+_0xe302b2);}return _0x5c6c76['json']();}export async function listFeatures(_0x35ef8a){const _0x144ab7=_0x5eba,_0x3a2b88={'weaph':_0x144ab7(0xdf),'YhgtE':_0x144ab7(0x112),'TnsLm':_0x144ab7(0xf0),'xCYSA':'offset','ZMSSR':'includeDeleted'},_0x5b8903=await getToken();if(!_0x5b8903)throw new Error(_0x3a2b88['weaph']);const _0x2c528b=getApiBaseUrl(),_0x905782=new URLSearchParams();if(_0x35ef8a?.['gitRepoUrl'])_0x905782['set']('gitRepoUrl',_0x35ef8a[_0x144ab7(0x10e)]);if(_0x35ef8a?.[_0x144ab7(0x112)])_0x905782['set'](_0x3a2b88['YhgtE'],_0x35ef8a[_0x144ab7(0x112)]);if(_0x35ef8a?.[_0x144ab7(0xf0)])_0x905782['set'](_0x3a2b88[_0x144ab7(0xff)],_0x35ef8a[_0x144ab7(0xf0)][_0x144ab7(0x11c)]());if(_0x35ef8a?.[_0x144ab7(0x120)])_0x905782['set'](_0x3a2b88[_0x144ab7(0xe7)],_0x35ef8a[_0x144ab7(0x120)][_0x144ab7(0x11c)]());if(_0x35ef8a?.['includeDeleted'])_0x905782[_0x144ab7(0x121)](_0x3a2b88['ZMSSR'],'true');const _0x155d87=_0x2c528b+_0x144ab7(0x11a)+(_0x905782[_0x144ab7(0x11c)]()?'?'+_0x905782[_0x144ab7(0x11c)]():''),_0x5d6ffa=await fetch(_0x155d87,{'method':'GET','headers':{'Authorization':_0x144ab7(0xef)+_0x5b8903}});if(!_0x5d6ffa['ok']){const _0x2a6a79=await _0x5d6ffa[_0x144ab7(0x115)]();throw new Error(_0x144ab7(0xfb)+_0x2a6a79);}return _0x5d6ffa['json']();}export async function getFeature(_0x269527){const _0x3aa6f5=_0x5eba,_0x4396eb={'VsoVl':function(_0x569e6c){return _0x569e6c();},'hKklU':_0x3aa6f5(0xdf),'MzlKS':function(_0x5cc75e,_0x5b3c3a,_0x2fc67c){return _0x5cc75e(_0x5b3c3a,_0x2fc67c);}},_0x31a070=await _0x4396eb['VsoVl'](getToken);if(!_0x31a070)throw new Error(_0x4396eb['hKklU']);const _0x3430c7=_0x4396eb['VsoVl'](getApiBaseUrl),_0x4b31b1=await _0x4396eb['MzlKS'](fetch,_0x3430c7+_0x3aa6f5(0x107)+_0x269527,{'method':'GET','headers':{'Authorization':_0x3aa6f5(0xef)+_0x31a070}});if(!_0x4b31b1['ok']){const _0x42e620=await _0x4b31b1[_0x3aa6f5(0x115)]();throw new Error(_0x3aa6f5(0xde)+_0x42e620);}return _0x4b31b1[_0x3aa6f5(0x101)]();}export async function updateFeature(_0x181ae8,_0x4c800d){const _0x2ffbdf=_0x5eba,_0x272266={'XWkhx':function(_0x2ee9cc){return _0x2ee9cc();},'tzvMm':function(_0x6d3119,_0x475b69,_0x2ea35f){return _0x6d3119(_0x475b69,_0x2ea35f);},'NmkMl':_0x2ffbdf(0xe9),'oSVZd':_0x2ffbdf(0xfa)},_0x5d453f=await _0x272266['XWkhx'](getToken);if(!_0x5d453f)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xfcac9e=getApiBaseUrl(),_0x49d0b5=await _0x272266['tzvMm'](fetch,_0xfcac9e+'/api/v1/mcp/features/'+_0x181ae8,{'method':_0x272266['NmkMl'],'headers':{'Authorization':'Bearer\x20'+_0x5d453f,'Content-Type':_0x272266['oSVZd']},'body':JSON['stringify'](_0x4c800d)});if(!_0x49d0b5['ok']){const _0x2a3915=await _0x49d0b5[_0x2ffbdf(0x115)]();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x2a3915);}return _0x49d0b5['json']();}export async function createChecklistItem(_0x208ef5,_0x2c58bd,_0x223e82){const _0xb6ed02=_0x5eba,_0x4556ea={'ejwuO':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','OTpai':function(_0xb4a01f,_0x70a9e2,_0x2c9472){return _0xb4a01f(_0x70a9e2,_0x2c9472);},'ViYha':_0xb6ed02(0xfa)},_0x5b157d=await getToken();if(!_0x5b157d)throw new Error(_0x4556ea[_0xb6ed02(0xe5)]);const _0x71b0c4=getApiBaseUrl(),_0x373cc0=await _0x4556ea['OTpai'](fetch,_0x71b0c4+'/api/v1/mcp/features/'+_0x208ef5+'/checklist',{'method':_0xb6ed02(0xf3),'headers':{'Authorization':'Bearer\x20'+_0x5b157d,'Content-Type':_0x4556ea['ViYha']},'body':JSON['stringify']({'description':_0x2c58bd,'position':_0x223e82})});if(!_0x373cc0['ok']){const _0x5a156a=await _0x373cc0[_0xb6ed02(0x115)]();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x5a156a);}return _0x373cc0[_0xb6ed02(0x101)]();}export async function updateChecklistItem(_0x435d67,_0x221042,_0xe1d85f){const _0x2ea7a8=_0x5eba,_0x4eeb80={'AhmZX':function(_0x4ccde7){return _0x4ccde7();},'nEtre':function(_0x24b9ca,_0x10c822,_0x439e13){return _0x24b9ca(_0x10c822,_0x439e13);},'SDUYf':function(_0x192e79,_0x292aaa,_0x35d9c1){return _0x192e79(_0x292aaa,_0x35d9c1);}};return _0x4eeb80[_0x2ea7a8(0x108)](withRetry,async()=>{const _0x5665ca=_0x2ea7a8,_0x1d8a3c=await getToken();if(!_0x1d8a3c)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x131a1a=_0x4eeb80['AhmZX'](getApiBaseUrl),_0x42036a=await _0x4eeb80[_0x5665ca(0xe0)](fetch,_0x131a1a+_0x5665ca(0x107)+_0x435d67+_0x5665ca(0xf5)+_0x221042,{'method':_0x5665ca(0xe9),'headers':{'Authorization':_0x5665ca(0xef)+_0x1d8a3c,'Content-Type':'application/json'},'body':JSON['stringify'](_0xe1d85f)});if(!_0x42036a['ok']){const _0x2b7e27=await _0x42036a['text']();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x2b7e27);}return _0x42036a[_0x5665ca(0x101)]();},{'label':_0x2ea7a8(0xfe)});}export async function getFeatureReport(_0x56afd6){const _0x5d3bd1=_0x5eba,_0x24c555=await getToken();if(!_0x24c555)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x393318=getApiBaseUrl(),_0xc6ab4d=await fetch(_0x393318+'/api/v1/mcp/features/'+_0x56afd6+_0x5d3bd1(0x111),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x24c555}});if(!_0xc6ab4d['ok']){const _0x24fb21=await _0xc6ab4d['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x24fb21);}return _0xc6ab4d['json']();}export async function getFeatureReportMarkdown(_0x3d7103,_0x20a625){const _0x35d04b=_0x5eba,_0x3f2855={'NjOOv':function(_0x5f070d){return _0x5f070d();},'lwnqj':_0x35d04b(0xdf),'eLyvB':function(_0x43499f,_0x271cc2){return _0x43499f>_0x271cc2;},'jOshc':'sessionId','GlKDx':'style'},_0x4e9817=await _0x3f2855[_0x35d04b(0xeb)](getToken);if(!_0x4e9817)throw new Error(_0x3f2855[_0x35d04b(0xe2)]);const _0x5b847e=getApiBaseUrl(),_0x8a7343=new URLSearchParams(),_0x4cde88=_0x3f2855['eLyvB'](_0x20a625?.['itemIds']?.[_0x35d04b(0xfd)]??0x0,0x0),_0x22a165=Boolean(_0x20a625?.[_0x35d04b(0x113)]);_0x4cde88&&_0x20a625?.['itemIds']&&_0x8a7343[_0x35d04b(0x121)](_0x35d04b(0xf6),_0x20a625[_0x35d04b(0xf6)]['join'](','));_0x22a165&&_0x20a625?.[_0x35d04b(0x113)]&&_0x8a7343['set'](_0x3f2855['jOshc'],_0x20a625[_0x35d04b(0x113)]);!_0x4cde88&&!_0x22a165&&_0x20a625?.[_0x35d04b(0x10d)]&&_0x8a7343[_0x35d04b(0x121)](_0x3f2855['GlKDx'],_0x20a625['style']);const _0x20c844=_0x5b847e+'/api/v1/mcp/features/'+_0x3d7103+_0x35d04b(0x11e),_0x526e30=''+_0x20c844+(_0x8a7343[_0x35d04b(0x11c)]()?'?'+_0x8a7343[_0x35d04b(0x11c)]():''),_0x2c9350=await fetch(_0x526e30,{'method':'GET','headers':{'Authorization':_0x35d04b(0xef)+_0x4e9817}});if(!_0x2c9350['ok']){const _0x2903c8=await _0x2c9350[_0x35d04b(0x115)]();throw new Error(_0x35d04b(0x104)+_0x2903c8);}return _0x2c9350['text']();}export async function listFeatureSessions(_0x3bd5ae){const _0x507ee1=_0x5eba,_0x4a0039={'otsDs':function(_0x419b9c){return _0x419b9c();},'vDABt':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','BxVRM':function(_0x13b442,_0x3b4dbb,_0x2e1fd8){return _0x13b442(_0x3b4dbb,_0x2e1fd8);},'uCrwk':'GET'},_0x4dc4c3=await _0x4a0039[_0x507ee1(0x116)](getToken);if(!_0x4dc4c3)throw new Error(_0x4a0039[_0x507ee1(0xdc)]);const _0x1aff58=_0x4a0039['otsDs'](getApiBaseUrl),_0x41b926=await _0x4a0039[_0x507ee1(0xf1)](fetch,_0x1aff58+'/api/v1/mcp/features/'+_0x3bd5ae+'/sessions',{'method':_0x4a0039[_0x507ee1(0x11f)],'headers':{'Authorization':'Bearer\x20'+_0x4dc4c3}});if(!_0x41b926['ok']){const _0x2bf3ec=await _0x41b926[_0x507ee1(0x115)]();throw new Error(_0x507ee1(0xf9)+_0x2bf3ec);}return _0x41b926['json']();}export async function startSession(_0x1a6a2b,_0x15f071){const _0x377789=_0x5eba,_0x10ef13={'asJIU':function(_0x340100){return _0x340100();},'QzLSh':_0x377789(0xdf),'SKPTE':function(_0x2c51c1){return _0x2c51c1();},'OPPtH':_0x377789(0xf3)},_0x3d3325=await _0x10ef13['asJIU'](getToken);if(!_0x3d3325)throw new Error(_0x10ef13[_0x377789(0xf8)]);const _0x297f72=_0x10ef13['SKPTE'](getApiBaseUrl),_0x407984=await fetch(_0x297f72+'/api/v1/mcp/features/'+_0x1a6a2b+'/sessions/'+_0x15f071+'/start',{'method':_0x10ef13[_0x377789(0x105)],'headers':{'Authorization':_0x377789(0xef)+_0x3d3325}});if(!_0x407984['ok']){const _0x1c0716=await _0x407984[_0x377789(0x115)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x1c0716);}return _0x407984[_0x377789(0x101)]();}export async function concludeSession(_0x24129d,_0x3c06d1){const _0x509183=_0x5eba,_0x1efc02={'OVdcR':function(_0x516e4e){return _0x516e4e();},'xxXjY':_0x509183(0xdf),'ruweZ':function(_0x429472){return _0x429472();},'eHMsy':_0x509183(0xf3)},_0x16424e=await _0x1efc02['OVdcR'](getToken);if(!_0x16424e)throw new Error(_0x1efc02['xxXjY']);const _0x2edd73=_0x1efc02[_0x509183(0xf4)](getApiBaseUrl),_0xcfe7d4=await fetch(_0x2edd73+'/api/v1/mcp/features/'+_0x24129d+_0x509183(0xe3)+_0x3c06d1+_0x509183(0xe6),{'method':_0x1efc02[_0x509183(0x10c)],'headers':{'Authorization':'Bearer\x20'+_0x16424e}});if(!_0xcfe7d4['ok']){const _0xe51ad4=await _0xcfe7d4['text']();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0xe51ad4);}return _0xcfe7d4[_0x509183(0x101)]();}export async function getActionItems(_0x4cf915){const _0xb73ec=_0x5eba,_0x4e70cd={'WCRKe':function(_0x264163){return _0x264163();}},_0x1b1b1d=await getToken();if(!_0x1b1b1d)throw new Error(_0xb73ec(0xdf));const _0x556b21=_0x4e70cd[_0xb73ec(0x117)](getApiBaseUrl),_0x3271cd=await fetch(_0x556b21+_0xb73ec(0x107)+_0x4cf915+'/action-items',{'method':'GET','headers':{'Authorization':_0xb73ec(0xef)+_0x1b1b1d}});if(!_0x3271cd['ok']){const _0x2c9cb3=await _0x3271cd[_0xb73ec(0x115)]();throw new Error(_0xb73ec(0xee)+_0x2c9cb3);}return _0x3271cd[_0xb73ec(0x101)]();}export async function getItemFeedback(_0x5f1d6e,_0xc732b8){const _0x1c7733=_0x5eba,_0x48cb52={'XzGzi':function(_0x7078a9){return _0x7078a9();},'nzdys':_0x1c7733(0xdd)},_0x519fe0=await getToken();if(!_0x519fe0)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2517e3=_0x48cb52[_0x1c7733(0x100)](getApiBaseUrl),_0x23f293=await fetch(_0x2517e3+'/api/v1/mcp/features/'+_0x5f1d6e+'/checklist-items/'+_0xc732b8+'/feedback',{'method':_0x48cb52['nzdys'],'headers':{'Authorization':_0x1c7733(0xef)+_0x519fe0}});if(!_0x23f293['ok']){const _0x192d50=await _0x23f293[_0x1c7733(0x115)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x192d50);}return _0x23f293['json']();}export async function markCommentsAddressed(_0x3cce73,_0x1275c8,_0x321b43){const _0x3cc98c=_0x5eba,_0x44dfa5={'xagJw':function(_0x350b5b){return _0x350b5b();},'QeGqL':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','LNNDQ':'POST','LrtTO':'application/json'},_0x30bc5a=await _0x44dfa5['xagJw'](getToken);if(!_0x30bc5a)throw new Error(_0x44dfa5['QeGqL']);const _0x33e892=getApiBaseUrl(),_0x3ee5e4=await fetch(_0x33e892+'/api/v1/mcp/features/'+_0x3cce73+'/comments/address',{'method':_0x44dfa5[_0x3cc98c(0x118)],'headers':{'Authorization':'Bearer\x20'+_0x30bc5a,'Content-Type':_0x44dfa5['LrtTO']},'body':JSON['stringify']({'checklistItemId':_0x1275c8,'commentIds':_0x321b43})});if(!_0x3ee5e4['ok']){const _0x29c5d4=await _0x3ee5e4[_0x3cc98c(0x115)]();throw new Error(_0x3cc98c(0x119)+_0x29c5d4);}}export async function softDeleteFeature(_0x34131d){const _0x1e2506=_0x5eba,_0x48a611={'wSYLf':function(_0x228e24){return _0x228e24();},'uukSv':function(_0x238304,_0x53fb9a,_0x5632da){return _0x238304(_0x53fb9a,_0x5632da);}},_0x543638=await _0x48a611['wSYLf'](getToken);if(!_0x543638)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x55a977=_0x48a611[_0x1e2506(0xed)](getApiBaseUrl),_0x48ba25=await _0x48a611[_0x1e2506(0x102)](fetch,_0x55a977+'/api/v1/mcp/features/'+_0x34131d,{'method':'DELETE','headers':{'Authorization':'Bearer\x20'+_0x543638}});if(!_0x48ba25['ok']){const _0x347fe6=await _0x48ba25['text']();throw new Error(_0x1e2506(0xf7)+_0x347fe6);}}export async function restoreFeature(_0x2acafd){const _0x503f20=_0x5eba,_0xd49c70={'tsoJx':function(_0x2d9de5){return _0x2d9de5();},'WVoYf':_0x503f20(0xdf),'NCAei':function(_0x52ff9a,_0x2a7bc6,_0x8f894e){return _0x52ff9a(_0x2a7bc6,_0x8f894e);}},_0x1e49b3=await _0xd49c70['tsoJx'](getToken);if(!_0x1e49b3)throw new Error(_0xd49c70[_0x503f20(0xfc)]);const _0x4a2cd8=getApiBaseUrl(),_0x4038a8=await _0xd49c70[_0x503f20(0x123)](fetch,_0x4a2cd8+_0x503f20(0x107)+_0x2acafd+'/restore',{'method':'POST','headers':{'Authorization':_0x503f20(0xef)+_0x1e49b3}});if(!_0x4038a8['ok']){const _0x5bdb54=await _0x4038a8['text']();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x5bdb54);}}