@ranger-testing/ranger-cli 3.1.6-alpha.4de822b-51 → 3.1.6

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 (87) 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/scenarioOriginCheck.js +1 -1
  71. package/build/commands/utils/sessionCache.js +1 -1
  72. package/build/commands/utils/settings.js +1 -1
  73. package/build/commands/utils/skillContent.js +1 -1
  74. package/build/commands/utils/skills.js +1 -1
  75. package/build/commands/utils/stitchWebmFiles.js +1 -1
  76. package/build/commands/utils/telemetry.js +1 -1
  77. package/build/commands/utils/tokenRefresh.js +1 -1
  78. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  79. package/build/commands/utils/tunnelClient.js +1 -1
  80. package/build/commands/utils/userApi.js +1 -1
  81. package/build/commands/utils/version.js +1 -1
  82. package/build/commands/verifyFeature.js +1 -1
  83. package/build/commands/verifyFeatureCli.js +1 -1
  84. package/build/commands/verifyFeatureNovaCli.js +1 -1
  85. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  86. package/build/skills/ranger/SKILL.md +1 -0
  87. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x65a753,_0x55951f){const _0x243677=_0x37eb,_0x391b90=_0x65a753();while(!![]){try{const _0x2e5ab3=-parseInt(_0x243677(0x122))/0x1*(-parseInt(_0x243677(0x155))/0x2)+-parseInt(_0x243677(0x1bc))/0x3*(-parseInt(_0x243677(0x140))/0x4)+parseInt(_0x243677(0x168))/0x5*(-parseInt(_0x243677(0x188))/0x6)+parseInt(_0x243677(0x102))/0x7*(parseInt(_0x243677(0x116))/0x8)+parseInt(_0x243677(0x12c))/0x9*(parseInt(_0x243677(0x148))/0xa)+-parseInt(_0x243677(0x15c))/0xb+-parseInt(_0x243677(0x10f))/0xc*(parseInt(_0x243677(0x143))/0xd);if(_0x2e5ab3===_0x55951f)break;else _0x391b90['push'](_0x391b90['shift']());}catch(_0x20afc5){_0x391b90['push'](_0x391b90['shift']());}}}(_0x1b2c,0x7c55e));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x7ecee3 from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';function _0x1b2c(){const _0x5000f7=['3204212UtBHOn','tunnel_login_cleanup','parse','isArray','NtEMr','tunnel_bridge_event','domains','trCyW','close','oXYvn','CiVbd','confirm','124470aLjMky','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','name','zhhar','force','\x22\x20on\x20profile\x20\x22','jeshK','cli:manual-login','ovgwm','Auth\x20environment\x20\x22','POST','password','setupHeaders','username','\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.','organizationId','\x22,\x20attempting\x20login...','reason','\x22;\x20proceeding\x20with\x20loginInstructions.','\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22','\x20\x20Login\x20successful.\x20Session\x20cached.','then','origin','save','ZMfQx','extraHTTPHeaders','sessionId','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','launch','\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','\x22\x20matched\x20by\x20host\x20for\x20','12iFYpSx','RANGER_TEST_PASSWORD','log','\x20\x20Auth\x20env\x20\x22','tNTZs','sessionCheckPath','replace','\x20\x20Skipping\x20cloud\x20session\x20for\x20local\x20target\x20\x22','status','code','RANGER_TUNNEL_LOGIN_HEADED','xfkDO','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','true','RANGER_TEST_USERNAME','profiles','iISPy','4|2|1|0|3','storageStatePath','ZJBJI','browserOptions','XWYbN','KdzjI','\x22.\x0a','wsEndpoint','key','/api/v1/tunnel/sessions','telemetry','about:blank','agent','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','BsrOp','test_output','string','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','storageState','trackPhaseStart','length','join','lqNBD','environments','invalidateOn','\x20Available:\x20','TLbtz','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','persistSessionState','rbMLF','tZotm','pwEndpoint','application/json','14145wCjNdg','IyYWW','\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.','Pass\x20--base-url\x20<your-app-url>\x20so\x20Ranger\x20can\x20match\x20the\x20right\x20one,\x20or\x20create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`.','1874579TABZkh','kHGYt','not_configured','MsPko','judtL','pgMgS','newPage','type','\x22\x20instead.','qekXG','ABQpm','detail','IQIps','12382572LVSVFh','\x20failed\x20(','elapsedMs','kYDds','Browser\x20login\x20timed\x20out\x20after\x20','catch','xtOet','16bwWfrH','JIGbb','message','\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...','utf-8','trackPhaseError','YcpZd','PHFEF','clientIp','uXuqR','\x20\x20Created\x20cloud\x20profile\x20\x22','/api/v1/profiles/','1dRKLXs','environment_key','DELETE','session_state','settings','zrRiL','tunnel','PUT','\x20\x20forceLogin\x20enabled\x20for\x20\x22','MPzml','2223cJOVBq','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','loginInstructions','forceLogin','stringify','/api/v1/tunnel/sessions/','\x20\x20Options:\x0a','\x22\x20for\x20','targetUrl','uRZWE','environmentKey','keys','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]',');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.','baseUrl','goto','/session','Browser\x20login\x20timed\x20out\x20before\x20completion.','env','\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22','236MomPPq','prompt','XDNrq','13SGNBks','uwhZO','RMNdo','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','defaultEnvironmentKey','4490VYeycU','No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22','mcJeT','ambiguous','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','cookies','trackPhaseEnd','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','sessionState','tunnel_login_request','tunnel_login_setup','json','pendingLocalConnections','1915114OHewgI','hqpYm','DasYu','some','error','\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a','nRjip'];_0x1b2c=function(){return _0x5000f7;};return _0x1b2c();}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{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x36e8c1){const _0x129b5e={'nOWmj':'invalid-url'};try{return new URL(_0x36e8c1)['host'];}catch{return _0x129b5e['nOWmj'];}}function errorMessageForTelemetry(_0x128f53){const _0x46732f=_0x37eb;return _0x128f53 instanceof Error?_0x128f53[_0x46732f(0x118)]:undefined;}function trackBridgeEvent(_0x40cdbd,_0x5c6770){const _0x4b33b7=_0x37eb,_0x1da323={'iISPy':'tunnel_error','woZsA':function(_0x5be73b,_0x56d266){return _0x5be73b===_0x56d266;},'NtEMr':'local_ws_error','QKSHu':'tunnel_bridge'};if(!_0x40cdbd)return;const _0x219cb8={'tunnelSessionId':_0x5c6770[_0x4b33b7(0x182)],'tunnelEventType':_0x5c6770['type'],'connectionId':_0x5c6770['connectionId'],'code':_0x5c6770['code'],'reason':_0x5c6770[_0x4b33b7(0x179)],'error':_0x5c6770['error'],'elapsedMs':_0x5c6770[_0x4b33b7(0x111)],'activeLocalConnections':_0x5c6770['activeLocalConnections'],'pendingLocalConnections':_0x5c6770[_0x4b33b7(0x154)]};_0x40cdbd[_0x4b33b7(0x14e)](_0x4b33b7(0x161),_0x219cb8),(_0x5c6770[_0x4b33b7(0x109)]===_0x1da323[_0x4b33b7(0x199)]||_0x1da323['woZsA'](_0x5c6770[_0x4b33b7(0x109)],_0x1da323[_0x4b33b7(0x160)]))&&void _0x40cdbd[_0x4b33b7(0x11b)](_0x1da323['QKSHu'],new Error(_0x5c6770['error']??_0x5c6770['type']),_0x219cb8);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x1b3abb=_0x37eb,_0x2c068c={'BkGSV':function(_0x46cc2c){return _0x46cc2c();},'qdFKn':_0x1b3abb(0x138)},_0x1d6e1d=await _0x2c068c['BkGSV'](getToken);if(!_0x1d6e1d)throw new Error(_0x2c068c['qdFKn']);return _0x1d6e1d;}async function apiRequest(_0x1e8475,_0x3258c6={}){const _0x23bd4c=_0x37eb,_0x24b348={'XWYbN':function(_0x4f7b7d){return _0x4f7b7d();},'ffQDe':'string','PHFEF':function(_0x287ec0,_0xc09a21){return _0x287ec0===_0xc09a21;},'QfxOZ':function(_0x87c190,_0xc0e22d){return _0x87c190===_0xc0e22d;}},_0x5d3c16=await _0x24b348[_0x23bd4c(0x19e)](requireToken),_0x524e11=getApiBaseUrl(),_0x5b7a71=await fetch(''+_0x524e11+_0x1e8475,{..._0x3258c6,'headers':{'Authorization':'Bearer\x20'+_0x5d3c16,'Content-Type':_0x23bd4c(0x1bb),..._0x3258c6['headers']??{}}});if(!_0x5b7a71['ok']){let _0x14c4a2='',_0x10a8ac;try{const _0x1dbde9=await _0x5b7a71[_0x23bd4c(0x153)](),_0x40be4d=(typeof _0x1dbde9['error']===_0x24b348['ffQDe']?_0x1dbde9[_0x23bd4c(0x159)]:undefined)??JSON[_0x23bd4c(0x130)](_0x1dbde9);_0x14c4a2=_0x40be4d;_0x24b348[_0x23bd4c(0x11d)](typeof _0x1dbde9[_0x23bd4c(0x1aa)],_0x23bd4c(0x1ab))&&_0x1dbde9['test_output']&&(_0x14c4a2=_0x14c4a2+'\x0a'+_0x1dbde9['test_output']);if(typeof _0x1dbde9['code']===_0x23bd4c(0x1ab))_0x10a8ac=_0x1dbde9[_0x23bd4c(0x191)];}catch{_0x14c4a2=_0x5b7a71['statusText'];}throw new ApiError('API\x20request\x20'+_0x1e8475+_0x23bd4c(0x110)+_0x5b7a71[_0x23bd4c(0x190)]+'):\x20'+_0x14c4a2,_0x5b7a71[_0x23bd4c(0x190)],_0x14c4a2,_0x10a8ac);}if(_0x24b348['QfxOZ'](_0x5b7a71['status'],0xcc))return undefined;return _0x5b7a71['json']();}export class ApiError extends Error{['status'];['detail'];['code'];constructor(_0x18d810,_0x2b44a6,_0x5c9848,_0x411467){const _0xb1594d=_0x37eb,_0x5681a1=_0xb1594d(0x19a)['split']('|');let _0x289d0a=0x0;while(!![]){switch(_0x5681a1[_0x289d0a++]){case'0':this[_0xb1594d(0x191)]=_0x411467;continue;case'1':this[_0xb1594d(0x10d)]=_0x5c9848;continue;case'2':this[_0xb1594d(0x190)]=_0x2b44a6;continue;case'3':this['name']='ApiError';continue;case'4':super(_0x18d810);continue;}break;}}}export async function fetchCloudProfile(_0x155b47){const _0x324f3d=_0x37eb,_0x4bc703={'zrRiL':function(_0x3e7be7,_0x15e126){return _0x3e7be7(_0x15e126);},'PHafi':function(_0x451230,_0x30c174){return _0x451230 instanceof _0x30c174;},'IiDzB':function(_0xa46efb,_0x34bac2){return _0xa46efb===_0x34bac2;}};try{return await _0x4bc703[_0x324f3d(0x127)](apiRequest,'/api/v1/profiles/'+_0x4bc703['zrRiL'](encodeURIComponent,_0x155b47));}catch(_0x3aefa9){if(_0x4bc703['PHafi'](_0x3aefa9,ApiError)&&_0x4bc703['IiDzB'](_0x3aefa9['status'],0x194))return null;throw _0x3aefa9;}}export async function listCloudProfiles(){const _0x50feec=_0x37eb,_0x5e737d=await apiRequest('/api/v1/profiles');return _0x5e737d[_0x50feec(0x198)];}export async function deleteCloudProfile(_0x7c9386){const _0x268c51=_0x37eb,_0x4870b9={'MnPKj':function(_0x83695c,_0x4e0de4,_0x5aee1f){return _0x83695c(_0x4e0de4,_0x5aee1f);},'BsrOp':function(_0x428b79,_0x23c738){return _0x428b79(_0x23c738);},'XRSYq':'DELETE','judtL':function(_0x10c2e7,_0x3dbbf5){return _0x10c2e7 instanceof _0x3dbbf5;}};try{await _0x4870b9['MnPKj'](apiRequest,_0x268c51(0x121)+_0x4870b9[_0x268c51(0x1a9)](encodeURIComponent,_0x7c9386),{'method':_0x4870b9['XRSYq']});}catch(_0x235f48){if(_0x4870b9[_0x268c51(0x106)](_0x235f48,ApiError)&&_0x235f48['status']===0x194)throw new Error('Cloud\x20profile\x20\x22'+_0x7c9386+'\x22\x20not\x20found.');throw _0x235f48;}}export async function createCloudProfile(_0x44c24a,_0x5dab2f,_0x1340a6={}){const _0x53116e=_0x37eb,_0x1966ac={'dVLei':'/api/v1/profiles','MPzml':_0x53116e(0x172)},_0x449fbb={'name':_0x44c24a};if(_0x5dab2f)_0x449fbb[_0x53116e(0x123)]=_0x5dab2f;_0x1340a6['settings']&&Object[_0x53116e(0x137)](_0x1340a6['settings'])[_0x53116e(0x1af)]>0x0&&(_0x449fbb[_0x53116e(0x126)]=_0x1340a6[_0x53116e(0x126)]);if(_0x1340a6['username'])_0x449fbb[_0x53116e(0x175)]=_0x1340a6['username'];if(_0x1340a6[_0x53116e(0x173)])_0x449fbb[_0x53116e(0x173)]=_0x1340a6[_0x53116e(0x173)];return await apiRequest(_0x1966ac['dVLei'],{'method':_0x1966ac[_0x53116e(0x12b)],'body':JSON[_0x53116e(0x130)](_0x449fbb)});}export async function uploadCloudProfileSession(_0x3084ee,_0x312e8a){const _0x3f1722=_0x37eb,_0x2a1289={'KZbgx':function(_0xc508f7,_0x40c925,_0x537757){return _0xc508f7(_0x40c925,_0x537757);}};return await _0x2a1289['KZbgx'](apiRequest,_0x3f1722(0x121)+encodeURIComponent(_0x3084ee)+_0x3f1722(0x13c),{'method':_0x3f1722(0x172),'body':JSON[_0x3f1722(0x130)]({'session_state':_0x312e8a})});}function _0x37eb(_0x184d1d,_0x5eff9a){_0x184d1d=_0x184d1d-0x101;const _0x1b2cb9=_0x1b2c();let _0x37ebf5=_0x1b2cb9[_0x184d1d];return _0x37ebf5;}export async function saveCloudProfileCredentials(_0x1c56da,_0x33c1f8,_0x3ecdaf){const _0x2a37c9=_0x37eb,_0x202925={'zhhar':function(_0x99f0c,_0x4b36e3,_0xc67479){return _0x99f0c(_0x4b36e3,_0xc67479);},'gTTZD':function(_0x5963b9,_0x545f04){return _0x5963b9(_0x545f04);},'KYSfB':_0x2a37c9(0x129)};await _0x202925[_0x2a37c9(0x16b)](apiRequest,'/api/v1/profiles/'+_0x202925['gTTZD'](encodeURIComponent,_0x1c56da),{'method':_0x202925['KYSfB'],'body':JSON['stringify']({'username':_0x33c1f8,'password':_0x3ecdaf})});}export async function fetchAuthConfig(){const _0x1eddf0=_0x37eb,_0x4f8210={'wrBgY':function(_0x5f3084,_0x2bbe22){return _0x5f3084!==_0x2bbe22;}};try{const _0x4a15c2=await apiRequest('/api/v1/profiles/auth-config');return _0x4a15c2['auth_config'];}catch(_0x1b1c7d){return _0x1b1c7d instanceof ApiError&&_0x4f8210['wrBgY'](_0x1b1c7d['status'],0x194)&&console['error'](_0x1eddf0(0x14c)+_0x1b1c7d['message']),null;}}async function createTunnelSession(_0x409bbf){const _0x2e4f3c=_0x37eb,_0x25a603={'rbMLF':'POST'};return await apiRequest(_0x2e4f3c(0x1a3),{'method':_0x25a603[_0x2e4f3c(0x1b8)],'body':JSON['stringify']({'targetUrl':_0x409bbf,'mode':_0x2e4f3c(0x1a6)})});}async function deleteTunnelSession(_0x4fe7b8){const _0x30263a=_0x37eb,_0x5440fb={'JIGbb':function(_0x63f3af,_0x4879eb,_0xcd305a){return _0x63f3af(_0x4879eb,_0xcd305a);},'uRZWE':_0x30263a(0x124)};await _0x5440fb[_0x30263a(0x117)](apiRequest,_0x30263a(0x131)+_0x4fe7b8,{'method':_0x5440fb[_0x30263a(0x135)]});}export function pickAdHocEnvKey(_0x4be86e,_0x3c8742,_0x5d1721){const _0x145110=_0x37eb,_0xe935e={'ZMfQx':function(_0x19210b,_0x1fbd72){return _0x19210b+_0x1fbd72;},'BqOKD':_0x145110(0x146),'tNTZs':function(_0xb4bd4a,_0x4c648f,_0x5ee421){return _0xb4bd4a(_0x4c648f,_0x5ee421);},'bNWDt':function(_0x18b44e,_0x1ddb3a,_0x434650){return _0x18b44e(_0x1ddb3a,_0x434650);},'xCkWu':_0x145110(0x1a2),'kKAwm':function(_0x522539,_0x583534){return _0x522539 in _0x583534;},'IoVcy':function(_0x278f1a,_0x1a99ca){return _0x278f1a(_0x1a99ca);},'QUbCn':function(_0x3568a9,_0x27b04f){return _0x3568a9+_0x27b04f;},'RyQfv':function(_0x214218,_0xfcd360){return _0x214218+_0xfcd360;},'tZotm':function(_0x59ba1a,_0x4f2d7d){return _0x59ba1a===_0x4f2d7d;}};if(_0x5d1721){if(!_0x4be86e?.['environments']?.[_0x5d1721]){const _0x35668d=Object[_0x145110(0x137)](_0x4be86e?.[_0x145110(0x1b2)]??{});throw new Error(_0xe935e['ZMfQx'](_0x145110(0x171)+_0x5d1721+_0x145110(0x176),_0x35668d['length']?_0x145110(0x1b4)+_0x35668d[_0x145110(0x1b0)](',\x20')+'.':_0xe935e['BqOKD'])+'\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)');}return _0x5d1721;}if(!_0x4be86e)return null;if(_0x3c8742){const _0x2a200f=_0xe935e[_0x145110(0x18c)](matchAuthEnvironmentExact,_0x3c8742,_0x4be86e);if(_0x2a200f)return _0x2a200f;const _0x26b573=_0xe935e['bNWDt'](matchAuthEnvironmentByHost,_0x3c8742,_0x4be86e);if(_0x26b573&&_0xe935e['xCkWu']in _0x26b573)return console[_0x145110(0x18a)](_0x145110(0x18b)+_0x26b573[_0x145110(0x1a2)]+_0x145110(0x187)+_0x3c8742+_0x145110(0x185)),_0x26b573[_0x145110(0x1a2)];if(_0x26b573&&_0xe935e['kKAwm']('ambiguous',_0x26b573))throw new Error('Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20('+_0x26b573[_0x145110(0x14b)]['join'](',\x20')+_0x145110(0x139));if(_0xe935e['IoVcy'](needsTunnel,_0x3c8742))throw new Error(_0xe935e['QUbCn'](_0xe935e[_0x145110(0x180)](_0xe935e['RyQfv'](_0x145110(0x149)+_0x3c8742+_0x145110(0x1a0),'\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a'),_0x145110(0x132)),_0x145110(0x15a))+(_0x145110(0x17b)+_0x3c8742[_0x145110(0x18e)](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a')+('\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20'+_0x3c8742+_0x145110(0x1be)));}if(_0x4be86e['defaultEnvironmentKey'])return _0x4be86e['defaultEnvironmentKey'];const _0x1a4b6c=Object['keys'](_0x4be86e['environments']??{});if(_0x1a4b6c['length']===0x1)return _0x1a4b6c[0x0];if(_0xe935e[_0x145110(0x1b9)](_0x1a4b6c[_0x145110(0x1af)],0x0))return null;throw new Error(_0xe935e['ZMfQx']('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x1a4b6c['join'](',\x20')+').\x20',_0x145110(0x101)));}export function adHocProfileName(_0x171991,_0x1221b2,_0x4cb161){const _0x377cff=_0x37eb,_0x5d278a={'kHGYt':function(_0x3b0b8e,_0x4415ee){return _0x3b0b8e===_0x4415ee;}};if(!_0x1221b2||_0x5d278a[_0x377cff(0x103)](_0x1221b2,_0x4cb161))return _0x171991;return _0x171991+':'+_0x1221b2;}export async function resolveAdHocProfile(_0x3e062b={},_0x533544=process['env']){const _0xfa5f60=_0x37eb,_0x543813={'vcpfr':function(_0x8f9d58){return _0x8f9d58();},'MGfCc':function(_0x8370d3,_0x4a7200,_0x2b8a23,_0x13b94d){return _0x8370d3(_0x4a7200,_0x2b8a23,_0x13b94d);},'kYDds':function(_0x119e90,_0x53b050){return _0x119e90(_0x53b050);},'CogYH':function(_0x5944d8,_0x26dd59){return _0x5944d8!==_0x26dd59;}},_0xe49ba6=_0x533544['RANGER_TEST_USERNAME'];if(!_0xe49ba6)return null;const _0x17d685=await _0x543813['vcpfr'](fetchAuthConfig),_0x1ee420=pickAdHocEnvKey(_0x17d685,_0x3e062b['targetUrl'],_0x3e062b['envKey']);let _0x52571=_0x543813['MGfCc'](adHocProfileName,_0xe49ba6,_0x1ee420,_0x17d685?.[_0xfa5f60(0x147)]),_0x7e537d=await _0x543813[_0xfa5f60(0x112)](fetchCloudProfile,_0x52571);_0x7e537d&&_0x1ee420&&_0x543813['CogYH'](_0x7e537d[_0xfa5f60(0x136)],_0x1ee420)&&(console[_0xfa5f60(0x18a)]('\x20\x20Cloud\x20profile\x20\x22'+_0x52571+_0xfa5f60(0x13f)+(_0x7e537d['environmentKey']??'none')+'\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22'+_0x1ee420+'\x22;\x20using\x20\x22'+_0xe49ba6+':'+_0x1ee420+_0xfa5f60(0x10a)),_0x52571=_0xe49ba6+':'+_0x1ee420,_0x7e537d=await fetchCloudProfile(_0x52571));if(_0x7e537d)return{'name':_0x7e537d[_0xfa5f60(0x16a)],'profile':_0x7e537d};const _0x186815=_0x533544[_0xfa5f60(0x189)],_0xfcecc3=await createCloudProfile(_0x52571,_0x1ee420??undefined,{'username':_0xe49ba6,'password':_0x186815});return console['log'](_0xfa5f60(0x120)+_0xfcecc3['name']+_0xfa5f60(0x133)+_0xe49ba6+(_0x1ee420?'\x20(auth\x20env:\x20'+_0x1ee420+')':'')),{'name':_0xfcecc3[_0xfa5f60(0x16a)],'profile':_0xfcecc3};}export async function writeSessionToLocalCache(_0xc6bd2a,_0x1dae27,_0x40a45e,_0x4f8b3e,_0x321bac,_0x58c855,_0x484a65){const _0x14ff2d=_0x37eb,_0x445ce9={'XDNrq':function(_0x59b4f7,_0x42e254,_0x3b8c05){return _0x59b4f7(_0x42e254,_0x3b8c05);},'OdLtH':function(_0x414843){return _0x414843();},'geunn':function(_0x37f066,_0x607de3){return _0x37f066(_0x607de3);},'fBIcd':function(_0x1f3d24,_0x300097,_0x561ac3){return _0x1f3d24(_0x300097,_0x561ac3);}},_0x1ea347=sessionCacheHash({'orgId':_0x1dae27,'profileName':_0xc6bd2a,'effectiveBaseUrl':_0x40a45e,'setupHeaders':_0x4f8b3e,'invalidateOn':_0x484a65?.['invalidateOn'],'userAgent':_0x484a65?.['userAgent'],'clientIp':_0x484a65?.[_0x14ff2d(0x11e)]}),_0x6a9c96=_0x445ce9['XDNrq'](getSessionCachePath,_0x1ea347,_0xc6bd2a),_0x29ab8d=join(_0x445ce9['OdLtH'](getRangerHomeDir),'auth');!_0x445ce9['geunn'](existsSync,_0x29ab8d)&&await mkdir(_0x29ab8d,{'recursive':!![]});const _0x11497d={..._0x321bac};_0x58c855&&_0x58c855[_0x14ff2d(0x1af)]>0x0&&Array[_0x14ff2d(0x15f)](_0x11497d['cookies'])&&(_0x11497d[_0x14ff2d(0x14d)]=_0x445ce9[_0x14ff2d(0x142)](duplicateCookiesForDomains,_0x11497d[_0x14ff2d(0x14d)],_0x58c855));const _0x58e242={'cached_at':new Date()['toISOString'](),'session_state':_0x11497d};await _0x445ce9['fBIcd'](writeFile,_0x6a9c96,JSON['stringify'](_0x58e242,null,0x2));const _0x937a45=getStorageStatePath(_0x6a9c96);return await _0x445ce9['XDNrq'](writeFile,_0x937a45,JSON['stringify'](_0x11497d,null,0x2)),_0x937a45;}export async function checkLocalCache(_0x380f47,_0x1f58d2,_0x5f4406,_0x2895e7,_0x9ba488){const _0x57e4c6=_0x37eb,_0x47d797={'oXYvn':function(_0x5c251a,_0x5e6f86){return _0x5c251a(_0x5e6f86);}},_0x273999=sessionCacheHash({'orgId':_0x1f58d2,'profileName':_0x380f47,'effectiveBaseUrl':_0x5f4406,'setupHeaders':_0x2895e7,'invalidateOn':_0x9ba488?.[_0x57e4c6(0x1b3)],'userAgent':_0x9ba488?.['userAgent'],'clientIp':_0x9ba488?.['clientIp']}),_0x4e83ed=getSessionCachePath(_0x273999,_0x380f47),_0x4574b3=_0x47d797[_0x57e4c6(0x165)](getStorageStatePath,_0x4e83ed);if(!existsSync(_0x4e83ed)||!existsSync(_0x4574b3))return null;try{const _0x56d89a=await readFile(_0x4e83ed,_0x57e4c6(0x11a));return JSON[_0x57e4c6(0x15e)](_0x56d89a),{'storageStatePath':_0x4574b3};}catch{return null;}}function launchRealBrowser(){const _0x3602ee=_0x37eb;return chromium[_0x3602ee(0x184)]({'headless':!![]});}function emitSessionValidationHint(_0x1958d7,_0x4d18df){const _0x116f3a=_0x37eb,_0x3c47a5={'QpWbT':function(_0x16bcb2,_0x5f08d0){return _0x16bcb2+_0x5f08d0;}};if(!_0x4d18df||!_0x4d18df['domains']?.[_0x116f3a(0x1af)])return;let _0x2e4c1c;try{_0x2e4c1c=new URL(_0x1958d7);}catch{return;}const _0x4baa4a=[];for(const _0x54eddf of _0x4d18df[_0x116f3a(0x162)]){try{_0x4baa4a['push']({'raw':_0x54eddf,'url':new URL(_0x54eddf)});}catch{}}if(_0x4baa4a[_0x116f3a(0x1af)]===0x0)return;if(_0x4baa4a[_0x116f3a(0x158)](_0x1589d8=>_0x1589d8['url']['origin']===_0x2e4c1c[_0x116f3a(0x17e)]))return;const _0x200f60=_0x4baa4a['map'](_0x4a0843=>'\x22'+_0x4a0843['raw']+'\x22')['join'](',\x20');console[_0x116f3a(0x18a)](_0x3c47a5['QpWbT']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x200f60+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x1958d7+'\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(_0x1174df,_0x3e2eb6){const _0x1ce4bf=_0x37eb,_0x5db118={'RMNdo':function(_0x5569a3,_0x5d85f5,_0x4934d7){return _0x5569a3(_0x5d85f5,_0x4934d7);},'mUubL':function(_0xf24f4f,_0x3809cc){return _0xf24f4f(_0x3809cc);},'XXKRs':'POST','jeshK':function(_0x399579,_0x4129b5){return _0x399579 instanceof _0x4129b5;},'ueKTX':function(_0x2a7a6d,_0x51e0b9){return _0x2a7a6d===_0x51e0b9;},'qekXG':function(_0x175063,_0x2e73d2){return _0x175063===_0x2e73d2;},'IQIps':_0x1ce4bf(0x104)},_0x2f5a83=process[_0x1ce4bf(0x13e)][_0x1ce4bf(0x197)],_0x16815c=process['env'][_0x1ce4bf(0x189)],_0x2bb06c={};if(_0x2f5a83)_0x2bb06c['username']=_0x2f5a83;if(_0x16815c)_0x2bb06c['password']=_0x16815c;if(_0x3e2eb6?.[_0x1ce4bf(0x16c)])_0x2bb06c[_0x1ce4bf(0x16c)]=!![];if(_0x3e2eb6?.[_0x1ce4bf(0x134)])_0x2bb06c['target_url']=_0x3e2eb6[_0x1ce4bf(0x134)];_0x3e2eb6?.['tunnel']&&(_0x2bb06c['tunnel_session_id']=_0x3e2eb6[_0x1ce4bf(0x128)][_0x1ce4bf(0x182)],_0x2bb06c['pw_endpoint']=_0x3e2eb6[_0x1ce4bf(0x128)]['pwEndpoint']);try{return await _0x5db118[_0x1ce4bf(0x145)](apiRequest,'/api/v1/profiles/'+_0x5db118['mUubL'](encodeURIComponent,_0x1174df)+'/login',{'method':_0x5db118['XXKRs'],'body':JSON['stringify'](_0x2bb06c)});}catch(_0x1913a8){if(_0x5db118[_0x1ce4bf(0x16e)](_0x1913a8,ApiError)&&_0x5db118['ueKTX'](_0x1913a8['status'],0x190)&&_0x5db118[_0x1ce4bf(0x10b)](_0x1913a8[_0x1ce4bf(0x191)],_0x5db118[_0x1ce4bf(0x10e)]))return{'status':_0x1ce4bf(0x104),'error':_0x1913a8['detail']};throw _0x1913a8;}}async function serverSideLoginWithOptionalTunnel(_0x43e0ec,_0x2b1d89,_0x2f5ed3={}){const _0x1feb65=_0x37eb,_0x2f7f4b={'trCyW':function(_0x10ee3e,_0x271b4a){return _0x10ee3e(_0x271b4a);},'ovgwm':function(_0x3acae5,_0x1ec557){return _0x3acae5(_0x1ec557);},'YcpZd':function(_0x3a7317,_0x2b0417,_0x52a0c4){return _0x3a7317(_0x2b0417,_0x52a0c4);},'HJtRO':function(_0x4880fb,_0x220b55){return _0x4880fb===_0x220b55;},'KNuLk':_0x1feb65(0x119),'CiVbd':function(_0x3a2bfd){return _0x3a2bfd();},'lqNBD':_0x1feb65(0x151),'KTBXR':_0x1feb65(0x152),'IyYWW':'tunnel_login_cleanup'};if(!_0x2f7f4b[_0x1feb65(0x170)](needsTunnel,_0x2b1d89))return await _0x2f7f4b[_0x1feb65(0x11c)](serverSideLogin,_0x43e0ec,{'force':_0x2f5ed3['force']});let _0x3b6db3=null,_0x33eb2b=null,_0x4d35f1=null,_0x2d5179=null,_0x518159=![];const _0x2e8e3a=process[_0x1feb65(0x13e)][_0x1feb65(0x192)]?.['toLowerCase'](),_0x2a5b18=_0x2e8e3a==='1'||_0x2f7f4b['HJtRO'](_0x2e8e3a,_0x1feb65(0x196)),_0x247946={'profileName':_0x43e0ec,'targetUrlHost':targetHostForTelemetry(_0x2b1d89),'tunnelRequired':!![],'forceLogin':Boolean(_0x2f5ed3['force']),'localBrowserServerHeaded':_0x2a5b18};try{_0x2f5ed3[_0x1feb65(0x1a4)]?.[_0x1feb65(0x1ae)]('tunnel_login_setup',_0x247946);_0x2a5b18&&console['log'](_0x2f7f4b['KNuLk']);_0x3b6db3=await launchBrowserServer({'headless':!_0x2a5b18}),_0x33eb2b=await createTunnelSession(_0x2b1d89);const _0x338e95=await _0x2f7f4b[_0x1feb65(0x166)](requireToken);_0x4d35f1=await _0x2f7f4b['trCyW'](createTunnelBridge,{'localWsUrl':_0x3b6db3[_0x1feb65(0x1a1)],'tunnelServerUrl':_0x33eb2b['tunnelUrl'],'sessionId':_0x33eb2b['sessionId'],'apiKey':_0x338e95,'onError':_0x376d0e=>{_0x2d5179=_0x376d0e;},'onClose':()=>{const _0x57f723=_0x1feb65;_0x2d5179??=new Error(_0x57f723(0x12d)+_0x43e0ec);},'onEvent':_0x564c72=>trackBridgeEvent(_0x2f5ed3[_0x1feb65(0x1a4)],_0x564c72)}),_0x2f5ed3['telemetry']?.['trackPhaseEnd']('tunnel_login_setup',{..._0x247946,'tunnelSessionId':_0x33eb2b[_0x1feb65(0x182)],'localBrowserServer':!![],'localBrowserServerHeaded':_0x2a5b18}),_0x518159=!![];try{return _0x2f5ed3['telemetry']?.['trackPhaseStart'](_0x2f7f4b[_0x1feb65(0x1b1)],{..._0x247946,'tunnelSessionId':_0x33eb2b['sessionId']}),await serverSideLogin(_0x43e0ec,{'force':_0x2f5ed3[_0x1feb65(0x16c)],'targetUrl':_0x2b1d89,'tunnel':{'sessionId':_0x33eb2b['sessionId'],'pwEndpoint':_0x33eb2b[_0x1feb65(0x1ba)]}})[_0x1feb65(0x17d)](_0x123f40=>{const _0x5ef95d=_0x1feb65;return _0x2f5ed3['telemetry']?.['trackPhaseEnd']('tunnel_login_request',{..._0x247946,'tunnelSessionId':_0x33eb2b?.['sessionId'],'loginStatus':_0x123f40['status'],'hasSessionState':Boolean(_0x123f40['session_state']),'hasTestOutput':Boolean(_0x123f40['test_output']),'bridgeError':_0x2f7f4b[_0x5ef95d(0x163)](errorMessageForTelemetry,_0x2d5179)}),_0x123f40;});}catch(_0x11536e){await _0x2f5ed3[_0x1feb65(0x1a4)]?.['trackPhaseError'](_0x2f7f4b[_0x1feb65(0x1b1)],_0x2d5179??_0x11536e,{..._0x247946,'tunnelSessionId':_0x33eb2b['sessionId'],'bridgeError':_0x2f7f4b[_0x1feb65(0x163)](errorMessageForTelemetry,_0x2d5179)});throw _0x2d5179??_0x11536e;}}catch(_0x44e43c){!_0x518159&&await _0x2f5ed3[_0x1feb65(0x1a4)]?.[_0x1feb65(0x11b)](_0x2f7f4b['KTBXR'],_0x44e43c,{..._0x247946,'tunnelSessionId':_0x33eb2b?.[_0x1feb65(0x182)]});throw _0x44e43c;}finally{(_0x33eb2b||_0x3b6db3||_0x4d35f1)&&(_0x2f5ed3['telemetry']?.[_0x1feb65(0x1ae)](_0x1feb65(0x15d),{..._0x247946,'tunnelSessionId':_0x33eb2b?.['sessionId']}),_0x4d35f1?.['close'](),_0x3b6db3&&await _0x3b6db3['close']()[_0x1feb65(0x114)](()=>{}),_0x33eb2b&&await deleteTunnelSession(_0x33eb2b['sessionId'])['catch'](()=>{}),_0x2f5ed3[_0x1feb65(0x1a4)]?.['trackPhaseEnd'](_0x2f7f4b[_0x1feb65(0x1bd)],{..._0x247946,'tunnelSessionId':_0x33eb2b?.['sessionId']}));}}export async function manualBrowserLogin(_0x360c47,_0x1416b1,_0x1df552={}){const _0x5b9383=_0x37eb,_0x2f219e={'kVfZC':function(_0x54d951,_0x40bcd1){return _0x54d951/_0x40bcd1;},'kfcpT':function(_0x2b7d9c,_0x169c2c){return _0x2b7d9c(_0x169c2c);},'MViIe':function(_0x3679f6,_0x28f992){return _0x3679f6+_0x28f992;},'KdzjI':_0x5b9383(0x1a7),'mcJeT':function(_0x2c0e52,_0x2964ca){return _0x2c0e52>_0x2964ca;},'pgMgS':_0x5b9383(0x1a5),'nRjip':'\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','uXuqR':_0x5b9383(0x183),'gpHwo':function(_0x509960,_0x1d46fe,_0x492462){return _0x509960(_0x1d46fe,_0x492462);},'TLbtz':_0x5b9383(0x16f)};if(!isInteractive())throw new Error(_0x2f219e['MViIe']('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x360c47[_0x5b9383(0x16a)]+_0x5b9383(0x1a0)+_0x5b9383(0x194),_0x2f219e[_0x5b9383(0x19f)]));const _0x1c5652=_0x1416b1&&_0x2f219e[_0x5b9383(0x14a)](_0x1416b1[_0x5b9383(0x162)][_0x5b9383(0x1af)],0x0)?_0x1416b1[_0x5b9383(0x162)][0x0]:_0x2f219e[_0x5b9383(0x107)];console[_0x5b9383(0x18a)](_0x5b9383(0x14f)),console['log'](_0x2f219e[_0x5b9383(0x15b)]),await new Promise(_0x2413cf=>setTimeout(_0x2413cf,0x7d0));const _0x45ace1=await chromium[_0x5b9383(0x184)]({'headless':![]});let _0x14a735=null;try{const _0x6bdb78={'ignoreHTTPSErrors':!![]};_0x1416b1?.[_0x5b9383(0x174)]&&(_0x6bdb78[_0x5b9383(0x181)]=_0x1416b1[_0x5b9383(0x174)]);const _0x5e610c=await _0x45ace1['newContext'](_0x6bdb78);await addProfileSetupBanner(_0x5e610c);const _0x3ff10f=await _0x5e610c[_0x5b9383(0x108)]();await _0x3ff10f[_0x5b9383(0x13b)](_0x1c5652);let _0x2e0aaf=![];await new Promise(_0x14923a=>{const _0x5a30f3=_0x5b9383,_0x453dc5=setTimeout(()=>{const _0x5d7507=_0x37eb;_0x2e0aaf=!![],console[_0x5d7507(0x159)](_0x5d7507(0x113)+_0x2f219e['kVfZC'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x14923a();},MANUAL_LOGIN_TIMEOUT_MS);_0x3ff10f['on'](_0x5a30f3(0x164),async()=>{const _0x15bd41=_0x5a30f3;_0x2f219e['kfcpT'](clearTimeout,_0x453dc5);try{const _0x11e284=await _0x5e610c[_0x15bd41(0x1ad)]();_0x14a735=_0x11e284;}catch{}_0x14923a();});});if(_0x2e0aaf&&!_0x14a735)throw new Error(_0x5b9383(0x13d));}finally{await _0x45ace1['close']()['catch'](()=>{});}if(!_0x14a735)throw new Error(_0x2f219e[_0x5b9383(0x11f)]);return _0x1df552[_0x5b9383(0x1b7)]!==![]&&await _0x2f219e['gpHwo'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x360c47['name'])+'/session',{'method':_0x5b9383(0x172),'body':JSON[_0x5b9383(0x130)]({'session_state':_0x14a735,'updated_by':_0x2f219e[_0x5b9383(0x1b5)]})}),{'sessionState':_0x14a735};}export async function promptSaveCredentials(_0x3f71ee){const _0x4ffae3=_0x37eb,_0x1fee45={'SRTrL':_0x4ffae3(0x167),'AeLBP':_0x4ffae3(0x17f),'NYVBG':function(_0x2729d0,_0x224512,_0x5bbabd){return _0x2729d0(_0x224512,_0x5bbabd);},'AMSxR':function(_0x5642d3,_0x23a8f7){return _0x5642d3(_0x23a8f7);},'ktAKo':'PUT'},_0x36e094=process[_0x4ffae3(0x13e)][_0x4ffae3(0x197)],_0x599ada=process['env'][_0x4ffae3(0x189)];if(!_0x36e094||!_0x599ada)return;if(!isInteractive())return;const {save:_0x340afc}=await _0x7ecee3[_0x4ffae3(0x141)]([{'type':_0x1fee45['SRTrL'],'name':_0x1fee45['AeLBP'],'message':_0x4ffae3(0x186),'default':![]}]);if(!_0x340afc)return;await _0x1fee45['NYVBG'](apiRequest,_0x4ffae3(0x121)+_0x1fee45['AMSxR'](encodeURIComponent,_0x3f71ee),{'method':_0x1fee45['ktAKo'],'body':JSON[_0x4ffae3(0x130)]({'username':_0x36e094,'password':_0x599ada})}),console['log']('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x1cb41d,_0x760d9b={}){const _0x12e02b=_0x37eb,_0x27d7c3={'gzzGg':function(_0x56aa5a){return _0x56aa5a();},'hqpYm':function(_0x43ed57,_0x5ab1c3){return _0x43ed57===_0x5ab1c3;},'ABQpm':function(_0x16b649,_0x28b609){return _0x16b649===_0x28b609;},'UCdek':'string','ZJBJI':function(_0x2c40f4,_0x3b0892,_0x28cbb2,_0x2ba00e,_0x2238dc){return _0x2c40f4(_0x3b0892,_0x28cbb2,_0x2ba00e,_0x2238dc);},'jXqNl':function(_0x5d63c4,_0x366a42,_0x427019,_0x2a045a,_0x2db670,_0xbd75d0,_0x2cbd5b,_0x5b662e){return _0x5d63c4(_0x366a42,_0x427019,_0x2a045a,_0x2db670,_0xbd75d0,_0x2cbd5b,_0x5b662e);},'sDIKO':function(_0x38b1d4,_0x2d6bd4,_0xe16456,_0x413847,_0x53619d){return _0x38b1d4(_0x2d6bd4,_0xe16456,_0x413847,_0x53619d);},'rFUrt':function(_0x417de7,_0x288c20,_0x502573){return _0x417de7(_0x288c20,_0x502573);},'DasYu':function(_0x40dbc1,_0x2cde1f){return _0x40dbc1(_0x2cde1f);},'xtOet':function(_0x31a113,_0x3cab60){return _0x31a113(_0x3cab60);},'mvCXR':function(_0x170a5b,_0x161b77){return _0x170a5b||_0x161b77;},'xfkDO':function(_0x578671,_0x463042,_0x47cb8e,_0x34acdc){return _0x578671(_0x463042,_0x47cb8e,_0x34acdc);},'uwhZO':function(_0x3a36bb,_0x3d2107,_0xcfc3d7){return _0x3a36bb(_0x3d2107,_0xcfc3d7);},'MsPko':function(_0x24b4fe,_0x446e06){return _0x24b4fe===_0x446e06;},'ihGYV':_0x12e02b(0x195),'uZZYT':function(_0x499fd9,_0x5a57da,_0x1270e8,_0x179ee3){return _0x499fd9(_0x5a57da,_0x1270e8,_0x179ee3);}},_0x48b9e4=_0x1cb41d['settings']??{},_0x2d13af=await _0x27d7c3['gzzGg'](fetchAuthConfig),_0x5277a1=_0x2d13af?resolveAuthEnvironmentLocally(_0x2d13af,_0x1cb41d[_0x12e02b(0x136)]):null,_0x3a329f=_0x27d7c3[_0x12e02b(0x156)](typeof _0x5277a1?.[_0x12e02b(0x12e)],'string')&&_0x5277a1['loginInstructions']['trim']()?_0x5277a1[_0x12e02b(0x12e)]:undefined,_0x201ca5=_0x27d7c3[_0x12e02b(0x10c)](typeof _0x48b9e4[_0x12e02b(0x12e)],_0x27d7c3['UCdek'])&&_0x48b9e4['loginInstructions']['trim']()?_0x48b9e4[_0x12e02b(0x12e)]:undefined,_0x1f5812=_0x201ca5||!_0x3a329f?_0x48b9e4:{..._0x48b9e4,'loginInstructions':_0x3a329f},_0x528f60=Boolean(_0x1f5812[_0x12e02b(0x12e)]?.['trim']()),_0x4860ae=Boolean(_0x48b9e4[_0x12e02b(0x12f)]||_0x5277a1?.['forceLogin']),_0x522b02=_0x5277a1?.[_0x12e02b(0x162)],_0x17ffd6=_0x48b9e4[_0x12e02b(0x174)],_0x128139=_0x17ffd6??_0x5277a1?.['setupHeaders'],_0x59ae5d=_0x760d9b['effectiveBaseUrl']??_0x48b9e4[_0x12e02b(0x13a)]??(_0x522b02&&_0x522b02['length']>0x0?_0x522b02[0x0]:''),_0x516ddb=_0x59ae5d?needsTunnel(_0x59ae5d):![],_0x4035d5={'invalidateOn':_0x5277a1?.['invalidateOn'],'userAgent':_0x5277a1?.[_0x12e02b(0x19d)]?.['userAgent']??_0x48b9e4['userAgent']};_0x4860ae&&console[_0x12e02b(0x18a)](_0x12e02b(0x12a)+_0x1cb41d[_0x12e02b(0x16a)]+'\x22,\x20refreshing\x20session...');if(!_0x4860ae){const _0x3d386a=await checkLocalCache(_0x1cb41d[_0x12e02b(0x16a)],_0x1cb41d[_0x12e02b(0x177)],_0x59ae5d,_0x128139,_0x4035d5);if(_0x3d386a){if(_0x59ae5d&&!_0x516ddb){const _0x511d23=await _0x27d7c3[_0x12e02b(0x19c)](isCachedSessionLive,_0x3d386a['storageStatePath'],_0x59ae5d,{'sessionCheckPath':_0x5277a1?.[_0x12e02b(0x18d)],'setupHeaders':_0x128139},{'launchBrowser':launchRealBrowser});if(_0x511d23)return console['log'](_0x12e02b(0x1a8)+_0x1cb41d[_0x12e02b(0x16a)]+'\x22'),{'authPath':_0x3d386a[_0x12e02b(0x19b)],'settings':_0x1f5812,'resolvedEnv':_0x5277a1};console[_0x12e02b(0x18a)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0x1cb41d['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),emitSessionValidationHint(_0x59ae5d,_0x5277a1);}else return _0x516ddb&&console['log'](_0x12e02b(0x169)+_0x1cb41d[_0x12e02b(0x16a)]+'\x22'),{'authPath':_0x3d386a[_0x12e02b(0x19b)],'settings':_0x1f5812,'resolvedEnv':_0x5277a1};}}if(!_0x4860ae&&_0x1cb41d[_0x12e02b(0x150)]){if(_0x516ddb)console['log'](_0x12e02b(0x18f)+_0x59ae5d+_0x12e02b(0x16d)+_0x1cb41d[_0x12e02b(0x16a)]+'\x22');else{const _0x272ade=await _0x27d7c3['jXqNl'](writeSessionToLocalCache,_0x1cb41d[_0x12e02b(0x16a)],_0x1cb41d['organizationId'],_0x59ae5d,_0x128139,_0x1cb41d[_0x12e02b(0x150)],_0x522b02,_0x4035d5);if(_0x59ae5d){const _0x972aa9=await _0x27d7c3['sDIKO'](isCachedSessionLive,_0x272ade,_0x59ae5d,{'sessionCheckPath':_0x5277a1?.[_0x12e02b(0x18d)],'setupHeaders':_0x128139},{'launchBrowser':launchRealBrowser});if(_0x972aa9)return console[_0x12e02b(0x18a)](_0x12e02b(0x1ac)+_0x1cb41d[_0x12e02b(0x16a)]+'\x22,\x20cached\x20locally'),{'authPath':_0x272ade,'settings':_0x1f5812,'resolvedEnv':_0x5277a1};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x1cb41d['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),_0x27d7c3['rFUrt'](emitSessionValidationHint,_0x59ae5d,_0x5277a1);}else return{'authPath':_0x272ade,'settings':_0x1f5812,'resolvedEnv':_0x5277a1};}}if(_0x528f60)return console[_0x12e02b(0x18a)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x1cb41d['name']+_0x12e02b(0x17a)),{'authPath':undefined,'settings':_0x1f5812,'resolvedEnv':_0x5277a1};console[_0x12e02b(0x18a)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x1cb41d['name']+_0x12e02b(0x178));const _0x1acd1e=_0x27d7c3[_0x12e02b(0x157)](Boolean,process[_0x12e02b(0x13e)][_0x12e02b(0x197)])&&_0x27d7c3['xtOet'](Boolean,process[_0x12e02b(0x13e)][_0x12e02b(0x189)]),_0x2c716b=_0x27d7c3[_0x12e02b(0x157)](Boolean,_0x1cb41d[_0x12e02b(0x175)]);if(_0x27d7c3['mvCXR'](_0x1acd1e,_0x2c716b))try{const _0x394f37=_0x59ae5d?await _0x27d7c3[_0x12e02b(0x193)](serverSideLoginWithOptionalTunnel,_0x1cb41d['name'],_0x59ae5d,{'force':_0x4860ae,'telemetry':_0x760d9b['telemetry']}):await _0x27d7c3[_0x12e02b(0x144)](serverSideLogin,_0x1cb41d['name'],{'force':_0x4860ae});if(_0x27d7c3[_0x12e02b(0x10c)](_0x394f37[_0x12e02b(0x190)],'not_configured'))console['log'](_0x12e02b(0x1b6));else{if(_0x27d7c3[_0x12e02b(0x105)](_0x394f37[_0x12e02b(0x190)],'success')&&_0x394f37[_0x12e02b(0x125)]){console[_0x12e02b(0x18a)](_0x12e02b(0x17c));const _0x49d23f=await writeSessionToLocalCache(_0x1cb41d[_0x12e02b(0x16a)],_0x1cb41d['organizationId'],_0x59ae5d,_0x128139,_0x394f37['session_state'],_0x522b02,_0x4035d5);return _0x1acd1e&&!_0x2c716b&&await _0x27d7c3[_0x12e02b(0x115)](promptSaveCredentials,_0x1cb41d['name']),{'authPath':_0x49d23f,'settings':_0x1f5812,'resolvedEnv':_0x5277a1};}else _0x394f37[_0x12e02b(0x1aa)]&&(console[_0x12e02b(0x18a)]('\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:'),console['log'](_0x394f37[_0x12e02b(0x1aa)])),console[_0x12e02b(0x18a)](_0x27d7c3['ihGYV']);}}catch(_0x420f21){console[_0x12e02b(0x18a)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x420f21 instanceof Error?_0x420f21['message']:String(_0x420f21))),console[_0x12e02b(0x18a)](_0x27d7c3['ihGYV']);}const _0x1e3873=_0x5277a1?{..._0x5277a1,'setupHeaders':_0x128139}:_0x59ae5d?{'key':_0x1cb41d['environmentKey']??'','domains':[_0x59ae5d],'setupHeaders':_0x128139}:null,{sessionState:_0xa26d97}=await _0x27d7c3['uZZYT'](manualBrowserLogin,_0x1cb41d,_0x1e3873,{'persistSessionState':!_0x516ddb}),_0x3b141f=await _0x27d7c3['jXqNl'](writeSessionToLocalCache,_0x1cb41d['name'],_0x1cb41d[_0x12e02b(0x177)],_0x59ae5d,_0x128139,_0xa26d97,_0x522b02,_0x4035d5);return{'authPath':_0x3b141f,'settings':_0x1f5812,'resolvedEnv':_0x5277a1};}
1
+ const _0x2bae3a=_0x1947;(function(_0x500238,_0x4633c1){const _0x3173d9=_0x1947,_0x4551ce=_0x500238();while(!![]){try{const _0x579f02=-parseInt(_0x3173d9(0x1f7))/0x1*(-parseInt(_0x3173d9(0x14e))/0x2)+-parseInt(_0x3173d9(0x200))/0x3+-parseInt(_0x3173d9(0x1bf))/0x4*(-parseInt(_0x3173d9(0x196))/0x5)+-parseInt(_0x3173d9(0x1f0))/0x6*(parseInt(_0x3173d9(0x1d3))/0x7)+-parseInt(_0x3173d9(0x170))/0x8*(parseInt(_0x3173d9(0x172))/0x9)+-parseInt(_0x3173d9(0x1a8))/0xa*(-parseInt(_0x3173d9(0x1a1))/0xb)+parseInt(_0x3173d9(0x146))/0xc;if(_0x579f02===_0x4633c1)break;else _0x4551ce['push'](_0x4551ce['shift']());}catch(_0x169fe2){_0x4551ce['push'](_0x4551ce['shift']());}}}(_0x320f,0x96b2f));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x4e34ea from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';function _0x320f(){const _0x210ddf=['uFWsi','No\x20saved\x20session\x20for\x20\x22','launch','forceLogin','205475fgmXLi','tunnel_login_cleanup','tunnel_login_setup','API\x20request\x20','rpJBl','cli:manual-login','reason','split','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','status','yStzg','11WAFUtQ','RIhmL','RhiPT','\x22\x20on\x20profile\x20\x22',');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.','WRQKB','agent','7193930WVvHHB','sessionId','absWR','xRYjC','password','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','setupHeaders','):\x20','about:blank','pw_endpoint','\x22\x20failed\x20validation\x20—\x20refreshing...','\x22\x20for\x20','QVkel','tuCMO','PUT','elapsedMs','FFThf','No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22','environmentKey','\x22,\x20and\x20cloud\x20sessions\x20don\x27t\x20apply\x20to\x20localhost.\x0a','activeLocalConnections','effectiveBaseUrl','loginInstructions','100ojqEHd','error','NwQXb','userAgent','confirm','kDKSh','settings','tunnel_session_id','username','clientIp','HBHfw','\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.','Mknwo','you\x27re\x20now\x20at\x20\x22','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','Auth\x20environment\x20\x22','Tyqts','length','pendingLocalConnections','kSGoH','7yiNfXc','string','Pass\x20--base-url\x20<your-app-url>\x20so\x20Ranger\x20can\x20match\x20the\x20right\x20one,\x20or\x20create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`.','aVMzA','oSUmi','some','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','cookies','POST','wcyNn','WAios','\x22\x20not\x20found.','assertedEnv','\x22,\x20attempting\x20login...','trackPhaseError','FUejt','invalidateOn','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','Browser\x20login\x20timed\x20out\x20after\x20','\x20\x20Options:\x0a','catch','pwgux','environments','ugPqO','jngPP','trackPhaseEnd','uFbef','\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22','RWGGR','3697932GLrRrR','env','/session','wDSbL','ambiguous','\x20failed\x20(','RANGER_TUNNEL_LOGIN_HEADED','5901cvDHLM','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','CbbZM','/api/v1/profiles','headers','xTwoD','\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).','log','code','2816991JLLpPO','\x22\x20matched\x20by\x20host\x20for\x20','ApiError','qIISM','telemetry','wyxWI','domains','\x20\x20No\x20live\x20session\x20for\x20\x22','invalid-url','\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a','sMqxp','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','10740816jXIlqH','not_configured','lzMjM','newPage','defaultEnvironmentKey','DWIAe','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','iqena','140UBnubd','stringify','WOVpH','/api/v1/profiles/','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','persistSessionState','message','WymHJ','force','organizationId','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','join','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','browserOptions','DELETE','szyTS','test_output','RANGER_TEST_PASSWORD','TjuLX','trackPhaseStart','akZYr','Bearer\x20','tunnel_login_request','moAIF','sessionState','GcfCL','hqTJi','auth','\x22,\x20refreshing\x20session...','KBWFs','auth_config','\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.','iEHUW','targetUrl','8oLyUZH','whPuH','7940916NDiAiM','key','local_ws_error','close','LhtAg','WPYsC','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','\x20\x20•\x20or\x20pass\x20--env\x20<key>\x20to\x20run\x20an\x20automated\x20login\x20for\x20this\x20target.','4|1|3|0|2','type','detail','origin','parse','\x20\x20forceLogin\x20enabled\x20for\x20\x22','pGGWg','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','sessionCheckPath','name','tunnelUrl','GJMaU','storageStatePath','url','tunnel','RANGER_TEST_USERNAME','pwEndpoint','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a','session_state','\x22.\x0a','HfnJY','keys','lKKms'];_0x320f=function(){return _0x210ddf;};return _0x320f();}import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isBareLocalhost,isCachedSessionLive,isInteractive,needsTunnel,orderLoginDomains,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';function _0x1947(_0x2615ed,_0x407aed){_0x2615ed=_0x2615ed-0x143;const _0x320f8e=_0x320f();let _0x194730=_0x320f8e[_0x2615ed];return _0x194730;}import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0xc5dd64){const _0x51e106=_0x1947,_0x3dba22={'YFmht':_0x51e106(0x208)};try{return new URL(_0xc5dd64)['host'];}catch{return _0x3dba22['YFmht'];}}function errorMessageForTelemetry(_0x10b199){return _0x10b199 instanceof Error?_0x10b199['message']:undefined;}function trackBridgeEvent(_0x4c0660,_0x473d42){const _0x580155=_0x1947,_0x56ed76={'mRSKI':'tunnel_error','xBLki':_0x580155(0x174)};if(!_0x4c0660)return;const _0x5f22bd={'tunnelSessionId':_0x473d42[_0x580155(0x1a9)],'tunnelEventType':_0x473d42['type'],'connectionId':_0x473d42['connectionId'],'code':_0x473d42['code'],'reason':_0x473d42[_0x580155(0x19c)],'error':_0x473d42['error'],'elapsedMs':_0x473d42[_0x580155(0x1b7)],'activeLocalConnections':_0x473d42[_0x580155(0x1bc)],'pendingLocalConnections':_0x473d42[_0x580155(0x1d1)]};_0x4c0660[_0x580155(0x1ec)]('tunnel_bridge_event',_0x5f22bd),(_0x473d42[_0x580155(0x17b)]===_0x56ed76['mRSKI']||_0x473d42['type']===_0x56ed76['xBLki'])&&void _0x4c0660['trackPhaseError']('tunnel_bridge',new Error(_0x473d42['error']??_0x473d42['type']),_0x5f22bd);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x51a174=_0x1947,_0x5c5d41={'akZYr':function(_0x3fcdc4){return _0x3fcdc4();},'ZVeHa':_0x51a174(0x152)},_0x3ddf57=await _0x5c5d41[_0x51a174(0x162)](getToken);if(!_0x3ddf57)throw new Error(_0x5c5d41['ZVeHa']);return _0x3ddf57;}async function apiRequest(_0x23527b,_0x1fdebb={}){const _0x3dba36=_0x1947,_0x102222={'moAIF':function(_0x1c4ebf){return _0x1c4ebf();},'qWriF':'application/json','xEoHC':function(_0x4aa4ed,_0x2ceebe){return _0x4aa4ed===_0x2ceebe;},'uFbef':'string','wyxWI':function(_0x143984,_0xdb9a79){return _0x143984===_0xdb9a79;}},_0x320800=await requireToken(),_0x1223cd=_0x102222[_0x3dba36(0x165)](getApiBaseUrl),_0xed8ef7=await fetch(''+_0x1223cd+_0x23527b,{..._0x1fdebb,'headers':{'Authorization':_0x3dba36(0x163)+_0x320800,'Content-Type':_0x102222['qWriF'],..._0x1fdebb[_0x3dba36(0x1fb)]??{}}});if(!_0xed8ef7['ok']){let _0x3281e8='',_0x105d9a;try{const _0x59d0de=await _0xed8ef7['json'](),_0x51c140=(_0x102222['xEoHC'](typeof _0x59d0de[_0x3dba36(0x1c0)],_0x102222[_0x3dba36(0x1ed)])?_0x59d0de['error']:undefined)??JSON['stringify'](_0x59d0de);_0x3281e8=_0x51c140;_0x102222['xEoHC'](typeof _0x59d0de['test_output'],'string')&&_0x59d0de[_0x3dba36(0x15e)]&&(_0x3281e8=_0x3281e8+'\x0a'+_0x59d0de[_0x3dba36(0x15e)]);if(typeof _0x59d0de['code']===_0x3dba36(0x1d4))_0x105d9a=_0x59d0de[_0x3dba36(0x1ff)];}catch{_0x3281e8=_0xed8ef7['statusText'];}throw new ApiError(_0x3dba36(0x199)+_0x23527b+_0x3dba36(0x1f5)+_0xed8ef7['status']+_0x3dba36(0x1af)+_0x3281e8,_0xed8ef7[_0x3dba36(0x19f)],_0x3281e8,_0x105d9a);}if(_0x102222[_0x3dba36(0x205)](_0xed8ef7[_0x3dba36(0x19f)],0xcc))return undefined;return _0xed8ef7['json']();}export class ApiError extends Error{[_0x2bae3a(0x19f)];[_0x2bae3a(0x17c)];['code'];constructor(_0x53f737,_0x4c8a62,_0x3b1d76,_0x3683e8){const _0x1df507=_0x2bae3a,_0x49edcd={'RhiPT':_0x1df507(0x17a),'DNoGb':_0x1df507(0x202)},_0x18cb74=_0x49edcd[_0x1df507(0x1a3)][_0x1df507(0x19d)]('|');let _0xd2e4e0=0x0;while(!![]){switch(_0x18cb74[_0xd2e4e0++]){case'0':this['code']=_0x3683e8;continue;case'1':this['status']=_0x4c8a62;continue;case'2':this['name']=_0x49edcd['DNoGb'];continue;case'3':this[_0x1df507(0x17c)]=_0x3b1d76;continue;case'4':super(_0x53f737);continue;}break;}}}export async function fetchCloudProfile(_0x209744){const _0x14d30f=_0x2bae3a,_0x4eeddc={'WRQKB':function(_0x4749d9,_0x35d93b){return _0x4749d9(_0x35d93b);},'gHdeE':function(_0x129d21,_0x34a7b2){return _0x129d21 instanceof _0x34a7b2;}};try{return await _0x4eeddc[_0x14d30f(0x1a6)](apiRequest,_0x14d30f(0x151)+encodeURIComponent(_0x209744));}catch(_0x58f525){if(_0x4eeddc['gHdeE'](_0x58f525,ApiError)&&_0x58f525['status']===0x194)return null;throw _0x58f525;}}export async function listCloudProfiles(){const _0x133813=_0x2bae3a,_0x86e8f5={'WymHJ':function(_0x40c17b,_0x452901){return _0x40c17b(_0x452901);}},_0x5a31d5=await _0x86e8f5[_0x133813(0x155)](apiRequest,'/api/v1/profiles');return _0x5a31d5['profiles'];}export async function deleteCloudProfile(_0x429c7c){const _0x2238ec=_0x2bae3a,_0x8f4971={'GcfCL':_0x2238ec(0x15c),'uGjsA':function(_0x18d42e,_0x1a5b2f){return _0x18d42e instanceof _0x1a5b2f;},'zaDZS':function(_0x3de6f5,_0x27f23c){return _0x3de6f5===_0x27f23c;}};try{await apiRequest(_0x2238ec(0x151)+encodeURIComponent(_0x429c7c),{'method':_0x8f4971[_0x2238ec(0x167)]});}catch(_0x192f48){if(_0x8f4971['uGjsA'](_0x192f48,ApiError)&&_0x8f4971['zaDZS'](_0x192f48['status'],0x194))throw new Error('Cloud\x20profile\x20\x22'+_0x429c7c+_0x2238ec(0x1de));throw _0x192f48;}}export async function createCloudProfile(_0x4c2221,_0x48587d,_0x4048ff={}){const _0x2b061d=_0x2bae3a,_0x1fb732={'cyYec':function(_0x553fdf,_0x49783c){return _0x553fdf>_0x49783c;},'vgYsH':function(_0x2a1529,_0x117d92,_0x279f14){return _0x2a1529(_0x117d92,_0x279f14);}},_0x4906c5={'name':_0x4c2221};if(_0x48587d)_0x4906c5['environment_key']=_0x48587d;_0x4048ff[_0x2b061d(0x1c5)]&&_0x1fb732['cyYec'](Object[_0x2b061d(0x190)](_0x4048ff[_0x2b061d(0x1c5)])[_0x2b061d(0x1d0)],0x0)&&(_0x4906c5['settings']=_0x4048ff['settings']);if(_0x4048ff['username'])_0x4906c5[_0x2b061d(0x1c7)]=_0x4048ff[_0x2b061d(0x1c7)];if(_0x4048ff['password'])_0x4906c5['password']=_0x4048ff['password'];return await _0x1fb732['vgYsH'](apiRequest,_0x2b061d(0x1fa),{'method':'POST','body':JSON['stringify'](_0x4906c5)});}export async function uploadCloudProfileSession(_0x8572b4,_0x1e05d2){const _0x304007=_0x2bae3a,_0x5136bb={'KkZLb':function(_0x461228,_0x45e777,_0x58f7c6){return _0x461228(_0x45e777,_0x58f7c6);},'Jefhg':function(_0x82c697,_0x51988c){return _0x82c697(_0x51988c);}};return await _0x5136bb['KkZLb'](apiRequest,_0x304007(0x151)+_0x5136bb['Jefhg'](encodeURIComponent,_0x8572b4)+_0x304007(0x1f2),{'method':_0x304007(0x1db),'body':JSON['stringify']({'session_state':_0x1e05d2})});}export async function saveCloudProfileCredentials(_0x32eb80,_0x4e7a64,_0x4d1e83){const _0x2e78a1=_0x2bae3a,_0x459b64={'oLWBo':function(_0xe4d3c1,_0x7620b2,_0x3ad755){return _0xe4d3c1(_0x7620b2,_0x3ad755);},'ooFHe':function(_0x2a3349,_0x5c317){return _0x2a3349(_0x5c317);},'QVkel':_0x2e78a1(0x1b6)};await _0x459b64['oLWBo'](apiRequest,_0x2e78a1(0x151)+_0x459b64['ooFHe'](encodeURIComponent,_0x32eb80),{'method':_0x459b64[_0x2e78a1(0x1b4)],'body':JSON[_0x2e78a1(0x14f)]({'username':_0x4e7a64,'password':_0x4d1e83})});}export async function fetchAuthConfig(){const _0x543d4d=_0x2bae3a,_0xa4c5cd={'RIhmL':function(_0x3357fd,_0x4287b3){return _0x3357fd(_0x4287b3);},'SPvSd':function(_0x18caea,_0x22c0dd){return _0x18caea instanceof _0x22c0dd;}};try{const _0x2b4419=await _0xa4c5cd[_0x543d4d(0x1a2)](apiRequest,'/api/v1/profiles/auth-config');return _0x2b4419[_0x543d4d(0x16c)];}catch(_0x1dfbd6){return _0xa4c5cd['SPvSd'](_0x1dfbd6,ApiError)&&_0x1dfbd6[_0x543d4d(0x19f)]!==0x194&&console[_0x543d4d(0x1c0)]('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x1dfbd6['message']),null;}}async function createTunnelSession(_0x26605e){const _0x491c2a=_0x2bae3a,_0x50efa9={'KBWFs':_0x491c2a(0x1a7)};return await apiRequest('/api/v1/tunnel/sessions',{'method':'POST','body':JSON['stringify']({'targetUrl':_0x26605e,'mode':_0x50efa9[_0x491c2a(0x16b)]})});}async function deleteTunnelSession(_0x47a426){const _0x2c9144=_0x2bae3a,_0x5f2155={'CfsXO':function(_0x3bac8b,_0x4d7101,_0x288b53){return _0x3bac8b(_0x4d7101,_0x288b53);}};await _0x5f2155['CfsXO'](apiRequest,'/api/v1/tunnel/sessions/'+_0x47a426,{'method':_0x2c9144(0x15c)});}export function pickAdHocEnvKey(_0x43807b,_0x525c3e,_0x3b16aa){const _0x134816=_0x2bae3a,_0x1c37d={'kDKSh':function(_0x2496c5,_0xe31abc){return _0x2496c5+_0xe31abc;},'IAFuZ':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','pGGWg':function(_0x3f281d,_0x44f542){return _0x3f281d in _0x44f542;},'ixLPN':_0x134816(0x173),'YIRld':'ambiguous','rvpSG':function(_0x463c6f,_0x27be8c){return _0x463c6f(_0x27be8c);},'CbbZM':function(_0xb0a5de,_0x4c7b50){return _0xb0a5de+_0x4c7b50;},'WAios':function(_0x56de11,_0x190637){return _0x56de11===_0x190637;}};if(_0x3b16aa){if(!_0x43807b?.[_0x134816(0x1e9)]?.[_0x3b16aa]){const _0x145928=Object['keys'](_0x43807b?.[_0x134816(0x1e9)]??{});throw new Error(_0x1c37d['kDKSh'](_0x134816(0x1ce)+_0x3b16aa+_0x134816(0x1ca),_0x145928['length']?'\x20Available:\x20'+_0x145928[_0x134816(0x159)](',\x20')+'.':_0x1c37d['IAFuZ'])+'\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)');}return _0x3b16aa;}if(!_0x43807b)return null;if(_0x525c3e){const _0x312599=matchAuthEnvironmentExact(_0x525c3e,_0x43807b);if(_0x312599)return _0x312599;const _0x9695c5=matchAuthEnvironmentByHost(_0x525c3e,_0x43807b);if(_0x9695c5&&_0x1c37d[_0x134816(0x180)](_0x1c37d['ixLPN'],_0x9695c5))return console[_0x134816(0x1fe)]('\x20\x20Auth\x20env\x20\x22'+_0x9695c5['key']+_0x134816(0x201)+_0x525c3e+_0x134816(0x1fd)),_0x9695c5[_0x134816(0x173)];if(_0x9695c5&&_0x1c37d['YIRld']in _0x9695c5)throw new Error('Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20('+_0x9695c5[_0x134816(0x1f4)][_0x134816(0x159)](',\x20')+_0x134816(0x1a5));if(_0x1c37d['rvpSG'](needsTunnel,_0x525c3e))throw new Error(_0x1c37d[_0x134816(0x1c4)](_0x1c37d['kDKSh'](_0x1c37d[_0x134816(0x1f9)](_0x134816(0x1b9)+_0x525c3e+_0x134816(0x18e),_0x134816(0x143)),_0x134816(0x1e6))+_0x134816(0x18c)+('\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22'+_0x525c3e['replace'](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a'),'\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20'+_0x525c3e+_0x134816(0x16d)));}if(_0x43807b[_0x134816(0x14a)])return _0x43807b[_0x134816(0x14a)];const _0x2b1c5d=Object[_0x134816(0x190)](_0x43807b[_0x134816(0x1e9)]??{});if(_0x1c37d[_0x134816(0x1dd)](_0x2b1c5d[_0x134816(0x1d0)],0x1))return _0x2b1c5d[0x0];if(_0x2b1c5d[_0x134816(0x1d0)]===0x0)return null;throw new Error('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x2b1c5d[_0x134816(0x159)](',\x20')+').\x20'+_0x134816(0x1d5));}export function adHocProfileName(_0x40ee52,_0x212c16,_0xb400f0){const _0x38c8b9=_0x2bae3a,_0x207416={'RWGGR':function(_0x46e8bc,_0x3b6781){return _0x46e8bc===_0x3b6781;}};if(!_0x212c16||_0x207416[_0x38c8b9(0x1ef)](_0x212c16,_0xb400f0))return _0x40ee52;return _0x40ee52+':'+_0x212c16;}export async function resolveAdHocProfile(_0x4dc94c={},_0x25300c=process[_0x2bae3a(0x1f1)]){const _0x2b9bc0=_0x2bae3a,_0x18894f={'DWIAe':function(_0x5b1824){return _0x5b1824();},'fKZzk':function(_0x1d02e3,_0x434bcb){return _0x1d02e3(_0x434bcb);},'LhtAg':function(_0x49c660,_0x46953c){return _0x49c660&&_0x46953c;},'cUUlh':'none','xRYjC':function(_0x3a1c08,_0x24af4b){return _0x3a1c08??_0x24af4b;}},_0x2f0c5c=_0x25300c['RANGER_TEST_USERNAME'];if(!_0x2f0c5c)return null;const _0x35fa27=await _0x18894f[_0x2b9bc0(0x14b)](fetchAuthConfig),_0x23f966=pickAdHocEnvKey(_0x35fa27,_0x4dc94c[_0x2b9bc0(0x16f)],_0x4dc94c['envKey']);let _0x44ce02=adHocProfileName(_0x2f0c5c,_0x23f966,_0x35fa27?.['defaultEnvironmentKey']),_0x35414c=await _0x18894f['fKZzk'](fetchCloudProfile,_0x44ce02);_0x18894f[_0x2b9bc0(0x176)](_0x35414c,_0x23f966)&&_0x35414c['environmentKey']!==_0x23f966&&(console[_0x2b9bc0(0x1fe)]('\x20\x20Cloud\x20profile\x20\x22'+_0x44ce02+'\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22'+(_0x35414c[_0x2b9bc0(0x1ba)]??_0x18894f['cUUlh'])+_0x2b9bc0(0x1ee)+_0x23f966+'\x22;\x20using\x20\x22'+_0x2f0c5c+':'+_0x23f966+'\x22\x20instead.'),_0x44ce02=_0x2f0c5c+':'+_0x23f966,_0x35414c=await fetchCloudProfile(_0x44ce02));if(_0x35414c)return{'name':_0x35414c[_0x2b9bc0(0x183)],'profile':_0x35414c};const _0x5175f4=_0x25300c[_0x2b9bc0(0x15f)],_0x4b7dcd=await createCloudProfile(_0x44ce02,_0x18894f[_0x2b9bc0(0x1ab)](_0x23f966,undefined),{'username':_0x2f0c5c,'password':_0x5175f4});return console[_0x2b9bc0(0x1fe)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x4b7dcd['name']+_0x2b9bc0(0x1b3)+_0x2f0c5c+(_0x23f966?'\x20(auth\x20env:\x20'+_0x23f966+')':'')),{'name':_0x4b7dcd['name'],'profile':_0x4b7dcd};}export async function writeSessionToLocalCache(_0x1ecba9,_0x18c096,_0x206f03,_0x27fe32,_0x3cc13a,_0x2b513d,_0x2c322a){const _0x3f33ea=_0x2bae3a,_0x3baa73={'SEdvC':function(_0x33893d,_0x22ed40,_0x225989){return _0x33893d(_0x22ed40,_0x225989);},'lKKms':_0x3f33ea(0x169),'qHRrM':function(_0x49eaba,_0x8e1a1b){return _0x49eaba(_0x8e1a1b);},'uFWsi':function(_0x5e5fad,_0x24b49d,_0xbe0053){return _0x5e5fad(_0x24b49d,_0xbe0053);},'qWxAN':function(_0x20ebea,_0x2efbbc,_0x24e622){return _0x20ebea(_0x2efbbc,_0x24e622);},'HSVyu':function(_0x492847,_0x19dfc7){return _0x492847(_0x19dfc7);}},_0x3565b1=sessionCacheHash({'orgId':_0x18c096,'profileName':_0x1ecba9,'effectiveBaseUrl':_0x206f03,'setupHeaders':_0x27fe32,'invalidateOn':_0x2c322a?.[_0x3f33ea(0x1e3)],'userAgent':_0x2c322a?.['userAgent'],'clientIp':_0x2c322a?.[_0x3f33ea(0x1c8)]}),_0x5d2ede=getSessionCachePath(_0x3565b1,_0x1ecba9),_0x11a808=_0x3baa73['SEdvC'](join,getRangerHomeDir(),_0x3baa73[_0x3f33ea(0x191)]);!_0x3baa73['qHRrM'](existsSync,_0x11a808)&&await _0x3baa73[_0x3f33ea(0x192)](mkdir,_0x11a808,{'recursive':!![]});const _0x499c81={..._0x3cc13a};_0x2b513d&&_0x2b513d['length']>0x0&&Array['isArray'](_0x499c81[_0x3f33ea(0x1da)])&&(_0x499c81['cookies']=duplicateCookiesForDomains(_0x499c81['cookies'],_0x2b513d));const _0xd4a5b3={'cached_at':new Date()['toISOString'](),'session_state':_0x499c81};await _0x3baa73['qWxAN'](writeFile,_0x5d2ede,JSON['stringify'](_0xd4a5b3,null,0x2));const _0x41bc72=_0x3baa73['HSVyu'](getStorageStatePath,_0x5d2ede);return await writeFile(_0x41bc72,JSON['stringify'](_0x499c81,null,0x2)),_0x41bc72;}export async function checkLocalCache(_0x30b101,_0x587f30,_0x5c5270,_0x2c0d04,_0x22c79d){const _0x2f7128=_0x2bae3a,_0x49f32e={'lzMjM':function(_0x45d469,_0x305f97){return _0x45d469(_0x305f97);},'uVNNy':function(_0xcb257b,_0x391cd6,_0x69beea){return _0xcb257b(_0x391cd6,_0x69beea);},'aVMzA':function(_0x7bfb6e,_0x41ded9){return _0x7bfb6e(_0x41ded9);},'kSGoH':function(_0x58721f,_0x3851e2){return _0x58721f(_0x3851e2);},'ezupd':function(_0x196ff8,_0x3f1dce,_0x6f71bb){return _0x196ff8(_0x3f1dce,_0x6f71bb);},'iqena':'utf-8'},_0x287385=_0x49f32e[_0x2f7128(0x148)](sessionCacheHash,{'orgId':_0x587f30,'profileName':_0x30b101,'effectiveBaseUrl':_0x5c5270,'setupHeaders':_0x2c0d04,'invalidateOn':_0x22c79d?.['invalidateOn'],'userAgent':_0x22c79d?.[_0x2f7128(0x1c2)],'clientIp':_0x22c79d?.[_0x2f7128(0x1c8)]}),_0x148f7a=_0x49f32e['uVNNy'](getSessionCachePath,_0x287385,_0x30b101),_0x99fcf7=_0x49f32e[_0x2f7128(0x1d6)](getStorageStatePath,_0x148f7a);if(!_0x49f32e[_0x2f7128(0x1d2)](existsSync,_0x148f7a)||!existsSync(_0x99fcf7))return null;try{const _0x331668=await _0x49f32e['ezupd'](readFile,_0x148f7a,_0x49f32e[_0x2f7128(0x14d)]);return JSON[_0x2f7128(0x17e)](_0x331668),{'storageStatePath':_0x99fcf7};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x1ed773,_0x51e2dd){const _0x53a1d2=_0x2bae3a,_0x29ba72={'rpJBl':function(_0xb16418,_0x41d3ee){return _0xb16418+_0x41d3ee;}};if(!_0x51e2dd||!_0x51e2dd['domains']?.['length'])return;let _0x34e31b;try{_0x34e31b=new URL(_0x1ed773);}catch{return;}const _0xc3246e=[];for(const _0x529867 of _0x51e2dd[_0x53a1d2(0x206)]){try{_0xc3246e['push']({'raw':_0x529867,'url':new URL(_0x529867)});}catch{}}if(_0xc3246e['length']===0x0)return;if(_0xc3246e[_0x53a1d2(0x1d8)](_0x52ab83=>_0x52ab83[_0x53a1d2(0x187)][_0x53a1d2(0x17d)]===_0x34e31b[_0x53a1d2(0x17d)]))return;const _0x21664a=_0xc3246e['map'](_0x238aaf=>'\x22'+_0x238aaf['raw']+'\x22')['join'](',\x20');console[_0x53a1d2(0x1fe)](_0x29ba72[_0x53a1d2(0x19a)]('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x21664a+';\x20',_0x53a1d2(0x1cc)+_0x1ed773+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20')+_0x53a1d2(0x145));}export async function serverSideLogin(_0x56b84e,_0x3208e3){const _0x4d476a=_0x2bae3a,_0x26622d={'xTwoD':function(_0x42572a,_0x314b6c){return _0x42572a(_0x314b6c);},'stuxo':'POST','DVJae':function(_0x280d8d,_0x563b85){return _0x280d8d instanceof _0x563b85;},'hqTJi':function(_0x105180,_0x42c503){return _0x105180===_0x42c503;},'szyTS':_0x4d476a(0x147)},_0xcb445d=process['env'][_0x4d476a(0x189)],_0x396ef6=process[_0x4d476a(0x1f1)]['RANGER_TEST_PASSWORD'],_0xf32314={};if(_0xcb445d)_0xf32314['username']=_0xcb445d;if(_0x396ef6)_0xf32314[_0x4d476a(0x1ac)]=_0x396ef6;if(_0x3208e3?.['force'])_0xf32314['force']=!![];if(_0x3208e3?.['targetUrl'])_0xf32314['target_url']=_0x3208e3['targetUrl'];if(_0x3208e3?.[_0x4d476a(0x1f1)])_0xf32314['env']=_0x3208e3['env'];_0x3208e3?.['tunnel']&&(_0xf32314[_0x4d476a(0x1c6)]=_0x3208e3[_0x4d476a(0x188)]['sessionId'],_0xf32314[_0x4d476a(0x1b1)]=_0x3208e3['tunnel'][_0x4d476a(0x18a)]);try{return await apiRequest('/api/v1/profiles/'+_0x26622d[_0x4d476a(0x1fc)](encodeURIComponent,_0x56b84e)+'/login',{'method':_0x26622d['stuxo'],'body':JSON[_0x4d476a(0x14f)](_0xf32314)});}catch(_0x2c6800){if(_0x26622d['DVJae'](_0x2c6800,ApiError)&&_0x26622d[_0x4d476a(0x168)](_0x2c6800['status'],0x190)&&_0x2c6800['code']===_0x26622d['szyTS'])return{'status':_0x26622d[_0x4d476a(0x15d)],'error':_0x2c6800[_0x4d476a(0x17c)]};throw _0x2c6800;}}async function serverSideLoginWithOptionalTunnel(_0x2f81fb,_0x5c38f3,_0x43d799={}){const _0x3c88b3=_0x2bae3a,_0x170f9a={'RBzFX':_0x3c88b3(0x164),'XUqvD':function(_0x4fdb79,_0x1250a0){return _0x4fdb79(_0x1250a0);},'HBHfw':function(_0x345d9b,_0x4f05e1){return _0x345d9b(_0x4f05e1);},'RBkch':function(_0x56ff63,_0x3897af){return _0x56ff63(_0x3897af);},'Mknwo':function(_0x51d9d1,_0x449175){return _0x51d9d1===_0x449175;},'FMvjt':function(_0x1c2afa,_0x2c0991){return _0x1c2afa(_0x2c0991);},'UbWYG':function(_0x312744,_0xc7ce12){return _0x312744(_0xc7ce12);},'ugPqO':function(_0x52cf04,_0x198998){return _0x52cf04??_0x198998;},'sMqxp':function(_0x364fe9,_0x26ae5c){return _0x364fe9||_0x26ae5c;}};if(!_0x170f9a['RBkch'](needsTunnel,_0x5c38f3))return await serverSideLogin(_0x2f81fb,{'force':_0x43d799[_0x3c88b3(0x156)],'env':_0x43d799['env']});let _0x4eae84=null,_0x215ee3=null,_0x4b76c5=null,_0xf5a4bf=null,_0x18e125=![];const _0x223b28=process[_0x3c88b3(0x1f1)][_0x3c88b3(0x1f6)]?.['toLowerCase'](),_0x2c6fb2=_0x223b28==='1'||_0x170f9a[_0x3c88b3(0x1cb)](_0x223b28,'true'),_0x3b68c6={'profileName':_0x2f81fb,'targetUrlHost':_0x170f9a['FMvjt'](targetHostForTelemetry,_0x5c38f3),'tunnelRequired':!![],'forceLogin':_0x170f9a['UbWYG'](Boolean,_0x43d799['force']),'localBrowserServerHeaded':_0x2c6fb2};try{_0x43d799['telemetry']?.['trackPhaseStart']('tunnel_login_setup',_0x3b68c6);_0x2c6fb2&&console['log']('\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...');_0x4eae84=await launchBrowserServer({'headless':!_0x2c6fb2}),_0x215ee3=await _0x170f9a[_0x3c88b3(0x1c9)](createTunnelSession,_0x5c38f3);const _0x4bfb68=await requireToken();_0x4b76c5=await createTunnelBridge({'localWsUrl':_0x4eae84['wsEndpoint'],'tunnelServerUrl':_0x215ee3[_0x3c88b3(0x184)],'sessionId':_0x215ee3[_0x3c88b3(0x1a9)],'apiKey':_0x4bfb68,'onError':_0x35d8e2=>{_0xf5a4bf=_0x35d8e2;},'onClose':()=>{const _0x436c8e=_0x3c88b3;_0xf5a4bf??=new Error(_0x436c8e(0x1ad)+_0x2f81fb);},'onEvent':_0x57a9dc=>trackBridgeEvent(_0x43d799[_0x3c88b3(0x204)],_0x57a9dc)}),_0x43d799['telemetry']?.[_0x3c88b3(0x1ec)]('tunnel_login_setup',{..._0x3b68c6,'tunnelSessionId':_0x215ee3[_0x3c88b3(0x1a9)],'localBrowserServer':!![],'localBrowserServerHeaded':_0x2c6fb2}),_0x18e125=!![];try{return _0x43d799['telemetry']?.['trackPhaseStart'](_0x170f9a['RBzFX'],{..._0x3b68c6,'tunnelSessionId':_0x215ee3[_0x3c88b3(0x1a9)]}),await serverSideLogin(_0x2f81fb,{'force':_0x43d799['force'],'targetUrl':_0x5c38f3,'env':_0x43d799[_0x3c88b3(0x1f1)],'tunnel':{'sessionId':_0x215ee3['sessionId'],'pwEndpoint':_0x215ee3[_0x3c88b3(0x18a)]}})['then'](_0x5ab59b=>{const _0x188f88=_0x3c88b3;return _0x43d799[_0x188f88(0x204)]?.['trackPhaseEnd'](_0x170f9a['RBzFX'],{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.[_0x188f88(0x1a9)],'loginStatus':_0x5ab59b['status'],'hasSessionState':Boolean(_0x5ab59b[_0x188f88(0x18d)]),'hasTestOutput':_0x170f9a['XUqvD'](Boolean,_0x5ab59b[_0x188f88(0x15e)]),'bridgeError':_0x170f9a[_0x188f88(0x1c9)](errorMessageForTelemetry,_0xf5a4bf)}),_0x5ab59b;});}catch(_0xa00ef3){await _0x43d799['telemetry']?.[_0x3c88b3(0x1e1)](_0x3c88b3(0x164),_0xf5a4bf??_0xa00ef3,{..._0x3b68c6,'tunnelSessionId':_0x215ee3[_0x3c88b3(0x1a9)],'bridgeError':errorMessageForTelemetry(_0xf5a4bf)});throw _0x170f9a[_0x3c88b3(0x1ea)](_0xf5a4bf,_0xa00ef3);}}catch(_0x25053d){!_0x18e125&&await _0x43d799[_0x3c88b3(0x204)]?.[_0x3c88b3(0x1e1)](_0x3c88b3(0x198),_0x25053d,{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.[_0x3c88b3(0x1a9)]});throw _0x25053d;}finally{(_0x170f9a[_0x3c88b3(0x144)](_0x215ee3,_0x4eae84)||_0x4b76c5)&&(_0x43d799[_0x3c88b3(0x204)]?.[_0x3c88b3(0x161)](_0x3c88b3(0x197),{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.['sessionId']}),_0x4b76c5?.['close'](),_0x4eae84&&await _0x4eae84[_0x3c88b3(0x175)]()[_0x3c88b3(0x1e7)](()=>{}),_0x215ee3&&await deleteTunnelSession(_0x215ee3['sessionId'])[_0x3c88b3(0x1e7)](()=>{}),_0x43d799['telemetry']?.[_0x3c88b3(0x1ec)](_0x3c88b3(0x197),{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.[_0x3c88b3(0x1a9)]}));}}export async function manualBrowserLogin(_0x5a82ca,_0x4169ef,_0xaa7d84={}){const _0x4df16=_0x2bae3a,_0x1ca7ae={'NwQXb':function(_0x4a1ed7,_0x118c23,_0x41859b){return _0x4a1ed7(_0x118c23,_0x41859b);},'vOjhL':_0x4df16(0x175),'jngPP':function(_0x2bb0f7){return _0x2bb0f7();},'WOVpH':function(_0x3e82cf,_0x265671){return _0x3e82cf+_0x265671;},'BkFaR':function(_0xa681a7,_0x2e7d93){return _0xa681a7+_0x2e7d93;},'cczrt':_0x4df16(0x1b0),'VczwK':_0x4df16(0x1f8),'GeDDs':function(_0x17f636,_0x2460d8){return _0x17f636(_0x2460d8);},'Tyqts':function(_0x3638fe,_0x1eff05){return _0x3638fe&&_0x1eff05;},'hMctJ':'Browser\x20login\x20timed\x20out\x20before\x20completion.','CyzKd':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','pwgux':function(_0x2f8540,_0x8b81ec){return _0x2f8540!==_0x8b81ec;},'NPJjw':'POST'};if(!_0x1ca7ae[_0x4df16(0x1eb)](isInteractive))throw new Error(_0x1ca7ae[_0x4df16(0x150)](_0x1ca7ae['BkFaR'](_0x4df16(0x158)+_0x5a82ca['name']+'\x22.\x0a','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20'),_0x4df16(0x1d9)));const _0x4fca90=_0x4169ef&&_0x4169ef[_0x4df16(0x206)]['length']>0x0?_0x4169ef[_0x4df16(0x206)][0x0]:_0x1ca7ae['cczrt'];console['log'](_0x1ca7ae['VczwK']),console[_0x4df16(0x1fe)](_0x4df16(0x1e4)),await new Promise(_0x441e18=>setTimeout(_0x441e18,0x7d0));const _0x48bdef=await chromium[_0x4df16(0x194)]({'headless':![]});let _0x15b53f=null;try{const _0x3dc2ac={'ignoreHTTPSErrors':!![]};_0x4169ef?.['setupHeaders']&&(_0x3dc2ac['extraHTTPHeaders']=_0x4169ef[_0x4df16(0x1ae)]);const _0xe8c999=await _0x48bdef['newContext'](_0x3dc2ac);await _0x1ca7ae['GeDDs'](addProfileSetupBanner,_0xe8c999);const _0x424cae=await _0xe8c999[_0x4df16(0x149)]();await _0x424cae['goto'](_0x4fca90);let _0x3f5173=![];await new Promise(_0x33c620=>{const _0x53d505=_0x4df16,_0x5c65cf={'verZF':function(_0x2151c0,_0x2a9185){return _0x2151c0/_0x2a9185;}},_0x271c27=_0x1ca7ae[_0x53d505(0x1c1)](setTimeout,()=>{const _0x1d3395=_0x53d505;_0x3f5173=!![],console['error'](_0x1d3395(0x1e5)+_0x5c65cf['verZF'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x33c620();},MANUAL_LOGIN_TIMEOUT_MS);_0x424cae['on'](_0x1ca7ae['vOjhL'],async()=>{clearTimeout(_0x271c27);try{const _0x26826f=await _0xe8c999['storageState']();_0x15b53f=_0x26826f;}catch{}_0x33c620();});});if(_0x1ca7ae[_0x4df16(0x1cf)](_0x3f5173,!_0x15b53f))throw new Error(_0x1ca7ae['hMctJ']);}finally{await _0x48bdef[_0x4df16(0x175)]()[_0x4df16(0x1e7)](()=>{});}if(!_0x15b53f)throw new Error(_0x1ca7ae['CyzKd']);return _0x1ca7ae[_0x4df16(0x1e8)](_0xaa7d84[_0x4df16(0x153)],![])&&await _0x1ca7ae['NwQXb'](apiRequest,_0x4df16(0x151)+encodeURIComponent(_0x5a82ca[_0x4df16(0x183)])+'/session',{'method':_0x1ca7ae['NPJjw'],'body':JSON[_0x4df16(0x14f)]({'session_state':_0x15b53f,'updated_by':_0x4df16(0x19b)})}),{'sessionState':_0x15b53f};}export async function promptSaveCredentials(_0x10f4bf){const _0x5a7854=_0x2bae3a,_0x2a5e90={'zFNfI':function(_0x48a923,_0x1442d0){return _0x48a923||_0x1442d0;},'haXfY':_0x5a7854(0x1c3),'vPKuR':_0x5a7854(0x178),'GJMaU':function(_0x538824,_0x2d9158,_0xdf589){return _0x538824(_0x2d9158,_0xdf589);},'Yuovk':_0x5a7854(0x1b6)},_0x212c43=process[_0x5a7854(0x1f1)]['RANGER_TEST_USERNAME'],_0x4443db=process[_0x5a7854(0x1f1)][_0x5a7854(0x15f)];if(_0x2a5e90['zFNfI'](!_0x212c43,!_0x4443db))return;if(!isInteractive())return;const {save:_0x54552b}=await _0x4e34ea['prompt']([{'type':_0x2a5e90['haXfY'],'name':'save','message':_0x2a5e90['vPKuR'],'default':![]}]);if(!_0x54552b)return;await _0x2a5e90[_0x5a7854(0x185)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x10f4bf),{'method':_0x2a5e90['Yuovk'],'body':JSON['stringify']({'username':_0x212c43,'password':_0x4443db})}),console['log'](_0x5a7854(0x18b));}export async function resolveCloudProfileSession(_0x4b2f89,_0x3b47d4={}){const _0x231d5e=_0x2bae3a,_0x547a37={'SYFlL':function(_0x158f82){return _0x158f82();},'TjuLX':function(_0x1f8bc9,_0x25f7ea,_0xd5506d){return _0x1f8bc9(_0x25f7ea,_0xd5506d);},'HfnJY':_0x231d5e(0x1d4),'wDSbL':function(_0x5dc49e,_0x3a52cf){return _0x5dc49e||_0x3a52cf;},'absWR':function(_0x4b5458,_0x3222ae){return _0x4b5458(_0x3222ae);},'tuCMO':function(_0x264fb8,_0x4fd32f){return _0x264fb8>_0x4fd32f;},'WPYsC':function(_0x215b9d,_0x57e022,_0x302c0b,_0x360f63,_0x2f2235,_0x28d632){return _0x215b9d(_0x57e022,_0x302c0b,_0x360f63,_0x2f2235,_0x28d632);},'wcyNn':function(_0x1b04aa,_0x26290d,_0x30a334,_0x7bc9ad,_0x4535cc){return _0x1b04aa(_0x26290d,_0x30a334,_0x7bc9ad,_0x4535cc);},'pDAjr':function(_0x23e2ef,_0x5b688a,_0x440232){return _0x23e2ef(_0x5b688a,_0x440232);},'RtsRm':function(_0x48279b,_0x1ebdd4){return _0x48279b(_0x1ebdd4);},'yStzg':function(_0x82129b,_0x34f3da){return _0x82129b(_0x34f3da);},'iEHUW':function(_0xa543d8,_0x29c4a0,_0xca9e13){return _0xa543d8(_0x29c4a0,_0xca9e13);},'FUejt':_0x231d5e(0x147),'mBwqj':'success','GSnPA':'\x20\x20Login\x20successful.\x20Session\x20cached.','JGbrf':function(_0x24386f,_0x512046,_0x5944c4,_0x388031,_0x2a45bc,_0x441a0c,_0x58562c,_0x3753f8){return _0x24386f(_0x512046,_0x5944c4,_0x388031,_0x2a45bc,_0x441a0c,_0x58562c,_0x3753f8);},'boZrj':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','qIISM':function(_0x253870,_0x4c4b74){return _0x253870 instanceof _0x4c4b74;},'VZGUe':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','vRdoP':function(_0x518131,_0x5f0715){return _0x518131&&_0x5f0715;},'nrZKw':function(_0x6f8afc){return _0x6f8afc();},'whPuH':function(_0x173a6f,_0x257979){return _0x173a6f+_0x257979;},'UtPUq':_0x231d5e(0x179),'FFThf':function(_0x4f8613,_0x8317e1,_0x489d0e){return _0x4f8613(_0x8317e1,_0x489d0e);},'oSUmi':function(_0x1449a3,_0x14f504,_0x42e0fc,_0x3dd579,_0x42467d,_0x522a74,_0x1a7774,_0x12f4bf){return _0x1449a3(_0x14f504,_0x42e0fc,_0x3dd579,_0x42467d,_0x522a74,_0x1a7774,_0x12f4bf);}},_0x4adb67=_0x4b2f89[_0x231d5e(0x1c5)]??{},_0xadf20a=await _0x547a37['SYFlL'](fetchAuthConfig),_0x22d822=_0xadf20a?_0x547a37[_0x231d5e(0x160)](resolveAuthEnvironmentLocally,_0xadf20a,_0x3b47d4[_0x231d5e(0x1df)]??_0x4b2f89[_0x231d5e(0x1ba)]):null,_0x3ba38e=typeof _0x22d822?.['loginInstructions']===_0x547a37['HfnJY']&&_0x22d822[_0x231d5e(0x1be)]['trim']()?_0x22d822['loginInstructions']:undefined,_0x1b6358=typeof _0x4adb67[_0x231d5e(0x1be)]===_0x547a37[_0x231d5e(0x18f)]&&_0x4adb67[_0x231d5e(0x1be)]['trim']()?_0x4adb67[_0x231d5e(0x1be)]:undefined,_0x4c8770=_0x547a37[_0x231d5e(0x1f3)](_0x1b6358,!_0x3ba38e)?_0x4adb67:{..._0x4adb67,'loginInstructions':_0x3ba38e},_0xafd180=_0x547a37[_0x231d5e(0x1aa)](Boolean,_0x4c8770['loginInstructions']?.['trim']()),_0x6f3775=Boolean(_0x4adb67[_0x231d5e(0x195)]||_0x22d822?.[_0x231d5e(0x195)]),_0x3c8e1a=_0x22d822?.[_0x231d5e(0x206)],_0x5960fa=_0x4adb67['setupHeaders'],_0x513d15=_0x5960fa??_0x22d822?.[_0x231d5e(0x1ae)],_0x462bc3=_0x3b47d4[_0x231d5e(0x1bd)]??_0x4adb67['baseUrl']??(_0x3c8e1a&&_0x547a37[_0x231d5e(0x1b5)](_0x3c8e1a['length'],0x0)?_0x3c8e1a[0x0]:''),_0x2e4451=_0x462bc3?needsTunnel(_0x462bc3):![],_0x405eec={'invalidateOn':_0x22d822?.['invalidateOn'],'userAgent':_0x22d822?.[_0x231d5e(0x15b)]?.[_0x231d5e(0x1c2)]??_0x4adb67['userAgent']};_0x6f3775&&console['log'](_0x231d5e(0x17f)+_0x4b2f89['name']+_0x231d5e(0x16a));if(!_0x6f3775){const _0x2d21ec=await _0x547a37[_0x231d5e(0x177)](checkLocalCache,_0x4b2f89['name'],_0x4b2f89['organizationId'],_0x462bc3,_0x513d15,_0x405eec);if(_0x2d21ec){if(_0x462bc3&&!_0x2e4451){const _0x114055=await isCachedSessionLive(_0x2d21ec['storageStatePath'],_0x462bc3,{'sessionCheckPath':_0x22d822?.[_0x231d5e(0x182)],'setupHeaders':_0x513d15},{'launchBrowser':launchRealBrowser});if(_0x114055)return console['log'](_0x231d5e(0x19e)+_0x4b2f89['name']+'\x22'),{'authPath':_0x2d21ec[_0x231d5e(0x186)],'settings':_0x4c8770,'resolvedEnv':_0x22d822};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x4b2f89[_0x231d5e(0x183)]+_0x231d5e(0x1b2)),_0x547a37['TjuLX'](emitSessionValidationHint,_0x462bc3,_0x22d822);}else return _0x2e4451&&console[_0x231d5e(0x1fe)](_0x231d5e(0x14c)+_0x4b2f89[_0x231d5e(0x183)]+'\x22'),{'authPath':_0x2d21ec[_0x231d5e(0x186)],'settings':_0x4c8770,'resolvedEnv':_0x22d822};}}if(!_0x6f3775&&_0x4b2f89[_0x231d5e(0x166)]){const _0x37aad9=await writeSessionToLocalCache(_0x4b2f89['name'],_0x4b2f89[_0x231d5e(0x157)],_0x462bc3,_0x513d15,_0x4b2f89['sessionState'],_0x3c8e1a,_0x405eec);if(_0x462bc3){const _0x34f2d0=await _0x547a37[_0x231d5e(0x1dc)](isCachedSessionLive,_0x37aad9,_0x462bc3,{'sessionCheckPath':_0x22d822?.[_0x231d5e(0x182)],'setupHeaders':_0x513d15},{'launchBrowser':launchRealBrowser});if(_0x34f2d0)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x4b2f89['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x37aad9,'settings':_0x4c8770,'resolvedEnv':_0x22d822};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x4b2f89['name']+_0x231d5e(0x15a)),_0x547a37['pDAjr'](emitSessionValidationHint,_0x462bc3,_0x22d822);}else return{'authPath':_0x37aad9,'settings':_0x4c8770,'resolvedEnv':_0x22d822};}if(_0xafd180)return console[_0x231d5e(0x1fe)](_0x231d5e(0x207)+_0x4b2f89['name']+'\x22;\x20proceeding\x20with\x20loginInstructions.'),{'authPath':undefined,'settings':_0x4c8770,'resolvedEnv':_0x22d822};console[_0x231d5e(0x1fe)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x4b2f89['name']+_0x231d5e(0x1e0));const _0x2088d5=_0x547a37['RtsRm'](Boolean,process['env']['RANGER_TEST_USERNAME'])&&_0x547a37['yStzg'](Boolean,process[_0x231d5e(0x1f1)][_0x231d5e(0x15f)]),_0x3ecc2d=Boolean(_0x4b2f89['username']),_0x54b0b4=Boolean(_0x3b47d4['assertedEnv']),_0x1a6cad=_0x462bc3?_0x547a37[_0x231d5e(0x1a0)](isBareLocalhost,_0x462bc3):![],_0x491d6b=(_0x2088d5||_0x3ecc2d)&&_0x547a37[_0x231d5e(0x1f3)](!_0x1a6cad,_0x54b0b4);if(_0x491d6b)try{const _0x2b9e5e=_0x462bc3?await serverSideLoginWithOptionalTunnel(_0x4b2f89[_0x231d5e(0x183)],_0x462bc3,{'force':_0x6f3775,'telemetry':_0x3b47d4['telemetry'],'env':_0x3b47d4['assertedEnv']}):await _0x547a37[_0x231d5e(0x16e)](serverSideLogin,_0x4b2f89[_0x231d5e(0x183)],{'force':_0x6f3775,'env':_0x3b47d4[_0x231d5e(0x1df)]});if(_0x2b9e5e['status']===_0x547a37[_0x231d5e(0x1e2)])console[_0x231d5e(0x1fe)](_0x231d5e(0x181));else{if(_0x2b9e5e[_0x231d5e(0x19f)]===_0x547a37['mBwqj']&&_0x2b9e5e[_0x231d5e(0x18d)]){console['log'](_0x547a37['GSnPA']);const _0x3d2da1=await _0x547a37['JGbrf'](writeSessionToLocalCache,_0x4b2f89['name'],_0x4b2f89[_0x231d5e(0x157)],_0x462bc3,_0x513d15,_0x2b9e5e['session_state'],_0x3c8e1a,_0x405eec);return _0x2088d5&&!_0x3ecc2d&&await promptSaveCredentials(_0x4b2f89[_0x231d5e(0x183)]),{'authPath':_0x3d2da1,'settings':_0x4c8770,'resolvedEnv':_0x22d822};}else _0x2b9e5e[_0x231d5e(0x15e)]&&(console[_0x231d5e(0x1fe)](_0x547a37['boZrj']),console[_0x231d5e(0x1fe)](_0x2b9e5e['test_output'])),console['log'](_0x231d5e(0x1cd));}}catch(_0xdacff3){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x547a37[_0x231d5e(0x203)](_0xdacff3,Error)?_0xdacff3[_0x231d5e(0x154)]:_0x547a37['absWR'](String,_0xdacff3))),console['log'](_0x547a37['VZGUe']);}if(_0x547a37['vRdoP'](_0x1a6cad,!_0x54b0b4)&&!_0x547a37['nrZKw'](isInteractive))throw new Error(_0x547a37[_0x231d5e(0x171)](_0x231d5e(0x193)+_0x462bc3+_0x231d5e(0x1a4)+_0x4b2f89['name']+_0x231d5e(0x1bb)+('\x20\x20•\x20capture\x20one\x20(a\x20browser\x20opens):\x20ranger\x20profile\x20add\x20'+_0x4b2f89[_0x231d5e(0x183)]+'\x20--url\x20'+_0x462bc3+'\x0a'),_0x547a37['UtPUq']));const _0x41a86d=_0x22d822?{..._0x22d822,'domains':_0x547a37[_0x231d5e(0x1b8)](orderLoginDomains,_0x462bc3,_0x22d822['domains']),'setupHeaders':_0x513d15}:_0x462bc3?{'key':_0x4b2f89['environmentKey']??'','domains':[_0x462bc3],'setupHeaders':_0x513d15}:null,{sessionState:_0x38021d}=await manualBrowserLogin(_0x4b2f89,_0x41a86d,{'persistSessionState':!_0x2e4451}),_0x1c7272=await _0x547a37[_0x231d5e(0x1d7)](writeSessionToLocalCache,_0x4b2f89['name'],_0x4b2f89['organizationId'],_0x462bc3,_0x513d15,_0x38021d,_0x3c8e1a,_0x405eec);return{'authPath':_0x1c7272,'settings':_0x4c8770,'resolvedEnv':_0x22d822};}
@@ -1 +1 @@
1
- const _0x1ac871=_0x1c21;(function(_0x1b799b,_0x2f6592){const _0x9a9ad6=_0x1c21,_0xf3f4b4=_0x1b799b();while(!![]){try{const _0x3fdfe9=parseInt(_0x9a9ad6(0x1ab))/0x1*(parseInt(_0x9a9ad6(0x1bc))/0x2)+parseInt(_0x9a9ad6(0x1a8))/0x3+-parseInt(_0x9a9ad6(0x1af))/0x4*(parseInt(_0x9a9ad6(0x1bf))/0x5)+parseInt(_0x9a9ad6(0x1d1))/0x6*(-parseInt(_0x9a9ad6(0x1b9))/0x7)+parseInt(_0x9a9ad6(0x1cb))/0x8*(-parseInt(_0x9a9ad6(0x1c0))/0x9)+-parseInt(_0x9a9ad6(0x1a5))/0xa*(parseInt(_0x9a9ad6(0x1a9))/0xb)+parseInt(_0x9a9ad6(0x1ba))/0xc*(parseInt(_0x9a9ad6(0x1d2))/0xd);if(_0x3fdfe9===_0x2f6592)break;else _0xf3f4b4['push'](_0xf3f4b4['shift']());}catch(_0x4d2e36){_0xf3f4b4['push'](_0xf3f4b4['shift']());}}}(_0x4968,0xa1e52));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x5f5c0a=process[_0x1ac871(0x1c8)],_0x279a4a={'stdin':process[_0x1ac871(0x1be)],'stdout':process['stdout']}){const _0x2b3588=_0x1ac871,_0x3224b4={'XeDuy':function(_0x53ebe5,_0x5f5402){return _0x53ebe5(_0x5f5402);}};if(_0x5f5c0a['CI'])return![];return Boolean(_0x279a4a[_0x2b3588(0x1be)]['isTTY'])&&_0x3224b4['XeDuy'](Boolean,_0x279a4a['stdout'][_0x2b3588(0x1aa)]);}function _0x4968(){const _0x3339cb=['10048049wcTNnt','isTTY','68KWJXaE','toString','rsQVB','update','4OYkzxa','newPage','replace','.storageState.json','add','defaultEnvironmentKey','close','hostname','auth','includes','253764HeHjBu','140496WhtSyO','goto','21292aqkAEi','JJFTP','stdin','5589055PnXkkp','9TFBqiS','pathname','baseUrl','push','environments','clientIp','endsWith','sha256','env','map','qDGGo','4129176VNTyUc','userAgent','port','effectiveBaseUrl','has','sort','114emwutH','3198hGlFiA','length','test','setupHeaders','10OoTtdH','localhost','puuos','885693YOtTrm'];_0x4968=function(){return _0x3339cb;};return _0x4968();}function _0x1c21(_0x339f04,_0x446f40){_0x339f04=_0x339f04-0x1a5;const _0x4968b3=_0x4968();let _0x1c21cb=_0x4968b3[_0x339f04];return _0x1c21cb;}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x307abe){const _0x44b460=_0x1ac871,_0x265618={'ORelv':_0x44b460(0x1c2),'hNqZv':function(_0x5bc834,_0x4d24ca){return _0x5bc834(_0x4d24ca);},'kSmDP':'userAgent','qDGGo':function(_0x4d9c8b,_0x2d00c5){return _0x4d9c8b!==_0x2d00c5;}},_0x194d24=new Set(_0x307abe['invalidateOn']??DEFAULT_INVALIDATE_ON);_0x307abe['effectiveBaseUrl']&&needsTunnel(_0x307abe[_0x44b460(0x1ce)])&&_0x194d24[_0x44b460(0x1b3)](_0x265618['ORelv']);const _0x432c49={'orgId':_0x307abe['orgId'],'profileName':_0x307abe['profileName']};return _0x194d24[_0x44b460(0x1cf)](_0x44b460(0x1c2))&&(_0x432c49[_0x44b460(0x1ce)]=_0x307abe['effectiveBaseUrl']),_0x194d24['has']('setupHeaders')&&(_0x432c49[_0x44b460(0x1d5)]=_0x307abe[_0x44b460(0x1d5)]?sortObjectKeys(_0x307abe['setupHeaders']):_0x307abe[_0x44b460(0x1d5)]),_0x194d24[_0x44b460(0x1cf)](_0x44b460(0x1cd))&&(_0x432c49['port']=_0x265618['hNqZv'](extractPort,_0x307abe[_0x44b460(0x1ce)])),_0x194d24['has'](_0x265618['kSmDP'])&&_0x307abe[_0x44b460(0x1cc)]!==undefined&&(_0x432c49[_0x44b460(0x1cc)]=_0x307abe['userAgent']),_0x194d24[_0x44b460(0x1cf)]('clientIp')&&_0x265618[_0x44b460(0x1ca)](_0x307abe[_0x44b460(0x1c5)],undefined)&&(_0x432c49['clientIp']=_0x307abe[_0x44b460(0x1c5)]),createHash(_0x44b460(0x1c7))[_0x44b460(0x1ae)](JSON['stringify'](_0x432c49))['digest']('hex')['slice'](0x0,0xc);}function extractPort(_0x3421bf){try{return new URL(_0x3421bf)['port'];}catch{return'';}}function sortObjectKeys(_0x210faf){const _0x5d92cb=_0x1ac871,_0x308769={};for(const _0x241048 of Object['keys'](_0x210faf)[_0x5d92cb(0x1d0)]()){_0x308769[_0x241048]=_0x210faf[_0x241048];}return _0x308769;}export function getSessionCachePath(_0x263fb0,_0x56ccc6){const _0x1a8568=_0x1ac871,_0x4bf905={'puuos':function(_0x372957){return _0x372957();},'JJFTP':_0x1a8568(0x1b7)};return join(_0x4bf905[_0x1a8568(0x1a7)](getRangerHomeDir),_0x4bf905[_0x1a8568(0x1bd)],_0x263fb0+'-'+_0x56ccc6+'.json');}export function getStorageStatePath(_0x6a092d){const _0x1d27a5=_0x1ac871;return _0x6a092d[_0x1d27a5(0x1b1)](/\.json$/,_0x1d27a5(0x1b2));}export function needsTunnel(_0x58f814){const _0x7516e3=_0x1ac871,_0x455700={'Qkpev':function(_0x4af7f8,_0x2e2588){return _0x4af7f8===_0x2e2588;},'rsQVB':'localhost.'};let _0x27cc45;try{_0x27cc45=new URL(_0x58f814)[_0x7516e3(0x1b6)];}catch{return![];}if(_0x455700['Qkpev'](_0x27cc45,_0x7516e3(0x1a6))||_0x27cc45==='127.0.0.1')return!![];if(_0x27cc45[_0x7516e3(0x1c6)]('.localhost'))return!![];if(_0x27cc45[_0x7516e3(0x1b8)](_0x455700[_0x7516e3(0x1ad)]))return!![];return![];}export function hostnameOf(_0x3becd5){const _0xd5bf82=_0x1ac871;return new URL(_0x3becd5)[_0xd5bf82(0x1b6)];}export function duplicateCookiesForDomains(_0x25103e,_0x58eab9){const _0x254feb=_0x1ac871,_0x4c4f5a=[..._0x25103e],_0x3c5f66=new Set(_0x25103e[_0x254feb(0x1c9)](_0x296858=>_0x296858['domain']));for(const _0x4cc02b of _0x58eab9){let _0x1114be;try{_0x1114be=hostnameOf(_0x4cc02b);}catch{continue;}if(!_0x1114be)continue;const _0x424fa1=_0x1114be['startsWith']('.')?_0x1114be:'.'+_0x1114be;if(_0x3c5f66['has'](_0x1114be)||_0x3c5f66['has'](_0x424fa1))continue;for(const _0x428d99 of _0x25103e){_0x4c4f5a[_0x254feb(0x1c3)]({..._0x428d99,'domain':_0x424fa1});}_0x3c5f66['add'](_0x424fa1);}return _0x4c4f5a;}export function resolveAuthEnvironmentLocally(_0x4d4890,_0x29858d){const _0x5a1c10=_0x1ac871,_0x3f0b6b=_0x4d4890[_0x5a1c10(0x1c4)];if(_0x29858d){const _0x29ffde=_0x3f0b6b[_0x29858d];if(!_0x29ffde)return null;return{'key':_0x29858d,..._0x29ffde};}if(_0x4d4890[_0x5a1c10(0x1b4)]){const _0x20d904=_0x3f0b6b[_0x4d4890[_0x5a1c10(0x1b4)]];if(!_0x20d904)return null;return{'key':_0x4d4890['defaultEnvironmentKey'],..._0x20d904};}const _0x490ab7=Object['keys'](_0x3f0b6b);if(_0x490ab7[_0x5a1c10(0x1d3)]===0x1){const _0x1b4cac=_0x490ab7[0x0];return{'key':_0x1b4cac,..._0x3f0b6b[_0x1b4cac]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0xfcb2f3,_0x2beb93){const _0x485d84=_0x1ac871;try{if(_0x2beb93)return new URL(_0x2beb93,_0xfcb2f3)[_0x485d84(0x1ac)]();return new URL(_0xfcb2f3)[_0x485d84(0x1ac)]();}catch{return null;}}export function looksLikeLoginUrl(_0x466d3f){const _0x136d8c=_0x1ac871;try{const _0x34e58c=new URL(_0x466d3f);return LOGIN_URL_PATTERN[_0x136d8c(0x1d4)](_0x34e58c[_0x136d8c(0x1c1)]);}catch{return LOGIN_URL_PATTERN['test'](_0x466d3f);}}export async function isCachedSessionLive(_0x3f38bb,_0x5ad684,_0x18c814={},_0x3428b2={}){const _0x810d2e=_0x1ac871,_0xef8131={'KvoyX':function(_0x18dfb1,_0x151601,_0x424088){return _0x18dfb1(_0x151601,_0x424088);},'ebhNl':function(_0x4e71b7,_0x1854ff){return _0x4e71b7(_0x1854ff);}},_0x157b1c=_0xef8131['KvoyX'](buildSessionCheckUrl,_0x5ad684,_0x18c814['sessionCheckPath']);if(!_0x157b1c)return!![];if(!_0x3428b2['launchBrowser'])return!![];let _0x24a1a6=null;try{_0x24a1a6=await _0x3428b2['launchBrowser']();const _0x465e4c=await _0x24a1a6['newContext']({'storageState':_0x3f38bb,'ignoreHTTPSErrors':!![],..._0x18c814[_0x810d2e(0x1d5)]?{'extraHTTPHeaders':_0x18c814[_0x810d2e(0x1d5)]}:{}}),_0x6c4214=await _0x465e4c[_0x810d2e(0x1b0)](),_0x396cd8=await _0x6c4214[_0x810d2e(0x1bb)](_0x157b1c,{'waitUntil':'domcontentloaded','timeout':0x3a98}),_0x4bc448=_0x396cd8?.['status']();if(_0x4bc448===0x191||_0x4bc448===0x193)return![];const _0x1bf995=_0x6c4214['url']();if(_0xef8131['ebhNl'](looksLikeLoginUrl,_0x1bf995))return![];return!![];}catch{return![];}finally{if(_0x24a1a6)await _0x24a1a6[_0x810d2e(0x1b5)]()['catch'](()=>{});}}
1
+ const _0x5ce9ca=_0x1d3a;(function(_0x598b85,_0x5743c8){const _0x42f91e=_0x1d3a,_0x192686=_0x598b85();while(!![]){try{const _0x1e2624=parseInt(_0x42f91e(0x1ab))/0x1*(parseInt(_0x42f91e(0x1a1))/0x2)+parseInt(_0x42f91e(0x1b4))/0x3*(-parseInt(_0x42f91e(0x1c9))/0x4)+parseInt(_0x42f91e(0x1d1))/0x5+-parseInt(_0x42f91e(0x1c8))/0x6+-parseInt(_0x42f91e(0x1aa))/0x7*(parseInt(_0x42f91e(0x19c))/0x8)+parseInt(_0x42f91e(0x1b2))/0x9*(parseInt(_0x42f91e(0x1c6))/0xa)+-parseInt(_0x42f91e(0x1b3))/0xb*(-parseInt(_0x42f91e(0x1b5))/0xc);if(_0x1e2624===_0x5743c8)break;else _0x192686['push'](_0x192686['shift']());}catch(_0x3337e3){_0x192686['push'](_0x192686['shift']());}}}(_0x2da4,0x57ad4));import{createHash}from'crypto';import{join}from'path';function _0x2da4(){const _0x142ebf=['hostname','BpCBY','[::1]','has','449474FwYjOp','wxzYR','status','effectiveBaseUrl','zdshA','etdqN','lhyDX','MrvIj','127.0.0.1','35GYIKQN','1SlvIIv','setupHeaders','keys','ktpDh','dLGmL','defaultEnvironmentKey','sort','1323BTaXOa','14887147kHVqIV','85362IzzBek','12lZpZzh','wzPTL','profileName','orgId','goto','digest','stdout','stringify','brzKI','::1','clientIp','userAgent','MMWjI','includes','gcARh','QlxxW','stdin','6650hsYrzg','newPage','4146390LscHYQ','16imCGVL','QbZkR','endsWith','launchBrowser','toString','baseUrl','hex','isTTY','212405GfYAnS','length','newContext','pathname','port','Wvbar','localhost','filter','.storageState.json','.json','886952eBwKQr'];_0x2da4=function(){return _0x142ebf;};return _0x2da4();}import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x38adf1=process['env'],_0x443637={'stdin':process[_0x5ce9ca(0x1c5)],'stdout':process['stdout']}){const _0x54b79d=_0x5ce9ca,_0x40c798={'sDFKd':function(_0x125a3d,_0x59adea){return _0x125a3d(_0x59adea);}};if(_0x38adf1['CI'])return![];return _0x40c798['sDFKd'](Boolean,_0x443637[_0x54b79d(0x1c5)]['isTTY'])&&Boolean(_0x443637[_0x54b79d(0x1bb)][_0x54b79d(0x1d0)]);}export const DEFAULT_INVALIDATE_ON=[];function _0x1d3a(_0x442e3a,_0x4ab97b){_0x442e3a=_0x442e3a-0x198;const _0x2da491=_0x2da4();let _0x1d3a4a=_0x2da491[_0x442e3a];return _0x1d3a4a;}export function sessionCacheHash(_0x422f0c){const _0x3e7d1b=_0x5ce9ca,_0xf3e467={'tmFRZ':_0x3e7d1b(0x1ac),'GxNAe':_0x3e7d1b(0x1d5),'dLGmL':_0x3e7d1b(0x1c0),'brzKI':function(_0x43208f,_0x4ed3fe){return _0x43208f!==_0x4ed3fe;},'gcARh':function(_0x33b956,_0x55ec7a){return _0x33b956!==_0x55ec7a;}},_0x25dc76=new Set(_0x422f0c['invalidateOn']??DEFAULT_INVALIDATE_ON);_0x422f0c[_0x3e7d1b(0x1a4)]&&needsTunnel(_0x422f0c['effectiveBaseUrl'])&&_0x25dc76['add'](_0x3e7d1b(0x1ce));const _0x16891c={'orgId':_0x422f0c[_0x3e7d1b(0x1b8)],'profileName':_0x422f0c[_0x3e7d1b(0x1b7)]};return _0x25dc76[_0x3e7d1b(0x1a0)](_0x3e7d1b(0x1ce))&&(_0x16891c['effectiveBaseUrl']=_0x422f0c['effectiveBaseUrl']),_0x25dc76['has'](_0xf3e467['tmFRZ'])&&(_0x16891c['setupHeaders']=_0x422f0c[_0x3e7d1b(0x1ac)]?sortObjectKeys(_0x422f0c['setupHeaders']):_0x422f0c[_0x3e7d1b(0x1ac)]),_0x25dc76['has'](_0xf3e467['GxNAe'])&&(_0x16891c['port']=extractPort(_0x422f0c[_0x3e7d1b(0x1a4)])),_0x25dc76['has'](_0xf3e467[_0x3e7d1b(0x1af)])&&_0xf3e467[_0x3e7d1b(0x1bd)](_0x422f0c[_0x3e7d1b(0x1c0)],undefined)&&(_0x16891c[_0x3e7d1b(0x1c0)]=_0x422f0c[_0x3e7d1b(0x1c0)]),_0x25dc76[_0x3e7d1b(0x1a0)](_0x3e7d1b(0x1bf))&&_0xf3e467[_0x3e7d1b(0x1c3)](_0x422f0c[_0x3e7d1b(0x1bf)],undefined)&&(_0x16891c['clientIp']=_0x422f0c['clientIp']),createHash('sha256')['update'](JSON[_0x3e7d1b(0x1bc)](_0x16891c))[_0x3e7d1b(0x1ba)](_0x3e7d1b(0x1cf))['slice'](0x0,0xc);}function extractPort(_0x2b59e7){const _0x477b48=_0x5ce9ca;try{return new URL(_0x2b59e7)[_0x477b48(0x1d5)];}catch{return'';}}function sortObjectKeys(_0x24e3fe){const _0x1ca5f9=_0x5ce9ca,_0x2b9357={};for(const _0x12d27d of Object[_0x1ca5f9(0x1ad)](_0x24e3fe)[_0x1ca5f9(0x1b1)]()){_0x2b9357[_0x12d27d]=_0x24e3fe[_0x12d27d];}return _0x2b9357;}export function getSessionCachePath(_0x4717f7,_0x26e799){const _0x2d6f63=_0x5ce9ca,_0x352022={'QlxxW':function(_0x808583,_0x3be6a8,_0x1de023,_0x59b724){return _0x808583(_0x3be6a8,_0x1de023,_0x59b724);},'hAavY':function(_0x2d33e4){return _0x2d33e4();},'SjLnK':'auth'};return _0x352022[_0x2d6f63(0x1c4)](join,_0x352022['hAavY'](getRangerHomeDir),_0x352022['SjLnK'],_0x4717f7+'-'+_0x26e799+_0x2d6f63(0x19b));}export function getStorageStatePath(_0x1e4342){const _0x1d41fc=_0x5ce9ca,_0x1f4661={'wzPTL':_0x1d41fc(0x19a)};return _0x1e4342['replace'](/\.json$/,_0x1f4661[_0x1d41fc(0x1b6)]);}export function needsTunnel(_0x121119){const _0x1e4815=_0x5ce9ca,_0x566783={'lhyDX':function(_0x58d183,_0x5142e7){return _0x58d183===_0x5142e7;},'QCtKy':_0x1e4815(0x1a9),'ktpDh':'.localhost','BpCBY':'localhost.'};let _0x54f625;try{_0x54f625=new URL(_0x121119)['hostname'];}catch{return![];}if(_0x54f625===_0x1e4815(0x198)||_0x566783[_0x1e4815(0x1a7)](_0x54f625,_0x566783['QCtKy']))return!![];if(_0x54f625[_0x1e4815(0x1cb)](_0x566783[_0x1e4815(0x1ae)]))return!![];if(_0x54f625[_0x1e4815(0x1c2)](_0x566783[_0x1e4815(0x19e)]))return!![];return![];}export function isBareLocalhost(_0x393cde){const _0x438d50=_0x5ce9ca,_0x4fe771={'etdqN':function(_0x41a564,_0x4d4adb){return _0x41a564===_0x4d4adb;},'Wvbar':'localhost','zdshA':_0x438d50(0x1a9),'MrvIj':_0x438d50(0x1be),'MMWjI':function(_0x5879fa,_0x3eaaa4){return _0x5879fa===_0x3eaaa4;}};let _0x47fff5;try{_0x47fff5=new URL(_0x393cde)['hostname'];}catch{return![];}return _0x4fe771['etdqN'](_0x47fff5,_0x4fe771[_0x438d50(0x1d6)])||_0x4fe771[_0x438d50(0x1a6)](_0x47fff5,_0x4fe771[_0x438d50(0x1a5)])||_0x4fe771[_0x438d50(0x1a6)](_0x47fff5,_0x4fe771[_0x438d50(0x1a8)])||_0x4fe771[_0x438d50(0x1c1)](_0x47fff5,_0x438d50(0x19f));}export function orderLoginDomains(_0x3e8541,_0x243c1f){const _0x52c4a6=_0x5ce9ca,_0x47fbf9=_0x243c1f??[];if(!_0x3e8541)return _0x47fbf9;return[_0x3e8541,..._0x47fbf9[_0x52c4a6(0x199)](_0x4928bd=>_0x4928bd!==_0x3e8541)];}export function hostnameOf(_0x4a7b27){const _0x468565=_0x5ce9ca;return new URL(_0x4a7b27)[_0x468565(0x19d)];}export function duplicateCookiesForDomains(_0x339c64,_0x2628de){const _0x330840=_0x5ce9ca,_0x1d68eb={'VjelF':function(_0x4b0bff,_0xd33b24){return _0x4b0bff(_0xd33b24);}},_0x3f6bc0=[..._0x339c64],_0x21eff3=new Set(_0x339c64['map'](_0x14eab6=>_0x14eab6['domain']));for(const _0x358b46 of _0x2628de){let _0x2fb6f9;try{_0x2fb6f9=_0x1d68eb['VjelF'](hostnameOf,_0x358b46);}catch{continue;}if(!_0x2fb6f9)continue;const _0x2819ea=_0x2fb6f9['startsWith']('.')?_0x2fb6f9:'.'+_0x2fb6f9;if(_0x21eff3[_0x330840(0x1a0)](_0x2fb6f9)||_0x21eff3['has'](_0x2819ea))continue;for(const _0x30e6ec of _0x339c64){_0x3f6bc0['push']({..._0x30e6ec,'domain':_0x2819ea});}_0x21eff3['add'](_0x2819ea);}return _0x3f6bc0;}export function resolveAuthEnvironmentLocally(_0x196797,_0x92ce9d){const _0x5b9315=_0x5ce9ca,_0x2d620e=_0x196797['environments'];if(_0x92ce9d){const _0x3474c7=_0x2d620e[_0x92ce9d];if(!_0x3474c7)return null;return{'key':_0x92ce9d,..._0x3474c7};}if(_0x196797['defaultEnvironmentKey']){const _0x80226c=_0x2d620e[_0x196797[_0x5b9315(0x1b0)]];if(!_0x80226c)return null;return{'key':_0x196797[_0x5b9315(0x1b0)],..._0x80226c};}const _0x4dbfac=Object[_0x5b9315(0x1ad)](_0x2d620e);if(_0x4dbfac[_0x5b9315(0x1d2)]===0x1){const _0x575641=_0x4dbfac[0x0];return{'key':_0x575641,..._0x2d620e[_0x575641]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x28cbe7,_0x26efa3){const _0x275b6f=_0x5ce9ca;try{if(_0x26efa3)return new URL(_0x26efa3,_0x28cbe7)[_0x275b6f(0x1cd)]();return new URL(_0x28cbe7)[_0x275b6f(0x1cd)]();}catch{return null;}}export function looksLikeLoginUrl(_0xa574bd){const _0x4add3d=_0x5ce9ca;try{const _0x2314c8=new URL(_0xa574bd);return LOGIN_URL_PATTERN['test'](_0x2314c8[_0x4add3d(0x1d4)]);}catch{return LOGIN_URL_PATTERN['test'](_0xa574bd);}}export async function isCachedSessionLive(_0x51dfa5,_0x1d84d7,_0x2c3666={},_0x30d367={}){const _0x1e4bb0=_0x5ce9ca,_0x1696f2={'wxzYR':function(_0x2b1b47,_0x33a7e7,_0x1128cb){return _0x2b1b47(_0x33a7e7,_0x1128cb);},'IyJHM':'domcontentloaded','QbZkR':function(_0xcc7ac,_0x3981cf){return _0xcc7ac===_0x3981cf;},'hVSVO':function(_0x2d4f86,_0x179b17){return _0x2d4f86(_0x179b17);}},_0x590ba6=_0x1696f2[_0x1e4bb0(0x1a2)](buildSessionCheckUrl,_0x1d84d7,_0x2c3666['sessionCheckPath']);if(!_0x590ba6)return!![];if(!_0x30d367['launchBrowser'])return!![];let _0x695441=null;try{_0x695441=await _0x30d367[_0x1e4bb0(0x1cc)]();const _0x3534cb=await _0x695441[_0x1e4bb0(0x1d3)]({'storageState':_0x51dfa5,'ignoreHTTPSErrors':!![],..._0x2c3666[_0x1e4bb0(0x1ac)]?{'extraHTTPHeaders':_0x2c3666['setupHeaders']}:{}}),_0x25eaf2=await _0x3534cb[_0x1e4bb0(0x1c7)](),_0x48bb4e=await _0x25eaf2[_0x1e4bb0(0x1b9)](_0x590ba6,{'waitUntil':_0x1696f2['IyJHM'],'timeout':0x3a98}),_0x36c72d=_0x48bb4e?.[_0x1e4bb0(0x1a3)]();if(_0x36c72d===0x191||_0x1696f2[_0x1e4bb0(0x1ca)](_0x36c72d,0x193))return![];const _0xa8c92d=_0x25eaf2['url']();if(_0x1696f2['hVSVO'](looksLikeLoginUrl,_0xa8c92d))return![];return!![];}catch{return![];}finally{if(_0x695441)await _0x695441['close']()['catch'](()=>{});}}
@@ -1 +1 @@
1
- function _0x2c10(){const _0x1213a4=['13545697nahcYc','934200imSzlI','5838310CnyIpu','setAuthTag','aes-256-gcm','9NJPMxb','final','utf8','366355EjlgZY','14gegGYT','update','2TxWQok','hrZqN','368756FTwmob','1685340cIBYnD','ranger-auth-encryption','MLtiO','680968ybmkpd','subarray','sha256','9DQjpAt'];_0x2c10=function(){return _0x1213a4;};return _0x2c10();}const _0x405bfb=_0x3f3f;function _0x3f3f(_0x344489,_0x1ed70f){_0x344489=_0x344489-0x7b;const _0x2c103e=_0x2c10();let _0x3f3ff9=_0x2c103e[_0x344489];return _0x3f3ff9;}(function(_0x4fbf91,_0x12c258){const _0x2bb10e=_0x3f3f,_0x1a532a=_0x4fbf91();while(!![]){try{const _0x2d58e5=parseInt(_0x2bb10e(0x8b))/0x1*(parseInt(_0x2bb10e(0x8e))/0x2)+-parseInt(_0x2bb10e(0x82))/0x3*(-parseInt(_0x2bb10e(0x7b))/0x4)+parseInt(_0x2bb10e(0x84))/0x5+parseInt(_0x2bb10e(0x7c))/0x6+parseInt(_0x2bb10e(0x8c))/0x7*(-parseInt(_0x2bb10e(0x7f))/0x8)+-parseInt(_0x2bb10e(0x88))/0x9*(-parseInt(_0x2bb10e(0x85))/0xa)+-parseInt(_0x2bb10e(0x83))/0xb;if(_0x2d58e5===_0x12c258)break;else _0x1a532a['push'](_0x1a532a['shift']());}catch(_0x3be2e9){_0x1a532a['push'](_0x1a532a['shift']());}}}(_0x2c10,0x477ce));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM=_0x405bfb(0x87),SALT=_0x405bfb(0x7d),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x2b4684){const _0x4c23fc=_0x405bfb,_0x13b3fc={'MLtiO':function(_0x2d3aa9,_0x50d242,_0x5cd5a8,_0x30b996,_0x4077f3,_0x16af16){return _0x2d3aa9(_0x50d242,_0x5cd5a8,_0x30b996,_0x4077f3,_0x16af16);}};return _0x13b3fc[_0x4c23fc(0x7e)](pbkdf2Sync,_0x2b4684,SALT,0x186a0,KEY_LENGTH,_0x4c23fc(0x81));}export function encrypt(_0x5e9215,_0x2751df){const _0x12f43d=_0x405bfb,_0x5b8009={'HLmTG':function(_0x4d9379,_0x1fe250){return _0x4d9379(_0x1fe250);}},_0x341f2b=deriveKey(_0x2751df),_0x52073d=_0x5b8009['HLmTG'](randomBytes,IV_LENGTH),_0x462933=createCipheriv(ALGORITHM,_0x341f2b,_0x52073d),_0x53a2fd=Buffer['concat']([_0x462933[_0x12f43d(0x8d)](_0x5e9215,_0x12f43d(0x8a)),_0x462933[_0x12f43d(0x89)]()]),_0x1d7cfc=_0x462933['getAuthTag']();return Buffer['concat']([_0x52073d,_0x1d7cfc,_0x53a2fd]);}export function decrypt(_0x32ce42,_0x1114fa){const _0x2c9fa8=_0x405bfb,_0x2b0333={'EFbxg':function(_0x2f60a6,_0x4160a4){return _0x2f60a6(_0x4160a4);},'hrZqN':function(_0x46756f,_0x2659bb){return _0x46756f+_0x2659bb;}},_0x384859=_0x2b0333['EFbxg'](deriveKey,_0x1114fa),_0x2921b0=_0x32ce42['subarray'](0x0,IV_LENGTH),_0x508eb3=_0x32ce42[_0x2c9fa8(0x80)](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x25fcdd=_0x32ce42['subarray'](_0x2b0333['hrZqN'](IV_LENGTH,TAG_LENGTH)),_0x1b2dbb=createDecipheriv(ALGORITHM,_0x384859,_0x2921b0);return _0x1b2dbb[_0x2c9fa8(0x86)](_0x508eb3),_0x2b0333[_0x2c9fa8(0x8f)](_0x1b2dbb['update'](_0x25fcdd),_0x1b2dbb[_0x2c9fa8(0x89)](_0x2c9fa8(0x8a)));}
1
+ function _0x388f(_0x39c244,_0x51b572){_0x39c244=_0x39c244-0x18c;const _0x34d883=_0x34d8();let _0x388f95=_0x34d883[_0x39c244];return _0x388f95;}const _0xde2e85=_0x388f;(function(_0x11a38d,_0x598480){const _0x24cda4=_0x388f,_0x34547d=_0x11a38d();while(!![]){try{const _0x541cc1=-parseInt(_0x24cda4(0x194))/0x1*(parseInt(_0x24cda4(0x18d))/0x2)+-parseInt(_0x24cda4(0x198))/0x3+parseInt(_0x24cda4(0x199))/0x4+-parseInt(_0x24cda4(0x190))/0x5+-parseInt(_0x24cda4(0x191))/0x6*(parseInt(_0x24cda4(0x19b))/0x7)+parseInt(_0x24cda4(0x192))/0x8+-parseInt(_0x24cda4(0x197))/0x9;if(_0x541cc1===_0x598480)break;else _0x34547d['push'](_0x34547d['shift']());}catch(_0x427b38){_0x34547d['push'](_0x34547d['shift']());}}}(_0x34d8,0x5e04e));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT=_0xde2e85(0x18e),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x436237){const _0x4d56f5=_0xde2e85,_0x29a119={'lhaZp':function(_0x4da27d,_0x46b5a7,_0x5d4d3e,_0x4cc404,_0x59d43f,_0x1c1ba4){return _0x4da27d(_0x46b5a7,_0x5d4d3e,_0x4cc404,_0x59d43f,_0x1c1ba4);}};return _0x29a119[_0x4d56f5(0x193)](pbkdf2Sync,_0x436237,SALT,0x186a0,KEY_LENGTH,_0x4d56f5(0x19c));}export function encrypt(_0x4316ba,_0x1887b2){const _0x469302=_0xde2e85,_0x26e83a={'lpUrp':function(_0x635471,_0x3b4919){return _0x635471(_0x3b4919);},'zWher':function(_0x4c33f6,_0x54f560,_0x3b4e66,_0x283ba9){return _0x4c33f6(_0x54f560,_0x3b4e66,_0x283ba9);}},_0xe42d21=_0x26e83a['lpUrp'](deriveKey,_0x1887b2),_0xe542df=randomBytes(IV_LENGTH),_0x11b0fd=_0x26e83a[_0x469302(0x196)](createCipheriv,ALGORITHM,_0xe42d21,_0xe542df),_0x2cfa66=Buffer[_0x469302(0x18f)]([_0x11b0fd['update'](_0x4316ba,'utf8'),_0x11b0fd[_0x469302(0x19d)]()]),_0x4a1dc7=_0x11b0fd['getAuthTag']();return Buffer['concat']([_0xe542df,_0x4a1dc7,_0x2cfa66]);}function _0x34d8(){const _0xf43aff=['ranger-auth-encryption','concat','1033420fTRGFs','51954hxzzkG','3967552aDtEwR','lhaZp','122JBjQLl','update','zWher','2131002WZEQtp','1136091DPWykw','2977968WSbhIu','GtrHT','21inkaFb','sha256','final','utf8','118dnSPzd'];_0x34d8=function(){return _0xf43aff;};return _0x34d8();}export function decrypt(_0x2db0c9,_0x282107){const _0x2c6fb2=_0xde2e85,_0x5eb918={'GtrHT':function(_0x2a9e33,_0x276499){return _0x2a9e33(_0x276499);},'jQMPU':function(_0x48df75,_0x2956c7){return _0x48df75+_0x2956c7;}},_0x540e84=_0x5eb918[_0x2c6fb2(0x19a)](deriveKey,_0x282107),_0x3405fc=_0x2db0c9['subarray'](0x0,IV_LENGTH),_0x4de63f=_0x2db0c9['subarray'](IV_LENGTH,_0x5eb918['jQMPU'](IV_LENGTH,TAG_LENGTH)),_0x201c5f=_0x2db0c9['subarray'](IV_LENGTH+TAG_LENGTH),_0x583405=createDecipheriv(ALGORITHM,_0x540e84,_0x3405fc);return _0x583405['setAuthTag'](_0x4de63f),_0x583405[_0x2c6fb2(0x195)](_0x201c5f)+_0x583405['final'](_0x2c6fb2(0x18c));}
@@ -1 +1 @@
1
- const _0x41dd8a=_0x3b5b;(function(_0xe1bc0c,_0x4336f7){const _0x53dc74=_0x3b5b,_0x33bbb0=_0xe1bc0c();while(!![]){try{const _0x38193e=parseInt(_0x53dc74(0x101))/0x1+-parseInt(_0x53dc74(0x108))/0x2*(-parseInt(_0x53dc74(0xfa))/0x3)+parseInt(_0x53dc74(0xfd))/0x4*(parseInt(_0x53dc74(0x10f))/0x5)+parseInt(_0x53dc74(0xfe))/0x6+parseInt(_0x53dc74(0x106))/0x7*(-parseInt(_0x53dc74(0xf6))/0x8)+-parseInt(_0x53dc74(0x11c))/0x9*(-parseInt(_0x53dc74(0xfb))/0xa)+-parseInt(_0x53dc74(0x10e))/0xb;if(_0x38193e===_0x4336f7)break;else _0x33bbb0['push'](_0x33bbb0['shift']());}catch(_0x54d543){_0x33bbb0['push'](_0x33bbb0['shift']());}}}(_0x5337,0x907f7));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';function _0x5337(){const _0x377234=['=[REDACTED]','FnEZe','Gaday','36785573ibKQCD','5IwaHLo','DEBUG','TGYQm','has','FgIGy','--secret','push','no_token','--key','runtime_error','[desire-path]\x20Sending\x20log\x20to\x20','toLowerCase','JtiOO','207ZdPyCY','--api-key','invalid_option_value','missing_required_argument','--pass','error','env','isTTY','Authorization','[REDACTED]','Missing\x20required\x20argument','491248wCylqu','--auth','--cookie','featureId','15XUkDBF','305690wYHdAj','Unknown\x20command','3485068bEmCho','6775158OFWzLD','/api/v1/mcp/desire-path-logs','[desire-path]\x20Failed\x20to\x20send:\x20','443455rLxciX','Wzote','application/json','stringify','unknown_command','7FssHRL','includes','340164UIGyqO','POST','indexOf'];_0x5337=function(){return _0x377234;};return _0x5337();}function _0x3b5b(_0x2f17e7,_0xf34b55){_0x2f17e7=_0x2f17e7-0xee;const _0x533769=_0x5337();let _0x3b5bcb=_0x533769[_0x2f17e7];return _0x3b5bcb;}const SENSITIVE_FLAGS=new Set(['--token','-t',_0x41dd8a(0x114),_0x41dd8a(0x11d),'--apikey',_0x41dd8a(0x117),'--password',_0x41dd8a(0xef),_0x41dd8a(0xf7),'--authorization','--header',_0x41dd8a(0xf8),'--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(_0x3d454e){return TOKEN_PATTERNS['some'](_0x28adfd=>_0x28adfd['test'](_0x3d454e));}export function sanitizeArgs(_0x1302dc){const _0x551219=_0x41dd8a,_0x59f1c4={'OjBmN':function(_0x1d9a72,_0x50450f){return _0x1d9a72<_0x50450f;},'SLohV':_0x551219(0xf4),'Wzote':function(_0x551cf4,_0x5d7f75){return _0x551cf4!==_0x5d7f75;}},_0x383528=[];let _0x4a8ac6=![];for(let _0x2bf7ff=0x0;_0x59f1c4['OjBmN'](_0x2bf7ff,_0x1302dc['length']);_0x2bf7ff++){const _0x466bd2=_0x1302dc[_0x2bf7ff];if(_0x4a8ac6){_0x383528['push'](_0x59f1c4['SLohV']),_0x4a8ac6=![];continue;}if(_0x466bd2['startsWith']('--')||_0x466bd2['startsWith']('-')){const _0x1dfd97=_0x466bd2[_0x551219(0x10a)]('=');if(_0x59f1c4[_0x551219(0x102)](_0x1dfd97,-0x1)){const _0xb41253=_0x466bd2['slice'](0x0,_0x1dfd97)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0xb41253)){_0x383528[_0x551219(0x115)](_0x466bd2['slice'](0x0,_0x1dfd97)+_0x551219(0x10b));continue;}}else{const _0x22fb96=_0x466bd2[_0x551219(0x11a)]();SENSITIVE_FLAGS[_0x551219(0x112)](_0x22fb96)&&(_0x4a8ac6=!![]);}_0x383528['push'](_0x466bd2);}else looksLikeToken(_0x466bd2)?_0x383528['push']('[REDACTED]'):_0x383528['push'](_0x466bd2);}return _0x383528['join']('\x20');}export async function logDesirePath(_0x290fb2){const _0x57e314=_0x41dd8a,_0x357e0e={'ouGsj':function(_0x2b23d1){return _0x2b23d1();},'ZozPV':'has_token','Gaday':_0x57e314(0x103),'iWeXk':_0x57e314(0xf3)};try{const _0x46b9d7=await _0x357e0e['ouGsj'](getToken)['catch'](()=>null),_0x491e69=getApiBaseUrl(),_0x4225ed=getCurrentVersion(),_0x34ca1c=_0x46b9d7?_0x357e0e['ZozPV']:_0x57e314(0x116),_0x505d3d={..._0x290fb2['metadata'],'authStatus':_0x34ca1c,'isTty':process['stdout'][_0x57e314(0xf2)]??![]},_0x57be81={'Content-Type':_0x357e0e[_0x57e314(0x10d)]};_0x46b9d7&&(_0x57be81[_0x357e0e['iWeXk']]='Bearer\x20'+_0x46b9d7);const _0x20117d={'rawCommand':_0x290fb2['rawCommand'],'errorMessage':_0x290fb2['errorMessage'],'errorType':_0x290fb2['errorType'],'featureId':_0x290fb2[_0x57e314(0xf9)],'sessionId':_0x290fb2['sessionId'],'metadata':_0x505d3d,'cliVersion':_0x4225ed};process[_0x57e314(0xf1)][_0x57e314(0x110)]&&(console[_0x57e314(0xf0)](_0x57e314(0x119)+_0x491e69+_0x57e314(0xff)),console[_0x57e314(0xf0)]('[desire-path]\x20Payload:\x20'+JSON[_0x57e314(0x104)](_0x20117d,null,0x2))),await fetch(_0x491e69+'/api/v1/mcp/desire-path-logs',{'method':_0x57e314(0x109),'headers':_0x57be81,'body':JSON[_0x57e314(0x104)](_0x20117d)});}catch(_0x5a8386){process[_0x57e314(0xf1)]['DEBUG']&&console[_0x57e314(0xf0)](_0x57e314(0x100)+_0x5a8386);}}export function getErrorType(_0x197b3f,_0x5b9df0){const _0x534662=_0x41dd8a,_0x1afb63={'FgIGy':'6|4|5|0|2|3|1|7','LuBAy':'unknown_argument','LoVQu':_0x534662(0xf5),'JtiOO':'missing_option','FnEZe':_0x534662(0xee),'TGYQm':_0x534662(0x118)},_0x40b6ad=_0x1afb63[_0x534662(0x113)]['split']('|');let _0x5a5d34=0x0;while(!![]){switch(_0x40b6ad[_0x5a5d34++]){case'0':if(_0x197b3f['includes']('Unknown\x20argument'))return _0x1afb63['LuBAy'];continue;case'1':if(_0x197b3f['includes'](_0x1afb63['LoVQu']))return _0x1afb63[_0x534662(0x11b)];continue;case'2':if(_0x197b3f[_0x534662(0x107)]('Not\x20enough\x20non-option\x20arguments'))return _0x1afb63[_0x534662(0x10c)];continue;case'3':if(_0x197b3f['includes']('Invalid\x20values'))return _0x534662(0x11e);continue;case'4':if(!_0x197b3f)return'unknown';continue;case'5':if(_0x197b3f[_0x534662(0x107)](_0x534662(0xfc)))return _0x534662(0x105);continue;case'6':if(_0x5b9df0)return _0x1afb63[_0x534662(0x111)];continue;case'7':return'syntax_error';}break;}}
1
+ const _0xc810c1=_0x3624;function _0x3624(_0x325327,_0x329dee){_0x325327=_0x325327-0x12a;const _0x594d26=_0x594d();let _0x3624fd=_0x594d26[_0x325327];return _0x3624fd;}(function(_0x539e2b,_0xba4fdb){const _0x2ae90b=_0x3624,_0x51ced0=_0x539e2b();while(!![]){try{const _0x2db7d5=parseInt(_0x2ae90b(0x15f))/0x1*(-parseInt(_0x2ae90b(0x154))/0x2)+-parseInt(_0x2ae90b(0x12e))/0x3*(parseInt(_0x2ae90b(0x143))/0x4)+parseInt(_0x2ae90b(0x149))/0x5*(parseInt(_0x2ae90b(0x12d))/0x6)+parseInt(_0x2ae90b(0x14e))/0x7*(parseInt(_0x2ae90b(0x132))/0x8)+-parseInt(_0x2ae90b(0x14b))/0x9+parseInt(_0x2ae90b(0x13d))/0xa*(parseInt(_0x2ae90b(0x12b))/0xb)+parseInt(_0x2ae90b(0x160))/0xc;if(_0x2db7d5===_0xba4fdb)break;else _0x51ced0['push'](_0x51ced0['shift']());}catch(_0x223149){_0x51ced0['push'](_0x51ced0['shift']());}}}(_0x594d,0x1ea1d));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';function _0x594d(){const _0x2876a5=['/api/v1/mcp/desire-path-logs','Missing\x20required\x20argument','sessionId','[desire-path]\x20Payload:\x20','split','2VmTYEl','application/json','--pass','RMxvY','UxDxb','push','stringify','unknown','has_token','--secret','error','205305KhPAxJ','3445884fXeRhz','--api-key','99tSxTUN','AmFab','18GgCxSr','325848HXtXtS','test','[REDACTED]','[desire-path]\x20Failed\x20to\x20send:\x20','8zMlASB','--header','DEBUG','grvGn','invalid_option_value','--credentials','--authorization','has','catch','--key','slice','209390mHykER','join','toLowerCase','includes','--auth','Unknown\x20argument','4arkhZM','unknown_command','unknown_argument','missing_required_argument','--apikey','--token','28690cyTGvT','Unknown\x20command','714015ChwgCm','[desire-path]\x20Sending\x20log\x20to\x20','rawCommand','181321EMnDid'];_0x594d=function(){return _0x2876a5;};return _0x594d();}const SENSITIVE_FLAGS=new Set([_0xc810c1(0x148),'-t',_0xc810c1(0x15d),_0xc810c1(0x12a),_0xc810c1(0x147),_0xc810c1(0x13b),'--password',_0xc810c1(0x156),_0xc810c1(0x141),_0xc810c1(0x138),_0xc810c1(0x133),'--cookie',_0xc810c1(0x137)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x49826c){const _0x136d40=_0xc810c1;return TOKEN_PATTERNS['some'](_0x255fe0=>_0x255fe0[_0x136d40(0x12f)](_0x49826c));}export function sanitizeArgs(_0x1a6393){const _0x68e73f=_0xc810c1,_0x19b4ba=[];let _0x156838=![];for(let _0x1f8e19=0x0;_0x1f8e19<_0x1a6393['length'];_0x1f8e19++){const _0xa2217d=_0x1a6393[_0x1f8e19];if(_0x156838){_0x19b4ba['push'](_0x68e73f(0x130)),_0x156838=![];continue;}if(_0xa2217d['startsWith']('--')||_0xa2217d['startsWith']('-')){const _0x40c635=_0xa2217d['indexOf']('=');if(_0x40c635!==-0x1){const _0x6a10a9=_0xa2217d[_0x68e73f(0x13c)](0x0,_0x40c635)[_0x68e73f(0x13f)]();if(SENSITIVE_FLAGS['has'](_0x6a10a9)){_0x19b4ba[_0x68e73f(0x159)](_0xa2217d['slice'](0x0,_0x40c635)+'=[REDACTED]');continue;}}else{const _0x5cc298=_0xa2217d['toLowerCase']();SENSITIVE_FLAGS[_0x68e73f(0x139)](_0x5cc298)&&(_0x156838=!![]);}_0x19b4ba[_0x68e73f(0x159)](_0xa2217d);}else looksLikeToken(_0xa2217d)?_0x19b4ba[_0x68e73f(0x159)](_0x68e73f(0x130)):_0x19b4ba['push'](_0xa2217d);}return _0x19b4ba[_0x68e73f(0x13e)]('\x20');}export async function logDesirePath(_0xf0f60f){const _0x109bbb=_0xc810c1,_0x4cce30={'UxDxb':function(_0x30708b){return _0x30708b();},'sdQeD':function(_0x1cde15){return _0x1cde15();},'grvGn':'no_token','OPFMH':_0x109bbb(0x155),'AmFab':function(_0x2132f0,_0x5c525b,_0x5c6418){return _0x2132f0(_0x5c525b,_0x5c6418);}};try{const _0x24e12d=await _0x4cce30[_0x109bbb(0x158)](getToken)[_0x109bbb(0x13a)](()=>null),_0x11db0b=_0x4cce30['sdQeD'](getApiBaseUrl),_0x496784=getCurrentVersion(),_0x505112=_0x24e12d?_0x109bbb(0x15c):_0x4cce30[_0x109bbb(0x135)],_0xb65609={..._0xf0f60f['metadata'],'authStatus':_0x505112,'isTty':process['stdout']['isTTY']??![]},_0x558846={'Content-Type':_0x4cce30['OPFMH']};_0x24e12d&&(_0x558846['Authorization']='Bearer\x20'+_0x24e12d);const _0x37413f={'rawCommand':_0xf0f60f[_0x109bbb(0x14d)],'errorMessage':_0xf0f60f['errorMessage'],'errorType':_0xf0f60f['errorType'],'featureId':_0xf0f60f['featureId'],'sessionId':_0xf0f60f[_0x109bbb(0x151)],'metadata':_0xb65609,'cliVersion':_0x496784};process['env']['DEBUG']&&(console['error'](_0x109bbb(0x14c)+_0x11db0b+_0x109bbb(0x14f)),console[_0x109bbb(0x15e)](_0x109bbb(0x152)+JSON[_0x109bbb(0x15a)](_0x37413f,null,0x2))),await _0x4cce30[_0x109bbb(0x12c)](fetch,_0x11db0b+_0x109bbb(0x14f),{'method':'POST','headers':_0x558846,'body':JSON[_0x109bbb(0x15a)](_0x37413f)});}catch(_0x1d1d13){process['env'][_0x109bbb(0x134)]&&console['error'](_0x109bbb(0x131)+_0x1d1d13);}}export function getErrorType(_0x112225,_0x491e05){const _0x191883=_0xc810c1,_0x1ead0b={'wnsnr':_0x191883(0x136),'RMxvY':'syntax_error','Euqzl':_0x191883(0x15b),'gJxTO':'runtime_error'},_0xa723a9='6|5|7|3|2|1|0|4'[_0x191883(0x153)]('|');let _0x501a11=0x0;while(!![]){switch(_0xa723a9[_0x501a11++]){case'0':if(_0x112225['includes'](_0x191883(0x150)))return'missing_option';continue;case'1':if(_0x112225[_0x191883(0x140)]('Invalid\x20values'))return _0x1ead0b['wnsnr'];continue;case'2':if(_0x112225[_0x191883(0x140)]('Not\x20enough\x20non-option\x20arguments'))return _0x191883(0x146);continue;case'3':if(_0x112225[_0x191883(0x140)](_0x191883(0x142)))return _0x191883(0x145);continue;case'4':return _0x1ead0b[_0x191883(0x157)];case'5':if(!_0x112225)return _0x1ead0b['Euqzl'];continue;case'6':if(_0x491e05)return _0x1ead0b['gJxTO'];continue;case'7':if(_0x112225['includes'](_0x191883(0x14a)))return _0x191883(0x144);continue;}break;}}
@@ -1 +1 @@
1
- const _0x6b11d1=_0x5024;(function(_0x387351,_0x547105){const _0xad641=_0x5024,_0x165723=_0x387351();while(!![]){try{const _0xe05cf2=parseInt(_0xad641(0x1ac))/0x1+-parseInt(_0xad641(0x19a))/0x2+parseInt(_0xad641(0x189))/0x3*(parseInt(_0xad641(0x1a1))/0x4)+parseInt(_0xad641(0x1ba))/0x5*(parseInt(_0xad641(0x1b5))/0x6)+-parseInt(_0xad641(0x183))/0x7+parseInt(_0xad641(0x1a4))/0x8*(-parseInt(_0xad641(0x1a6))/0x9)+-parseInt(_0xad641(0x1cf))/0xa*(-parseInt(_0xad641(0x18f))/0xb);if(_0xe05cf2===_0x547105)break;else _0x165723['push'](_0x165723['shift']());}catch(_0x2e1072){_0x165723['push'](_0x165723['shift']());}}}(_0x5849,0xd80ad));import{spawn}from'child_process';import _0x35835a from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x6b11d1(0x1b7);function _0x5849(){const _0x3d47bb=['\x27s\x20CLI\x20Key','slow_down','Failed\x20to\x20fetch\x20memberships:\x20','ignore','map','Bxmsv','508jcgMTg','error','dYGnn','144ZFRaCU','memberships','65781SeMIUY','mcp:write','Failed\x20to\x20provision\x20CLI\x20token:\x20','EvEik','lrJos','isTTY','315435BhShMC','error_description','list','UaIkx','interval','log','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','aAjWY','zrUvq','18sirFcn','write','https://api.workos.com/user_management/authenticate','token','application/json','1908290PZpiiq','start','open','CzKLs','Failed\x20to\x20provision\x20API\x20key:\x20','status','organizationId','device_code','jezhw','GET','viNKq','CfcDw','Setting\x20up\x20your\x20organization...','TrrXu','stdout','kvOeD','name','startsWith','stdin','refresh_token','CijHy','1417730CATmIE','12058774PYXnMO','xdg-open','CLI\x20Key','VZVdH','POST','Authentication\x20failed','22665mStGiS','authorization_pending','now','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','QgyWH','GOimy','55nXsrbE','application/x-www-form-urlencoded','access_token','platform','NqetM','stringify','text','GZRoL','length','apiKeys','json','779212DlORFW'];_0x5849=function(){return _0x3d47bb;};return _0x5849();}export async function requestDeviceCode(_0xc23b5){const _0x3bac2c=_0x6b11d1,_0x21267d={'CITaG':_0x3bac2c(0x190)},_0x131b72=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':'POST','headers':{'Content-Type':_0x21267d['CITaG']},'body':new URLSearchParams({'client_id':_0xc23b5})});if(!_0x131b72['ok']){const _0x958ae=await _0x131b72[_0x3bac2c(0x195)]();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x131b72['status']+'\x20'+_0x958ae);}return _0x131b72[_0x3bac2c(0x199)]();}export async function pollForTokens(_0x45be33,_0x28664a,_0x507156,_0x3467cc){const _0x1dac97=_0x6b11d1,_0x1f6a04={'Bxmsv':function(_0x444ebe,_0x4dfc50){return _0x444ebe+_0x4dfc50;},'PnwPq':function(_0x218e20,_0x252f90){return _0x218e20*_0x252f90;},'NqetM':function(_0x5162c2,_0x2e96f1){return _0x5162c2<_0x2e96f1;},'NCiYd':function(_0x40ea61,_0x5cb6c7){return _0x40ea61(_0x5cb6c7);},'YxTDB':'urn:ietf:params:oauth:grant-type:device_code','PSpYl':function(_0x564432,_0x53858e){return _0x564432===_0x53858e;},'EvEik':_0x1dac97(0x19c),'pxSGp':'Device\x20authorization\x20timed\x20out'},_0x1a6d04=_0x1f6a04[_0x1dac97(0x1a0)](Date['now'](),_0x3467cc*0x3e8);let _0x1953d6=_0x1f6a04['PnwPq'](_0x507156,0x3e8);while(_0x1f6a04[_0x1dac97(0x193)](Date[_0x1dac97(0x18b)](),_0x1a6d04)){await _0x1f6a04['NCiYd'](sleep,_0x1953d6);const _0x5364fc=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x45be33,'device_code':_0x28664a,'grant_type':_0x1f6a04['YxTDB']})});if(_0x5364fc['ok'])return _0x5364fc[_0x1dac97(0x199)]();const _0x3d4521=await _0x5364fc[_0x1dac97(0x199)]();if(_0x3d4521[_0x1dac97(0x1a2)]===_0x1dac97(0x18a))continue;if(_0x1f6a04['PSpYl'](_0x3d4521['error'],_0x1f6a04[_0x1dac97(0x1a9)])){_0x1953d6+=0x3e8;continue;}throw new Error(_0x3d4521[_0x1dac97(0x1ad)]||_0x3d4521['error']||_0x1dac97(0x188));}throw new Error(_0x1f6a04['pxSGp']);}async function fetchUserProfile(_0x27419a){const _0xfdf685=_0x6b11d1,_0x569c15={'VZVdH':function(_0x13c48c,_0x520320,_0x288d24){return _0x13c48c(_0x520320,_0x288d24);},'CijHy':_0xfdf685(0x1c3)},_0x3f964b=getApiBaseUrl();try{const _0x460b63=await _0x569c15[_0xfdf685(0x186)](fetch,_0x3f964b+'/organization/me',{'method':_0x569c15[_0xfdf685(0x1ce)],'headers':{'workos-token':_0x27419a}});if(_0x460b63['ok'])return _0x460b63['json']();}catch{}return null;}function buildKeyName(_0x1f5039,_0x89c55d){const _0x1f0243=_0x6b11d1,_0x20a38f={'kTxTJ':function(_0x370c4b,_0x44c4ae){return _0x370c4b===_0x44c4ae;},'PYqyg':function(_0x2745e0,_0x4a3755){return _0x2745e0+_0x4a3755;}},_0x46e5ab=_0x89c55d['filter'](_0x19a121=>_0x19a121[_0x1f0243(0x1ca)]===_0x1f5039||_0x19a121['name'][_0x1f0243(0x1cb)](_0x1f5039+'\x20('));if(_0x20a38f['kTxTJ'](_0x46e5ab['length'],0x0))return _0x1f5039;return _0x1f5039+'\x20('+_0x20a38f['PYqyg'](_0x46e5ab['length'],0x1)+')';}export async function provisionApiKey(_0x66308c){const _0x33a3eb=_0x6b11d1,_0x3d7d30={'aqDAC':function(_0x1cd5a6,_0x32b943){return _0x1cd5a6(_0x32b943);},'CfcDw':_0x33a3eb(0x1c3),'mLCww':_0x33a3eb(0x187)},_0x246f09=getApiBaseUrl(),_0x25f51a={'Content-Type':_0x33a3eb(0x1b9),'workos-token':_0x66308c},_0x1b47ea=await _0x3d7d30['aqDAC'](fetchUserProfile,_0x66308c),_0x541607=_0x1b47ea?.['firstName']||_0x1b47ea?.['email']?.['split']('@')[0x0],_0x5e007b=_0x541607?_0x541607+_0x33a3eb(0x19b):_0x33a3eb(0x185);let _0x57aba6=[];try{const _0x382512=await fetch(_0x246f09+'/api-keys',{'method':_0x3d7d30[_0x33a3eb(0x1c5)],'headers':_0x25f51a});if(_0x382512['ok']){const _0x3b1167=await _0x382512['json']();_0x57aba6=_0x3b1167[_0x33a3eb(0x198)];}}catch{}const _0x848d2a=buildKeyName(_0x5e007b,_0x57aba6),_0x59622c=await fetch(_0x246f09+'/api-keys',{'method':_0x3d7d30['mLCww'],'headers':_0x25f51a,'body':JSON[_0x33a3eb(0x194)]({'name':_0x848d2a,'scope':_0x33a3eb(0x1a7)})});if(!_0x59622c['ok']){const _0x4421e9=await _0x59622c['text']();throw new Error(_0x33a3eb(0x1be)+_0x59622c['status']+'\x20'+_0x4421e9);}const _0x53537a=await _0x59622c['json']();return _0x53537a['apiKey'][_0x33a3eb(0x1b8)];}export function openBrowser(_0x158a1a){const _0x39ecca=_0x6b11d1,_0x146fe1={'QgyWH':function(_0x29db5f,_0x29b7d4){return _0x29db5f===_0x29b7d4;},'IGxzW':'cmd','PGrgP':_0x39ecca(0x1bb),'CzKLs':function(_0x3dee0f,_0x3856a7){return _0x3dee0f===_0x3856a7;},'TrrXu':_0x39ecca(0x1bc),'lrJos':function(_0x9bedbd,_0x4e7570,_0x4139bb,_0x2ca12e){return _0x9bedbd(_0x4e7570,_0x4139bb,_0x2ca12e);}};try{if(_0x146fe1[_0x39ecca(0x18d)](process[_0x39ecca(0x192)],'win32')){const _0x56ad59=spawn(_0x146fe1['IGxzW'],['/c',_0x146fe1['PGrgP'],'',_0x158a1a],{'detached':!![],'stdio':_0x39ecca(0x19e),'windowsHide':!![]});_0x56ad59['unref']();return;}const _0x458f54=_0x146fe1[_0x39ecca(0x1bd)](process['platform'],'darwin')?_0x146fe1[_0x39ecca(0x1c7)]:_0x39ecca(0x184),_0x520893=_0x146fe1[_0x39ecca(0x1aa)](spawn,_0x458f54,[_0x158a1a],{'detached':!![],'stdio':_0x39ecca(0x19e)});_0x520893['unref']();}catch{}}function _0x5024(_0x2eeb7b,_0x4ea5a0){_0x2eeb7b=_0x2eeb7b-0x183;const _0x58494e=_0x5849();let _0x5024a3=_0x58494e[_0x2eeb7b];return _0x5024a3;}function decodeJwtPayload(_0x5489e6){const _0x3bdfdb=_0x6b11d1,_0x19bdc5={'KzrPd':function(_0x51a4f3,_0x23310d){return _0x51a4f3!==_0x23310d;},'UaIkx':'base64url'},_0x81925b=_0x5489e6['split']('.');if(_0x19bdc5['KzrPd'](_0x81925b[_0x3bdfdb(0x197)],0x3))throw new Error('Invalid\x20JWT\x20format');const _0x12146f=Buffer['from'](_0x81925b[0x1],_0x19bdc5[_0x3bdfdb(0x1af)])['toString']('utf-8');return JSON['parse'](_0x12146f);}async function selfServeSignup(_0x2b9d5e){const _0x39b0e6=_0x6b11d1,_0x4acd7d={'jezhw':function(_0x2c2443,_0x7ee03,_0x3ba6f9){return _0x2c2443(_0x7ee03,_0x3ba6f9);},'haUJs':'application/json'},_0x24bc98=getApiBaseUrl(),_0x4a418e=await _0x4acd7d[_0x39b0e6(0x1c2)](fetch,_0x24bc98+'/organization/self-serve-signup',{'method':'POST','headers':{'Content-Type':_0x4acd7d['haUJs'],'workos-token':_0x2b9d5e}});if(!_0x4a418e['ok']){const _0x64cfbe=await _0x4a418e[_0x39b0e6(0x195)]();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x4a418e['status']+'\x20'+_0x64cfbe);}return _0x4a418e[_0x39b0e6(0x199)]();}async function fetchMyMemberships(_0x4e74cf){const _0x4e871a=_0x6b11d1,_0x1153c5={'aAjWY':function(_0x4fd432){return _0x4fd432();}},_0x32192b=_0x1153c5[_0x4e871a(0x1b3)](getApiBaseUrl),_0x310865=await fetch(_0x32192b+'/organization/my-memberships',{'method':_0x4e871a(0x1c3),'headers':{'workos-token':_0x4e74cf}});if(!_0x310865['ok']){const _0x37d77a=await _0x310865[_0x4e871a(0x195)]();throw new Error(_0x4e871a(0x19d)+_0x310865['status']+'\x20'+_0x37d77a);}const _0x58552c=await _0x310865['json']();return _0x58552c[_0x4e871a(0x1a5)];}async function refreshTokenWithOrg(_0x3ea712,_0x14f8bc,_0x1183ea){const _0xfe705c=_0x6b11d1,_0x5c1b9e={'DWCFN':function(_0x360491,_0x31f845,_0x367c61){return _0x360491(_0x31f845,_0x367c61);},'zrUvq':_0xfe705c(0x187),'qMPfq':'application/x-www-form-urlencoded','uDFUT':'refresh_token'},_0x40d20b=await _0x5c1b9e['DWCFN'](fetch,WORKOS_TOKEN_URL,{'method':_0x5c1b9e[_0xfe705c(0x1b4)],'headers':{'Content-Type':_0x5c1b9e['qMPfq']},'body':new URLSearchParams({'client_id':_0x3ea712,'grant_type':_0x5c1b9e['uDFUT'],'refresh_token':_0x14f8bc,'organization_id':_0x1183ea})});if(!_0x40d20b['ok']){const _0x3389e0=await _0x40d20b[_0xfe705c(0x195)]();throw new Error(_0xfe705c(0x1b2)+_0x40d20b[_0xfe705c(0x1bf)]+'\x20'+_0x3389e0);}return _0x40d20b[_0xfe705c(0x199)]();}async function provisionCliToken(_0x4ff9e7){const _0x40d72e=_0x6b11d1,_0x58aeff={'zaTNv':function(_0x2eeaa9){return _0x2eeaa9();},'Bawja':function(_0x3d74a7,_0x5e4bb0,_0xe20248){return _0x3d74a7(_0x5e4bb0,_0xe20248);},'GZRoL':_0x40d72e(0x187)},_0x5bf2fd=_0x58aeff['zaTNv'](getApiBaseUrl),_0x3e0923=await _0x58aeff['Bawja'](fetch,_0x5bf2fd+'/cli-auth/token',{'method':_0x58aeff[_0x40d72e(0x196)],'headers':{'Content-Type':_0x40d72e(0x1b9),'workos-token':_0x4ff9e7}});if(!_0x3e0923['ok']){const _0x4f44d0=await _0x3e0923['text']();throw new Error(_0x40d72e(0x1a8)+_0x3e0923[_0x40d72e(0x1bf)]+'\x20'+_0x4f44d0);}return _0x3e0923['json']();}export async function runDeviceAuthFlow(){const _0x19ca99=_0x6b11d1,_0x14ef3d={'yFDET':function(_0x50b759){return _0x50b759();},'tluoQ':function(_0x28818a,_0x3b70ca){return _0x28818a(_0x3b70ca);},'dYGnn':'Waiting\x20for\x20authentication...','viNKq':function(_0xed3923,_0x2dfb24,_0x1d2d03,_0x576e96,_0x44e770){return _0xed3923(_0x2dfb24,_0x1d2d03,_0x576e96,_0x44e770);},'ZknOe':function(_0x155a19,_0x117bbf){return _0x155a19+_0x117bbf;},'kvOeD':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','GOimy':function(_0x5659de,_0x1a292c){return _0x5659de(_0x1a292c);}},_0xda2baf=_0x14ef3d['yFDET'](getCurrentEnvironment),_0x40a314=ENVIRONMENT_CONFIGS[_0xda2baf]['workosClientId'],_0x4533e2=await _0x14ef3d['tluoQ'](requestDeviceCode,_0x40a314);console[_0x19ca99(0x1b1)]('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x19ca99(0x1b1)]('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),openBrowser(_0x4533e2['verification_uri_complete']),console['log'](_0x19ca99(0x18c)+_0x4533e2['verification_uri_complete']),console['log']('Code:\x20'+_0x4533e2['user_code']+'\x0a'),process['stdout']['write'](_0x14ef3d[_0x19ca99(0x1a3)]);let _0x5481da=await _0x14ef3d[_0x19ca99(0x1c4)](pollForTokens,_0x40a314,_0x4533e2[_0x19ca99(0x1c1)],_0x4533e2[_0x19ca99(0x1b0)],_0x4533e2['expires_in']);console['log']('\x20✓');const _0x273d9c=_0x14ef3d['tluoQ'](decodeJwtPayload,_0x5481da['access_token']);if(!_0x273d9c['org_id']){const _0x335b0e=await fetchMyMemberships(_0x5481da[_0x19ca99(0x191)]);let _0x190ff;if(_0x335b0e[_0x19ca99(0x197)]===0x0){process['stdout'][_0x19ca99(0x1b6)](_0x19ca99(0x1c6));const _0x4b3b6f=await selfServeSignup(_0x5481da[_0x19ca99(0x191)]);_0x190ff=_0x4b3b6f[_0x19ca99(0x1c0)],console[_0x19ca99(0x1b1)]('\x20✓');}else{if(_0x335b0e[_0x19ca99(0x197)]===0x1)_0x190ff=_0x335b0e[0x0]['organizationId'],console['log']('Using\x20organization:\x20'+_0x335b0e[0x0][_0x19ca99(0x1ca)]);else{const _0x2f3914=process[_0x19ca99(0x1cc)][_0x19ca99(0x1ab)]&&process[_0x19ca99(0x1c8)][_0x19ca99(0x1ab)];if(!_0x2f3914)throw new Error(_0x14ef3d['ZknOe']('Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a',_0x14ef3d[_0x19ca99(0x1c9)]));const {selected:_0xd2c615}=await _0x35835a['prompt']([{'type':_0x19ca99(0x1ae),'name':'selected','message':'Select\x20an\x20organization:','choices':_0x335b0e[_0x19ca99(0x19f)](_0x2316c5=>({'name':_0x2316c5[_0x19ca99(0x1ca)],'value':_0x2316c5[_0x19ca99(0x1c0)]}))}]);_0x190ff=_0xd2c615;}}_0x5481da=await refreshTokenWithOrg(_0x40a314,_0x5481da[_0x19ca99(0x1cd)],_0x190ff);}process[_0x19ca99(0x1c8)]['write']('Provisioning\x20CLI\x20token...');const _0x2f13bc=await provisionCliToken(_0x5481da[_0x19ca99(0x191)]);return console[_0x19ca99(0x1b1)]('\x20✓'),await _0x14ef3d[_0x19ca99(0x18e)](storeToken,_0x2f13bc['token']),_0x5481da[_0x19ca99(0x1cd)]&&await storeRefreshToken(_0x5481da['refresh_token']),_0x2f13bc['token'];}function sleep(_0x205ade){return new Promise(_0x813289=>setTimeout(_0x813289,_0x205ade));}
1
+ const _0x568548=_0x2e9d;(function(_0x13b141,_0x572245){const _0x4f1086=_0x2e9d,_0xaefc99=_0x13b141();while(!![]){try{const _0x352505=parseInt(_0x4f1086(0xe9))/0x1+parseInt(_0x4f1086(0xc7))/0x2*(parseInt(_0x4f1086(0xfa))/0x3)+parseInt(_0x4f1086(0xe6))/0x4+parseInt(_0x4f1086(0xb2))/0x5*(-parseInt(_0x4f1086(0xb0))/0x6)+-parseInt(_0x4f1086(0xec))/0x7*(-parseInt(_0x4f1086(0xe1))/0x8)+-parseInt(_0x4f1086(0xf2))/0x9+-parseInt(_0x4f1086(0xd0))/0xa;if(_0x352505===_0x572245)break;else _0xaefc99['push'](_0xaefc99['shift']());}catch(_0x567701){_0xaefc99['push'](_0xaefc99['shift']());}}}(_0x3a6f,0x3ddf7));import{spawn}from'child_process';import _0x53bce5 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';function _0x3a6f(){const _0x901f6e=['refresh_token','selected','authorization_pending','write','vKTHV','mcp:write','https://api.workos.com/user_management/authenticate','Failed\x20to\x20request\x20device\x20code:\x20','JTdOL','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','expires_in','ZXoZN','GET','264386raSIAi','thqZe','kXUaO','AZAOL','RPLej','Failed\x20to\x20create\x20organization:\x20','aJudY','aMUyZ','utf-8','6885770phtEbI','bPkwr','stdin','organizationId','workosClientId','list','Failed\x20to\x20fetch\x20memberships:\x20','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','SrdLZ','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','Select\x20an\x20organization:','xdg-open','json','Code:\x20','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','access_token','32JZtkWt','text','verification_uri_complete','POST','Setting\x20up\x20your\x20organization...','1969560LHwmei','/api-keys','/organization/self-serve-signup','238298mmOWLG','unref','lsmQa','576597wtufqW','/cli-auth/token','Hsoaj','ERcAE','stringify','log','2397987ioZtNv','bPYlA','length','base64url','Authentication\x20failed','JyqXW','status','Provisioning\x20CLI\x20token...','6uSqZsM','sfNCD','token','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','YYOek','application/x-www-form-urlencoded','yLzqY','error_description','BJylm','696642psXolC','name','5fjQrjJ','prompt','QZWKk','platform','memberships','JONFu','Using\x20organization:\x20','\x27s\x20CLI\x20Key'];_0x3a6f=function(){return _0x901f6e;};return _0x3a6f();}import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x568548(0xc0);export async function requestDeviceCode(_0x3bab6f){const _0xb02d70=_0x568548,_0x3163fb={'aMUyZ':_0xb02d70(0xe4),'thqZe':_0xb02d70(0xff)},_0x10b79b=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x3163fb[_0xb02d70(0xce)],'headers':{'Content-Type':_0x3163fb[_0xb02d70(0xc8)]},'body':new URLSearchParams({'client_id':_0x3bab6f})});if(!_0x10b79b['ok']){const _0x49f751=await _0x10b79b[_0xb02d70(0xe2)]();throw new Error(_0xb02d70(0xc1)+_0x10b79b['status']+'\x20'+_0x49f751);}return _0x10b79b[_0xb02d70(0xdd)]();}export async function pollForTokens(_0x2d1155,_0x3ce9ae,_0xef25b0,_0x5bec49){const _0x44e8a6=_0x568548,_0x3ad099={'kcQvv':function(_0x23a381,_0x27282e){return _0x23a381*_0x27282e;},'HNvCa':function(_0x443e5f,_0x2bd509){return _0x443e5f*_0x2bd509;},'RPLej':function(_0x28fd4a,_0x2671d3,_0x4bc6cb){return _0x28fd4a(_0x2671d3,_0x4bc6cb);},'AZAOL':_0x44e8a6(0xe4),'bPkwr':'application/x-www-form-urlencoded','jpczy':'urn:ietf:params:oauth:grant-type:device_code','ERcAE':_0x44e8a6(0xbc),'QZWKk':function(_0x10f3d1,_0x18daa8){return _0x10f3d1===_0x18daa8;},'kXUaO':'slow_down','nSPqO':_0x44e8a6(0xf6)},_0x5ca702=Date['now']()+_0x3ad099['kcQvv'](_0x5bec49,0x3e8);let _0x1e9597=_0x3ad099['HNvCa'](_0xef25b0,0x3e8);while(Date['now']()<_0x5ca702){await sleep(_0x1e9597);const _0x357245=await _0x3ad099[_0x44e8a6(0xcb)](fetch,WORKOS_TOKEN_URL,{'method':_0x3ad099[_0x44e8a6(0xca)],'headers':{'Content-Type':_0x3ad099[_0x44e8a6(0xd1)]},'body':new URLSearchParams({'client_id':_0x2d1155,'device_code':_0x3ce9ae,'grant_type':_0x3ad099['jpczy']})});if(_0x357245['ok'])return _0x357245[_0x44e8a6(0xdd)]();const _0x5da898=await _0x357245[_0x44e8a6(0xdd)]();if(_0x5da898['error']===_0x3ad099[_0x44e8a6(0xef)])continue;if(_0x3ad099[_0x44e8a6(0xb4)](_0x5da898['error'],_0x3ad099[_0x44e8a6(0xc9)])){_0x1e9597+=0x3e8;continue;}throw new Error(_0x5da898[_0x44e8a6(0xae)]||_0x5da898['error']||_0x3ad099['nSPqO']);}throw new Error('Device\x20authorization\x20timed\x20out');}async function fetchUserProfile(_0x191860){const _0x5478c8=_0x568548,_0x41e137={'gURrb':'GET'},_0x380236=getApiBaseUrl();try{const _0x5d9064=await fetch(_0x380236+'/organization/me',{'method':_0x41e137['gURrb'],'headers':{'workos-token':_0x191860}});if(_0x5d9064['ok'])return _0x5d9064[_0x5478c8(0xdd)]();}catch{}return null;}function buildKeyName(_0xda7a07,_0x1e6096){const _0x20c470=_0x568548,_0x563880=_0x1e6096['filter'](_0x441467=>_0x441467[_0x20c470(0xb1)]===_0xda7a07||_0x441467[_0x20c470(0xb1)]['startsWith'](_0xda7a07+'\x20('));if(_0x563880['length']===0x0)return _0xda7a07;return _0xda7a07+'\x20('+(_0x563880[_0x20c470(0xf4)]+0x1)+')';}export async function provisionApiKey(_0x472b25){const _0x4d7583=_0x568548,_0x3da8a0={'BJylm':function(_0x39cc58){return _0x39cc58();},'JONFu':'CLI\x20Key','SrdLZ':function(_0x26e73b,_0x34e0c9,_0x3b7076){return _0x26e73b(_0x34e0c9,_0x3b7076);},'Hsoaj':_0x4d7583(0xbf)},_0x48965b=_0x3da8a0[_0x4d7583(0xaf)](getApiBaseUrl),_0x2fdde6={'Content-Type':'application/json','workos-token':_0x472b25},_0xdfabfc=await fetchUserProfile(_0x472b25),_0x5ad52b=_0xdfabfc?.['firstName']||_0xdfabfc?.['email']?.['split']('@')[0x0],_0x30934f=_0x5ad52b?_0x5ad52b+_0x4d7583(0xb9):_0x3da8a0[_0x4d7583(0xb7)];let _0x5ee91e=[];try{const _0x3f4a77=await _0x3da8a0[_0x4d7583(0xd9)](fetch,_0x48965b+'/api-keys',{'method':'GET','headers':_0x2fdde6});if(_0x3f4a77['ok']){const _0x1e8ee8=await _0x3f4a77[_0x4d7583(0xdd)]();_0x5ee91e=_0x1e8ee8['apiKeys'];}}catch{}const _0x19173c=buildKeyName(_0x30934f,_0x5ee91e),_0x1daffc=await fetch(_0x48965b+_0x4d7583(0xe7),{'method':_0x4d7583(0xe4),'headers':_0x2fdde6,'body':JSON[_0x4d7583(0xf0)]({'name':_0x19173c,'scope':_0x3da8a0[_0x4d7583(0xee)]})});if(!_0x1daffc['ok']){const _0x25eaea=await _0x1daffc[_0x4d7583(0xe2)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x1daffc['status']+'\x20'+_0x25eaea);}const _0x51951b=await _0x1daffc['json']();return _0x51951b['apiKey'][_0x4d7583(0xfc)];}export function openBrowser(_0x2bcc45){const _0x14af6c=_0x568548,_0x50031a={'bkPdt':function(_0x57d7a8,_0x315d6b){return _0x57d7a8===_0x315d6b;},'vKTHV':'win32','nLHJj':'cmd','yLzqY':'start','IrwVJ':'ignore','iNYva':function(_0x585d01,_0x4e6dd5){return _0x585d01===_0x4e6dd5;},'fuaVU':'darwin','PvHLN':function(_0x25d39e,_0x23b930,_0x5e2ca8,_0x138222){return _0x25d39e(_0x23b930,_0x5e2ca8,_0x138222);}};try{if(_0x50031a['bkPdt'](process[_0x14af6c(0xb5)],_0x50031a[_0x14af6c(0xbe)])){const _0x5bdb50=spawn(_0x50031a['nLHJj'],['/c',_0x50031a[_0x14af6c(0xad)],'',_0x2bcc45],{'detached':!![],'stdio':_0x50031a['IrwVJ'],'windowsHide':!![]});_0x5bdb50['unref']();return;}const _0x335aa0=_0x50031a['iNYva'](process[_0x14af6c(0xb5)],_0x50031a['fuaVU'])?'open':_0x14af6c(0xdc),_0xc96e93=_0x50031a['PvHLN'](spawn,_0x335aa0,[_0x2bcc45],{'detached':!![],'stdio':_0x50031a['IrwVJ']});_0xc96e93[_0x14af6c(0xea)]();}catch{}}function _0x2e9d(_0x30d13f,_0x303fc6){_0x30d13f=_0x30d13f-0xad;const _0x3a6f00=_0x3a6f();let _0x2e9d97=_0x3a6f00[_0x30d13f];return _0x2e9d97;}function decodeJwtPayload(_0x3ffaad){const _0x2cdf19=_0x568548,_0x1d1649={'sfNCD':'Invalid\x20JWT\x20format'},_0xe63259=_0x3ffaad['split']('.');if(_0xe63259[_0x2cdf19(0xf4)]!==0x3)throw new Error(_0x1d1649[_0x2cdf19(0xfb)]);const _0x43848c=Buffer['from'](_0xe63259[0x1],_0x2cdf19(0xf5))['toString'](_0x2cdf19(0xcf));return JSON['parse'](_0x43848c);}async function selfServeSignup(_0x2e059a){const _0x1cba2e=_0x568548,_0x111d85={'JARca':function(_0x4ef805,_0x1d00c9,_0x5514ef){return _0x4ef805(_0x1d00c9,_0x5514ef);},'JTdOL':'application/json'},_0x27f4e5=getApiBaseUrl(),_0x2efd93=await _0x111d85['JARca'](fetch,_0x27f4e5+_0x1cba2e(0xe8),{'method':_0x1cba2e(0xe4),'headers':{'Content-Type':_0x111d85[_0x1cba2e(0xc2)],'workos-token':_0x2e059a}});if(!_0x2efd93['ok']){const _0x40ef2d=await _0x2efd93['text']();throw new Error(_0x1cba2e(0xcc)+_0x2efd93['status']+'\x20'+_0x40ef2d);}return _0x2efd93['json']();}async function fetchMyMemberships(_0x494a54){const _0x3a51d9=_0x568548,_0x52a144={'bPYlA':function(_0x1ff00c){return _0x1ff00c();},'UiJCC':function(_0x43d24d,_0x5d7246,_0x1f6ee5){return _0x43d24d(_0x5d7246,_0x1f6ee5);}},_0x1b1142=_0x52a144[_0x3a51d9(0xf3)](getApiBaseUrl),_0x5196a7=await _0x52a144['UiJCC'](fetch,_0x1b1142+'/organization/my-memberships',{'method':_0x3a51d9(0xc6),'headers':{'workos-token':_0x494a54}});if(!_0x5196a7['ok']){const _0x1ee5b6=await _0x5196a7['text']();throw new Error(_0x3a51d9(0xd6)+_0x5196a7[_0x3a51d9(0xf8)]+'\x20'+_0x1ee5b6);}const _0x5c484a=await _0x5196a7[_0x3a51d9(0xdd)]();return _0x5c484a[_0x3a51d9(0xb6)];}async function refreshTokenWithOrg(_0x136047,_0x236977,_0x558106){const _0x448842=_0x568548,_0xa01bc5={'bVawm':function(_0x26a063,_0x2532de,_0x4a6f1d){return _0x26a063(_0x2532de,_0x4a6f1d);},'BgUOm':'POST'},_0x539641=await _0xa01bc5['bVawm'](fetch,WORKOS_TOKEN_URL,{'method':_0xa01bc5['BgUOm'],'headers':{'Content-Type':_0x448842(0xff)},'body':new URLSearchParams({'client_id':_0x136047,'grant_type':_0x448842(0xba),'refresh_token':_0x236977,'organization_id':_0x558106})});if(!_0x539641['ok']){const _0x395d1d=await _0x539641[_0x448842(0xe2)]();throw new Error(_0x448842(0xda)+_0x539641['status']+'\x20'+_0x395d1d);}return _0x539641[_0x448842(0xdd)]();}async function provisionCliToken(_0x41e278){const _0x5936b6=_0x568548,_0x484363={'JyqXW':'application/json'},_0x1ec298=getApiBaseUrl(),_0x4b18e1=await fetch(_0x1ec298+_0x5936b6(0xed),{'method':'POST','headers':{'Content-Type':_0x484363[_0x5936b6(0xf7)],'workos-token':_0x41e278}});if(!_0x4b18e1['ok']){const _0x47f293=await _0x4b18e1['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x4b18e1[_0x5936b6(0xf8)]+'\x20'+_0x47f293);}return _0x4b18e1['json']();}export async function runDeviceAuthFlow(){const _0x47a0d6=_0x568548,_0x1e5204={'ZXoZN':_0x47a0d6(0xd7),'YYOek':function(_0xebc354,_0x587058){return _0xebc354(_0x587058);},'HLyPa':'Waiting\x20for\x20authentication...','wiSWk':function(_0x11d993,_0x231ac0,_0x3253c6,_0x14f1a5,_0x48d73f){return _0x11d993(_0x231ac0,_0x3253c6,_0x14f1a5,_0x48d73f);},'aJudY':function(_0x42119f,_0x518f28){return _0x42119f===_0x518f28;},'bWHRS':_0x47a0d6(0xfd),'LITcY':_0x47a0d6(0xd5),'lsmQa':_0x47a0d6(0xdb),'sgBsv':function(_0x469c86,_0x490027){return _0x469c86(_0x490027);}},_0x172a11=getCurrentEnvironment(),_0x3fa1ec=ENVIRONMENT_CONFIGS[_0x172a11][_0x47a0d6(0xd4)],_0x7584d3=await requestDeviceCode(_0x3fa1ec);console[_0x47a0d6(0xf1)](_0x1e5204[_0x47a0d6(0xc5)]),console['log'](_0x47a0d6(0xd8)),_0x1e5204['YYOek'](openBrowser,_0x7584d3[_0x47a0d6(0xe3)]),console[_0x47a0d6(0xf1)](_0x47a0d6(0xc3)+_0x7584d3[_0x47a0d6(0xe3)]),console['log'](_0x47a0d6(0xde)+_0x7584d3['user_code']+'\x0a'),process['stdout'][_0x47a0d6(0xbd)](_0x1e5204['HLyPa']);let _0x3a48df=await _0x1e5204['wiSWk'](pollForTokens,_0x3fa1ec,_0x7584d3['device_code'],_0x7584d3['interval'],_0x7584d3[_0x47a0d6(0xc4)]);console[_0x47a0d6(0xf1)]('\x20✓');const _0x11e182=_0x1e5204[_0x47a0d6(0xfe)](decodeJwtPayload,_0x3a48df[_0x47a0d6(0xe0)]);if(!_0x11e182['org_id']){const _0x56b12b=await fetchMyMemberships(_0x3a48df['access_token']);let _0x29833a;if(_0x56b12b[_0x47a0d6(0xf4)]===0x0){process['stdout'][_0x47a0d6(0xbd)](_0x47a0d6(0xe5));const _0x25f656=await _0x1e5204['YYOek'](selfServeSignup,_0x3a48df['access_token']);_0x29833a=_0x25f656['organizationId'],console[_0x47a0d6(0xf1)]('\x20✓');}else{if(_0x1e5204[_0x47a0d6(0xcd)](_0x56b12b['length'],0x1))_0x29833a=_0x56b12b[0x0][_0x47a0d6(0xd3)],console[_0x47a0d6(0xf1)](_0x47a0d6(0xb8)+_0x56b12b[0x0]['name']);else{const _0x387c43=process[_0x47a0d6(0xd2)]['isTTY']&&process['stdout']['isTTY'];if(!_0x387c43)throw new Error(_0x47a0d6(0xdf)+_0x1e5204['bWHRS']);const {selected:_0x587e99}=await _0x53bce5[_0x47a0d6(0xb3)]([{'type':_0x1e5204['LITcY'],'name':_0x47a0d6(0xbb),'message':_0x1e5204[_0x47a0d6(0xeb)],'choices':_0x56b12b['map'](_0x215fe2=>({'name':_0x215fe2[_0x47a0d6(0xb1)],'value':_0x215fe2['organizationId']}))}]);_0x29833a=_0x587e99;}}_0x3a48df=await refreshTokenWithOrg(_0x3fa1ec,_0x3a48df[_0x47a0d6(0xba)],_0x29833a);}process['stdout'][_0x47a0d6(0xbd)](_0x47a0d6(0xf9));const _0x3dd610=await _0x1e5204[_0x47a0d6(0xfe)](provisionCliToken,_0x3a48df[_0x47a0d6(0xe0)]);return console['log']('\x20✓'),await storeToken(_0x3dd610['token']),_0x3a48df['refresh_token']&&await _0x1e5204['sgBsv'](storeRefreshToken,_0x3a48df['refresh_token']),_0x3dd610[_0x47a0d6(0xfc)];}function sleep(_0x3561fd){return new Promise(_0x236a08=>setTimeout(_0x236a08,_0x3561fd));}
@@ -1 +1 @@
1
- const _0x149f20=_0x3c80;(function(_0x2ffd18,_0x4a8a49){const _0x4876b4=_0x3c80,_0x412df0=_0x2ffd18();while(!![]){try{const _0x5c4851=parseInt(_0x4876b4(0x1f9))/0x1*(parseInt(_0x4876b4(0x1ed))/0x2)+-parseInt(_0x4876b4(0x203))/0x3+parseInt(_0x4876b4(0x1fd))/0x4+-parseInt(_0x4876b4(0x1f1))/0x5+-parseInt(_0x4876b4(0x206))/0x6+parseInt(_0x4876b4(0x20b))/0x7*(-parseInt(_0x4876b4(0x1fc))/0x8)+parseInt(_0x4876b4(0x1fe))/0x9;if(_0x5c4851===_0x4a8a49)break;else _0x412df0['push'](_0x412df0['shift']());}catch(_0x41580a){_0x412df0['push'](_0x412df0['shift']());}}}(_0x2a32,0x9b035));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x149f20(0x20f),'aiProxyUrl':_0x149f20(0x1fb),'mcpAuthUrl':_0x149f20(0x1f0)},'staging':{'apiBaseUrl':_0x149f20(0x207),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'https://ai-proxy-301751771437.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':_0x149f20(0x1fa),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'http://localhost:8090','mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT=_0x149f20(0x1f8);function _0x3c80(_0x16b08b,_0x4b6137){_0x16b08b=_0x16b08b-0x1eb;const _0x2a32cf=_0x2a32();let _0x3c8014=_0x2a32cf[_0x16b08b];return _0x3c8014;}export function isValidEnvironment(_0x375bc3){const _0x6eee82=_0x149f20,_0x37c065={'QiLrX':function(_0x177a36,_0xe7c44b){return _0x177a36===_0xe7c44b;}};return _0x37c065['QiLrX'](_0x375bc3,_0x6eee82(0x1f8))||_0x375bc3==='staging'||_0x375bc3==='local';}function _0x2a32(){const _0x3141dd=['RANGER_HOOKS','auto','1388370naBZwC','https://api.staging.ranger.net','toLowerCase','true','error','7177086wnvVbk','off','RANGER_TRANSPORT','qJumR','client_01J9CBYM7M5ZETCF7G6614DXR2','nova-act-cli','tomtb','mcpAuthUrl','RANGER_USE_NOVA_ACT','env','mcp','find','trim','16034ajpwML','RANGER_BYOK','prNmb','https://mcp-auth.ranger.net/mcp','2439585xZHHou','Invalid\x20RANGER_TRANSPORT=\x22','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.','YUucY','SuHMT','CHxfp','RANGER_CLI_ENV','prod','101QwAimk','http://localhost:8080','https://ai-proxy-716115358910.us-central1.run.app','8axsazz','339984kTazeG','21627153texzQy','FhMYU','uNBAo','rangerwright-cli','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','2754561mrhhpu'];_0x2a32=function(){return _0x3141dd;};return _0x2a32();}export function getCurrentEnvironment(){const _0x4081ba=_0x149f20,_0x4ee5a0={'tomtb':function(_0x59ff59,_0x435323){return _0x59ff59(_0x435323);}},_0x3fa713=process['env'][_0x4081ba(0x1f7)];if(_0x3fa713&&_0x4ee5a0[_0x4081ba(0x211)](isValidEnvironment,_0x3fa713))return _0x3fa713;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x209087=_0x149f20,_0x17509a={'SuHMT':function(_0x57d6d8){return _0x57d6d8();}};return ENVIRONMENT_CONFIGS[_0x17509a[_0x209087(0x1f5)](getCurrentEnvironment)]['apiBaseUrl'];}export function getAiProxyUrl(){const _0x549a27=_0x149f20,_0xeab312={'uNBAo':function(_0x1bcf63){return _0x1bcf63();}};return ENVIRONMENT_CONFIGS[_0xeab312[_0x549a27(0x200)](getCurrentEnvironment)]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x574300=_0x149f20,_0x4af78e={'CHxfp':function(_0x4c95a3){return _0x4c95a3();}};return process['env']['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[_0x4af78e[_0x574300(0x1f6)](getCurrentEnvironment)][_0x574300(0x212)];}export function isByokEnabled(){const _0x10a156=_0x149f20;return process['env'][_0x10a156(0x1ee)]===_0x10a156(0x209);}function isVerificationTransport(_0x49b444){const _0x1277cd=_0x149f20,_0x583077={'YUucY':function(_0x19a453,_0x31d0b1){return _0x19a453===_0x31d0b1;},'RZOph':function(_0x29f333,_0x115d61){return _0x29f333===_0x115d61;},'sGhgk':'playwright-cli','FhMYU':_0x1277cd(0x210)};return _0x583077['YUucY'](_0x49b444,_0x1277cd(0x215))||_0x583077['RZOph'](_0x49b444,_0x583077['sGhgk'])||_0x49b444===_0x583077[_0x1277cd(0x1ff)]||_0x583077[_0x1277cd(0x1f4)](_0x49b444,_0x1277cd(0x201));}const LEGACY_TRANSPORT_ENV_VARS=[_0x149f20(0x213),'RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x1965e1=_0x149f20,_0x4f68a9={'prNmb':function(_0x185981,_0x2e897a){return _0x185981(_0x2e897a);}},_0x3c5208=process['env'][_0x1965e1(0x20d)]?.['trim']();if(_0x3c5208){if(_0x4f68a9[_0x1965e1(0x1ef)](isVerificationTransport,_0x3c5208))return _0x3c5208;throw new Error(_0x1965e1(0x1f2)+_0x3c5208+_0x1965e1(0x202));}const _0x108d40=LEGACY_TRANSPORT_ENV_VARS[_0x1965e1(0x1eb)](_0x1de27c=>process['env'][_0x1de27c]);if(_0x108d40)throw new Error(_0x108d40+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return _0x1965e1(0x215);}export function resolveHookMode(_0xdcfde2=process[_0x149f20(0x214)]){const _0x2f68ab=_0x149f20,_0x52871d={'qJumR':function(_0xdf97e3,_0x5e2107){return _0xdf97e3===_0x5e2107;},'odgTE':function(_0x1f12a2,_0x4dc53d){return _0x1f12a2===_0x4dc53d;},'nyIcS':'auto'},_0x5c5900=_0xdcfde2['RANGER_HOOKS']?.[_0x2f68ab(0x1ec)]()[_0x2f68ab(0x208)]();if(!_0x5c5900)return _0x2f68ab(0x205);if(_0x52871d[_0x2f68ab(0x20e)](_0x5c5900,_0x2f68ab(0x20c))||_0x52871d['odgTE'](_0x5c5900,'on')||_0x5c5900===_0x2f68ab(0x205))return _0x5c5900;return console[_0x2f68ab(0x20a)]('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0xdcfde2[_0x2f68ab(0x204)]+'\x22.\x20'+_0x2f68ab(0x1f3)),_0x52871d['nyIcS'];}
1
+ const _0x22c7d7=_0x25d5;(function(_0xf18dec,_0x529e1c){const _0x1a488d=_0x25d5,_0x784126=_0xf18dec();while(!![]){try{const _0x11ef7c=-parseInt(_0x1a488d(0x174))/0x1*(-parseInt(_0x1a488d(0x17b))/0x2)+-parseInt(_0x1a488d(0x162))/0x3+parseInt(_0x1a488d(0x167))/0x4*(parseInt(_0x1a488d(0x16f))/0x5)+-parseInt(_0x1a488d(0x16c))/0x6+parseInt(_0x1a488d(0x18f))/0x7+-parseInt(_0x1a488d(0x17d))/0x8+-parseInt(_0x1a488d(0x182))/0x9*(-parseInt(_0x1a488d(0x186))/0xa);if(_0x11ef7c===_0x529e1c)break;else _0x784126['push'](_0x784126['shift']());}catch(_0x59ee08){_0x784126['push'](_0x784126['shift']());}}}(_0x118b,0xd04c7));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x22c7d7(0x16a),'workosClientId':'client_01J9CBYM7M5ZETCF7G6614DXR2','aiProxyUrl':_0x22c7d7(0x16e),'mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':_0x22c7d7(0x178),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x22c7d7(0x189),'mcpAuthUrl':_0x22c7d7(0x168)},'local':{'apiBaseUrl':_0x22c7d7(0x172),'workosClientId':_0x22c7d7(0x170),'aiProxyUrl':_0x22c7d7(0x18e),'mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x2cb43c){const _0x367bc3=_0x22c7d7,_0x5ad864={'TcsTi':'prod'};return _0x2cb43c===_0x5ad864[_0x367bc3(0x183)]||_0x2cb43c==='staging'||_0x2cb43c===_0x367bc3(0x181);}export function getCurrentEnvironment(){const _0x3b2949=_0x22c7d7,_0x50df07=process['env'][_0x3b2949(0x177)];if(_0x50df07&&isValidEnvironment(_0x50df07))return _0x50df07;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x4970ce=_0x22c7d7,_0x2769d2={'uJXXf':function(_0x5df009){return _0x5df009();}};return ENVIRONMENT_CONFIGS[_0x2769d2[_0x4970ce(0x17e)](getCurrentEnvironment)][_0x4970ce(0x165)];}function _0x118b(){const _0x404a56=['https://api.staging.ranger.net','vnHur','find','453718NtLWWA','bTUeJ','612504OCBtKi','uJXXf','fXaCE','trim','local','9LOIMHz','TcsTi','LbVLs','true','1028870rGrvgn','RANGER_DISABLE_MCP','PQpfE','https://ai-proxy-301751771437.us-central1.run.app','toLowerCase','\x22.\x20','env','Invalid\x20RANGER_TRANSPORT=\x22','http://localhost:8090','2830856nNXhot','mcpAuthUrl','RANGER_MCP_AUTH_URL','4588620hWuSmO','YKKYb','nova-act-cli','apiBaseUrl','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.','96BpZYxG','https://mcp-auth.staging.ranger.net/mcp','mcp','https://api.ranger.net','RANGER_HOOKS','6714420pdDDvP','off','https://ai-proxy-716115358910.us-central1.run.app','308970LDvnAL','client_01J9CBYM2DKWV9HM17D95Z540K','playwright-cli','http://localhost:8080','TjFzW','7YuExQd','FtvXC','auto','RANGER_CLI_ENV'];_0x118b=function(){return _0x404a56;};return _0x118b();}export function getAiProxyUrl(){const _0x4523a4=_0x22c7d7,_0x5a9868={'FtvXC':function(_0x6bd27){return _0x6bd27();}};return ENVIRONMENT_CONFIGS[_0x5a9868[_0x4523a4(0x175)](getCurrentEnvironment)]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x1c14df=_0x22c7d7;return process['env'][_0x1c14df(0x161)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x1c14df(0x160)];}export function isByokEnabled(){const _0x57fc96=_0x22c7d7,_0x1c58d9={'vnHur':function(_0x18c076,_0xa8fecf){return _0x18c076===_0xa8fecf;},'KNbLr':_0x57fc96(0x185)};return _0x1c58d9[_0x57fc96(0x179)](process['env']['RANGER_BYOK'],_0x1c58d9['KNbLr']);}function isVerificationTransport(_0x43ff05){const _0x563374=_0x22c7d7,_0xf6c76={'bTUeJ':_0x563374(0x169),'LbVLs':function(_0x3770ae,_0xa90952){return _0x3770ae===_0xa90952;},'TjFzW':function(_0x427a1d,_0x2e95c4){return _0x427a1d===_0x2e95c4;},'fXaCE':'rangerwright-cli'};return _0x43ff05===_0xf6c76[_0x563374(0x17c)]||_0xf6c76[_0x563374(0x184)](_0x43ff05,_0x563374(0x171))||_0xf6c76['TjFzW'](_0x43ff05,_0x563374(0x164))||_0xf6c76[_0x563374(0x173)](_0x43ff05,_0xf6c76[_0x563374(0x17f)]);}const LEGACY_TRANSPORT_ENV_VARS=['RANGER_USE_NOVA_ACT',_0x22c7d7(0x187)];export function getVerificationTransport(){const _0x2945ad=_0x22c7d7,_0x2a798a=process['env']['RANGER_TRANSPORT']?.['trim']();if(_0x2a798a){if(isVerificationTransport(_0x2a798a))return _0x2a798a;throw new Error(_0x2945ad(0x18d)+_0x2a798a+'\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.');}const _0x49c84e=LEGACY_TRANSPORT_ENV_VARS[_0x2945ad(0x17a)](_0x1ad2fb=>process[_0x2945ad(0x18c)][_0x1ad2fb]);if(_0x49c84e)throw new Error(_0x49c84e+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return _0x2945ad(0x169);}function _0x25d5(_0x1e3c97,_0x177467){_0x1e3c97=_0x1e3c97-0x160;const _0x118bbc=_0x118b();let _0x25d504=_0x118bbc[_0x1e3c97];return _0x25d504;}export function resolveHookMode(_0x7bfe4b=process['env']){const _0x53a027=_0x22c7d7,_0x15107c={'YKKYb':function(_0x4e54eb,_0x1e9b17){return _0x4e54eb===_0x1e9b17;},'TFqXa':_0x53a027(0x176),'PQpfE':function(_0x50ce62,_0x41910a){return _0x50ce62+_0x41910a;}},_0x24fa15=_0x7bfe4b[_0x53a027(0x16b)]?.[_0x53a027(0x180)]()[_0x53a027(0x18a)]();if(!_0x24fa15)return _0x53a027(0x176);if(_0x15107c[_0x53a027(0x163)](_0x24fa15,_0x53a027(0x16d))||_0x15107c['YKKYb'](_0x24fa15,'on')||_0x24fa15===_0x15107c['TFqXa'])return _0x24fa15;return console['error'](_0x15107c[_0x53a027(0x188)]('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x7bfe4b['RANGER_HOOKS']+_0x53a027(0x18b),_0x53a027(0x166))),'auto';}
@@ -1 +1 @@
1
- (function(_0x375294,_0x1f3110){const _0x4ad900=_0x1c0d,_0x487eda=_0x375294();while(!![]){try{const _0x587386=-parseInt(_0x4ad900(0x92))/0x1*(-parseInt(_0x4ad900(0xa7))/0x2)+-parseInt(_0x4ad900(0xb0))/0x3*(parseInt(_0x4ad900(0xa1))/0x4)+parseInt(_0x4ad900(0x97))/0x5+parseInt(_0x4ad900(0x91))/0x6*(-parseInt(_0x4ad900(0xb5))/0x7)+parseInt(_0x4ad900(0xb9))/0x8*(parseInt(_0x4ad900(0x90))/0x9)+parseInt(_0x4ad900(0x7d))/0xa+-parseInt(_0x4ad900(0x99))/0xb*(parseInt(_0x4ad900(0xbb))/0xc);if(_0x587386===_0x1f3110)break;else _0x487eda['push'](_0x487eda['shift']());}catch(_0xc639db){_0x487eda['push'](_0x487eda['shift']());}}}(_0x5c1b,0xc9ed5));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x508ee4){const _0x1b13e0=_0x1c0d,_0x525a2f={'Lpbjk':function(_0x126d7d,_0x7779fb,_0x4b2964){return _0x126d7d(_0x7779fb,_0x4b2964);},'cYAOT':_0x1b13e0(0x95),'TmYRy':function(_0x1fb230,_0x457682){return _0x1fb230===_0x457682;},'gsFUv':'https://dashboard.ranger.net/billing','gYOlh':'Feature\x20limit\x20exceeded'},_0x332330=await getToken();if(!_0x332330)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x333e3d=getApiBaseUrl(),_0x1de012=await _0x525a2f[_0x1b13e0(0x8f)](fetch,_0x333e3d+_0x1b13e0(0x81),{'method':'POST','headers':{'Authorization':_0x1b13e0(0x80)+_0x332330,'Content-Type':_0x525a2f['cYAOT']},'body':JSON[_0x1b13e0(0x94)](_0x508ee4)});if(!_0x1de012['ok']){if(_0x525a2f[_0x1b13e0(0x7a)](_0x1de012[_0x1b13e0(0xa9)],0x192)){const _0x5ba83f=await _0x1de012['json'](),_0x22a484=_0x5ba83f['billingUrl']||_0x525a2f[_0x1b13e0(0x8b)];throw new Error((_0x5ba83f[_0x1b13e0(0xa3)]||_0x525a2f['gYOlh'])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x22a484);}const _0x43a6b5=await _0x1de012[_0x1b13e0(0xae)]();throw new Error(_0x1b13e0(0xa4)+_0x43a6b5);}return _0x1de012[_0x1b13e0(0x82)]();}export async function listFeatures(_0x452aad){const _0x26a6a3=_0x1c0d,_0x4b698b={'eTEtb':_0x26a6a3(0xa8),'QDusK':function(_0xed8c7f){return _0xed8c7f();},'QPfCg':'true','UPFXo':function(_0x271d29,_0x124eb0,_0x334294){return _0x271d29(_0x124eb0,_0x334294);},'QvnOq':_0x26a6a3(0xad)},_0x6775ba=await getToken();if(!_0x6775ba)throw new Error(_0x4b698b['eTEtb']);const _0x87db8a=_0x4b698b['QDusK'](getApiBaseUrl),_0x2d3feb=new URLSearchParams();if(_0x452aad?.[_0x26a6a3(0x87)])_0x2d3feb[_0x26a6a3(0x85)](_0x26a6a3(0x87),_0x452aad['gitRepoUrl']);if(_0x452aad?.['gitBranch'])_0x2d3feb[_0x26a6a3(0x85)](_0x26a6a3(0x86),_0x452aad['gitBranch']);if(_0x452aad?.['limit'])_0x2d3feb['set']('limit',_0x452aad['limit']['toString']());if(_0x452aad?.['offset'])_0x2d3feb['set'](_0x26a6a3(0xb1),_0x452aad['offset']['toString']());if(_0x452aad?.[_0x26a6a3(0x9f)])_0x2d3feb[_0x26a6a3(0x85)](_0x26a6a3(0x9f),_0x4b698b['QPfCg']);const _0x3fb842=_0x87db8a+_0x26a6a3(0x81)+(_0x2d3feb[_0x26a6a3(0x7e)]()?'?'+_0x2d3feb[_0x26a6a3(0x7e)]():''),_0x41a271=await _0x4b698b['UPFXo'](fetch,_0x3fb842,{'method':_0x4b698b[_0x26a6a3(0xba)],'headers':{'Authorization':'Bearer\x20'+_0x6775ba}});if(!_0x41a271['ok']){const _0x25514b=await _0x41a271[_0x26a6a3(0xae)]();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x25514b);}return _0x41a271['json']();}export async function getFeature(_0x2b61f2){const _0x12e4e7=_0x1c0d,_0x28eb97={'PDYnT':_0x12e4e7(0xad)},_0x14c413=await getToken();if(!_0x14c413)throw new Error(_0x12e4e7(0xa8));const _0x234716=getApiBaseUrl(),_0x1ed124=await fetch(_0x234716+_0x12e4e7(0xb3)+_0x2b61f2,{'method':_0x28eb97[_0x12e4e7(0x9d)],'headers':{'Authorization':'Bearer\x20'+_0x14c413}});if(!_0x1ed124['ok']){const _0x593c92=await _0x1ed124['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x593c92);}return _0x1ed124['json']();}export async function updateFeature(_0x1f9615,_0x118a81){const _0x5b41e1=_0x1c0d,_0xea24ba={'btftt':'PATCH'},_0x3ca663=await getToken();if(!_0x3ca663)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x7f54f2=getApiBaseUrl(),_0x4f257f=await fetch(_0x7f54f2+_0x5b41e1(0xb3)+_0x1f9615,{'method':_0xea24ba[_0x5b41e1(0xb4)],'headers':{'Authorization':_0x5b41e1(0x80)+_0x3ca663,'Content-Type':_0x5b41e1(0x95)},'body':JSON['stringify'](_0x118a81)});if(!_0x4f257f['ok']){const _0x2a9d2c=await _0x4f257f['text']();throw new Error(_0x5b41e1(0xaf)+_0x2a9d2c);}return _0x4f257f[_0x5b41e1(0x82)]();}export async function createChecklistItem(_0x87faa1,_0x5be8d8,_0x1d0db6){const _0x534c36=_0x1c0d,_0x1fdc90={'GhYnn':function(_0x40ba2f,_0x2c572e,_0x163caf){return _0x40ba2f(_0x2c572e,_0x163caf);},'HAGCi':'POST'},_0x40b82b=await getToken();if(!_0x40b82b)throw new Error(_0x534c36(0xa8));const _0x21fef8=getApiBaseUrl(),_0x51156a=await _0x1fdc90['GhYnn'](fetch,_0x21fef8+_0x534c36(0xb3)+_0x87faa1+_0x534c36(0xaa),{'method':_0x1fdc90['HAGCi'],'headers':{'Authorization':'Bearer\x20'+_0x40b82b,'Content-Type':_0x534c36(0x95)},'body':JSON[_0x534c36(0x94)]({'description':_0x5be8d8,'position':_0x1d0db6})});if(!_0x51156a['ok']){const _0x15db20=await _0x51156a['text']();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x15db20);}return _0x51156a[_0x534c36(0x82)]();}function _0x5c1b(){const _0x4b50b3=['json','sessionId','ClCjv','set','gitBranch','gitRepoUrl','length','VCeNl','/checklist/','gsFUv','bisNZ','InbgT','kYxmw','Lpbjk','140607pbnMWJ','6vAEJOt','8ptSbUP','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','stringify','application/json','rnxCW','4093170qslfmZ','Failed\x20to\x20update\x20scenario:\x20','3965071bKQyjo','RKpwK','Ydzvg','uoDrN','PDYnT','jQXEf','includeDeleted','zOEdm','4798264wPhmNl','DELETE','message','Failed\x20to\x20create\x20feature\x20review:\x20','Failed\x20to\x20list\x20sessions:\x20','Failed\x20to\x20get\x20action\x20items:\x20','34124ytdMCJ','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','status','/checklist','QjIvQ','POST','GET','text','Failed\x20to\x20update\x20feature\x20review:\x20','3udORdD','offset','/report','/api/v1/mcp/features/','btftt','9613219iszkpz','itemIds','ClqzX','/sessions/','648gLIKUp','QvnOq','12YXJnYp','DFphs','/sessions','TmYRy','EhqYp','/start','15398440mXfSsT','toString','/conclude','Bearer\x20','/api/v1/mcp/features'];_0x5c1b=function(){return _0x4b50b3;};return _0x5c1b();}export async function updateChecklistItem(_0x3fed5f,_0x3f83f4,_0x340a71){const _0x2d04e7=_0x1c0d,_0x362e96={'Ydzvg':function(_0xd3c350){return _0xd3c350();},'jQXEf':function(_0x5a6199,_0x9499f9,_0x5b4749){return _0x5a6199(_0x9499f9,_0x5b4749);},'oZvDj':'PATCH','RKpwK':_0x2d04e7(0x95),'AEJdw':'updateChecklistItem'};return withRetry(async()=>{const _0x45d750=_0x2d04e7,_0x36fe76=await _0x362e96[_0x45d750(0x9b)](getToken);if(!_0x36fe76)throw new Error(_0x45d750(0xa8));const _0x503887=_0x362e96['Ydzvg'](getApiBaseUrl),_0x2b5fb6=await _0x362e96[_0x45d750(0x9e)](fetch,_0x503887+'/api/v1/mcp/features/'+_0x3fed5f+_0x45d750(0x8a)+_0x3f83f4,{'method':_0x362e96['oZvDj'],'headers':{'Authorization':'Bearer\x20'+_0x36fe76,'Content-Type':_0x362e96[_0x45d750(0x9a)]},'body':JSON['stringify'](_0x340a71)});if(!_0x2b5fb6['ok']){const _0x3a957a=await _0x2b5fb6['text']();throw new Error(_0x45d750(0x98)+_0x3a957a);}return _0x2b5fb6['json']();},{'label':_0x362e96['AEJdw']});}export async function getFeatureReport(_0x4ea801){const _0x2e226c=_0x1c0d,_0x3aed19={'jGbUG':function(_0x4a7760){return _0x4a7760();},'ocfyk':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','LKDpH':function(_0x2f4a59,_0x310a2a,_0x59d2b8){return _0x2f4a59(_0x310a2a,_0x59d2b8);}},_0x177ca1=await _0x3aed19['jGbUG'](getToken);if(!_0x177ca1)throw new Error(_0x3aed19['ocfyk']);const _0x3eec58=getApiBaseUrl(),_0x21afad=await _0x3aed19['LKDpH'](fetch,_0x3eec58+'/api/v1/mcp/features/'+_0x4ea801+_0x2e226c(0xb2),{'method':_0x2e226c(0xad),'headers':{'Authorization':'Bearer\x20'+_0x177ca1}});if(!_0x21afad['ok']){const _0x2a7bff=await _0x21afad['text']();throw new Error(_0x2e226c(0x93)+_0x2a7bff);}return _0x21afad[_0x2e226c(0x82)]();}export async function getFeatureReportMarkdown(_0x3a2d33,_0x454a2b){const _0x229388=_0x1c0d,_0x3f9ebf={'bisNZ':function(_0x297dfa,_0x179dc3){return _0x297dfa>_0x179dc3;},'dPdww':'sessionId','DFphs':function(_0x3077ad,_0x24fc8e){return _0x3077ad&&_0x24fc8e;},'kYxmw':function(_0x2a520d,_0x17902d,_0x2a6e35){return _0x2a520d(_0x17902d,_0x2a6e35);},'ClCjv':'GET'},_0x4fe327=await getToken();if(!_0x4fe327)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3c4460=getApiBaseUrl(),_0x539f4d=new URLSearchParams(),_0x275200=_0x3f9ebf[_0x229388(0x8c)](_0x454a2b?.[_0x229388(0xb6)]?.[_0x229388(0x88)]??0x0,0x0),_0x21ee19=Boolean(_0x454a2b?.['sessionId']);_0x275200&&_0x454a2b?.['itemIds']&&_0x539f4d['set'](_0x229388(0xb6),_0x454a2b[_0x229388(0xb6)]['join'](','));_0x21ee19&&_0x454a2b?.[_0x229388(0x83)]&&_0x539f4d['set'](_0x3f9ebf['dPdww'],_0x454a2b[_0x229388(0x83)]);_0x3f9ebf[_0x229388(0x78)](!_0x275200,!_0x21ee19)&&_0x454a2b?.['style']&&_0x539f4d[_0x229388(0x85)]('style',_0x454a2b['style']);const _0xcb5ee6=_0x3c4460+_0x229388(0xb3)+_0x3a2d33+'/report/markdown',_0x5b4bcc=''+_0xcb5ee6+(_0x539f4d['toString']()?'?'+_0x539f4d['toString']():''),_0x1ab783=await _0x3f9ebf[_0x229388(0x8e)](fetch,_0x5b4bcc,{'method':_0x3f9ebf[_0x229388(0x84)],'headers':{'Authorization':_0x229388(0x80)+_0x4fe327}});if(!_0x1ab783['ok']){const _0x5b7d67=await _0x1ab783['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x5b7d67);}return _0x1ab783[_0x229388(0xae)]();}export async function listFeatureSessions(_0xc2d989){const _0xe7cdfc=_0x1c0d,_0x3fc5d5={'WipJM':function(_0x5eb34b){return _0x5eb34b();},'eXvMj':_0xe7cdfc(0xad)},_0x4c8868=await _0x3fc5d5['WipJM'](getToken);if(!_0x4c8868)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3df86a=getApiBaseUrl(),_0x2e0be4=await fetch(_0x3df86a+'/api/v1/mcp/features/'+_0xc2d989+_0xe7cdfc(0x79),{'method':_0x3fc5d5['eXvMj'],'headers':{'Authorization':_0xe7cdfc(0x80)+_0x4c8868}});if(!_0x2e0be4['ok']){const _0x5ed54f=await _0x2e0be4['text']();throw new Error(_0xe7cdfc(0xa5)+_0x5ed54f);}return _0x2e0be4[_0xe7cdfc(0x82)]();}export async function startSession(_0x38b21e,_0x834b54){const _0x52f538=_0x1c0d,_0x39873d={'rnxCW':function(_0x7da9e5,_0x1ce2f0,_0x4723b1){return _0x7da9e5(_0x1ce2f0,_0x4723b1);}},_0x54a26e=await getToken();if(!_0x54a26e)throw new Error(_0x52f538(0xa8));const _0x3dd591=getApiBaseUrl(),_0x379b1a=await _0x39873d[_0x52f538(0x96)](fetch,_0x3dd591+'/api/v1/mcp/features/'+_0x38b21e+'/sessions/'+_0x834b54+_0x52f538(0x7c),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x54a26e}});if(!_0x379b1a['ok']){const _0x46de10=await _0x379b1a[_0x52f538(0xae)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x46de10);}return _0x379b1a['json']();}export async function concludeSession(_0x291888,_0x44edb0){const _0x17028e=_0x1c0d,_0x34ec49={'InbgT':function(_0x1eb07d){return _0x1eb07d();},'DZOwd':function(_0x10ba9b,_0x51b32d,_0x2255ca){return _0x10ba9b(_0x51b32d,_0x2255ca);},'pECsw':_0x17028e(0xac)},_0x49d0dc=await _0x34ec49['InbgT'](getToken);if(!_0x49d0dc)throw new Error(_0x17028e(0xa8));const _0x380cfa=_0x34ec49[_0x17028e(0x8d)](getApiBaseUrl),_0x289a8a=await _0x34ec49['DZOwd'](fetch,_0x380cfa+'/api/v1/mcp/features/'+_0x291888+_0x17028e(0xb8)+_0x44edb0+_0x17028e(0x7f),{'method':_0x34ec49['pECsw'],'headers':{'Authorization':'Bearer\x20'+_0x49d0dc}});if(!_0x289a8a['ok']){const _0x4b46f2=await _0x289a8a['text']();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x4b46f2);}return _0x289a8a['json']();}export async function getActionItems(_0x513e68){const _0x142677=_0x1c0d,_0x116454={'jhkah':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','EHHgf':function(_0x2f5288,_0x5dc1fb,_0x4fca0){return _0x2f5288(_0x5dc1fb,_0x4fca0);}},_0x53bd6f=await getToken();if(!_0x53bd6f)throw new Error(_0x116454['jhkah']);const _0x2a6019=getApiBaseUrl(),_0x2dd0e4=await _0x116454['EHHgf'](fetch,_0x2a6019+_0x142677(0xb3)+_0x513e68+'/action-items',{'method':_0x142677(0xad),'headers':{'Authorization':'Bearer\x20'+_0x53bd6f}});if(!_0x2dd0e4['ok']){const _0x476ff7=await _0x2dd0e4[_0x142677(0xae)]();throw new Error(_0x142677(0xa6)+_0x476ff7);}return _0x2dd0e4[_0x142677(0x82)]();}export async function getItemFeedback(_0x4e37b9,_0x48fdea){const _0x93de24=_0x1c0d,_0x5dcab2={'QjIvQ':function(_0x310ced){return _0x310ced();},'zlmuH':function(_0x1cf20b,_0x58a544,_0xebc4ee){return _0x1cf20b(_0x58a544,_0xebc4ee);}},_0x107152=await _0x5dcab2[_0x93de24(0xab)](getToken);if(!_0x107152)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1cf0a3=_0x5dcab2['QjIvQ'](getApiBaseUrl),_0xc60f5d=await _0x5dcab2['zlmuH'](fetch,_0x1cf0a3+_0x93de24(0xb3)+_0x4e37b9+'/checklist-items/'+_0x48fdea+'/feedback',{'method':_0x93de24(0xad),'headers':{'Authorization':'Bearer\x20'+_0x107152}});if(!_0xc60f5d['ok']){const _0x2701c7=await _0xc60f5d[_0x93de24(0xae)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x2701c7);}return _0xc60f5d[_0x93de24(0x82)]();}function _0x1c0d(_0x36eeaa,_0x3cece6){_0x36eeaa=_0x36eeaa-0x78;const _0x5c1bdc=_0x5c1b();let _0x1c0d59=_0x5c1bdc[_0x36eeaa];return _0x1c0d59;}export async function markCommentsAddressed(_0x4faab8,_0x157eec,_0x537fd7){const _0x4299b4=_0x1c0d,_0x30f9b7={'TIXHE':function(_0x597ab0){return _0x597ab0();},'LQose':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','uoDrN':function(_0x33f4f5,_0x572d78,_0xbd022a){return _0x33f4f5(_0x572d78,_0xbd022a);},'euHyt':'POST','ggGxK':'application/json'},_0x18da8a=await _0x30f9b7['TIXHE'](getToken);if(!_0x18da8a)throw new Error(_0x30f9b7['LQose']);const _0x11dff3=getApiBaseUrl(),_0x2ef8cb=await _0x30f9b7[_0x4299b4(0x9c)](fetch,_0x11dff3+_0x4299b4(0xb3)+_0x4faab8+'/comments/address',{'method':_0x30f9b7['euHyt'],'headers':{'Authorization':_0x4299b4(0x80)+_0x18da8a,'Content-Type':_0x30f9b7['ggGxK']},'body':JSON['stringify']({'checklistItemId':_0x157eec,'commentIds':_0x537fd7})});if(!_0x2ef8cb['ok']){const _0x42dbbc=await _0x2ef8cb['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x42dbbc);}}export async function softDeleteFeature(_0x281f47){const _0x296b9a=_0x1c0d,_0x3b7e17={'ClqzX':function(_0x26f147){return _0x26f147();},'zOEdm':_0x296b9a(0xa2)},_0x18903f=await getToken();if(!_0x18903f)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x413bf9=_0x3b7e17[_0x296b9a(0xb7)](getApiBaseUrl),_0x267283=await fetch(_0x413bf9+'/api/v1/mcp/features/'+_0x281f47,{'method':_0x3b7e17[_0x296b9a(0xa0)],'headers':{'Authorization':_0x296b9a(0x80)+_0x18903f}});if(!_0x267283['ok']){const _0x5f52a8=await _0x267283['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x5f52a8);}}export async function restoreFeature(_0x4ad4d5){const _0x1f6183=_0x1c0d,_0x2e507a={'qiZtM':function(_0x2a847f){return _0x2a847f();},'VCeNl':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','sSXxm':function(_0x1c6f6a,_0x3d1801,_0x21a343){return _0x1c6f6a(_0x3d1801,_0x21a343);},'EhqYp':'POST'},_0x610ad1=await _0x2e507a['qiZtM'](getToken);if(!_0x610ad1)throw new Error(_0x2e507a[_0x1f6183(0x89)]);const _0x502b94=getApiBaseUrl(),_0x1aeadf=await _0x2e507a['sSXxm'](fetch,_0x502b94+'/api/v1/mcp/features/'+_0x4ad4d5+'/restore',{'method':_0x2e507a[_0x1f6183(0x7b)],'headers':{'Authorization':'Bearer\x20'+_0x610ad1}});if(!_0x1aeadf['ok']){const _0x2aab31=await _0x1aeadf[_0x1f6183(0xae)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x2aab31);}}
1
+ (function(_0x402791,_0x33a22f){const _0x537ea4=_0x21e5,_0x218deb=_0x402791();while(!![]){try{const _0x353fa9=-parseInt(_0x537ea4(0x1e0))/0x1*(-parseInt(_0x537ea4(0x1cc))/0x2)+parseInt(_0x537ea4(0x1ad))/0x3*(-parseInt(_0x537ea4(0x1ae))/0x4)+-parseInt(_0x537ea4(0x1bd))/0x5+-parseInt(_0x537ea4(0x1a8))/0x6*(-parseInt(_0x537ea4(0x1e5))/0x7)+parseInt(_0x537ea4(0x1df))/0x8*(-parseInt(_0x537ea4(0x1d3))/0x9)+parseInt(_0x537ea4(0x1ba))/0xa+-parseInt(_0x537ea4(0x1db))/0xb*(-parseInt(_0x537ea4(0x1d8))/0xc);if(_0x353fa9===_0x33a22f)break;else _0x218deb['push'](_0x218deb['shift']());}catch(_0x5d5c07){_0x218deb['push'](_0x218deb['shift']());}}}(_0x1c07,0xbbfa8));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x1c07(){const _0x37d6d7=['itemIds','510235GoEcMf','/report','/checklist-items/','/comments/address','164928HMlJGL','158VezSwF','Bearer\x20','toString','stringify','Failed\x20to\x20create\x20feature\x20review:\x20','7dJBfeZ','bXKSZ','limit','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','nAIdo','xGMLj','TTjXr','SJrLG','length','application/json','Failed\x20to\x20delete\x20feature\x20review:\x20','/api/v1/mcp/features','billingUrl','updateChecklistItem','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','yxTOp','message','5662218QKmaFl','json','\x0a\x0aUpgrade\x20your\x20plan:\x20','POST','set','43389GxnNwH','240UieFVq','offset','airBq','gitBranch','GET','/action-items','https://dashboard.ranger.net/billing','KThxK','/api/v1/mcp/features/','MAweg','TIEnx','true','5531530xRjsTJ','Failed\x20to\x20get\x20item\x20feedback:\x20','style','3116665gPLChE','sQJcT','zRRsG','/checklist','rzlYr','hjppk','Uskoy','ajpPC','uPLuT','Failed\x20to\x20update\x20scenario:\x20','ivgGT','/conclude','dIbfN','COoPP','text','6216hNohDE','Failed\x20to\x20update\x20feature\x20review:\x20','kriKF','tGmNt','/sessions/','/feedback','includeDeleted','63RJEHMX','ZrUAi','BGTPv','xjRWb','sessionId','108TANlGO','PATCH'];_0x1c07=function(){return _0x37d6d7;};return _0x1c07();}import{withRetry}from'./retry.js';export async function createFeature(_0x1a33f4){const _0x155f62=_0x21e5,_0x4b302c={'Uskoy':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','FXquW':_0x155f62(0x1ee),'TIEnx':'Feature\x20limit\x20exceeded'},_0x1c1fb3=await getToken();if(!_0x1c1fb3)throw new Error(_0x4b302c[_0x155f62(0x1c3)]);const _0x28ea26=getApiBaseUrl(),_0x53dd53=await fetch(_0x28ea26+_0x155f62(0x1f0),{'method':'POST','headers':{'Authorization':_0x155f62(0x1e1)+_0x1c1fb3,'Content-Type':_0x4b302c['FXquW']},'body':JSON[_0x155f62(0x1e3)](_0x1a33f4)});if(!_0x53dd53['ok']){if(_0x53dd53['status']===0x192){const _0x539747=await _0x53dd53['json'](),_0x160034=_0x539747[_0x155f62(0x1f1)]||_0x155f62(0x1b4);throw new Error((_0x539747[_0x155f62(0x1a7)]||_0x4b302c[_0x155f62(0x1b8)])+_0x155f62(0x1aa)+_0x160034);}const _0x2c453e=await _0x53dd53[_0x155f62(0x1cb)]();throw new Error(_0x155f62(0x1e4)+_0x2c453e);}return _0x53dd53['json']();}export async function listFeatures(_0x46be68){const _0x5e0ea3=_0x21e5,_0x4a2446={'dIbfN':function(_0x314564){return _0x314564();},'wGfSU':_0x5e0ea3(0x1b2)},_0x22b09c=await getToken();if(!_0x22b09c)throw new Error(_0x5e0ea3(0x1e8));const _0x3e1215=_0x4a2446[_0x5e0ea3(0x1c9)](getApiBaseUrl),_0x1b5c3d=new URLSearchParams();if(_0x46be68?.['gitRepoUrl'])_0x1b5c3d[_0x5e0ea3(0x1ac)]('gitRepoUrl',_0x46be68['gitRepoUrl']);if(_0x46be68?.[_0x5e0ea3(0x1b1)])_0x1b5c3d['set'](_0x5e0ea3(0x1b1),_0x46be68[_0x5e0ea3(0x1b1)]);if(_0x46be68?.[_0x5e0ea3(0x1e7)])_0x1b5c3d['set']('limit',_0x46be68['limit']['toString']());if(_0x46be68?.['offset'])_0x1b5c3d['set'](_0x5e0ea3(0x1af),_0x46be68[_0x5e0ea3(0x1af)][_0x5e0ea3(0x1e2)]());if(_0x46be68?.['includeDeleted'])_0x1b5c3d[_0x5e0ea3(0x1ac)](_0x5e0ea3(0x1d2),_0x5e0ea3(0x1b9));const _0x4647a2=_0x3e1215+'/api/v1/mcp/features'+(_0x1b5c3d['toString']()?'?'+_0x1b5c3d['toString']():''),_0x15f971=await fetch(_0x4647a2,{'method':_0x4a2446['wGfSU'],'headers':{'Authorization':_0x5e0ea3(0x1e1)+_0x22b09c}});if(!_0x15f971['ok']){const _0x319e18=await _0x15f971['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x319e18);}return _0x15f971[_0x5e0ea3(0x1a9)]();}export async function getFeature(_0x5e42db){const _0x9189e2=_0x21e5,_0x2a49ec={'xGMLj':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','mfvEu':_0x9189e2(0x1b2)},_0x159af6=await getToken();if(!_0x159af6)throw new Error(_0x2a49ec[_0x9189e2(0x1ea)]);const _0x44c4a0=getApiBaseUrl(),_0x42493f=await fetch(_0x44c4a0+_0x9189e2(0x1b6)+_0x5e42db,{'method':_0x2a49ec['mfvEu'],'headers':{'Authorization':_0x9189e2(0x1e1)+_0x159af6}});if(!_0x42493f['ok']){const _0x4463a0=await _0x42493f['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x4463a0);}return _0x42493f['json']();}export async function updateFeature(_0x526e11,_0x545b69){const _0x2ca925=_0x21e5,_0x482838={'pImdc':function(_0x23b9d4){return _0x23b9d4();},'uPLuT':_0x2ca925(0x1e8),'ZrUAi':'PATCH'},_0x8284b7=await _0x482838['pImdc'](getToken);if(!_0x8284b7)throw new Error(_0x482838[_0x2ca925(0x1c5)]);const _0x58b12e=getApiBaseUrl(),_0x38a7cf=await fetch(_0x58b12e+_0x2ca925(0x1b6)+_0x526e11,{'method':_0x482838[_0x2ca925(0x1d4)],'headers':{'Authorization':_0x2ca925(0x1e1)+_0x8284b7,'Content-Type':_0x2ca925(0x1ee)},'body':JSON['stringify'](_0x545b69)});if(!_0x38a7cf['ok']){const _0x4f7fcc=await _0x38a7cf['text']();throw new Error(_0x2ca925(0x1cd)+_0x4f7fcc);}return _0x38a7cf['json']();}export async function createChecklistItem(_0x5d34e3,_0x134e9f,_0x2810ae){const _0x15ae4c=_0x21e5,_0x595208={'MAweg':_0x15ae4c(0x1e8),'OrVGB':function(_0x1f0acc){return _0x1f0acc();},'oMwYe':function(_0x3e7503,_0x5bcdbf,_0x15d03c){return _0x3e7503(_0x5bcdbf,_0x15d03c);},'yxTOp':_0x15ae4c(0x1ee)},_0xb6c9f5=await getToken();if(!_0xb6c9f5)throw new Error(_0x595208[_0x15ae4c(0x1b7)]);const _0x349d59=_0x595208['OrVGB'](getApiBaseUrl),_0x39c361=await _0x595208['oMwYe'](fetch,_0x349d59+'/api/v1/mcp/features/'+_0x5d34e3+_0x15ae4c(0x1c0),{'method':_0x15ae4c(0x1ab),'headers':{'Authorization':'Bearer\x20'+_0xb6c9f5,'Content-Type':_0x595208[_0x15ae4c(0x1a6)]},'body':JSON['stringify']({'description':_0x134e9f,'position':_0x2810ae})});if(!_0x39c361['ok']){const _0x4eb906=await _0x39c361[_0x15ae4c(0x1cb)]();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x4eb906);}return _0x39c361[_0x15ae4c(0x1a9)]();}export async function updateChecklistItem(_0x56475c,_0x5d1cde,_0x157f64){const _0xc8bc42=_0x21e5,_0x40b190={'oScZI':function(_0x5bb0c5){return _0x5bb0c5();},'ajpPC':_0xc8bc42(0x1d9)};return withRetry(async()=>{const _0x1fec3f=_0xc8bc42,_0x7da169=await _0x40b190['oScZI'](getToken);if(!_0x7da169)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xa26da4=getApiBaseUrl(),_0x23efb7=await fetch(_0xa26da4+'/api/v1/mcp/features/'+_0x56475c+'/checklist/'+_0x5d1cde,{'method':_0x40b190[_0x1fec3f(0x1c4)],'headers':{'Authorization':_0x1fec3f(0x1e1)+_0x7da169,'Content-Type':'application/json'},'body':JSON[_0x1fec3f(0x1e3)](_0x157f64)});if(!_0x23efb7['ok']){const _0x2af0ec=await _0x23efb7[_0x1fec3f(0x1cb)]();throw new Error(_0x1fec3f(0x1c6)+_0x2af0ec);}return _0x23efb7[_0x1fec3f(0x1a9)]();},{'label':_0xc8bc42(0x1a4)});}export async function getFeatureReport(_0x2b654f){const _0x57081a=_0x21e5,_0x1dc6ff={'VunZc':function(_0x19fe3d){return _0x19fe3d();},'rzlYr':function(_0x5bc6ea,_0x577aee,_0x20f4ad){return _0x5bc6ea(_0x577aee,_0x20f4ad);}},_0x30401e=await _0x1dc6ff['VunZc'](getToken);if(!_0x30401e)throw new Error(_0x57081a(0x1e8));const _0x48bcff=getApiBaseUrl(),_0x2a820e=await _0x1dc6ff[_0x57081a(0x1c1)](fetch,_0x48bcff+_0x57081a(0x1b6)+_0x2b654f+_0x57081a(0x1dc),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x30401e}});if(!_0x2a820e['ok']){const _0x34347f=await _0x2a820e['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x34347f);}return _0x2a820e[_0x57081a(0x1a9)]();}export async function getFeatureReportMarkdown(_0x35e4fd,_0x254745){const _0x2b782b=_0x21e5,_0x3ba3f6={'EIniC':function(_0x3e7a69){return _0x3e7a69();},'kriKF':function(_0x547ff2,_0x430919){return _0x547ff2>_0x430919;},'KThxK':function(_0x461636,_0x785081){return _0x461636&&_0x785081;},'xjRWb':_0x2b782b(0x1bc),'nXXNC':_0x2b782b(0x1b2)},_0x565714=await getToken();if(!_0x565714)throw new Error(_0x2b782b(0x1e8));const _0x593518=_0x3ba3f6['EIniC'](getApiBaseUrl),_0x48ab32=new URLSearchParams(),_0x2872b8=_0x3ba3f6[_0x2b782b(0x1ce)](_0x254745?.['itemIds']?.[_0x2b782b(0x1ed)]??0x0,0x0),_0x49755c=Boolean(_0x254745?.['sessionId']);_0x2872b8&&_0x254745?.[_0x2b782b(0x1da)]&&_0x48ab32['set']('itemIds',_0x254745['itemIds']['join'](','));_0x49755c&&_0x254745?.[_0x2b782b(0x1d7)]&&_0x48ab32[_0x2b782b(0x1ac)]('sessionId',_0x254745[_0x2b782b(0x1d7)]);_0x3ba3f6[_0x2b782b(0x1b5)](!_0x2872b8,!_0x49755c)&&_0x254745?.[_0x2b782b(0x1bc)]&&_0x48ab32['set'](_0x3ba3f6[_0x2b782b(0x1d6)],_0x254745['style']);const _0x2caa10=_0x593518+'/api/v1/mcp/features/'+_0x35e4fd+'/report/markdown',_0x12c21e=''+_0x2caa10+(_0x48ab32[_0x2b782b(0x1e2)]()?'?'+_0x48ab32['toString']():''),_0xd282f7=await fetch(_0x12c21e,{'method':_0x3ba3f6['nXXNC'],'headers':{'Authorization':'Bearer\x20'+_0x565714}});if(!_0xd282f7['ok']){const _0x4e0cfb=await _0xd282f7['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x4e0cfb);}return _0xd282f7[_0x2b782b(0x1cb)]();}export async function listFeatureSessions(_0x51ab2a){const _0x4793ed=_0x21e5,_0x30e5a4={'Yolrq':_0x4793ed(0x1e8),'btLTu':_0x4793ed(0x1b2)},_0x5be41e=await getToken();if(!_0x5be41e)throw new Error(_0x30e5a4['Yolrq']);const _0x2c1ea1=getApiBaseUrl(),_0x1a2f49=await fetch(_0x2c1ea1+'/api/v1/mcp/features/'+_0x51ab2a+'/sessions',{'method':_0x30e5a4['btLTu'],'headers':{'Authorization':_0x4793ed(0x1e1)+_0x5be41e}});if(!_0x1a2f49['ok']){const _0x9fe8f=await _0x1a2f49[_0x4793ed(0x1cb)]();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x9fe8f);}return _0x1a2f49['json']();}function _0x21e5(_0x268a9f,_0xf9c07f){_0x268a9f=_0x268a9f-0x1a4;const _0x1c0777=_0x1c07();let _0x21e5fe=_0x1c0777[_0x268a9f];return _0x21e5fe;}export async function startSession(_0x15433b,_0xd1d2dc){const _0x2caa00=_0x21e5,_0x436a2b={'COoPP':function(_0x563fbe){return _0x563fbe();},'jvqAA':function(_0x38ef48,_0x3ee2e4,_0x354610){return _0x38ef48(_0x3ee2e4,_0x354610);}},_0x4b9638=await getToken();if(!_0x4b9638)throw new Error(_0x2caa00(0x1e8));const _0x4f10c0=_0x436a2b[_0x2caa00(0x1ca)](getApiBaseUrl),_0x1b8ed9=await _0x436a2b['jvqAA'](fetch,_0x4f10c0+_0x2caa00(0x1b6)+_0x15433b+_0x2caa00(0x1d0)+_0xd1d2dc+'/start',{'method':'POST','headers':{'Authorization':_0x2caa00(0x1e1)+_0x4b9638}});if(!_0x1b8ed9['ok']){const _0x498aa0=await _0x1b8ed9[_0x2caa00(0x1cb)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x498aa0);}return _0x1b8ed9['json']();}export async function concludeSession(_0x239401,_0x2aeb00){const _0x5ab0a5=_0x21e5,_0x39d7a2={'Lblqg':function(_0x2dc33c){return _0x2dc33c();},'SSgYq':_0x5ab0a5(0x1e8),'dibzC':_0x5ab0a5(0x1ab)},_0x1bf6dc=await _0x39d7a2['Lblqg'](getToken);if(!_0x1bf6dc)throw new Error(_0x39d7a2['SSgYq']);const _0x37b0a4=getApiBaseUrl(),_0x1989bf=await fetch(_0x37b0a4+'/api/v1/mcp/features/'+_0x239401+'/sessions/'+_0x2aeb00+_0x5ab0a5(0x1c8),{'method':_0x39d7a2['dibzC'],'headers':{'Authorization':'Bearer\x20'+_0x1bf6dc}});if(!_0x1989bf['ok']){const _0x4d16a9=await _0x1989bf[_0x5ab0a5(0x1cb)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x4d16a9);}return _0x1989bf[_0x5ab0a5(0x1a9)]();}export async function getActionItems(_0x197fd5){const _0x5c5180=_0x21e5,_0xd94748={'PeUQT':_0x5c5180(0x1e8),'SJrLG':function(_0x33a985,_0x317412,_0xea7800){return _0x33a985(_0x317412,_0xea7800);},'SdHQe':_0x5c5180(0x1b2)},_0x3d0941=await getToken();if(!_0x3d0941)throw new Error(_0xd94748['PeUQT']);const _0x4cec78=getApiBaseUrl(),_0xb4bb3d=await _0xd94748[_0x5c5180(0x1ec)](fetch,_0x4cec78+'/api/v1/mcp/features/'+_0x197fd5+_0x5c5180(0x1b3),{'method':_0xd94748['SdHQe'],'headers':{'Authorization':'Bearer\x20'+_0x3d0941}});if(!_0xb4bb3d['ok']){const _0x2afe8a=await _0xb4bb3d[_0x5c5180(0x1cb)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x2afe8a);}return _0xb4bb3d['json']();}export async function getItemFeedback(_0x2629cf,_0x4d48fa){const _0x31aab9=_0x21e5,_0x130438={'airBq':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','sQJcT':function(_0x29cd98,_0x3b2e57,_0x4a23b8){return _0x29cd98(_0x3b2e57,_0x4a23b8);},'zAcFI':_0x31aab9(0x1b2)},_0x2e34c0=await getToken();if(!_0x2e34c0)throw new Error(_0x130438[_0x31aab9(0x1b0)]);const _0x4a195c=getApiBaseUrl(),_0x333fd0=await _0x130438[_0x31aab9(0x1be)](fetch,_0x4a195c+_0x31aab9(0x1b6)+_0x2629cf+_0x31aab9(0x1dd)+_0x4d48fa+_0x31aab9(0x1d1),{'method':_0x130438['zAcFI'],'headers':{'Authorization':_0x31aab9(0x1e1)+_0x2e34c0}});if(!_0x333fd0['ok']){const _0x436dfe=await _0x333fd0[_0x31aab9(0x1cb)]();throw new Error(_0x31aab9(0x1bb)+_0x436dfe);}return _0x333fd0['json']();}export async function markCommentsAddressed(_0x30e9a5,_0x20601a,_0x577c70){const _0x7be8e0=_0x21e5,_0x367f2d={'TTjXr':function(_0x3e7145){return _0x3e7145();},'zRRsG':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','wysVa':function(_0x36cf16){return _0x36cf16();},'tGmNt':_0x7be8e0(0x1ab),'bXKSZ':'application/json'},_0x1e2f8d=await _0x367f2d[_0x7be8e0(0x1eb)](getToken);if(!_0x1e2f8d)throw new Error(_0x367f2d[_0x7be8e0(0x1bf)]);const _0x527590=_0x367f2d['wysVa'](getApiBaseUrl),_0x5632a7=await fetch(_0x527590+_0x7be8e0(0x1b6)+_0x30e9a5+_0x7be8e0(0x1de),{'method':_0x367f2d[_0x7be8e0(0x1cf)],'headers':{'Authorization':_0x7be8e0(0x1e1)+_0x1e2f8d,'Content-Type':_0x367f2d[_0x7be8e0(0x1e6)]},'body':JSON['stringify']({'checklistItemId':_0x20601a,'commentIds':_0x577c70})});if(!_0x5632a7['ok']){const _0x269af8=await _0x5632a7[_0x7be8e0(0x1cb)]();throw new Error(_0x7be8e0(0x1a5)+_0x269af8);}}export async function softDeleteFeature(_0x1f27b2){const _0x490f79=_0x21e5,_0x2ec70a={'hjppk':function(_0x29967e){return _0x29967e();},'BGTPv':_0x490f79(0x1e8),'ZDMlg':function(_0x2fc43e,_0x2a70d1,_0x3b016b){return _0x2fc43e(_0x2a70d1,_0x3b016b);}},_0x34c023=await _0x2ec70a['hjppk'](getToken);if(!_0x34c023)throw new Error(_0x2ec70a[_0x490f79(0x1d5)]);const _0x1f913e=_0x2ec70a[_0x490f79(0x1c2)](getApiBaseUrl),_0x806b25=await _0x2ec70a['ZDMlg'](fetch,_0x1f913e+_0x490f79(0x1b6)+_0x1f27b2,{'method':'DELETE','headers':{'Authorization':'Bearer\x20'+_0x34c023}});if(!_0x806b25['ok']){const _0x75b251=await _0x806b25['text']();throw new Error(_0x490f79(0x1ef)+_0x75b251);}}export async function restoreFeature(_0x54988b){const _0x508c52=_0x21e5,_0x4e678e={'nAIdo':function(_0x4d51eb){return _0x4d51eb();},'ivgGT':'POST'},_0x98ab12=await _0x4e678e[_0x508c52(0x1e9)](getToken);if(!_0x98ab12)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x198c80=_0x4e678e['nAIdo'](getApiBaseUrl),_0x134f4a=await fetch(_0x198c80+'/api/v1/mcp/features/'+_0x54988b+'/restore',{'method':_0x4e678e[_0x508c52(0x1c7)],'headers':{'Authorization':'Bearer\x20'+_0x98ab12}});if(!_0x134f4a['ok']){const _0x388d0f=await _0x134f4a[_0x508c52(0x1cb)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x388d0f);}}