@ranger-testing/ranger-cli 3.1.7-alpha.9ed0a8d-59 → 3.1.7-alpha.a5be4ca-60

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 (86) 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/package.json +14 -5
@@ -1 +1 @@
1
- const _0x53b5fb=_0x3317;(function(_0x3966a8,_0x481d57){const _0x62efd0=_0x3317,_0x1191a8=_0x3966a8();while(!![]){try{const _0x447a3f=parseInt(_0x62efd0(0xad))/0x1+parseInt(_0x62efd0(0x104))/0x2+-parseInt(_0x62efd0(0xcb))/0x3*(parseInt(_0x62efd0(0xc0))/0x4)+-parseInt(_0x62efd0(0xc4))/0x5+-parseInt(_0x62efd0(0xca))/0x6*(parseInt(_0x62efd0(0xf9))/0x7)+-parseInt(_0x62efd0(0xaa))/0x8*(parseInt(_0x62efd0(0xc6))/0x9)+-parseInt(_0x62efd0(0xcd))/0xa*(-parseInt(_0x62efd0(0xc2))/0xb);if(_0x447a3f===_0x481d57)break;else _0x1191a8['push'](_0x1191a8['shift']());}catch(_0x548ea9){_0x1191a8['push'](_0x1191a8['shift']());}}}(_0x7a98,0x2c00e));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x426f01 from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isBareLocalhost,isCachedSessionLive,isInteractive,needsTunnel,orderLoginDomains,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x3e5eed){const _0x4b3a23=_0x3317,_0x5b9bea={'wFrYV':_0x4b3a23(0xa1)};try{return new URL(_0x3e5eed)['host'];}catch{return _0x5b9bea[_0x4b3a23(0x127)];}}function errorMessageForTelemetry(_0x5a9c1e){return _0x5a9c1e instanceof Error?_0x5a9c1e['message']:undefined;}function trackBridgeEvent(_0x329021,_0x1cecf1){const _0x52f77f=_0x3317,_0x4f5999={'XaRMC':function(_0x345551,_0x1dd2c4){return _0x345551===_0x1dd2c4;}};if(!_0x329021)return;const _0x237ae0={'tunnelSessionId':_0x1cecf1[_0x52f77f(0x71)],'tunnelEventType':_0x1cecf1[_0x52f77f(0x121)],'connectionId':_0x1cecf1[_0x52f77f(0x117)],'code':_0x1cecf1['code'],'reason':_0x1cecf1[_0x52f77f(0x126)],'error':_0x1cecf1[_0x52f77f(0x72)],'elapsedMs':_0x1cecf1[_0x52f77f(0x70)],'activeLocalConnections':_0x1cecf1['activeLocalConnections'],'pendingLocalConnections':_0x1cecf1[_0x52f77f(0x103)]};_0x329021[_0x52f77f(0xa3)](_0x52f77f(0x77),_0x237ae0),(_0x1cecf1['type']==='tunnel_error'||_0x4f5999['XaRMC'](_0x1cecf1['type'],_0x52f77f(0xe0)))&&void _0x329021['trackPhaseError'](_0x52f77f(0x8b),new Error(_0x1cecf1['error']??_0x1cecf1[_0x52f77f(0x121)]),_0x237ae0);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x4ad5be=await getToken();if(!_0x4ad5be)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');return _0x4ad5be;}async function apiRequest(_0x4edfbd,_0x598649={}){const _0x270293=_0x3317,_0x3c0916={'YyKOI':function(_0xb00bd9){return _0xb00bd9();},'FEZFs':'application/json','oGXQo':function(_0x586d6c,_0x5e9dfd){return _0x586d6c===_0x5e9dfd;},'uoOky':_0x270293(0xb5),'YJwpk':function(_0x5946ce,_0x288193){return _0x5946ce===_0x288193;}},_0x2d4ae7=await requireToken(),_0x2bfb81=_0x3c0916[_0x270293(0x119)](getApiBaseUrl),_0x558fd6=await fetch(''+_0x2bfb81+_0x4edfbd,{..._0x598649,'headers':{'Authorization':'Bearer\x20'+_0x2d4ae7,'Content-Type':_0x3c0916[_0x270293(0xb8)],..._0x598649['headers']??{}}});if(!_0x558fd6['ok']){let _0x412ae4='',_0x1d60b6;try{const _0x5498ef=await _0x558fd6['json'](),_0x131d47=(_0x3c0916['oGXQo'](typeof _0x5498ef['error'],_0x270293(0xb5))?_0x5498ef['error']:undefined)??JSON['stringify'](_0x5498ef);_0x412ae4=_0x131d47;typeof _0x5498ef['test_output']===_0x3c0916[_0x270293(0x83)]&&_0x5498ef['test_output']&&(_0x412ae4=_0x412ae4+'\x0a'+_0x5498ef[_0x270293(0xf5)]);if(_0x3c0916['YJwpk'](typeof _0x5498ef['code'],_0x3c0916[_0x270293(0x83)]))_0x1d60b6=_0x5498ef['code'];}catch{_0x412ae4=_0x558fd6[_0x270293(0x129)];}throw new ApiError(_0x270293(0xbb)+_0x4edfbd+_0x270293(0x8f)+_0x558fd6[_0x270293(0xf3)]+'):\x20'+_0x412ae4,_0x558fd6[_0x270293(0xf3)],_0x412ae4,_0x1d60b6);}if(_0x3c0916[_0x270293(0x9a)](_0x558fd6['status'],0xcc))return undefined;return _0x558fd6[_0x270293(0x102)]();}export class ApiError extends Error{['status'];[_0x53b5fb(0xe3)];['code'];constructor(_0x5089e6,_0x4cdea5,_0xedd239,_0x37ddf2){const _0xa9791d=_0x53b5fb,_0x514472={'zlbcK':'ApiError'},_0x375b7e='3|4|2|0|1'['split']('|');let _0x3655a5=0x0;while(!![]){switch(_0x375b7e[_0x3655a5++]){case'0':this['code']=_0x37ddf2;continue;case'1':this[_0xa9791d(0x10e)]=_0x514472['zlbcK'];continue;case'2':this[_0xa9791d(0xe3)]=_0xedd239;continue;case'3':super(_0x5089e6);continue;case'4':this[_0xa9791d(0xf3)]=_0x4cdea5;continue;}break;}}}export async function fetchCloudProfile(_0x68e568){const _0x57b4ef={'PJPvT':function(_0x48fa68,_0x173bfe){return _0x48fa68(_0x173bfe);},'UKBZL':function(_0x4910ef,_0xadb94f){return _0x4910ef===_0xadb94f;}};try{return await _0x57b4ef['PJPvT'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x68e568));}catch(_0x19628e){if(_0x19628e instanceof ApiError&&_0x57b4ef['UKBZL'](_0x19628e['status'],0x194))return null;throw _0x19628e;}}export async function listCloudProfiles(){const _0x20112a=_0x53b5fb,_0x1cb453={'mybZA':'/api/v1/profiles'},_0x450a49=await apiRequest(_0x1cb453[_0x20112a(0x122)]);return _0x450a49[_0x20112a(0x97)];}function _0x7a98(){const _0x5edec4=['test_output','username','Nwihm','HLPzW','681464Hghzzx','\x22\x20instead.','DELETE','PUT','\x22;\x20using\x20\x22','raw','\x20Available:\x20','environment_key','EvWkJ','json','pendingLocalConnections','152334irzRcf','NRQCJ','POST','origin','/api/v1/tunnel/sessions/','userAgent','\x20\x20Cloud\x20session\x20for\x20\x22','RANGER_TUNNEL_LOGIN_HEADED','baseUrl','UAqQF','name','cookies','assertedEnv','RANGER_TEST_PASSWORD','URtui','XfPEz','isArray','session_state','defaultEnvironmentKey','connectionId','settings','YyKOI','qlHYL','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','daQnb','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','TYfRH','keys','FChbX','type','mybZA','wsEndpoint','tkfPi','\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...','reason','wFrYV','save','statusText','ewHtK','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','elapsedMs','sessionId','error','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','mQaON','pw_endpoint','Browser\x20login\x20timed\x20out\x20before\x20completion.','tunnel_bridge_event','\x20\x20No\x20live\x20session\x20for\x20\x22','mVcNH','\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a','\x22;\x20proceeding\x20with\x20loginInstructions.','launch','\x22\x20matched\x20by\x20host\x20for\x20','\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20','mPRAr','organizationId','true','effectiveBaseUrl','uoOky','\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22','storageStatePath','tunnel_session_id','password','\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','SRIJy','tunnel_bridge','\x20\x20Cloud\x20profile\x20\x22','\x22.\x0a','ambiguous','\x20failed\x20(','environmentKey','BxZOY','\x20\x20•\x20capture\x20one\x20(a\x20browser\x20opens):\x20ranger\x20profile\x20add\x20','auth_config','RANGER_TEST_USERNAME','kHFTU','length','profiles','trim','mVhUu','YJwpk','TYGWz','Vlhat','EjNaI','\x20\x20Cached\x20session\x20for\x20\x22','pwCQH','\x22,\x20cached\x20locally','invalid-url','BSMtY','trackPhaseEnd','\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a','qutiq','trackPhaseStart','crTso','tunnel_login_request','/session','19704bcFKEj','agent','domains','150435dIwvQe','AamUQ','/login','telemetry','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','environments','auth','tunnel','string','persistSessionState','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','FEZFs','\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).','/api/v1/profiles/auth-config','API\x20request\x20','message','forceLogin','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','key','772ExWQOr','\x20\x20•\x20or\x20pass\x20--env\x20<key>\x20to\x20run\x20an\x20automated\x20login\x20for\x20this\x20target.','77JAEYVF','tunnelUrl','1077065GzVOMT','success','549IGzSFV','join','toISOString','pwEndpoint','6IhMJSL','1383kVtBPL','Cloud\x20profile\x20\x22','722310WkOmkI',');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.','map','\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)','stringify','close','slhHa','clientIp','setupHeaders','\x20\x20Options:\x0a','qlhpE','you\x27re\x20now\x20at\x20\x22','MWlGU','HgypP','PanYc','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','zNouC','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','local_ws_error','dodoT','qXUPM','detail','\x22,\x20and\x20cloud\x20sessions\x20don\x27t\x20apply\x20to\x20localhost.\x0a','No\x20saved\x20session\x20for\x20\x22','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','loginInstructions','Browser\x20login\x20timed\x20out\x20after\x20','wwRCj','parse','sessionState','prompt','/api/v1/profiles/','log','mhkNx','SOqad','sessionCheckPath','some','status','env'];_0x7a98=function(){return _0x5edec4;};return _0x7a98();}export async function deleteCloudProfile(_0xa804cc){const _0x3c36d7=_0x53b5fb,_0x23e68e={'ujnAe':function(_0x2f9046,_0x4a2074,_0x3b74a3){return _0x2f9046(_0x4a2074,_0x3b74a3);},'HLPzW':function(_0x6265e7,_0x38baf9){return _0x6265e7(_0x38baf9);},'ewHtK':_0x3c36d7(0xfb)};try{await _0x23e68e['ujnAe'](apiRequest,'/api/v1/profiles/'+_0x23e68e[_0x3c36d7(0xf8)](encodeURIComponent,_0xa804cc),{'method':_0x23e68e[_0x3c36d7(0x6e)]});}catch(_0xd9cb3){if(_0xd9cb3 instanceof ApiError&&_0xd9cb3['status']===0x194)throw new Error(_0x3c36d7(0xcc)+_0xa804cc+'\x22\x20not\x20found.');throw _0xd9cb3;}}export async function createCloudProfile(_0x579d67,_0x71fcb4,_0x59486d={}){const _0x25a1c7=_0x53b5fb,_0x19d849={'tkfPi':function(_0x3c9f4d,_0x5f4697){return _0x3c9f4d>_0x5f4697;},'mVhUu':'/api/v1/profiles'},_0x1a15c5={'name':_0x579d67};if(_0x71fcb4)_0x1a15c5[_0x25a1c7(0x100)]=_0x71fcb4;_0x59486d['settings']&&_0x19d849[_0x25a1c7(0x124)](Object[_0x25a1c7(0x11f)](_0x59486d['settings'])[_0x25a1c7(0x96)],0x0)&&(_0x1a15c5[_0x25a1c7(0x118)]=_0x59486d[_0x25a1c7(0x118)]);if(_0x59486d['username'])_0x1a15c5[_0x25a1c7(0xf6)]=_0x59486d[_0x25a1c7(0xf6)];if(_0x59486d[_0x25a1c7(0x87)])_0x1a15c5[_0x25a1c7(0x87)]=_0x59486d['password'];return await apiRequest(_0x19d849[_0x25a1c7(0x99)],{'method':_0x25a1c7(0x106),'body':JSON[_0x25a1c7(0xd1)](_0x1a15c5)});}export async function uploadCloudProfileSession(_0x9587cf,_0x35ea9f){const _0x53fe83=_0x53b5fb,_0x26e9f7={'tZoPw':function(_0x2e2e47,_0x512052,_0x2acfb2){return _0x2e2e47(_0x512052,_0x2acfb2);},'Vlhat':_0x53fe83(0x106)};return await _0x26e9f7['tZoPw'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x9587cf)+_0x53fe83(0xa9),{'method':_0x26e9f7[_0x53fe83(0x9c)],'body':JSON['stringify']({'session_state':_0x35ea9f})});}export async function saveCloudProfileCredentials(_0x3a3bb5,_0x3f9770,_0x1fac66){const _0x444678=_0x53b5fb;await apiRequest(_0x444678(0xed)+encodeURIComponent(_0x3a3bb5),{'method':_0x444678(0xfc),'body':JSON['stringify']({'username':_0x3f9770,'password':_0x1fac66})});}export async function fetchAuthConfig(){const _0x5a6bd9=_0x53b5fb,_0x2bd2b3={'dodoT':function(_0x1d1559,_0xb599bc){return _0x1d1559 instanceof _0xb599bc;}};try{const _0x387598=await apiRequest(_0x5a6bd9(0xba));return _0x387598[_0x5a6bd9(0x93)];}catch(_0x20c666){return _0x2bd2b3[_0x5a6bd9(0xe1)](_0x20c666,ApiError)&&_0x20c666[_0x5a6bd9(0xf3)]!==0x194&&console['error'](_0x5a6bd9(0x73)+_0x20c666['message']),null;}}async function createTunnelSession(_0x40d379){const _0x4cd936=_0x53b5fb;return await apiRequest('/api/v1/tunnel/sessions',{'method':_0x4cd936(0x106),'body':JSON[_0x4cd936(0xd1)]({'targetUrl':_0x40d379,'mode':_0x4cd936(0xab)})});}async function deleteTunnelSession(_0x2d8fa6){const _0x285ef5=_0x53b5fb,_0x5c74c1={'wwWoA':'DELETE'};await apiRequest(_0x285ef5(0x108)+_0x2d8fa6,{'method':_0x5c74c1['wwWoA']});}export function pickAdHocEnvKey(_0x5801c3,_0x37c443,_0x5d8915){const _0x1c4911=_0x53b5fb,_0x2d1578={'qlhpE':function(_0x3ce032,_0xe13f2c){return _0x3ce032+_0xe13f2c;},'BxZOY':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','mAxiu':function(_0x51a611,_0x4031c5){return _0x51a611(_0x4031c5);},'tLLId':function(_0x8655a7,_0x1cd950){return _0x8655a7===_0x1cd950;},'gJbUr':function(_0x28fed9,_0x704630){return _0x28fed9+_0x704630;}};if(_0x5d8915){if(!_0x5801c3?.['environments']?.[_0x5d8915]){const _0x396710=Object[_0x1c4911(0x11f)](_0x5801c3?.[_0x1c4911(0xb2)]??{});throw new Error(_0x2d1578[_0x1c4911(0xd7)]('Auth\x20environment\x20\x22'+_0x5d8915+_0x1c4911(0x88),_0x396710[_0x1c4911(0x96)]?_0x1c4911(0xff)+_0x396710['join'](',\x20')+'.':_0x2d1578[_0x1c4911(0x91)])+_0x1c4911(0xd0));}return _0x5d8915;}if(!_0x5801c3)return null;if(_0x37c443){const _0x5a18c9=matchAuthEnvironmentExact(_0x37c443,_0x5801c3);if(_0x5a18c9)return _0x5a18c9;const _0x14cb0a=matchAuthEnvironmentByHost(_0x37c443,_0x5801c3);if(_0x14cb0a&&'key'in _0x14cb0a)return console['log']('\x20\x20Auth\x20env\x20\x22'+_0x14cb0a[_0x1c4911(0xbf)]+_0x1c4911(0x7d)+_0x37c443+_0x1c4911(0xb9)),_0x14cb0a['key'];if(_0x14cb0a&&_0x1c4911(0x8e)in _0x14cb0a)throw new Error('Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20('+_0x14cb0a[_0x1c4911(0x8e)][_0x1c4911(0xc7)](',\x20')+_0x1c4911(0xce));if(_0x2d1578['mAxiu'](needsTunnel,_0x37c443))throw new Error(_0x2d1578['qlhpE']('No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22'+_0x37c443+_0x1c4911(0x8d)+_0x1c4911(0x7a)+_0x1c4911(0xd6)+_0x1c4911(0xa4),'\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22'+_0x37c443['replace'](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a')+(_0x1c4911(0x7e)+_0x37c443+'\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.'));}if(_0x5801c3[_0x1c4911(0x116)])return _0x5801c3[_0x1c4911(0x116)];const _0x74759a=Object['keys'](_0x5801c3[_0x1c4911(0xb2)]??{});if(_0x2d1578['tLLId'](_0x74759a[_0x1c4911(0x96)],0x1))return _0x74759a[0x0];if(_0x74759a['length']===0x0)return null;throw new Error(_0x2d1578['gJbUr']('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x74759a['join'](',\x20')+').\x20','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>`.'));}function _0x3317(_0x225507,_0x490a7d){_0x225507=_0x225507-0x6e;const _0x7a986b=_0x7a98();let _0x331721=_0x7a986b[_0x225507];return _0x331721;}export function adHocProfileName(_0x47013d,_0x217e09,_0x186cca){const _0xaf1d11={'VxDXB':function(_0x42bd97,_0x11c8dd){return _0x42bd97===_0x11c8dd;}};if(!_0x217e09||_0xaf1d11['VxDXB'](_0x217e09,_0x186cca))return _0x47013d;return _0x47013d+':'+_0x217e09;}export async function resolveAdHocProfile(_0x5784bf={},_0xc2cfd2=process[_0x53b5fb(0xf4)]){const _0x5f241f=_0x53b5fb,_0x488370={'UAqQF':function(_0x564952,_0x5f4278,_0x4ca010,_0x349170){return _0x564952(_0x5f4278,_0x4ca010,_0x349170);},'NRQCJ':function(_0x95ddd4,_0x29cce3){return _0x95ddd4(_0x29cce3);},'SRIJy':function(_0xac28ed,_0xd2dc0d){return _0xac28ed&&_0xd2dc0d;}},_0x9eb644=_0xc2cfd2['RANGER_TEST_USERNAME'];if(!_0x9eb644)return null;const _0x49b8ce=await fetchAuthConfig(),_0x29c3dc=_0x488370[_0x5f241f(0x10d)](pickAdHocEnvKey,_0x49b8ce,_0x5784bf['targetUrl'],_0x5784bf['envKey']);let _0x3c45b1=adHocProfileName(_0x9eb644,_0x29c3dc,_0x49b8ce?.[_0x5f241f(0x116)]),_0x21e11f=await _0x488370[_0x5f241f(0x105)](fetchCloudProfile,_0x3c45b1);_0x488370[_0x5f241f(0x8a)](_0x21e11f,_0x29c3dc)&&_0x21e11f[_0x5f241f(0x90)]!==_0x29c3dc&&(console['log'](_0x5f241f(0x8c)+_0x3c45b1+_0x5f241f(0x84)+(_0x21e11f[_0x5f241f(0x90)]??'none')+'\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22'+_0x29c3dc+_0x5f241f(0xfd)+_0x9eb644+':'+_0x29c3dc+_0x5f241f(0xfa)),_0x3c45b1=_0x9eb644+':'+_0x29c3dc,_0x21e11f=await _0x488370[_0x5f241f(0x105)](fetchCloudProfile,_0x3c45b1));if(_0x21e11f)return{'name':_0x21e11f[_0x5f241f(0x10e)],'profile':_0x21e11f};const _0x32825a=_0xc2cfd2['RANGER_TEST_PASSWORD'],_0x109f6d=await createCloudProfile(_0x3c45b1,_0x29c3dc??undefined,{'username':_0x9eb644,'password':_0x32825a});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x109f6d['name']+'\x22\x20for\x20'+_0x9eb644+(_0x29c3dc?'\x20(auth\x20env:\x20'+_0x29c3dc+')':'')),{'name':_0x109f6d['name'],'profile':_0x109f6d};}export async function writeSessionToLocalCache(_0x9e1217,_0x420c12,_0x2f8048,_0x30e13f,_0x162440,_0x3bff75,_0x4d6aae){const _0xd2ae5f=_0x53b5fb,_0x3cfc6e={'Eqpqg':function(_0x45c634,_0x1b999e){return _0x45c634(_0x1b999e);},'ZYkdC':function(_0xa4a2ad,_0x55544d,_0x554d1f){return _0xa4a2ad(_0x55544d,_0x554d1f);},'qlHYL':function(_0x22c27b,_0xc085ac,_0x2eb388){return _0x22c27b(_0xc085ac,_0x2eb388);},'JBxPP':function(_0x4016f3){return _0x4016f3();},'NIOJC':_0xd2ae5f(0xb3),'mPRAr':function(_0x59382f,_0x248565,_0x96d880){return _0x59382f(_0x248565,_0x96d880);},'BSMtY':function(_0x3af2b9,_0x1a4d8b,_0x2b9ed3){return _0x3af2b9(_0x1a4d8b,_0x2b9ed3);}},_0x49d68e=_0x3cfc6e['Eqpqg'](sessionCacheHash,{'orgId':_0x420c12,'profileName':_0x9e1217,'effectiveBaseUrl':_0x2f8048,'setupHeaders':_0x30e13f,'invalidateOn':_0x4d6aae?.['invalidateOn'],'userAgent':_0x4d6aae?.[_0xd2ae5f(0x109)],'clientIp':_0x4d6aae?.[_0xd2ae5f(0xd4)]}),_0x2fabff=_0x3cfc6e['ZYkdC'](getSessionCachePath,_0x49d68e,_0x9e1217),_0x93262c=_0x3cfc6e[_0xd2ae5f(0x11a)](join,_0x3cfc6e['JBxPP'](getRangerHomeDir),_0x3cfc6e['NIOJC']);!existsSync(_0x93262c)&&await mkdir(_0x93262c,{'recursive':!![]});const _0x4a08b6={..._0x162440};_0x3bff75&&_0x3bff75['length']>0x0&&Array[_0xd2ae5f(0x114)](_0x4a08b6[_0xd2ae5f(0x10f)])&&(_0x4a08b6['cookies']=_0x3cfc6e[_0xd2ae5f(0x7f)](duplicateCookiesForDomains,_0x4a08b6[_0xd2ae5f(0x10f)],_0x3bff75));const _0xe83a9a={'cached_at':new Date()[_0xd2ae5f(0xc8)](),'session_state':_0x4a08b6};await _0x3cfc6e[_0xd2ae5f(0xa2)](writeFile,_0x2fabff,JSON[_0xd2ae5f(0xd1)](_0xe83a9a,null,0x2));const _0x1bb75f=getStorageStatePath(_0x2fabff);return await writeFile(_0x1bb75f,JSON[_0xd2ae5f(0xd1)](_0x4a08b6,null,0x2)),_0x1bb75f;}export async function checkLocalCache(_0x4769db,_0x47e45c,_0x1a8da5,_0x2c7b46,_0x6a87bf){const _0x2558eb=_0x53b5fb,_0x546600={'Nwihm':function(_0xeb8fbd,_0x52c6b9){return _0xeb8fbd(_0x52c6b9);},'yMIHr':function(_0x30cff0,_0x42a4a3){return _0x30cff0(_0x42a4a3);}},_0x4d3745=_0x546600[_0x2558eb(0xf7)](sessionCacheHash,{'orgId':_0x47e45c,'profileName':_0x4769db,'effectiveBaseUrl':_0x1a8da5,'setupHeaders':_0x2c7b46,'invalidateOn':_0x6a87bf?.['invalidateOn'],'userAgent':_0x6a87bf?.[_0x2558eb(0x109)],'clientIp':_0x6a87bf?.[_0x2558eb(0xd4)]}),_0x38fed0=getSessionCachePath(_0x4d3745,_0x4769db),_0x2f19eb=getStorageStatePath(_0x38fed0);if(!existsSync(_0x38fed0)||!_0x546600['yMIHr'](existsSync,_0x2f19eb))return null;try{const _0x26a901=await readFile(_0x38fed0,'utf-8');return JSON[_0x2558eb(0xea)](_0x26a901),{'storageStatePath':_0x2f19eb};}catch{return null;}}function launchRealBrowser(){const _0x33f8b5=_0x53b5fb;return chromium[_0x33f8b5(0x7c)]({'headless':!![]});}function emitSessionValidationHint(_0x52c158,_0x51eaf5){const _0x52d823=_0x53b5fb;if(!_0x51eaf5||!_0x51eaf5['domains']?.[_0x52d823(0x96)])return;let _0x33ac8b;try{_0x33ac8b=new URL(_0x52c158);}catch{return;}const _0xa0e7e9=[];for(const _0x3112e2 of _0x51eaf5['domains']){try{_0xa0e7e9['push']({'raw':_0x3112e2,'url':new URL(_0x3112e2)});}catch{}}if(_0xa0e7e9['length']===0x0)return;if(_0xa0e7e9[_0x52d823(0xf2)](_0x23b8a7=>_0x23b8a7['url'][_0x52d823(0x107)]===_0x33ac8b['origin']))return;const _0x539ff=_0xa0e7e9[_0x52d823(0xcf)](_0x267978=>'\x22'+_0x267978[_0x52d823(0xfe)]+'\x22')['join'](',\x20');console['log'](_0x52d823(0xdd)+_0x539ff+';\x20'+(_0x52d823(0xd8)+_0x52c158+_0x52d823(0x11d))+_0x52d823(0xb7));}export async function serverSideLogin(_0x383c14,_0x4dd0e1){const _0x4c6011=_0x53b5fb,_0x2c3bb6={'daQnb':function(_0x73a49e,_0x461232,_0x352b08){return _0x73a49e(_0x461232,_0x352b08);},'zvEVS':_0x4c6011(0x106),'ilnSs':function(_0x2b49ca,_0xfa53e7){return _0x2b49ca instanceof _0xfa53e7;},'kHFTU':function(_0x478a8f,_0x5a11c6){return _0x478a8f===_0x5a11c6;},'xkfYA':'not_configured'},_0x5eb8ec=process[_0x4c6011(0xf4)][_0x4c6011(0x94)],_0x2ed571=process[_0x4c6011(0xf4)]['RANGER_TEST_PASSWORD'],_0x2e1344={};if(_0x5eb8ec)_0x2e1344['username']=_0x5eb8ec;if(_0x2ed571)_0x2e1344[_0x4c6011(0x87)]=_0x2ed571;if(_0x4dd0e1?.['force'])_0x2e1344['force']=!![];if(_0x4dd0e1?.['targetUrl'])_0x2e1344['target_url']=_0x4dd0e1['targetUrl'];if(_0x4dd0e1?.['env'])_0x2e1344[_0x4c6011(0xf4)]=_0x4dd0e1[_0x4c6011(0xf4)];_0x4dd0e1?.['tunnel']&&(_0x2e1344[_0x4c6011(0x86)]=_0x4dd0e1[_0x4c6011(0xb4)][_0x4c6011(0x71)],_0x2e1344[_0x4c6011(0x75)]=_0x4dd0e1['tunnel'][_0x4c6011(0xc9)]);try{return await _0x2c3bb6[_0x4c6011(0x11c)](apiRequest,_0x4c6011(0xed)+encodeURIComponent(_0x383c14)+_0x4c6011(0xaf),{'method':_0x2c3bb6['zvEVS'],'body':JSON['stringify'](_0x2e1344)});}catch(_0x26f887){if(_0x2c3bb6['ilnSs'](_0x26f887,ApiError)&&_0x26f887[_0x4c6011(0xf3)]===0x190&&_0x2c3bb6[_0x4c6011(0x95)](_0x26f887['code'],_0x2c3bb6['xkfYA']))return{'status':'not_configured','error':_0x26f887['detail']};throw _0x26f887;}}async function serverSideLoginWithOptionalTunnel(_0x1e8f70,_0x586f80,_0x4425fa={}){const _0x289f23=_0x53b5fb,_0x5b7caa={'wwRCj':function(_0x560935,_0x3440ae){return _0x560935(_0x3440ae);},'HgypP':function(_0x1fc5b2,_0x3e9d4f){return _0x1fc5b2(_0x3e9d4f);},'PanYc':function(_0x21c5d4,_0x15dcbe){return _0x21c5d4===_0x15dcbe;},'qutiq':_0x289f23(0x81),'EjNaI':_0x289f23(0x125),'RVlYj':function(_0x2eb90b){return _0x2eb90b();},'BMDrz':function(_0x215854,_0x43b4b9,_0x2dd839){return _0x215854(_0x43b4b9,_0x2dd839);},'HTjpC':function(_0x5f3b56,_0x11a0ad){return _0x5f3b56??_0x11a0ad;},'URtui':'tunnel_login_setup','lMcNx':function(_0x4eeb07,_0x49ad03){return _0x4eeb07||_0x49ad03;},'MWlGU':'tunnel_login_cleanup'};if(!_0x5b7caa['HgypP'](needsTunnel,_0x586f80))return await serverSideLogin(_0x1e8f70,{'force':_0x4425fa['force'],'env':_0x4425fa[_0x289f23(0xf4)]});let _0x1b47bf=null,_0x1c0e7b=null,_0x55126c=null,_0x2509a1=null,_0x25373e=![];const _0x4863a4=process['env'][_0x289f23(0x10b)]?.['toLowerCase'](),_0x54c762=_0x4863a4==='1'||_0x5b7caa[_0x289f23(0xdb)](_0x4863a4,_0x5b7caa[_0x289f23(0xa5)]),_0x2462ed={'profileName':_0x1e8f70,'targetUrlHost':targetHostForTelemetry(_0x586f80),'tunnelRequired':!![],'forceLogin':_0x5b7caa[_0x289f23(0xe9)](Boolean,_0x4425fa['force']),'localBrowserServerHeaded':_0x54c762};try{_0x4425fa['telemetry']?.['trackPhaseStart']('tunnel_login_setup',_0x2462ed);_0x54c762&&console['log'](_0x5b7caa[_0x289f23(0x9d)]);_0x1b47bf=await launchBrowserServer({'headless':!_0x54c762}),_0x1c0e7b=await _0x5b7caa[_0x289f23(0xe9)](createTunnelSession,_0x586f80);const _0x57bf58=await _0x5b7caa['RVlYj'](requireToken);_0x55126c=await createTunnelBridge({'localWsUrl':_0x1b47bf[_0x289f23(0x123)],'tunnelServerUrl':_0x1c0e7b[_0x289f23(0xc3)],'sessionId':_0x1c0e7b['sessionId'],'apiKey':_0x57bf58,'onError':_0x499dbd=>{_0x2509a1=_0x499dbd;},'onClose':()=>{const _0x42daef=_0x289f23;_0x2509a1??=new Error(_0x42daef(0xdf)+_0x1e8f70);},'onEvent':_0x9683e0=>trackBridgeEvent(_0x4425fa[_0x289f23(0xb0)],_0x9683e0)}),_0x4425fa['telemetry']?.[_0x289f23(0xa3)]('tunnel_login_setup',{..._0x2462ed,'tunnelSessionId':_0x1c0e7b[_0x289f23(0x71)],'localBrowserServer':!![],'localBrowserServerHeaded':_0x54c762}),_0x25373e=!![];try{return _0x4425fa[_0x289f23(0xb0)]?.[_0x289f23(0xa6)](_0x289f23(0xa8),{..._0x2462ed,'tunnelSessionId':_0x1c0e7b['sessionId']}),await _0x5b7caa['BMDrz'](serverSideLogin,_0x1e8f70,{'force':_0x4425fa['force'],'targetUrl':_0x586f80,'env':_0x4425fa['env'],'tunnel':{'sessionId':_0x1c0e7b['sessionId'],'pwEndpoint':_0x1c0e7b[_0x289f23(0xc9)]}})['then'](_0x3a0b89=>{const _0x17268a=_0x289f23;return _0x4425fa[_0x17268a(0xb0)]?.[_0x17268a(0xa3)]('tunnel_login_request',{..._0x2462ed,'tunnelSessionId':_0x1c0e7b?.[_0x17268a(0x71)],'loginStatus':_0x3a0b89[_0x17268a(0xf3)],'hasSessionState':_0x5b7caa['wwRCj'](Boolean,_0x3a0b89[_0x17268a(0x115)]),'hasTestOutput':Boolean(_0x3a0b89['test_output']),'bridgeError':errorMessageForTelemetry(_0x2509a1)}),_0x3a0b89;});}catch(_0x12c092){await _0x4425fa['telemetry']?.['trackPhaseError']('tunnel_login_request',_0x5b7caa['HTjpC'](_0x2509a1,_0x12c092),{..._0x2462ed,'tunnelSessionId':_0x1c0e7b['sessionId'],'bridgeError':errorMessageForTelemetry(_0x2509a1)});throw _0x2509a1??_0x12c092;}}catch(_0x3e1f1c){!_0x25373e&&await _0x4425fa[_0x289f23(0xb0)]?.['trackPhaseError'](_0x5b7caa[_0x289f23(0x112)],_0x3e1f1c,{..._0x2462ed,'tunnelSessionId':_0x1c0e7b?.['sessionId']});throw _0x3e1f1c;}finally{(_0x5b7caa['lMcNx'](_0x1c0e7b,_0x1b47bf)||_0x55126c)&&(_0x4425fa['telemetry']?.[_0x289f23(0xa6)](_0x5b7caa[_0x289f23(0xd9)],{..._0x2462ed,'tunnelSessionId':_0x1c0e7b?.[_0x289f23(0x71)]}),_0x55126c?.[_0x289f23(0xd2)](),_0x1b47bf&&await _0x1b47bf[_0x289f23(0xd2)]()['catch'](()=>{}),_0x1c0e7b&&await _0x5b7caa[_0x289f23(0xda)](deleteTunnelSession,_0x1c0e7b['sessionId'])['catch'](()=>{}),_0x4425fa['telemetry']?.['trackPhaseEnd'](_0x5b7caa['MWlGU'],{..._0x2462ed,'tunnelSessionId':_0x1c0e7b?.[_0x289f23(0x71)]}));}}export async function manualBrowserLogin(_0x208bf7,_0x341a0e,_0x491144={}){const _0x566cf0=_0x53b5fb,_0x34eba2={'EvWkJ':function(_0x596382){return _0x596382();},'XzaiK':_0x566cf0(0xd2),'AWWzt':function(_0x127d05){return _0x127d05();},'oVGOU':function(_0x4a327f,_0x12221d){return _0x4a327f+_0x12221d;},'FChbX':'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','AamUQ':function(_0x31cdc5,_0x3b71ec){return _0x31cdc5>_0x3b71ec;},'dchiR':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','XfPEz':function(_0x5d2dd1,_0x5b7744){return _0x5d2dd1!==_0x5b7744;},'PzjGt':function(_0x54bbe3,_0xc0f3a8){return _0x54bbe3(_0xc0f3a8);},'sljAu':'cli:manual-login'};if(!_0x34eba2['AWWzt'](isInteractive))throw new Error(_0x34eba2['oVGOU']('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x208bf7[_0x566cf0(0x10e)]+_0x566cf0(0x8d),'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20')+_0x34eba2[_0x566cf0(0x120)]);const _0x49a4da=_0x341a0e&&_0x34eba2[_0x566cf0(0xae)](_0x341a0e[_0x566cf0(0xac)][_0x566cf0(0x96)],0x0)?_0x341a0e['domains'][0x0]:'about:blank';console[_0x566cf0(0xee)]('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log'](_0x566cf0(0xdc)),await new Promise(_0x2ed742=>setTimeout(_0x2ed742,0x7d0));const _0x239e97=await chromium[_0x566cf0(0x7c)]({'headless':![]});let _0xc3f248=null;try{const _0x107d37={'ignoreHTTPSErrors':!![]};_0x341a0e?.[_0x566cf0(0xd5)]&&(_0x107d37['extraHTTPHeaders']=_0x341a0e[_0x566cf0(0xd5)]);const _0x27c482=await _0x239e97['newContext'](_0x107d37);await addProfileSetupBanner(_0x27c482);const _0x234e86=await _0x27c482['newPage']();await _0x234e86['goto'](_0x49a4da);let _0x3df6ed=![];await new Promise(_0x1bf653=>{const _0x1b9e25={'SOqad':function(_0x35acb4,_0x467c82){return _0x35acb4(_0x467c82);}},_0xd8bd16=setTimeout(()=>{const _0x5859a0=_0x3317;_0x3df6ed=!![],console[_0x5859a0(0x72)](_0x5859a0(0xe8)+MANUAL_LOGIN_TIMEOUT_MS/0xea60+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x34eba2[_0x5859a0(0x101)](_0x1bf653);},MANUAL_LOGIN_TIMEOUT_MS);_0x234e86['on'](_0x34eba2['XzaiK'],async()=>{const _0x336960=_0x3317;_0x1b9e25[_0x336960(0xf0)](clearTimeout,_0xd8bd16);try{const _0x4587a2=await _0x27c482['storageState']();_0xc3f248=_0x4587a2;}catch{}_0x1bf653();});});if(_0x3df6ed&&!_0xc3f248)throw new Error(_0x566cf0(0x76));}finally{await _0x239e97[_0x566cf0(0xd2)]()['catch'](()=>{});}if(!_0xc3f248)throw new Error(_0x34eba2['dchiR']);return _0x34eba2[_0x566cf0(0x113)](_0x491144[_0x566cf0(0xb6)],![])&&await apiRequest('/api/v1/profiles/'+_0x34eba2['PzjGt'](encodeURIComponent,_0x208bf7['name'])+_0x566cf0(0xa9),{'method':'POST','body':JSON['stringify']({'session_state':_0xc3f248,'updated_by':_0x34eba2['sljAu']})}),{'sessionState':_0xc3f248};}export async function promptSaveCredentials(_0x245558){const _0x31b545=_0x53b5fb,_0x525006={'UVmAu':function(_0x5cafd5,_0x1d0fd0){return _0x5cafd5||_0x1d0fd0;},'TaCWO':'confirm','Iiekp':_0x31b545(0x128),'Dephq':_0x31b545(0x11b)},_0x569aab=process[_0x31b545(0xf4)][_0x31b545(0x94)],_0x54f0d1=process['env'][_0x31b545(0x111)];if(_0x525006['UVmAu'](!_0x569aab,!_0x54f0d1))return;if(!isInteractive())return;const {save:_0x1bad6d}=await _0x426f01[_0x31b545(0xec)]([{'type':_0x525006['TaCWO'],'name':_0x525006['Iiekp'],'message':_0x31b545(0x6f),'default':![]}]);if(!_0x1bad6d)return;await apiRequest(_0x31b545(0xed)+encodeURIComponent(_0x245558),{'method':'PUT','body':JSON['stringify']({'username':_0x569aab,'password':_0x54f0d1})}),console['log'](_0x525006['Dephq']);}export async function resolveCloudProfileSession(_0x281f26,_0xd37cee={}){const _0x2e4844=_0x53b5fb,_0x4f22f5={'TYfRH':function(_0x557ba4){return _0x557ba4();},'dbnEE':function(_0x39d5e5,_0x20ce9,_0x30b94f){return _0x39d5e5(_0x20ce9,_0x30b94f);},'crTso':_0x2e4844(0xb5),'zNouC':function(_0x29ceb1,_0x169809){return _0x29ceb1===_0x169809;},'qXUPM':function(_0x473e1d,_0x50c1c3){return _0x473e1d||_0x50c1c3;},'mhkNx':function(_0x259cea,_0x596b64){return _0x259cea(_0x596b64);},'mVcNH':function(_0x497bf0,_0x5b7554){return _0x497bf0>_0x5b7554;},'yTwMQ':function(_0x3822b1,_0x5b956c,_0x222796,_0x5097fe,_0x360193,_0x4af339){return _0x3822b1(_0x5b956c,_0x222796,_0x5097fe,_0x360193,_0x4af339);},'uIwAU':function(_0x4b9851,_0x381212){return _0x4b9851(_0x381212);},'pwCQH':function(_0x20ba08,_0x56c9d9){return _0x20ba08||_0x56c9d9;},'mQaON':'not_configured','PVLBi':_0x2e4844(0xc5),'TYGWz':'\x20\x20Login\x20successful.\x20Session\x20cached.','EUkci':function(_0x2e72e5,_0x1a9f4a,_0x4e33d8,_0x2261ec,_0x5e90c3,_0x41e005,_0x1bdd1f,_0x2c2e52){return _0x2e72e5(_0x1a9f4a,_0x4e33d8,_0x2261ec,_0x5e90c3,_0x41e005,_0x1bdd1f,_0x2c2e52);},'ecTvH':function(_0x200b47,_0x18683d){return _0x200b47 instanceof _0x18683d;},'IdSrq':function(_0x23f713,_0x17a197){return _0x23f713(_0x17a197);},'FijBx':_0x2e4844(0xe6),'aUbax':_0x2e4844(0xc1),'ARHJu':function(_0x57a584,_0x2d71b6,_0x43fbb1,_0x4693fe){return _0x57a584(_0x2d71b6,_0x43fbb1,_0x4693fe);},'slhHa':function(_0x45a275,_0x33cd85,_0x420b7b,_0x181ec1,_0xcc0993,_0x4980f6,_0x4553fb,_0x18f4f7){return _0x45a275(_0x33cd85,_0x420b7b,_0x181ec1,_0xcc0993,_0x4980f6,_0x4553fb,_0x18f4f7);}},_0x2ba892=_0x281f26['settings']??{},_0x262c0e=await _0x4f22f5[_0x2e4844(0x11e)](fetchAuthConfig),_0xea7a2e=_0x262c0e?_0x4f22f5['dbnEE'](resolveAuthEnvironmentLocally,_0x262c0e,_0xd37cee[_0x2e4844(0x110)]??_0x281f26[_0x2e4844(0x90)]):null,_0x138503=typeof _0xea7a2e?.['loginInstructions']===_0x4f22f5[_0x2e4844(0xa7)]&&_0xea7a2e['loginInstructions']['trim']()?_0xea7a2e['loginInstructions']:undefined,_0xa19eaf=_0x4f22f5[_0x2e4844(0xde)](typeof _0x2ba892['loginInstructions'],_0x4f22f5[_0x2e4844(0xa7)])&&_0x2ba892[_0x2e4844(0xe7)][_0x2e4844(0x98)]()?_0x2ba892[_0x2e4844(0xe7)]:undefined,_0x5b87c1=_0x4f22f5[_0x2e4844(0xe2)](_0xa19eaf,!_0x138503)?_0x2ba892:{..._0x2ba892,'loginInstructions':_0x138503},_0x4d5653=_0x4f22f5['mhkNx'](Boolean,_0x5b87c1['loginInstructions']?.['trim']()),_0x110d8f=_0x4f22f5[_0x2e4844(0xef)](Boolean,_0x2ba892[_0x2e4844(0xbd)]||_0xea7a2e?.[_0x2e4844(0xbd)]),_0x4988e7=_0xea7a2e?.[_0x2e4844(0xac)],_0x1f6f08=_0x2ba892['setupHeaders'],_0x4dadd4=_0x1f6f08??_0xea7a2e?.[_0x2e4844(0xd5)],_0x104044=_0xd37cee[_0x2e4844(0x82)]??_0x2ba892[_0x2e4844(0x10c)]??(_0x4988e7&&_0x4f22f5[_0x2e4844(0x79)](_0x4988e7[_0x2e4844(0x96)],0x0)?_0x4988e7[0x0]:''),_0x3be095=_0x104044?needsTunnel(_0x104044):![],_0x46f069={'invalidateOn':_0xea7a2e?.['invalidateOn'],'userAgent':_0xea7a2e?.['browserOptions']?.['userAgent']??_0x2ba892['userAgent']};_0x110d8f&&console['log']('\x20\x20forceLogin\x20enabled\x20for\x20\x22'+_0x281f26[_0x2e4844(0x10e)]+'\x22,\x20refreshing\x20session...');if(!_0x110d8f){const _0x58d312=await _0x4f22f5['yTwMQ'](checkLocalCache,_0x281f26[_0x2e4844(0x10e)],_0x281f26['organizationId'],_0x104044,_0x4dadd4,_0x46f069);if(_0x58d312){if(_0x104044&&!_0x3be095){const _0x3b53e4=await isCachedSessionLive(_0x58d312['storageStatePath'],_0x104044,{'sessionCheckPath':_0xea7a2e?.[_0x2e4844(0xf1)],'setupHeaders':_0x4dadd4},{'launchBrowser':launchRealBrowser});if(_0x3b53e4)return console['log']('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x281f26[_0x2e4844(0x10e)]+'\x22'),{'authPath':_0x58d312[_0x2e4844(0x85)],'settings':_0x5b87c1,'resolvedEnv':_0xea7a2e};console[_0x2e4844(0xee)](_0x2e4844(0x9e)+_0x281f26[_0x2e4844(0x10e)]+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x4f22f5['dbnEE'](emitSessionValidationHint,_0x104044,_0xea7a2e);}else return _0x3be095&&console[_0x2e4844(0xee)](_0x2e4844(0xbe)+_0x281f26['name']+'\x22'),{'authPath':_0x58d312['storageStatePath'],'settings':_0x5b87c1,'resolvedEnv':_0xea7a2e};}}if(!_0x110d8f&&_0x281f26[_0x2e4844(0xeb)]){const _0xb5796e=await writeSessionToLocalCache(_0x281f26[_0x2e4844(0x10e)],_0x281f26['organizationId'],_0x104044,_0x4dadd4,_0x281f26[_0x2e4844(0xeb)],_0x4988e7,_0x46f069);if(_0x104044){const _0x51aff1=await isCachedSessionLive(_0xb5796e,_0x104044,{'sessionCheckPath':_0xea7a2e?.['sessionCheckPath'],'setupHeaders':_0x4dadd4},{'launchBrowser':launchRealBrowser});if(_0x51aff1)return console[_0x2e4844(0xee)]('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x281f26[_0x2e4844(0x10e)]+_0x2e4844(0xa0)),{'authPath':_0xb5796e,'settings':_0x5b87c1,'resolvedEnv':_0xea7a2e};console['log'](_0x2e4844(0x10a)+_0x281f26['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),emitSessionValidationHint(_0x104044,_0xea7a2e);}else return{'authPath':_0xb5796e,'settings':_0x5b87c1,'resolvedEnv':_0xea7a2e};}if(_0x4d5653)return console['log'](_0x2e4844(0x78)+_0x281f26['name']+_0x2e4844(0x7b)),{'authPath':undefined,'settings':_0x5b87c1,'resolvedEnv':_0xea7a2e};console[_0x2e4844(0xee)](_0x2e4844(0x78)+_0x281f26[_0x2e4844(0x10e)]+'\x22,\x20attempting\x20login...');const _0x10cc90=Boolean(process[_0x2e4844(0xf4)]['RANGER_TEST_USERNAME'])&&_0x4f22f5['uIwAU'](Boolean,process[_0x2e4844(0xf4)][_0x2e4844(0x111)]),_0x180f3c=_0x4f22f5['mhkNx'](Boolean,_0x281f26['username']),_0x569ad0=Boolean(_0xd37cee['assertedEnv']),_0x172ddf=_0x104044?_0x4f22f5[_0x2e4844(0xef)](isBareLocalhost,_0x104044):![],_0x3e71b5=_0x4f22f5['qXUPM'](_0x10cc90,_0x180f3c)&&_0x4f22f5[_0x2e4844(0x9f)](!_0x172ddf,_0x569ad0);if(_0x3e71b5)try{const _0x3c06fd=_0x104044?await serverSideLoginWithOptionalTunnel(_0x281f26['name'],_0x104044,{'force':_0x110d8f,'telemetry':_0xd37cee[_0x2e4844(0xb0)],'env':_0xd37cee['assertedEnv']}):await serverSideLogin(_0x281f26['name'],{'force':_0x110d8f,'env':_0xd37cee['assertedEnv']});if(_0x3c06fd[_0x2e4844(0xf3)]===_0x4f22f5[_0x2e4844(0x74)])console['log'](_0x2e4844(0xb1));else{if(_0x3c06fd[_0x2e4844(0xf3)]===_0x4f22f5['PVLBi']&&_0x3c06fd[_0x2e4844(0x115)]){console[_0x2e4844(0xee)](_0x4f22f5[_0x2e4844(0x9b)]);const _0x5df487=await _0x4f22f5['EUkci'](writeSessionToLocalCache,_0x281f26[_0x2e4844(0x10e)],_0x281f26['organizationId'],_0x104044,_0x4dadd4,_0x3c06fd['session_state'],_0x4988e7,_0x46f069);return _0x10cc90&&!_0x180f3c&&await promptSaveCredentials(_0x281f26['name']),{'authPath':_0x5df487,'settings':_0x5b87c1,'resolvedEnv':_0xea7a2e};}else _0x3c06fd[_0x2e4844(0xf5)]&&(console['log'](_0x2e4844(0x89)),console[_0x2e4844(0xee)](_0x3c06fd[_0x2e4844(0xf5)])),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0x4497db){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x4f22f5['ecTvH'](_0x4497db,Error)?_0x4497db[_0x2e4844(0xbc)]:_0x4f22f5['IdSrq'](String,_0x4497db))),console[_0x2e4844(0xee)](_0x4f22f5['FijBx']);}if(_0x172ddf&&!_0x569ad0&&!isInteractive())throw new Error(_0x2e4844(0xe5)+_0x104044+'\x22\x20on\x20profile\x20\x22'+_0x281f26['name']+_0x2e4844(0xe4)+(_0x2e4844(0x92)+_0x281f26[_0x2e4844(0x10e)]+'\x20--url\x20'+_0x104044+'\x0a')+_0x4f22f5['aUbax']);const _0x5ec4c9=_0xea7a2e?{..._0xea7a2e,'domains':_0x4f22f5['dbnEE'](orderLoginDomains,_0x104044,_0xea7a2e[_0x2e4844(0xac)]),'setupHeaders':_0x4dadd4}:_0x104044?{'key':_0x281f26[_0x2e4844(0x90)]??'','domains':[_0x104044],'setupHeaders':_0x4dadd4}:null,{sessionState:_0x39f4b4}=await _0x4f22f5['ARHJu'](manualBrowserLogin,_0x281f26,_0x5ec4c9,{'persistSessionState':!_0x3be095}),_0x24f01b=await _0x4f22f5[_0x2e4844(0xd3)](writeSessionToLocalCache,_0x281f26[_0x2e4844(0x10e)],_0x281f26[_0x2e4844(0x80)],_0x104044,_0x4dadd4,_0x39f4b4,_0x4988e7,_0x46f069);return{'authPath':_0x24f01b,'settings':_0x5b87c1,'resolvedEnv':_0xea7a2e};}
1
+ const _0x25ed96=_0xdb1b;(function(_0x798f6f,_0xbfc016){const _0x1ce422=_0xdb1b,_0x516fc7=_0x798f6f();while(!![]){try{const _0x51b9cc=parseInt(_0x1ce422(0x1bb))/0x1+parseInt(_0x1ce422(0x1ee))/0x2+-parseInt(_0x1ce422(0x188))/0x3*(parseInt(_0x1ce422(0x1fe))/0x4)+-parseInt(_0x1ce422(0x192))/0x5*(-parseInt(_0x1ce422(0x1c6))/0x6)+-parseInt(_0x1ce422(0x1aa))/0x7+parseInt(_0x1ce422(0x1e7))/0x8*(parseInt(_0x1ce422(0x1b8))/0x9)+-parseInt(_0x1ce422(0x1ff))/0xa;if(_0x51b9cc===_0xbfc016)break;else _0x516fc7['push'](_0x516fc7['shift']());}catch(_0xb237cb){_0x516fc7['push'](_0x516fc7['shift']());}}}(_0xa0f0,0xec11d));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x226ce7 from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isBareLocalhost,isCachedSessionLive,isInteractive,needsTunnel,orderLoginDomains,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x93010a){const _0x4b7259=_0xdb1b;try{return new URL(_0x93010a)[_0x4b7259(0x184)];}catch{return _0x4b7259(0x1b4);}}function errorMessageForTelemetry(_0x1d16f2){const _0x20037f=_0xdb1b,_0x56855e={'ZgwII':function(_0x319d3c,_0x46d946){return _0x319d3c instanceof _0x46d946;}};return _0x56855e['ZgwII'](_0x1d16f2,Error)?_0x1d16f2[_0x20037f(0x196)]:undefined;}function trackBridgeEvent(_0x22bbbb,_0x3d7ba7){const _0x16d40e=_0xdb1b,_0x4f0b1b={'wonEv':'tunnel_bridge_event','BZihN':function(_0x3be5eb,_0x596592){return _0x3be5eb===_0x596592;},'IrgCD':'tunnel_error','ClgyF':'local_ws_error'};if(!_0x22bbbb)return;const _0x275220={'tunnelSessionId':_0x3d7ba7['sessionId'],'tunnelEventType':_0x3d7ba7['type'],'connectionId':_0x3d7ba7['connectionId'],'code':_0x3d7ba7['code'],'reason':_0x3d7ba7['reason'],'error':_0x3d7ba7[_0x16d40e(0x21a)],'elapsedMs':_0x3d7ba7[_0x16d40e(0x175)],'activeLocalConnections':_0x3d7ba7['activeLocalConnections'],'pendingLocalConnections':_0x3d7ba7[_0x16d40e(0x18e)]};_0x22bbbb[_0x16d40e(0x1da)](_0x4f0b1b['wonEv'],_0x275220),(_0x4f0b1b[_0x16d40e(0x165)](_0x3d7ba7[_0x16d40e(0x17b)],_0x4f0b1b[_0x16d40e(0x16a)])||_0x4f0b1b['BZihN'](_0x3d7ba7[_0x16d40e(0x17b)],_0x4f0b1b[_0x16d40e(0x1e5)]))&&void _0x22bbbb[_0x16d40e(0x214)]('tunnel_bridge',new Error(_0x3d7ba7['error']??_0x3d7ba7[_0x16d40e(0x17b)]),_0x275220);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x59618d=await getToken();if(!_0x59618d)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');return _0x59618d;}async function apiRequest(_0x45924d,_0x18e67e={}){const _0x663edd=_0xdb1b,_0x2a0329={'eRwOL':function(_0x5a6749){return _0x5a6749();},'ozmxI':function(_0x4429e2,_0x3d1fd9,_0x358fed){return _0x4429e2(_0x3d1fd9,_0x358fed);},'chhYe':function(_0x1883d9,_0x3cff81){return _0x1883d9===_0x3cff81;},'URTcs':'string'},_0xb3e008=await _0x2a0329['eRwOL'](requireToken),_0x44e4ce=getApiBaseUrl(),_0x2d5793=await _0x2a0329[_0x663edd(0x1c7)](fetch,''+_0x44e4ce+_0x45924d,{..._0x18e67e,'headers':{'Authorization':_0x663edd(0x166)+_0xb3e008,'Content-Type':_0x663edd(0x16e),..._0x18e67e[_0x663edd(0x19f)]??{}}});if(!_0x2d5793['ok']){let _0x21d069='',_0x49f3ae;try{const _0x4599d6=await _0x2d5793[_0x663edd(0x1f6)](),_0x134a6f=(_0x2a0329[_0x663edd(0x1c5)](typeof _0x4599d6['error'],_0x663edd(0x1ca))?_0x4599d6[_0x663edd(0x21a)]:undefined)??JSON['stringify'](_0x4599d6);_0x21d069=_0x134a6f;typeof _0x4599d6[_0x663edd(0x1c2)]===_0x2a0329['URTcs']&&_0x4599d6[_0x663edd(0x1c2)]&&(_0x21d069=_0x21d069+'\x0a'+_0x4599d6[_0x663edd(0x1c2)]);if(_0x2a0329['chhYe'](typeof _0x4599d6[_0x663edd(0x1b0)],'string'))_0x49f3ae=_0x4599d6[_0x663edd(0x1b0)];}catch{_0x21d069=_0x2d5793[_0x663edd(0x170)];}throw new ApiError('API\x20request\x20'+_0x45924d+_0x663edd(0x190)+_0x2d5793[_0x663edd(0x17a)]+'):\x20'+_0x21d069,_0x2d5793[_0x663edd(0x17a)],_0x21d069,_0x49f3ae);}if(_0x2d5793[_0x663edd(0x17a)]===0xcc)return undefined;return _0x2d5793['json']();}export class ApiError extends Error{['status'];['detail'];[_0x25ed96(0x1b0)];constructor(_0x486244,_0x8239fe,_0xb70317,_0xe93b9b){const _0x5ba6bb=_0x25ed96,_0x1f25ac={'YQtXB':_0x5ba6bb(0x174)};super(_0x486244),this[_0x5ba6bb(0x17a)]=_0x8239fe,this['detail']=_0xb70317,this[_0x5ba6bb(0x1b0)]=_0xe93b9b,this[_0x5ba6bb(0x1a3)]=_0x1f25ac['YQtXB'];}}export async function fetchCloudProfile(_0x330146){const _0x2f869e=_0x25ed96,_0x3527ae={'UnOgg':function(_0x41df68,_0x3c87f3){return _0x41df68 instanceof _0x3c87f3;},'bJmWU':function(_0x5d1ce0,_0x7ac9cf){return _0x5d1ce0===_0x7ac9cf;}};try{return await apiRequest(_0x2f869e(0x1f5)+encodeURIComponent(_0x330146));}catch(_0x5accf9){if(_0x3527ae[_0x2f869e(0x1d9)](_0x5accf9,ApiError)&&_0x3527ae[_0x2f869e(0x168)](_0x5accf9['status'],0x194))return null;throw _0x5accf9;}}export async function listCloudProfiles(){const _0x21631b=_0x25ed96,_0x353219={'bdgnK':'/api/v1/profiles'},_0x24db0a=await apiRequest(_0x353219['bdgnK']);return _0x24db0a[_0x21631b(0x1d6)];}export async function deleteCloudProfile(_0x98610b){const _0x25bf25=_0x25ed96;try{await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x98610b),{'method':'DELETE'});}catch(_0x4900cc){if(_0x4900cc instanceof ApiError&&_0x4900cc[_0x25bf25(0x17a)]===0x194)throw new Error(_0x25bf25(0x221)+_0x98610b+'\x22\x20not\x20found.');throw _0x4900cc;}}function _0xa0f0(){const _0x32d51b=['/login','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>`.','PWPql','storageStatePath','profiles','fHmRX','Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20(','UnOgg','trackPhaseEnd','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','tunnel_login_request','join','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','environment_key','wsEndpoint','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','extraHTTPHeaders','organizationId','jicvZ','ClgyF','\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a','514328PKsSOH','\x22\x20on\x20profile\x20\x22','PNYWV','map','\x22,\x20and\x20cloud\x20sessions\x20don\x27t\x20apply\x20to\x20localhost.\x0a','invalidateOn','envKey','998270FpKTCL','SfPfg','replace','DELETE','loginInstructions','\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a','QYaWl','/api/v1/profiles/','json','setupHeaders','\x22,\x20attempting\x20login...','sessionId','stringify','\x22,\x20refreshing\x20session...','domains','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','116HoEbra','5796550tUOTLB','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','newPage','close','ZWQlx','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','env','session_state','JfhvB','whskW','kLjxP','\x22\x20matched\x20by\x20host\x20for\x20','ABilH','storageState','YrNqK','browserOptions','success','JKgvX','omPQX','qwEBx','RANGER_TEST_PASSWORD','trackPhaseError','sKsFo','No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','wvYVR','tunnel','error','keys','THitF','opfyK','length','xKPoZ','environmentKey','Cloud\x20profile\x20\x22','sessionCheckPath','Edxdi','auth','/api/v1/profiles','forceLogin','vBKqK','BZihN','Bearer\x20','COuTq','bJmWU','tunnel_session_id','IrgCD','FhCUJ','MkTwG','effectiveBaseUrl','application/json','\x20\x20Login\x20successful.\x20Session\x20cached.','statusText','RANGER_TUNNEL_LOGIN_HEADED','log','isArray','ApiError','elapsedMs','Browser\x20login\x20timed\x20out\x20before\x20completion.','RANGER_TEST_USERNAME','YWemU','GFGzp','status','type','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','WRPwW','FvZjx','RxAiB','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','origin','EfVYm','gRknK','host','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','push','force','173427tBpnNG','/api/v1/profiles/auth-config','\x20\x20•\x20or\x20pass\x20--env\x20<key>\x20to\x20run\x20an\x20automated\x20login\x20for\x20this\x20target.','\x22\x20instead.','Tvifg','tOFCB','pendingLocalConnections','trim','\x20failed\x20(','mcXry','25dIHWvo','settings','trackPhaseStart','none','message','ambiguous','clientIp','\x20\x20Created\x20cloud\x20profile\x20\x22','/session','WmRxp','\x20\x20Server-side\x20login\x20error:\x20','newContext','Browser\x20login\x20timed\x20out\x20after\x20','headers','maXfT','target_url','\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20','name','userAgent','pNWWK','cookies','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','assertedEnv','\x22;\x20proceeding\x20with\x20loginInstructions.','9821427hfLGat','true','environments','\x20--url\x20','OtQfG','oXZkv','code','RQMZC','NiXEb','parse','invalid-url','sessionState','SqUbD','\x22.\x0a','72QnppYL','utf-8','POST','1708185hzBrJT','key','\x20\x20Cached\x20session\x20for\x20\x22','telemetry','username','KhAzu','\x20\x20No\x20live\x20session\x20for\x20\x22','test_output','\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)','Auth\x20environment\x20\x22','chhYe','2285364SUdSmt','ozmxI','pw_endpoint','\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22','string','defaultEnvironmentKey','ZElnw','/api/v1/tunnel/sessions/','MTObm','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','TpHSd','HLGOs'];_0xa0f0=function(){return _0x32d51b;};return _0xa0f0();}export async function createCloudProfile(_0x31293c,_0xbd48f2,_0x59d21d={}){const _0x484f02=_0x25ed96,_0x61197a={'yRphM':function(_0x535625,_0x2e5711,_0x1692e7){return _0x535625(_0x2e5711,_0x1692e7);}},_0x42eb35={'name':_0x31293c};if(_0xbd48f2)_0x42eb35[_0x484f02(0x1df)]=_0xbd48f2;_0x59d21d[_0x484f02(0x193)]&&Object[_0x484f02(0x21b)](_0x59d21d[_0x484f02(0x193)])['length']>0x0&&(_0x42eb35['settings']=_0x59d21d['settings']);if(_0x59d21d['username'])_0x42eb35['username']=_0x59d21d['username'];if(_0x59d21d['password'])_0x42eb35['password']=_0x59d21d['password'];return await _0x61197a['yRphM'](apiRequest,_0x484f02(0x162),{'method':'POST','body':JSON[_0x484f02(0x1fa)](_0x42eb35)});}export async function uploadCloudProfileSession(_0x1f99b9,_0x1a6f6d){const _0x42e3a9=_0x25ed96,_0x3bb642={'QYaWl':function(_0x19ff56,_0xabd062,_0x247e74){return _0x19ff56(_0xabd062,_0x247e74);},'omPQX':function(_0x34b9b5,_0xefcea5){return _0x34b9b5(_0xefcea5);}};return await _0x3bb642[_0x42e3a9(0x1f4)](apiRequest,'/api/v1/profiles/'+_0x3bb642[_0x42e3a9(0x211)](encodeURIComponent,_0x1f99b9)+_0x42e3a9(0x19a),{'method':'POST','body':JSON[_0x42e3a9(0x1fa)]({'session_state':_0x1a6f6d})});}export async function saveCloudProfileCredentials(_0x2fd36d,_0x32c198,_0xb3ac10){const _0x114d60={'cDITo':function(_0x49f149,_0x125a3b,_0x3a0707){return _0x49f149(_0x125a3b,_0x3a0707);},'UaoVV':function(_0x2a59c3,_0x25a720){return _0x2a59c3(_0x25a720);}};await _0x114d60['cDITo'](apiRequest,'/api/v1/profiles/'+_0x114d60['UaoVV'](encodeURIComponent,_0x2fd36d),{'method':'PUT','body':JSON['stringify']({'username':_0x32c198,'password':_0xb3ac10})});}export async function fetchAuthConfig(){const _0x219cc1=_0x25ed96,_0x19c58c={'IdSVf':function(_0x41eb8b,_0x1b53b6){return _0x41eb8b instanceof _0x1b53b6;}};try{const _0x21d146=await apiRequest(_0x219cc1(0x189));return _0x21d146['auth_config'];}catch(_0x49a49b){return _0x19c58c['IdSVf'](_0x49a49b,ApiError)&&_0x49a49b['status']!==0x194&&console['error'](_0x219cc1(0x1de)+_0x49a49b['message']),null;}}function _0xdb1b(_0x441673,_0x15cf64){_0x441673=_0x441673-0x162;const _0xa0f059=_0xa0f0();let _0xdb1b03=_0xa0f059[_0x441673];return _0xdb1b03;}async function createTunnelSession(_0x1c19f9){const _0x4fdff1=_0x25ed96,_0x55595a={'FuVGf':function(_0x194bf6,_0x3a51ee,_0x2bcfd6){return _0x194bf6(_0x3a51ee,_0x2bcfd6);},'MkTwG':'agent'};return await _0x55595a['FuVGf'](apiRequest,'/api/v1/tunnel/sessions',{'method':_0x4fdff1(0x1ba),'body':JSON['stringify']({'targetUrl':_0x1c19f9,'mode':_0x55595a[_0x4fdff1(0x16c)]})});}async function deleteTunnelSession(_0x1b9e61){const _0x3bcd34=_0x25ed96,_0x558b62={'SqUbD':_0x3bcd34(0x1f1)};await apiRequest(_0x3bcd34(0x1cd)+_0x1b9e61,{'method':_0x558b62[_0x3bcd34(0x1b6)]});}export function pickAdHocEnvKey(_0x439fb8,_0x1d3057,_0x1067af){const _0x3419ca=_0x25ed96,_0x18c7bc={'nHRMN':function(_0x229ada,_0x3e10eb){return _0x229ada+_0x3e10eb;},'HLGOs':function(_0x514af3,_0x13a337){return _0x514af3+_0x13a337;},'YWemU':function(_0x4e9320,_0x21185e,_0x62bcad){return _0x4e9320(_0x21185e,_0x62bcad);},'maXfT':function(_0x3ddfd3,_0x39a7f7){return _0x3ddfd3 in _0x39a7f7;},'GVmMt':_0x3419ca(0x197),'EfVYm':function(_0x2e2b41,_0x3a39d5){return _0x2e2b41+_0x3a39d5;},'MTObm':function(_0x532ed3,_0x57923d){return _0x532ed3===_0x57923d;}};if(_0x1067af){if(!_0x439fb8?.[_0x3419ca(0x1ac)]?.[_0x1067af]){const _0x20cf76=Object[_0x3419ca(0x21b)](_0x439fb8?.[_0x3419ca(0x1ac)]??{});throw new Error(_0x18c7bc['nHRMN'](_0x18c7bc['HLGOs'](_0x3419ca(0x1c4)+_0x1067af+'\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.',_0x20cf76[_0x3419ca(0x21e)]?'\x20Available:\x20'+_0x20cf76[_0x3419ca(0x1dd)](',\x20')+'.':_0x3419ca(0x1cf)),_0x3419ca(0x1c3)));}return _0x1067af;}if(!_0x439fb8)return null;if(_0x1d3057){const _0x5971d7=_0x18c7bc[_0x3419ca(0x178)](matchAuthEnvironmentExact,_0x1d3057,_0x439fb8);if(_0x5971d7)return _0x5971d7;const _0x1dfdb8=matchAuthEnvironmentByHost(_0x1d3057,_0x439fb8);if(_0x1dfdb8&&_0x18c7bc[_0x3419ca(0x1a0)](_0x3419ca(0x1bc),_0x1dfdb8))return console[_0x3419ca(0x172)]('\x20\x20Auth\x20env\x20\x22'+_0x1dfdb8[_0x3419ca(0x1bc)]+_0x3419ca(0x20a)+_0x1d3057+'\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).'),_0x1dfdb8[_0x3419ca(0x1bc)];if(_0x1dfdb8&&_0x18c7bc[_0x3419ca(0x1a0)](_0x18c7bc['GVmMt'],_0x1dfdb8))throw new Error(_0x3419ca(0x1d8)+_0x1dfdb8[_0x3419ca(0x197)][_0x3419ca(0x1dd)](',\x20')+');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.');if(needsTunnel(_0x1d3057))throw new Error(_0x18c7bc[_0x3419ca(0x1d1)](_0x18c7bc['EfVYm'](_0x18c7bc[_0x3419ca(0x182)](_0x3419ca(0x216)+_0x1d3057+_0x3419ca(0x1b7),_0x3419ca(0x1f3)),'\x20\x20Options:\x0a')+_0x3419ca(0x1e6)+(_0x3419ca(0x1c9)+_0x1d3057[_0x3419ca(0x1f0)](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a'),_0x3419ca(0x1a2)+_0x1d3057+'\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.'));}if(_0x439fb8['defaultEnvironmentKey'])return _0x439fb8['defaultEnvironmentKey'];const _0x3368d1=Object[_0x3419ca(0x21b)](_0x439fb8['environments']??{});if(_0x3368d1[_0x3419ca(0x21e)]===0x1)return _0x3368d1[0x0];if(_0x18c7bc[_0x3419ca(0x1ce)](_0x3368d1[_0x3419ca(0x21e)],0x0))return null;throw new Error(_0x3419ca(0x1db)+_0x3368d1['join'](',\x20')+').\x20'+_0x3419ca(0x1d3));}export function adHocProfileName(_0x415cd4,_0x35b491,_0x1d113f){if(!_0x35b491||_0x35b491===_0x1d113f)return _0x415cd4;return _0x415cd4+':'+_0x35b491;}export async function resolveAdHocProfile(_0x55c466={},_0x3d5c20=process['env']){const _0x47cf9a=_0x25ed96,_0xb9ad8e={'xKPoZ':function(_0x21ac91,_0x1faf3c){return _0x21ac91&&_0x1faf3c;},'COuTq':_0x47cf9a(0x195),'kLjxP':function(_0x31579b,_0x4bb5be,_0xb877cf,_0x4dc878){return _0x31579b(_0x4bb5be,_0xb877cf,_0x4dc878);},'opfyK':function(_0x41cff0,_0xc34d9b){return _0x41cff0??_0xc34d9b;}},_0x3240c8=_0x3d5c20['RANGER_TEST_USERNAME'];if(!_0x3240c8)return null;const _0x1be6ec=await fetchAuthConfig(),_0x3b72f5=pickAdHocEnvKey(_0x1be6ec,_0x55c466['targetUrl'],_0x55c466[_0x47cf9a(0x1ed)]);let _0x551a58=adHocProfileName(_0x3240c8,_0x3b72f5,_0x1be6ec?.[_0x47cf9a(0x1cb)]),_0x3f02d8=await fetchCloudProfile(_0x551a58);_0xb9ad8e[_0x47cf9a(0x21f)](_0x3f02d8,_0x3b72f5)&&_0x3f02d8[_0x47cf9a(0x220)]!==_0x3b72f5&&(console[_0x47cf9a(0x172)]('\x20\x20Cloud\x20profile\x20\x22'+_0x551a58+'\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22'+(_0x3f02d8['environmentKey']??_0xb9ad8e[_0x47cf9a(0x167)])+'\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22'+_0x3b72f5+'\x22;\x20using\x20\x22'+_0x3240c8+':'+_0x3b72f5+_0x47cf9a(0x18b)),_0x551a58=_0x3240c8+':'+_0x3b72f5,_0x3f02d8=await fetchCloudProfile(_0x551a58));if(_0x3f02d8)return{'name':_0x3f02d8[_0x47cf9a(0x1a3)],'profile':_0x3f02d8};const _0x3100aa=_0x3d5c20['RANGER_TEST_PASSWORD'],_0x445336=await _0xb9ad8e[_0x47cf9a(0x209)](createCloudProfile,_0x551a58,_0xb9ad8e[_0x47cf9a(0x21d)](_0x3b72f5,undefined),{'username':_0x3240c8,'password':_0x3100aa});return console['log'](_0x47cf9a(0x199)+_0x445336[_0x47cf9a(0x1a3)]+'\x22\x20for\x20'+_0x3240c8+(_0x3b72f5?'\x20(auth\x20env:\x20'+_0x3b72f5+')':'')),{'name':_0x445336[_0x47cf9a(0x1a3)],'profile':_0x445336};}export async function writeSessionToLocalCache(_0x16a46e,_0x471448,_0x1f71dc,_0x580697,_0x5b1387,_0x21f84e,_0x2d2c74){const _0x500b03=_0x25ed96,_0x323b62={'THitF':function(_0x3ac85e,_0x2ecdcc){return _0x3ac85e(_0x2ecdcc);},'FvZjx':function(_0x210b0d,_0x572f00,_0x1e22d6){return _0x210b0d(_0x572f00,_0x1e22d6);},'ZElnw':_0x500b03(0x224),'fHmRX':function(_0xf2bbe1,_0x5dd5c8){return _0xf2bbe1(_0x5dd5c8);},'wvYVR':function(_0x2cdefd,_0x53062a){return _0x2cdefd>_0x53062a;},'vBKqK':function(_0x5c0143,_0x50e8e1,_0x57dd8b){return _0x5c0143(_0x50e8e1,_0x57dd8b);},'lWyIx':function(_0x3fef0d,_0x2c7806){return _0x3fef0d(_0x2c7806);}},_0xad280b=_0x323b62[_0x500b03(0x21c)](sessionCacheHash,{'orgId':_0x471448,'profileName':_0x16a46e,'effectiveBaseUrl':_0x1f71dc,'setupHeaders':_0x580697,'invalidateOn':_0x2d2c74?.[_0x500b03(0x1ec)],'userAgent':_0x2d2c74?.['userAgent'],'clientIp':_0x2d2c74?.['clientIp']}),_0x528444=_0x323b62['FvZjx'](getSessionCachePath,_0xad280b,_0x16a46e),_0x429994=_0x323b62[_0x500b03(0x17e)](join,getRangerHomeDir(),_0x323b62[_0x500b03(0x1cc)]);!_0x323b62[_0x500b03(0x1d7)](existsSync,_0x429994)&&await mkdir(_0x429994,{'recursive':!![]});const _0x33bab1={..._0x5b1387};_0x21f84e&&_0x323b62[_0x500b03(0x218)](_0x21f84e['length'],0x0)&&Array[_0x500b03(0x173)](_0x33bab1[_0x500b03(0x1a6)])&&(_0x33bab1['cookies']=duplicateCookiesForDomains(_0x33bab1[_0x500b03(0x1a6)],_0x21f84e));const _0x4663a3={'cached_at':new Date()['toISOString'](),'session_state':_0x33bab1};await _0x323b62[_0x500b03(0x164)](writeFile,_0x528444,JSON['stringify'](_0x4663a3,null,0x2));const _0x48fdaf=_0x323b62['lWyIx'](getStorageStatePath,_0x528444);return await _0x323b62[_0x500b03(0x17e)](writeFile,_0x48fdaf,JSON['stringify'](_0x33bab1,null,0x2)),_0x48fdaf;}export async function checkLocalCache(_0x28d1b4,_0x4ce679,_0x2a8b49,_0x1757eb,_0x17fc6f){const _0x12cf64=_0x25ed96,_0xd1ab1f={'jicvZ':function(_0x1bd8d5,_0xeda901){return _0x1bd8d5(_0xeda901);},'XOuAR':function(_0x494dd7,_0x383449){return _0x494dd7(_0x383449);},'fUunv':function(_0x4c6927,_0xa3735a,_0x3f219a){return _0x4c6927(_0xa3735a,_0x3f219a);},'DDMko':_0x12cf64(0x1b9)},_0x1f325c=sessionCacheHash({'orgId':_0x4ce679,'profileName':_0x28d1b4,'effectiveBaseUrl':_0x2a8b49,'setupHeaders':_0x1757eb,'invalidateOn':_0x17fc6f?.['invalidateOn'],'userAgent':_0x17fc6f?.[_0x12cf64(0x1a4)],'clientIp':_0x17fc6f?.[_0x12cf64(0x198)]}),_0x4cb9d6=getSessionCachePath(_0x1f325c,_0x28d1b4),_0xc69ef8=_0xd1ab1f[_0x12cf64(0x1e4)](getStorageStatePath,_0x4cb9d6);if(!existsSync(_0x4cb9d6)||!_0xd1ab1f['XOuAR'](existsSync,_0xc69ef8))return null;try{const _0x506666=await _0xd1ab1f['fUunv'](readFile,_0x4cb9d6,_0xd1ab1f['DDMko']);return JSON[_0x12cf64(0x1b3)](_0x506666),{'storageStatePath':_0xc69ef8};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x1eede1,_0x794842){const _0xde914e=_0x25ed96,_0x4ff6aa={'whskW':function(_0x13dc01,_0x5f3dd7){return _0x13dc01===_0x5f3dd7;},'JfhvB':function(_0x5e1cb7,_0x157ce0){return _0x5e1cb7+_0x157ce0;},'cVjGb':function(_0x36b602,_0x1a3fd3){return _0x36b602+_0x1a3fd3;}};if(!_0x794842||!_0x794842['domains']?.['length'])return;let _0x3eada4;try{_0x3eada4=new URL(_0x1eede1);}catch{return;}const _0x3993ed=[];for(const _0x571653 of _0x794842[_0xde914e(0x1fc)]){try{_0x3993ed[_0xde914e(0x186)]({'raw':_0x571653,'url':new URL(_0x571653)});}catch{}}if(_0x4ff6aa[_0xde914e(0x208)](_0x3993ed[_0xde914e(0x21e)],0x0))return;if(_0x3993ed['some'](_0x30748f=>_0x30748f['url']['origin']===_0x3eada4[_0xde914e(0x181)]))return;const _0x2d324a=_0x3993ed[_0xde914e(0x1ea)](_0x55b5a8=>'\x22'+_0x55b5a8['raw']+'\x22')['join'](',\x20');console['log'](_0x4ff6aa[_0xde914e(0x207)](_0x4ff6aa['cVjGb'](_0xde914e(0x204)+_0x2d324a+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x1eede1+'\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(_0x41e515,_0x27eedf){const _0x40406d=_0x25ed96,_0x345a8f={'NiXEb':function(_0x3534bd,_0x96bdcd){return _0x3534bd(_0x96bdcd);},'Tvifg':_0x40406d(0x1ba),'WRPwW':function(_0x2d480f,_0x529906){return _0x2d480f===_0x529906;},'FhCUJ':'not_configured'},_0x5a867c=process[_0x40406d(0x205)][_0x40406d(0x177)],_0x3d9700=process['env'][_0x40406d(0x213)],_0x3f5094={};if(_0x5a867c)_0x3f5094[_0x40406d(0x1bf)]=_0x5a867c;if(_0x3d9700)_0x3f5094['password']=_0x3d9700;if(_0x27eedf?.[_0x40406d(0x187)])_0x3f5094[_0x40406d(0x187)]=!![];if(_0x27eedf?.['targetUrl'])_0x3f5094[_0x40406d(0x1a1)]=_0x27eedf['targetUrl'];if(_0x27eedf?.['env'])_0x3f5094[_0x40406d(0x205)]=_0x27eedf['env'];_0x27eedf?.[_0x40406d(0x219)]&&(_0x3f5094[_0x40406d(0x169)]=_0x27eedf[_0x40406d(0x219)]['sessionId'],_0x3f5094[_0x40406d(0x1c8)]=_0x27eedf['tunnel']['pwEndpoint']);try{return await apiRequest('/api/v1/profiles/'+_0x345a8f[_0x40406d(0x1b2)](encodeURIComponent,_0x41e515)+_0x40406d(0x1d2),{'method':_0x345a8f[_0x40406d(0x18c)],'body':JSON['stringify'](_0x3f5094)});}catch(_0x22fcad){if(_0x22fcad instanceof ApiError&&_0x345a8f[_0x40406d(0x17d)](_0x22fcad[_0x40406d(0x17a)],0x190)&&_0x22fcad['code']===_0x345a8f['FhCUJ'])return{'status':_0x345a8f[_0x40406d(0x16b)],'error':_0x22fcad['detail']};throw _0x22fcad;}}async function serverSideLoginWithOptionalTunnel(_0x224ba5,_0x15b9af,_0x59ddf9={}){const _0x7e14b3=_0x25ed96,_0x4c16f7={'SfPfg':_0x7e14b3(0x1dc),'qwEBx':function(_0x340818,_0x57ece2){return _0x340818(_0x57ece2);},'SVvrC':'tunnel_login_setup','oquGp':function(_0x38c806,_0x1e4ccf){return _0x38c806??_0x1e4ccf;},'TiFym':function(_0x47e29d,_0x51f3d9){return _0x47e29d||_0x51f3d9;},'PNYWV':'tunnel_login_cleanup','cSyTD':function(_0x472289,_0x566de7){return _0x472289(_0x566de7);}};if(!_0x4c16f7[_0x7e14b3(0x212)](needsTunnel,_0x15b9af))return await serverSideLogin(_0x224ba5,{'force':_0x59ddf9['force'],'env':_0x59ddf9[_0x7e14b3(0x205)]});let _0x759e41=null,_0x4340d5=null,_0x23023e=null,_0x11b191=null,_0x2fe2d2=![];const _0x506ef3=process['env'][_0x7e14b3(0x171)]?.['toLowerCase'](),_0x55b837=_0x506ef3==='1'||_0x506ef3===_0x7e14b3(0x1ab),_0x4e8b25={'profileName':_0x224ba5,'targetUrlHost':_0x4c16f7[_0x7e14b3(0x212)](targetHostForTelemetry,_0x15b9af),'tunnelRequired':!![],'forceLogin':Boolean(_0x59ddf9[_0x7e14b3(0x187)]),'localBrowserServerHeaded':_0x55b837};try{_0x59ddf9['telemetry']?.['trackPhaseStart'](_0x4c16f7['SVvrC'],_0x4e8b25);_0x55b837&&console['log']('\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...');_0x759e41=await _0x4c16f7[_0x7e14b3(0x212)](launchBrowserServer,{'headless':!_0x55b837}),_0x4340d5=await _0x4c16f7[_0x7e14b3(0x212)](createTunnelSession,_0x15b9af);const _0x79cce7=await requireToken();_0x23023e=await _0x4c16f7['qwEBx'](createTunnelBridge,{'localWsUrl':_0x759e41[_0x7e14b3(0x1e0)],'tunnelServerUrl':_0x4340d5['tunnelUrl'],'sessionId':_0x4340d5[_0x7e14b3(0x1f9)],'apiKey':_0x79cce7,'onError':_0x531794=>{_0x11b191=_0x531794;},'onClose':()=>{const _0x5bea94=_0x7e14b3;_0x11b191??=new Error(_0x5bea94(0x180)+_0x224ba5);},'onEvent':_0xf0652=>trackBridgeEvent(_0x59ddf9[_0x7e14b3(0x1be)],_0xf0652)}),_0x59ddf9['telemetry']?.[_0x7e14b3(0x1da)]('tunnel_login_setup',{..._0x4e8b25,'tunnelSessionId':_0x4340d5['sessionId'],'localBrowserServer':!![],'localBrowserServerHeaded':_0x55b837}),_0x2fe2d2=!![];try{return _0x59ddf9[_0x7e14b3(0x1be)]?.[_0x7e14b3(0x194)]('tunnel_login_request',{..._0x4e8b25,'tunnelSessionId':_0x4340d5[_0x7e14b3(0x1f9)]}),await serverSideLogin(_0x224ba5,{'force':_0x59ddf9[_0x7e14b3(0x187)],'targetUrl':_0x15b9af,'env':_0x59ddf9['env'],'tunnel':{'sessionId':_0x4340d5['sessionId'],'pwEndpoint':_0x4340d5['pwEndpoint']}})['then'](_0x2a6a04=>{const _0x2074fc=_0x7e14b3;return _0x59ddf9['telemetry']?.['trackPhaseEnd'](_0x4c16f7[_0x2074fc(0x1ef)],{..._0x4e8b25,'tunnelSessionId':_0x4340d5?.[_0x2074fc(0x1f9)],'loginStatus':_0x2a6a04['status'],'hasSessionState':_0x4c16f7['qwEBx'](Boolean,_0x2a6a04[_0x2074fc(0x206)]),'hasTestOutput':Boolean(_0x2a6a04['test_output']),'bridgeError':errorMessageForTelemetry(_0x11b191)}),_0x2a6a04;});}catch(_0x5c5b57){await _0x59ddf9[_0x7e14b3(0x1be)]?.[_0x7e14b3(0x214)](_0x4c16f7['SfPfg'],_0x4c16f7['oquGp'](_0x11b191,_0x5c5b57),{..._0x4e8b25,'tunnelSessionId':_0x4340d5['sessionId'],'bridgeError':errorMessageForTelemetry(_0x11b191)});throw _0x11b191??_0x5c5b57;}}catch(_0x3ccfe1){!_0x2fe2d2&&await _0x59ddf9[_0x7e14b3(0x1be)]?.[_0x7e14b3(0x214)]('tunnel_login_setup',_0x3ccfe1,{..._0x4e8b25,'tunnelSessionId':_0x4340d5?.[_0x7e14b3(0x1f9)]});throw _0x3ccfe1;}finally{if(_0x4c16f7['TiFym'](_0x4340d5,_0x759e41)||_0x23023e){const _0x593ebf='0|2|3|4|1'['split']('|');let _0x335290=0x0;while(!![]){switch(_0x593ebf[_0x335290++]){case'0':_0x59ddf9['telemetry']?.[_0x7e14b3(0x194)](_0x4c16f7[_0x7e14b3(0x1e9)],{..._0x4e8b25,'tunnelSessionId':_0x4340d5?.[_0x7e14b3(0x1f9)]});continue;case'1':_0x59ddf9['telemetry']?.[_0x7e14b3(0x1da)]('tunnel_login_cleanup',{..._0x4e8b25,'tunnelSessionId':_0x4340d5?.[_0x7e14b3(0x1f9)]});continue;case'2':_0x23023e?.['close']();continue;case'3':_0x759e41&&await _0x759e41['close']()['catch'](()=>{});continue;case'4':_0x4340d5&&await _0x4c16f7['cSyTD'](deleteTunnelSession,_0x4340d5[_0x7e14b3(0x1f9)])['catch'](()=>{});continue;}break;}}}}export async function manualBrowserLogin(_0x3acf8c,_0x56bb9d,_0x47e830={}){const _0x34f6de=_0x25ed96,_0x21e962={'mcXry':function(_0x258ab4,_0x56e59a){return _0x258ab4/_0x56e59a;},'XyVFd':_0x34f6de(0x202),'OtQfG':'about:blank','GbfgK':'\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','GFGzp':_0x34f6de(0x1fd),'LnHPT':function(_0xa1fe4b,_0x4dddd0){return _0xa1fe4b(_0x4dddd0);},'KhAzu':_0x34f6de(0x200),'sKsFo':function(_0x579d20,_0x1c4001){return _0x579d20!==_0x1c4001;},'JDYyW':'cli:manual-login'};if(!isInteractive())throw new Error('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x3acf8c['name']+'\x22.\x0a'+_0x34f6de(0x1a7)+'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.');const _0x532ef3=_0x56bb9d&&_0x56bb9d[_0x34f6de(0x1fc)][_0x34f6de(0x21e)]>0x0?_0x56bb9d['domains'][0x0]:_0x21e962[_0x34f6de(0x1ae)];console['log'](_0x21e962['GbfgK']),console['log'](_0x21e962[_0x34f6de(0x179)]),await new Promise(_0x4b907a=>setTimeout(_0x4b907a,0x7d0));const _0x5a3cc2=await chromium['launch']({'headless':![]});let _0x45796f=null;try{const _0x19b204={'ignoreHTTPSErrors':!![]};_0x56bb9d?.['setupHeaders']&&(_0x19b204[_0x34f6de(0x1e2)]=_0x56bb9d['setupHeaders']);const _0x4193c8=await _0x5a3cc2[_0x34f6de(0x19d)](_0x19b204);await _0x21e962['LnHPT'](addProfileSetupBanner,_0x4193c8);const _0x53edc5=await _0x4193c8[_0x34f6de(0x201)]();await _0x53edc5['goto'](_0x532ef3);let _0x1b395c=![];await new Promise(_0x4e6adc=>{const _0x1a0166=setTimeout(()=>{const _0x426829=_0xdb1b;_0x1b395c=!![],console[_0x426829(0x21a)](_0x426829(0x19e)+_0x21e962[_0x426829(0x191)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x4e6adc();},MANUAL_LOGIN_TIMEOUT_MS);_0x53edc5['on'](_0x21e962['XyVFd'],async()=>{const _0xa16973=_0xdb1b;clearTimeout(_0x1a0166);try{const _0x3efa51=await _0x4193c8[_0xa16973(0x20c)]();_0x45796f=_0x3efa51;}catch{}_0x4e6adc();});});if(_0x1b395c&&!_0x45796f)throw new Error(_0x34f6de(0x176));}finally{await _0x5a3cc2['close']()['catch'](()=>{});}if(!_0x45796f)throw new Error(_0x21e962[_0x34f6de(0x1c0)]);return _0x21e962[_0x34f6de(0x215)](_0x47e830['persistSessionState'],![])&&await apiRequest(_0x34f6de(0x1f5)+_0x21e962['LnHPT'](encodeURIComponent,_0x3acf8c['name'])+'/session',{'method':'POST','body':JSON['stringify']({'session_state':_0x45796f,'updated_by':_0x21e962['JDYyW']})}),{'sessionState':_0x45796f};}export async function promptSaveCredentials(_0x3582c9){const _0x55dd16=_0x25ed96,_0x95d1b9={'UzDCk':function(_0x5e84a5,_0x2c2ffe){return _0x5e84a5||_0x2c2ffe;},'tOFCB':function(_0x4e63d4){return _0x4e63d4();},'oXZkv':'save','NUeqY':function(_0x316922,_0x483ed5,_0x31a2ed){return _0x316922(_0x483ed5,_0x31a2ed);}},_0x1d4792=process['env'][_0x55dd16(0x177)],_0x4312d1=process['env']['RANGER_TEST_PASSWORD'];if(_0x95d1b9['UzDCk'](!_0x1d4792,!_0x4312d1))return;if(!_0x95d1b9[_0x55dd16(0x18d)](isInteractive))return;const {save:_0x3e2c6a}=await _0x226ce7['prompt']([{'type':'confirm','name':_0x95d1b9[_0x55dd16(0x1af)],'message':_0x55dd16(0x217),'default':![]}]);if(!_0x3e2c6a)return;await _0x95d1b9['NUeqY'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x3582c9),{'method':'PUT','body':JSON[_0x55dd16(0x1fa)]({'username':_0x1d4792,'password':_0x4312d1})}),console['log']('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x125d20,_0x1425b8={}){const _0x2002da=_0x25ed96,_0x231c97={'Edxdi':function(_0x4c58fb){return _0x4c58fb();},'fsgrP':function(_0x5bb0cb,_0x2c6278){return _0x5bb0cb===_0x2c6278;},'PWPql':_0x2002da(0x1ca),'ZWQlx':function(_0x3c39be,_0x8ecb8a){return _0x3c39be===_0x8ecb8a;},'gRknK':function(_0x14771f,_0x2860b3){return _0x14771f||_0x2860b3;},'YrNqK':function(_0x59f885,_0x2918a0){return _0x59f885(_0x2918a0);},'egwqC':function(_0x1ac0f9,_0x53c0dc){return _0x1ac0f9(_0x53c0dc);},'pYSXP':function(_0x1dc0b6,_0x103430){return _0x1dc0b6>_0x103430;},'WmRxp':function(_0x8cde5a,_0x57d792,_0xed5bd9,_0x507a99,_0x30a468,_0x368cc7){return _0x8cde5a(_0x57d792,_0xed5bd9,_0x507a99,_0x30a468,_0x368cc7);},'PwpuS':function(_0x4c9034,_0x23fc57,_0x565ad6){return _0x4c9034(_0x23fc57,_0x565ad6);},'RQMZC':function(_0x47ec59,_0x230071,_0x565948){return _0x47ec59(_0x230071,_0x565948);},'RxAiB':function(_0x4709a2,_0x5bd746){return _0x4709a2(_0x5bd746);},'HXdTd':function(_0x358881,_0x583016,_0x511604,_0x5df8f1){return _0x358881(_0x583016,_0x511604,_0x5df8f1);},'IzIAr':function(_0x24db32,_0x40911d,_0x4dd511){return _0x24db32(_0x40911d,_0x4dd511);},'mmTNn':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','ABilH':function(_0x52904a,_0x52f0b8){return _0x52904a===_0x52f0b8;},'JKgvX':_0x2002da(0x20f),'olOxN':function(_0xadff0,_0x1084da,_0x41ac8b,_0x3c8be0,_0x4149a1,_0x1c0807,_0x18fe2d,_0x33bcce){return _0xadff0(_0x1084da,_0x41ac8b,_0x3c8be0,_0x4149a1,_0x1c0807,_0x18fe2d,_0x33bcce);},'TpHSd':function(_0x36d826,_0x12ce7e){return _0x36d826&&_0x12ce7e;},'YbPtz':function(_0x353ee9,_0x3fa475){return _0x353ee9(_0x3fa475);},'pNWWK':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','bNTzM':function(_0x3d4f66,_0x1a5a8c){return _0x3d4f66 instanceof _0x1a5a8c;},'gEzSy':function(_0x563c1d,_0x890838){return _0x563c1d+_0x890838;},'QOQOj':function(_0x45b6bc,_0xc0407c,_0xddbcaf){return _0x45b6bc(_0xc0407c,_0xddbcaf);},'EtVLc':function(_0x530c9c,_0x3d60c5,_0x3a372a,_0x1fb36a,_0x416641,_0x90c4f5,_0x5670cc,_0x22c888){return _0x530c9c(_0x3d60c5,_0x3a372a,_0x1fb36a,_0x416641,_0x90c4f5,_0x5670cc,_0x22c888);}},_0x5d045c=_0x125d20[_0x2002da(0x193)]??{},_0x769213=await _0x231c97[_0x2002da(0x223)](fetchAuthConfig),_0x1901a0=_0x769213?resolveAuthEnvironmentLocally(_0x769213,_0x1425b8['assertedEnv']??_0x125d20['environmentKey']):null,_0x2a7edb=_0x231c97['fsgrP'](typeof _0x1901a0?.[_0x2002da(0x1f2)],_0x231c97[_0x2002da(0x1d4)])&&_0x1901a0['loginInstructions'][_0x2002da(0x18f)]()?_0x1901a0['loginInstructions']:undefined,_0x1dc295=_0x231c97[_0x2002da(0x203)](typeof _0x5d045c[_0x2002da(0x1f2)],'string')&&_0x5d045c[_0x2002da(0x1f2)]['trim']()?_0x5d045c['loginInstructions']:undefined,_0x2f9259=_0x231c97[_0x2002da(0x183)](_0x1dc295,!_0x2a7edb)?_0x5d045c:{..._0x5d045c,'loginInstructions':_0x2a7edb},_0x497e08=_0x231c97[_0x2002da(0x20d)](Boolean,_0x2f9259[_0x2002da(0x1f2)]?.['trim']()),_0x352a3c=_0x231c97['egwqC'](Boolean,_0x5d045c[_0x2002da(0x163)]||_0x1901a0?.['forceLogin']),_0x138242=_0x1901a0?.['domains'],_0x1810f5=_0x5d045c[_0x2002da(0x1f7)],_0x31eca6=_0x1810f5??_0x1901a0?.[_0x2002da(0x1f7)],_0x5e5a68=_0x1425b8[_0x2002da(0x16d)]??_0x5d045c['baseUrl']??(_0x138242&&_0x231c97['pYSXP'](_0x138242['length'],0x0)?_0x138242[0x0]:''),_0x2de6b9=_0x5e5a68?needsTunnel(_0x5e5a68):![],_0x27ec99={'invalidateOn':_0x1901a0?.[_0x2002da(0x1ec)],'userAgent':_0x1901a0?.[_0x2002da(0x20e)]?.['userAgent']??_0x5d045c[_0x2002da(0x1a4)]};_0x352a3c&&console['log']('\x20\x20forceLogin\x20enabled\x20for\x20\x22'+_0x125d20[_0x2002da(0x1a3)]+_0x2002da(0x1fb));if(!_0x352a3c){const _0x2088d6=await _0x231c97[_0x2002da(0x19b)](checkLocalCache,_0x125d20['name'],_0x125d20['organizationId'],_0x5e5a68,_0x31eca6,_0x27ec99);if(_0x2088d6){if(_0x5e5a68&&!_0x2de6b9){const _0x2b2d8f=await isCachedSessionLive(_0x2088d6[_0x2002da(0x1d5)],_0x5e5a68,{'sessionCheckPath':_0x1901a0?.[_0x2002da(0x222)],'setupHeaders':_0x31eca6},{'launchBrowser':launchRealBrowser});if(_0x2b2d8f)return console[_0x2002da(0x172)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x125d20['name']+'\x22'),{'authPath':_0x2088d6['storageStatePath'],'settings':_0x2f9259,'resolvedEnv':_0x1901a0};console[_0x2002da(0x172)](_0x2002da(0x1bd)+_0x125d20['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x231c97['PwpuS'](emitSessionValidationHint,_0x5e5a68,_0x1901a0);}else return _0x2de6b9&&console[_0x2002da(0x172)](_0x2002da(0x1e1)+_0x125d20[_0x2002da(0x1a3)]+'\x22'),{'authPath':_0x2088d6[_0x2002da(0x1d5)],'settings':_0x2f9259,'resolvedEnv':_0x1901a0};}}if(!_0x352a3c&&_0x125d20[_0x2002da(0x1b5)]){const _0x49ff13=await writeSessionToLocalCache(_0x125d20['name'],_0x125d20['organizationId'],_0x5e5a68,_0x31eca6,_0x125d20['sessionState'],_0x138242,_0x27ec99);if(_0x5e5a68){const _0x9efb45=await isCachedSessionLive(_0x49ff13,_0x5e5a68,{'sessionCheckPath':_0x1901a0?.['sessionCheckPath'],'setupHeaders':_0x31eca6},{'launchBrowser':launchRealBrowser});if(_0x9efb45)return console[_0x2002da(0x172)](_0x2002da(0x185)+_0x125d20['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x49ff13,'settings':_0x2f9259,'resolvedEnv':_0x1901a0};console[_0x2002da(0x172)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x125d20[_0x2002da(0x1a3)]+_0x2002da(0x17c)),_0x231c97[_0x2002da(0x1b1)](emitSessionValidationHint,_0x5e5a68,_0x1901a0);}else return{'authPath':_0x49ff13,'settings':_0x2f9259,'resolvedEnv':_0x1901a0};}if(_0x497e08)return console['log']('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x125d20[_0x2002da(0x1a3)]+_0x2002da(0x1a9)),{'authPath':undefined,'settings':_0x2f9259,'resolvedEnv':_0x1901a0};console['log'](_0x2002da(0x1c1)+_0x125d20['name']+_0x2002da(0x1f8));const _0x4bb471=Boolean(process[_0x2002da(0x205)][_0x2002da(0x177)])&&_0x231c97['YrNqK'](Boolean,process['env'][_0x2002da(0x213)]),_0x3a9ca9=_0x231c97[_0x2002da(0x17f)](Boolean,_0x125d20[_0x2002da(0x1bf)]),_0x255a82=Boolean(_0x1425b8[_0x2002da(0x1a8)]),_0x6c0db5=_0x5e5a68?isBareLocalhost(_0x5e5a68):![],_0x355730=_0x231c97['gRknK'](_0x4bb471,_0x3a9ca9)&&_0x231c97[_0x2002da(0x183)](!_0x6c0db5,_0x255a82);if(_0x355730)try{const _0x3877e2=_0x5e5a68?await _0x231c97['HXdTd'](serverSideLoginWithOptionalTunnel,_0x125d20[_0x2002da(0x1a3)],_0x5e5a68,{'force':_0x352a3c,'telemetry':_0x1425b8[_0x2002da(0x1be)],'env':_0x1425b8['assertedEnv']}):await _0x231c97['IzIAr'](serverSideLogin,_0x125d20[_0x2002da(0x1a3)],{'force':_0x352a3c,'env':_0x1425b8['assertedEnv']});if(_0x3877e2['status']==='not_configured')console['log'](_0x231c97['mmTNn']);else{if(_0x231c97[_0x2002da(0x20b)](_0x3877e2[_0x2002da(0x17a)],_0x231c97[_0x2002da(0x210)])&&_0x3877e2['session_state']){console[_0x2002da(0x172)](_0x2002da(0x16f));const _0x2963d3=await _0x231c97['olOxN'](writeSessionToLocalCache,_0x125d20['name'],_0x125d20[_0x2002da(0x1e3)],_0x5e5a68,_0x31eca6,_0x3877e2[_0x2002da(0x206)],_0x138242,_0x27ec99);return _0x231c97[_0x2002da(0x1d0)](_0x4bb471,!_0x3a9ca9)&&await _0x231c97['YbPtz'](promptSaveCredentials,_0x125d20['name']),{'authPath':_0x2963d3,'settings':_0x2f9259,'resolvedEnv':_0x1901a0};}else _0x3877e2['test_output']&&(console['log']('\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:'),console['log'](_0x3877e2['test_output'])),console['log'](_0x231c97[_0x2002da(0x1a5)]);}}catch(_0x4db916){console[_0x2002da(0x172)](_0x2002da(0x19c)+(_0x231c97['bNTzM'](_0x4db916,Error)?_0x4db916['message']:String(_0x4db916))),console['log'](_0x231c97['pNWWK']);}if(_0x6c0db5&&!_0x255a82&&!isInteractive())throw new Error(_0x231c97['gEzSy']('No\x20saved\x20session\x20for\x20\x22'+_0x5e5a68+_0x2002da(0x1e8)+_0x125d20['name']+_0x2002da(0x1eb),'\x20\x20•\x20capture\x20one\x20(a\x20browser\x20opens):\x20ranger\x20profile\x20add\x20'+_0x125d20[_0x2002da(0x1a3)]+_0x2002da(0x1ad)+_0x5e5a68+'\x0a')+_0x2002da(0x18a));const _0x19c610=_0x1901a0?{..._0x1901a0,'domains':_0x231c97['QOQOj'](orderLoginDomains,_0x5e5a68,_0x1901a0[_0x2002da(0x1fc)]),'setupHeaders':_0x31eca6}:_0x5e5a68?{'key':_0x125d20['environmentKey']??'','domains':[_0x5e5a68],'setupHeaders':_0x31eca6}:null,{sessionState:_0x23e6a7}=await manualBrowserLogin(_0x125d20,_0x19c610,{'persistSessionState':!_0x2de6b9}),_0x56ea2f=await _0x231c97['EtVLc'](writeSessionToLocalCache,_0x125d20['name'],_0x125d20['organizationId'],_0x5e5a68,_0x31eca6,_0x23e6a7,_0x138242,_0x27ec99);return{'authPath':_0x56ea2f,'settings':_0x2f9259,'resolvedEnv':_0x1901a0};}
@@ -1 +1 @@
1
- const _0x33dbb0=_0x4121;function _0x4121(_0x178702,_0x46c567){_0x178702=_0x178702-0x17b;const _0x4cc7dc=_0x4cc7();let _0x412168=_0x4cc7dc[_0x178702];return _0x412168;}(function(_0x1ee242,_0x4dcd95){const _0x594fc6=_0x4121,_0xdf8fa5=_0x1ee242();while(!![]){try{const _0x3b89c7=-parseInt(_0x594fc6(0x194))/0x1+-parseInt(_0x594fc6(0x1aa))/0x2*(-parseInt(_0x594fc6(0x199))/0x3)+-parseInt(_0x594fc6(0x18c))/0x4+-parseInt(_0x594fc6(0x1a5))/0x5+parseInt(_0x594fc6(0x196))/0x6*(parseInt(_0x594fc6(0x195))/0x7)+parseInt(_0x594fc6(0x1af))/0x8*(-parseInt(_0x594fc6(0x17d))/0x9)+-parseInt(_0x594fc6(0x17c))/0xa*(-parseInt(_0x594fc6(0x198))/0xb);if(_0x3b89c7===_0x4dcd95)break;else _0xdf8fa5['push'](_0xdf8fa5['shift']());}catch(_0x18c086){_0xdf8fa5['push'](_0xdf8fa5['shift']());}}}(_0x4cc7,0x3809c));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x307bc5=process[_0x33dbb0(0x17b)],_0x5b1dc1={'stdin':process[_0x33dbb0(0x186)],'stdout':process[_0x33dbb0(0x19f)]}){const _0x155bdb=_0x33dbb0,_0x10daf6={'cfhty':function(_0x5b6353,_0x30ecf3){return _0x5b6353(_0x30ecf3);}};if(_0x307bc5['CI'])return![];return _0x10daf6[_0x155bdb(0x1a4)](Boolean,_0x5b1dc1['stdin']['isTTY'])&&_0x10daf6['cfhty'](Boolean,_0x5b1dc1[_0x155bdb(0x19f)]['isTTY']);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x314ec5){const _0x5cdeee=_0x33dbb0,_0x495e56={'ZGpYc':function(_0x14bd80,_0x1d491a){return _0x14bd80(_0x1d491a);},'AzaTl':'baseUrl','imyIs':'setupHeaders','ijhHm':'port','lrpev':_0x5cdeee(0x1a3),'qsSzN':function(_0x237d30,_0x5ece7d){return _0x237d30!==_0x5ece7d;},'nykKD':'clientIp','aRsEY':_0x5cdeee(0x1a2)},_0x15d334=new Set(_0x314ec5[_0x5cdeee(0x182)]??DEFAULT_INVALIDATE_ON);_0x314ec5['effectiveBaseUrl']&&_0x495e56[_0x5cdeee(0x1ae)](needsTunnel,_0x314ec5['effectiveBaseUrl'])&&_0x15d334[_0x5cdeee(0x190)](_0x495e56[_0x5cdeee(0x19b)]);const _0x480b2f={'orgId':_0x314ec5[_0x5cdeee(0x18e)],'profileName':_0x314ec5[_0x5cdeee(0x192)]};return _0x15d334[_0x5cdeee(0x1b0)]('baseUrl')&&(_0x480b2f['effectiveBaseUrl']=_0x314ec5[_0x5cdeee(0x1ac)]),_0x15d334[_0x5cdeee(0x1b0)](_0x495e56['imyIs'])&&(_0x480b2f[_0x5cdeee(0x188)]=_0x314ec5['setupHeaders']?sortObjectKeys(_0x314ec5['setupHeaders']):_0x314ec5['setupHeaders']),_0x15d334[_0x5cdeee(0x1b0)](_0x495e56[_0x5cdeee(0x184)])&&(_0x480b2f['port']=extractPort(_0x314ec5['effectiveBaseUrl'])),_0x15d334[_0x5cdeee(0x1b0)](_0x495e56[_0x5cdeee(0x1a6)])&&_0x495e56['qsSzN'](_0x314ec5['userAgent'],undefined)&&(_0x480b2f[_0x5cdeee(0x1a3)]=_0x314ec5['userAgent']),_0x15d334[_0x5cdeee(0x1b0)](_0x495e56['nykKD'])&&_0x314ec5[_0x5cdeee(0x197)]!==undefined&&(_0x480b2f[_0x5cdeee(0x197)]=_0x314ec5[_0x5cdeee(0x197)]),createHash('sha256')['update'](JSON[_0x5cdeee(0x181)](_0x480b2f))['digest'](_0x495e56['aRsEY'])['slice'](0x0,0xc);}function extractPort(_0x1ece60){const _0xafbad1=_0x33dbb0;try{return new URL(_0x1ece60)[_0xafbad1(0x17f)];}catch{return'';}}function sortObjectKeys(_0x20d7c6){const _0x4b4a7c=_0x33dbb0,_0x3baa4f={};for(const _0x509717 of Object['keys'](_0x20d7c6)[_0x4b4a7c(0x187)]()){_0x3baa4f[_0x509717]=_0x20d7c6[_0x509717];}return _0x3baa4f;}export function getSessionCachePath(_0x1d777f,_0x53bbe1){const _0x4c9dec=_0x33dbb0,_0x1e1481={'zgegf':function(_0x4fb323,_0x2279dc,_0x5a33c5,_0x52e66a){return _0x4fb323(_0x2279dc,_0x5a33c5,_0x52e66a);},'HXefp':function(_0x2b4d5e){return _0x2b4d5e();}};return _0x1e1481['zgegf'](join,_0x1e1481['HXefp'](getRangerHomeDir),_0x4c9dec(0x18a),_0x1d777f+'-'+_0x53bbe1+'.json');}export function getStorageStatePath(_0x12608e){const _0x2b2f9d=_0x33dbb0,_0x1b7141={'xsyYd':'.storageState.json'};return _0x12608e[_0x2b2f9d(0x183)](/\.json$/,_0x1b7141['xsyYd']);}export function needsTunnel(_0x46ab55){const _0x122cd2=_0x33dbb0,_0x4dbf69={'SrMvZ':function(_0x274d95,_0x232683){return _0x274d95===_0x232683;},'QdrGH':_0x122cd2(0x193)};let _0x117c05;try{_0x117c05=new URL(_0x46ab55)[_0x122cd2(0x1a1)];}catch{return![];}if(_0x4dbf69['SrMvZ'](_0x117c05,'localhost')||_0x117c05==='127.0.0.1')return!![];if(_0x117c05[_0x122cd2(0x1a0)](_0x4dbf69[_0x122cd2(0x17e)]))return!![];if(_0x117c05['includes']('localhost.'))return!![];return![];}export function isBareLocalhost(_0x57a069){const _0x116ac9=_0x33dbb0,_0x264d59={'KbOMi':function(_0x47066e,_0x430d38){return _0x47066e===_0x430d38;},'wEdbU':_0x116ac9(0x1a9)};let _0xff1f14;try{_0xff1f14=new URL(_0x57a069)['hostname'];}catch{return![];}return _0xff1f14===_0x116ac9(0x180)||_0x264d59[_0x116ac9(0x189)](_0xff1f14,_0x264d59['wEdbU'])||_0x264d59[_0x116ac9(0x189)](_0xff1f14,'::1')||_0xff1f14==='[::1]';}export function orderLoginDomains(_0x1481e5,_0x29875e){const _0x406d3a=_0x33dbb0,_0x2a8aa1=_0x29875e??[];if(!_0x1481e5)return _0x2a8aa1;return[_0x1481e5,..._0x2a8aa1[_0x406d3a(0x19e)](_0x3e4bf4=>_0x3e4bf4!==_0x1481e5)];}export function hostnameOf(_0xd343ff){return new URL(_0xd343ff)['hostname'];}export function duplicateCookiesForDomains(_0x147c88,_0x3ea853){const _0xd29ede=_0x33dbb0,_0x5adc59={'CGoEZ':function(_0x1c8055,_0x307d17){return _0x1c8055(_0x307d17);}},_0x23d647=[..._0x147c88],_0x3cbdd4=new Set(_0x147c88[_0xd29ede(0x18f)](_0x175307=>_0x175307['domain']));for(const _0xd7dd33 of _0x3ea853){let _0x32489d;try{_0x32489d=_0x5adc59['CGoEZ'](hostnameOf,_0xd7dd33);}catch{continue;}if(!_0x32489d)continue;const _0x5732f7=_0x32489d[_0xd29ede(0x19d)]('.')?_0x32489d:'.'+_0x32489d;if(_0x3cbdd4[_0xd29ede(0x1b0)](_0x32489d)||_0x3cbdd4[_0xd29ede(0x1b0)](_0x5732f7))continue;for(const _0x1c56ec of _0x147c88){_0x23d647['push']({..._0x1c56ec,'domain':_0x5732f7});}_0x3cbdd4[_0xd29ede(0x190)](_0x5732f7);}return _0x23d647;}export function resolveAuthEnvironmentLocally(_0x3ea3fc,_0x3f507d){const _0x52caa3=_0x33dbb0,_0x2e5b8e=_0x3ea3fc['environments'];if(_0x3f507d){const _0x2f0a52=_0x2e5b8e[_0x3f507d];if(!_0x2f0a52)return null;return{'key':_0x3f507d,..._0x2f0a52};}if(_0x3ea3fc[_0x52caa3(0x1a7)]){const _0x1b0e36=_0x2e5b8e[_0x3ea3fc['defaultEnvironmentKey']];if(!_0x1b0e36)return null;return{'key':_0x3ea3fc[_0x52caa3(0x1a7)],..._0x1b0e36};}const _0x4b96b4=Object['keys'](_0x2e5b8e);if(_0x4b96b4['length']===0x1){const _0xa07fe=_0x4b96b4[0x0];return{'key':_0xa07fe,..._0x2e5b8e[_0xa07fe]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x5cedc2,_0x441d2c){try{if(_0x441d2c)return new URL(_0x441d2c,_0x5cedc2)['toString']();return new URL(_0x5cedc2)['toString']();}catch{return null;}}function _0x4cc7(){const _0x54e642=['env','220qqenzd','9LtrYpu','QdrGH','port','localhost','stringify','invalidateOn','replace','ijhHm','fmIXN','stdin','sort','setupHeaders','KbOMi','auth','newContext','1423264TOfmsI','close','orgId','map','add','sessionCheckPath','profileName','.localhost','440000wtiWym','135002SdoYqg','102UMQTEF','clientIp','574442rKRUxx','3TVRLdl','test','AzaTl','domcontentloaded','startsWith','filter','stdout','endsWith','hostname','hex','userAgent','cfhty','1630095AzSanG','lrpev','defaultEnvironmentKey','AcIgP','127.0.0.1','482596OUftFQ','launchBrowser','effectiveBaseUrl','newPage','ZGpYc','2933416mgjqFT','has'];_0x4cc7=function(){return _0x54e642;};return _0x4cc7();}export function looksLikeLoginUrl(_0x1c9ee5){const _0x16dfb0=_0x33dbb0;try{const _0x5c0dca=new URL(_0x1c9ee5);return LOGIN_URL_PATTERN['test'](_0x5c0dca['pathname']);}catch{return LOGIN_URL_PATTERN[_0x16dfb0(0x19a)](_0x1c9ee5);}}export async function isCachedSessionLive(_0x32fe2b,_0x2b9c5c,_0x26966f={},_0x1fd3c5={}){const _0x28c25a=_0x33dbb0,_0x35bb7f={'AcIgP':_0x28c25a(0x19c),'fmIXN':function(_0x472fff,_0x4e4340){return _0x472fff===_0x4e4340;}},_0x4504a6=buildSessionCheckUrl(_0x2b9c5c,_0x26966f[_0x28c25a(0x191)]);if(!_0x4504a6)return!![];if(!_0x1fd3c5['launchBrowser'])return!![];let _0xd41492=null;try{_0xd41492=await _0x1fd3c5[_0x28c25a(0x1ab)]();const _0x483c46=await _0xd41492[_0x28c25a(0x18b)]({'storageState':_0x32fe2b,'ignoreHTTPSErrors':!![],..._0x26966f[_0x28c25a(0x188)]?{'extraHTTPHeaders':_0x26966f[_0x28c25a(0x188)]}:{}}),_0x5f3e76=await _0x483c46[_0x28c25a(0x1ad)](),_0x4031e6=await _0x5f3e76['goto'](_0x4504a6,{'waitUntil':_0x35bb7f[_0x28c25a(0x1a8)],'timeout':0x3a98}),_0x3d3095=_0x4031e6?.['status']();if(_0x3d3095===0x191||_0x35bb7f[_0x28c25a(0x185)](_0x3d3095,0x193))return![];const _0x4788fd=_0x5f3e76['url']();if(looksLikeLoginUrl(_0x4788fd))return![];return!![];}catch{return![];}finally{if(_0xd41492)await _0xd41492[_0x28c25a(0x18d)]()['catch'](()=>{});}}
1
+ const _0x396108=_0x469d;(function(_0x310cc8,_0x4391db){const _0x792bba=_0x469d,_0x482732=_0x310cc8();while(!![]){try{const _0x252692=parseInt(_0x792bba(0x131))/0x1*(parseInt(_0x792bba(0x141))/0x2)+parseInt(_0x792bba(0x14f))/0x3+parseInt(_0x792bba(0x12d))/0x4+-parseInt(_0x792bba(0x14c))/0x5+parseInt(_0x792bba(0x155))/0x6*(parseInt(_0x792bba(0x12c))/0x7)+parseInt(_0x792bba(0x135))/0x8*(parseInt(_0x792bba(0x12b))/0x9)+-parseInt(_0x792bba(0x139))/0xa;if(_0x252692===_0x4391db)break;else _0x482732['push'](_0x482732['shift']());}catch(_0x229a3b){_0x482732['push'](_0x482732['shift']());}}}(_0x2af9,0x917e1));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x1e9992=process[_0x396108(0x13b)],_0x51c517={'stdin':process['stdin'],'stdout':process[_0x396108(0x134)]}){const _0x49307f=_0x396108,_0x1b3b13={'ftNyw':function(_0x8db514,_0x52d240){return _0x8db514(_0x52d240);}};if(_0x1e9992['CI'])return![];return Boolean(_0x51c517[_0x49307f(0x13a)]['isTTY'])&&_0x1b3b13[_0x49307f(0x142)](Boolean,_0x51c517['stdout']['isTTY']);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x276d67){const _0x29ef0d=_0x396108,_0xfc0cc6={'Sfgzh':function(_0x30068e,_0xe7ed5c){return _0x30068e(_0xe7ed5c);},'qXLKb':'baseUrl','SAflx':'userAgent','DWPDu':function(_0x1ae11c,_0x233e2d){return _0x1ae11c!==_0x233e2d;}},_0x32d139=new Set(_0x276d67['invalidateOn']??DEFAULT_INVALIDATE_ON);_0x276d67[_0x29ef0d(0x12e)]&&_0xfc0cc6['Sfgzh'](needsTunnel,_0x276d67[_0x29ef0d(0x12e)])&&_0x32d139['add'](_0xfc0cc6['qXLKb']);const _0x3a9ce9={'orgId':_0x276d67[_0x29ef0d(0x14e)],'profileName':_0x276d67[_0x29ef0d(0x13c)]};return _0x32d139[_0x29ef0d(0x15e)](_0x29ef0d(0x151))&&(_0x3a9ce9[_0x29ef0d(0x12e)]=_0x276d67[_0x29ef0d(0x12e)]),_0x32d139[_0x29ef0d(0x15e)](_0x29ef0d(0x149))&&(_0x3a9ce9[_0x29ef0d(0x149)]=_0x276d67['setupHeaders']?sortObjectKeys(_0x276d67[_0x29ef0d(0x149)]):_0x276d67['setupHeaders']),_0x32d139[_0x29ef0d(0x15e)](_0x29ef0d(0x15c))&&(_0x3a9ce9[_0x29ef0d(0x15c)]=extractPort(_0x276d67['effectiveBaseUrl'])),_0x32d139['has'](_0xfc0cc6['SAflx'])&&_0xfc0cc6[_0x29ef0d(0x14b)](_0x276d67['userAgent'],undefined)&&(_0x3a9ce9['userAgent']=_0x276d67[_0x29ef0d(0x144)]),_0x32d139['has']('clientIp')&&_0x276d67[_0x29ef0d(0x148)]!==undefined&&(_0x3a9ce9[_0x29ef0d(0x148)]=_0x276d67[_0x29ef0d(0x148)]),_0xfc0cc6[_0x29ef0d(0x154)](createHash,'sha256')['update'](JSON[_0x29ef0d(0x13f)](_0x3a9ce9))[_0x29ef0d(0x157)](_0x29ef0d(0x162))[_0x29ef0d(0x152)](0x0,0xc);}function extractPort(_0x32aa30){const _0x27f4fe=_0x396108;try{return new URL(_0x32aa30)[_0x27f4fe(0x15c)];}catch{return'';}}function sortObjectKeys(_0x11a8c6){const _0x5656ca={};for(const _0x2f8bc8 of Object['keys'](_0x11a8c6)['sort']()){_0x5656ca[_0x2f8bc8]=_0x11a8c6[_0x2f8bc8];}return _0x5656ca;}export function getSessionCachePath(_0x29d976,_0x2bb4be){const _0x50daf7=_0x396108,_0x3791ea={'kbHoS':function(_0x182f76,_0x49d28f,_0x10d182,_0x50035b){return _0x182f76(_0x49d28f,_0x10d182,_0x50035b);}};return _0x3791ea[_0x50daf7(0x146)](join,getRangerHomeDir(),_0x50daf7(0x150),_0x29d976+'-'+_0x2bb4be+_0x50daf7(0x14d));}export function getStorageStatePath(_0x3da326){const _0x3e73c4=_0x396108;return _0x3da326['replace'](/\.json$/,_0x3e73c4(0x158));}export function needsTunnel(_0x1a5bd6){const _0x1e6d9b=_0x396108,_0x452b08={'IZwHt':function(_0x298c75,_0x5dc0d1){return _0x298c75===_0x5dc0d1;},'vFvvs':function(_0x4c0837,_0x42a0a7){return _0x4c0837===_0x42a0a7;},'bcxZR':'127.0.0.1','vyTgS':'localhost.'};let _0x675a7e;try{_0x675a7e=new URL(_0x1a5bd6)['hostname'];}catch{return![];}if(_0x452b08[_0x1e6d9b(0x13d)](_0x675a7e,_0x1e6d9b(0x15d))||_0x452b08[_0x1e6d9b(0x130)](_0x675a7e,_0x452b08['bcxZR']))return!![];if(_0x675a7e['endsWith'](_0x1e6d9b(0x15f)))return!![];if(_0x675a7e[_0x1e6d9b(0x138)](_0x452b08['vyTgS']))return!![];return![];}function _0x469d(_0x54a31a,_0x102bee){_0x54a31a=_0x54a31a-0x12b;const _0x2af983=_0x2af9();let _0x469d2a=_0x2af983[_0x54a31a];return _0x469d2a;}export function isBareLocalhost(_0x2e0d97){const _0x2e9daf=_0x396108,_0x27f108={'fEXeE':function(_0xd8e98,_0x46b03a){return _0xd8e98===_0x46b03a;},'nFAJH':'::1'};let _0x42a744;try{_0x42a744=new URL(_0x2e0d97)[_0x2e9daf(0x160)];}catch{return![];}return _0x27f108['fEXeE'](_0x42a744,'localhost')||_0x27f108['fEXeE'](_0x42a744,'127.0.0.1')||_0x42a744===_0x27f108[_0x2e9daf(0x156)]||_0x42a744==='[::1]';}export function orderLoginDomains(_0x3f8774,_0x10c9b3){const _0x3787b7=_0x396108,_0x31c3ba=_0x10c9b3??[];if(!_0x3f8774)return _0x31c3ba;return[_0x3f8774,..._0x31c3ba[_0x3787b7(0x161)](_0x68f331=>_0x68f331!==_0x3f8774)];}export function hostnameOf(_0x12c37d){const _0x50ef98=_0x396108;return new URL(_0x12c37d)[_0x50ef98(0x160)];}export function duplicateCookiesForDomains(_0x50a976,_0x2113da){const _0x2f1b5b=_0x396108,_0xc24e13=[..._0x50a976],_0x591e39=new Set(_0x50a976[_0x2f1b5b(0x12f)](_0x48c623=>_0x48c623['domain']));for(const _0x566eed of _0x2113da){let _0x62b195;try{_0x62b195=hostnameOf(_0x566eed);}catch{continue;}if(!_0x62b195)continue;const _0x208b73=_0x62b195['startsWith']('.')?_0x62b195:'.'+_0x62b195;if(_0x591e39['has'](_0x62b195)||_0x591e39['has'](_0x208b73))continue;for(const _0x186fd2 of _0x50a976){_0xc24e13['push']({..._0x186fd2,'domain':_0x208b73});}_0x591e39[_0x2f1b5b(0x14a)](_0x208b73);}return _0xc24e13;}export function resolveAuthEnvironmentLocally(_0x1cf939,_0x443740){const _0x166cfb=_0x396108,_0x3222ff=_0x1cf939['environments'];if(_0x443740){const _0x7126ce=_0x3222ff[_0x443740];if(!_0x7126ce)return null;return{'key':_0x443740,..._0x7126ce};}if(_0x1cf939['defaultEnvironmentKey']){const _0x57151d=_0x3222ff[_0x1cf939['defaultEnvironmentKey']];if(!_0x57151d)return null;return{'key':_0x1cf939['defaultEnvironmentKey'],..._0x57151d};}const _0x5d940a=Object[_0x166cfb(0x140)](_0x3222ff);if(_0x5d940a[_0x166cfb(0x15a)]===0x1){const _0x5c995b=_0x5d940a[0x0];return{'key':_0x5c995b,..._0x3222ff[_0x5c995b]};}return null;}function _0x2af9(){const _0x27d572=['digest','.storageState.json','peUbG','length','url','port','localhost','has','.localhost','hostname','filter','hex','9SbAcvc','1906338cmCBuL','2754232veVHGY','effectiveBaseUrl','map','vFvvs','1JILVnR','hEQYu','newContext','stdout','5573432AeuLUs','launchBrowser','newPage','includes','11489720qlZpFu','stdin','env','profileName','IZwHt','domcontentloaded','stringify','keys','304176MXtYsA','ftNyw','goto','userAgent','toString','kbHoS','pathname','clientIp','setupHeaders','add','DWPDu','2601770mxKcZl','.json','orgId','549810sGvAzP','auth','baseUrl','slice','test','Sfgzh','12RkZGhe','nFAJH'];_0x2af9=function(){return _0x27d572;};return _0x2af9();}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x419915,_0x556f22){const _0x169f6f=_0x396108;try{if(_0x556f22)return new URL(_0x556f22,_0x419915)[_0x169f6f(0x145)]();return new URL(_0x419915)[_0x169f6f(0x145)]();}catch{return null;}}export function looksLikeLoginUrl(_0x35a2da){const _0x18b290=_0x396108;try{const _0x18184e=new URL(_0x35a2da);return LOGIN_URL_PATTERN['test'](_0x18184e[_0x18b290(0x147)]);}catch{return LOGIN_URL_PATTERN[_0x18b290(0x153)](_0x35a2da);}}export async function isCachedSessionLive(_0x413f90,_0x164362,_0x183401={},_0x25e8d1={}){const _0x21ac2a=_0x396108,_0x33d5e3={'hEQYu':_0x21ac2a(0x13e),'ytDdw':function(_0x174307,_0x4260c4){return _0x174307===_0x4260c4;},'peUbG':function(_0x3b3275,_0x5adc3c){return _0x3b3275(_0x5adc3c);}},_0x40cbd7=buildSessionCheckUrl(_0x164362,_0x183401['sessionCheckPath']);if(!_0x40cbd7)return!![];if(!_0x25e8d1['launchBrowser'])return!![];let _0xef9428=null;try{_0xef9428=await _0x25e8d1[_0x21ac2a(0x136)]();const _0x4c9325=await _0xef9428[_0x21ac2a(0x133)]({'storageState':_0x413f90,'ignoreHTTPSErrors':!![],..._0x183401['setupHeaders']?{'extraHTTPHeaders':_0x183401[_0x21ac2a(0x149)]}:{}}),_0x2b5afd=await _0x4c9325[_0x21ac2a(0x137)](),_0x43c13e=await _0x2b5afd[_0x21ac2a(0x143)](_0x40cbd7,{'waitUntil':_0x33d5e3[_0x21ac2a(0x132)],'timeout':0x3a98}),_0x9272a=_0x43c13e?.['status']();if(_0x9272a===0x191||_0x33d5e3['ytDdw'](_0x9272a,0x193))return![];const _0x466c04=_0x2b5afd[_0x21ac2a(0x15b)]();if(_0x33d5e3[_0x21ac2a(0x159)](looksLikeLoginUrl,_0x466c04))return![];return!![];}catch{return![];}finally{if(_0xef9428)await _0xef9428['close']()['catch'](()=>{});}}
@@ -1 +1 @@
1
- const _0x1a92e3=_0x44bc;(function(_0x3e3a12,_0x5688af){const _0x5d0829=_0x44bc,_0x1baa7c=_0x3e3a12();while(!![]){try{const _0x30b8e1=parseInt(_0x5d0829(0x146))/0x1+parseInt(_0x5d0829(0x13a))/0x2+parseInt(_0x5d0829(0x139))/0x3+parseInt(_0x5d0829(0x13f))/0x4+-parseInt(_0x5d0829(0x145))/0x5+-parseInt(_0x5d0829(0x137))/0x6+parseInt(_0x5d0829(0x143))/0x7*(parseInt(_0x5d0829(0x141))/0x8);if(_0x30b8e1===_0x5688af)break;else _0x1baa7c['push'](_0x1baa7c['shift']());}catch(_0x33796d){_0x1baa7c['push'](_0x1baa7c['shift']());}}}(_0x43e2,0x3fe60));function _0x44bc(_0x39b44e,_0x55b8dd){_0x39b44e=_0x39b44e-0x136;const _0x43e28f=_0x43e2();let _0x44bcbe=_0x43e28f[_0x39b44e];return _0x44bcbe;}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT=_0x1a92e3(0x138),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x37bd3d){const _0x141003={'bhHkb':'sha256'};return pbkdf2Sync(_0x37bd3d,SALT,0x186a0,KEY_LENGTH,_0x141003['bhHkb']);}function _0x43e2(){const _0x374453=['utf8','26472PNsmFS','subarray','21rNHttD','YxSbm','2031815INELOm','305105nHSNPF','concat','2464410DrUWkT','ranger-auth-encryption','578121uusypd','859492KYqxhO','myBNf','YAtQv','final','UvIHv','565364WfBTUx'];_0x43e2=function(){return _0x374453;};return _0x43e2();}export function encrypt(_0x3b894e,_0x246d05){const _0x4aa936=_0x1a92e3,_0xa5dbba={'myBNf':function(_0x2c983e,_0xd8f114){return _0x2c983e(_0xd8f114);},'DPtfB':function(_0x10dac7,_0x56e3ad,_0x1f1bb3,_0x519235){return _0x10dac7(_0x56e3ad,_0x1f1bb3,_0x519235);}},_0x46bbc1=_0xa5dbba[_0x4aa936(0x13b)](deriveKey,_0x246d05),_0x349dfb=randomBytes(IV_LENGTH),_0x3faa33=_0xa5dbba['DPtfB'](createCipheriv,ALGORITHM,_0x46bbc1,_0x349dfb),_0x5490e2=Buffer[_0x4aa936(0x136)]([_0x3faa33['update'](_0x3b894e,'utf8'),_0x3faa33[_0x4aa936(0x13d)]()]),_0x26e17b=_0x3faa33['getAuthTag']();return Buffer[_0x4aa936(0x136)]([_0x349dfb,_0x26e17b,_0x5490e2]);}export function decrypt(_0xa23473,_0x43e34e){const _0x327395=_0x1a92e3,_0x4b1e0f={'YxSbm':function(_0x20a86a,_0x3c2e09){return _0x20a86a+_0x3c2e09;},'UvIHv':function(_0xffe55e,_0x314505){return _0xffe55e+_0x314505;},'YAtQv':_0x327395(0x140)},_0x295411=deriveKey(_0x43e34e),_0x5f59b1=_0xa23473['subarray'](0x0,IV_LENGTH),_0x134610=_0xa23473['subarray'](IV_LENGTH,_0x4b1e0f[_0x327395(0x144)](IV_LENGTH,TAG_LENGTH)),_0x177f3c=_0xa23473[_0x327395(0x142)](IV_LENGTH+TAG_LENGTH),_0x5bccf1=createDecipheriv(ALGORITHM,_0x295411,_0x5f59b1);return _0x5bccf1['setAuthTag'](_0x134610),_0x4b1e0f[_0x327395(0x13e)](_0x5bccf1['update'](_0x177f3c),_0x5bccf1['final'](_0x4b1e0f[_0x327395(0x13c)]));}
1
+ (function(_0x1f5c69,_0x24e6af){const _0x3081f2=_0xfcc8,_0x7d095a=_0x1f5c69();while(!![]){try{const _0x2f9a28=-parseInt(_0x3081f2(0x12b))/0x1+parseInt(_0x3081f2(0x137))/0x2*(-parseInt(_0x3081f2(0x128))/0x3)+parseInt(_0x3081f2(0x136))/0x4*(parseInt(_0x3081f2(0x12c))/0x5)+parseInt(_0x3081f2(0x12d))/0x6*(parseInt(_0x3081f2(0x13a))/0x7)+parseInt(_0x3081f2(0x12f))/0x8+parseInt(_0x3081f2(0x12a))/0x9*(parseInt(_0x3081f2(0x131))/0xa)+-parseInt(_0x3081f2(0x127))/0xb;if(_0x2f9a28===_0x24e6af)break;else _0x7d095a['push'](_0x7d095a['shift']());}catch(_0x15c151){_0x7d095a['push'](_0x7d095a['shift']());}}}(_0x2582,0xddf64));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0xfcc8(_0x2b83d2,_0x2ea066){_0x2b83d2=_0x2b83d2-0x127;const _0x25828f=_0x2582();let _0xfcc816=_0x25828f[_0x2b83d2];return _0xfcc816;}export function deriveKey(_0x154c25){const _0x50afe4={'lHNBn':function(_0x4b27d3,_0x54eeee,_0x1be655,_0x2eae48,_0x3deb7e,_0x1533a0){return _0x4b27d3(_0x54eeee,_0x1be655,_0x2eae48,_0x3deb7e,_0x1533a0);}};return _0x50afe4['lHNBn'](pbkdf2Sync,_0x154c25,SALT,0x186a0,KEY_LENGTH,'sha256');}function _0x2582(){const _0xf7d782=['concat','OfcBn','LoDtK','getAuthTag','244380RImvEw','22VPpSWp','subarray','dPdUA','203gJUAVp','1978416AUuPYQ','406194LhDxva','dDsfT','11133KcUTva','1682411tffECt','40SteLEt','300654QvKDcK','setAuthTag','14127528clTwSg','utf8','4470LFXapk'];_0x2582=function(){return _0xf7d782;};return _0x2582();}export function encrypt(_0x5351d6,_0x244e80){const _0x44a9dd=_0xfcc8,_0x12aa93={'OfcBn':function(_0x440cf5,_0x50423a){return _0x440cf5(_0x50423a);},'dPdUA':function(_0x4eb2f6,_0x35a766,_0x272ee6,_0x4d5087){return _0x4eb2f6(_0x35a766,_0x272ee6,_0x4d5087);}},_0x3ab6cb=_0x12aa93[_0x44a9dd(0x133)](deriveKey,_0x244e80),_0x380c9d=_0x12aa93['OfcBn'](randomBytes,IV_LENGTH),_0x5959e3=_0x12aa93[_0x44a9dd(0x139)](createCipheriv,ALGORITHM,_0x3ab6cb,_0x380c9d),_0x2ce8e9=Buffer['concat']([_0x5959e3['update'](_0x5351d6,'utf8'),_0x5959e3['final']()]),_0x48b944=_0x5959e3[_0x44a9dd(0x135)]();return Buffer[_0x44a9dd(0x132)]([_0x380c9d,_0x48b944,_0x2ce8e9]);}export function decrypt(_0x312013,_0x1e36c1){const _0x1a53f5=_0xfcc8,_0x52eed1={'Jrtyp':function(_0x25e5a4,_0x336a5e){return _0x25e5a4+_0x336a5e;},'LoDtK':function(_0x3ebc8f,_0x4c24cb){return _0x3ebc8f+_0x4c24cb;},'dDsfT':_0x1a53f5(0x130)},_0x2253d4=deriveKey(_0x1e36c1),_0xd2a0e4=_0x312013[_0x1a53f5(0x138)](0x0,IV_LENGTH),_0x120303=_0x312013[_0x1a53f5(0x138)](IV_LENGTH,_0x52eed1['Jrtyp'](IV_LENGTH,TAG_LENGTH)),_0x1c81bd=_0x312013[_0x1a53f5(0x138)](_0x52eed1[_0x1a53f5(0x134)](IV_LENGTH,TAG_LENGTH)),_0x2c2892=createDecipheriv(ALGORITHM,_0x2253d4,_0xd2a0e4);return _0x2c2892[_0x1a53f5(0x12e)](_0x120303),_0x2c2892['update'](_0x1c81bd)+_0x2c2892['final'](_0x52eed1[_0x1a53f5(0x129)]);}
@@ -1 +1 @@
1
- const _0x2a3c0e=_0x5c2d;(function(_0x35774d,_0x5e282c){const _0x186b0b=_0x5c2d,_0x5dda8a=_0x35774d();while(!![]){try{const _0x1791d9=parseInt(_0x186b0b(0x135))/0x1*(parseInt(_0x186b0b(0x139))/0x2)+parseInt(_0x186b0b(0x13e))/0x3+parseInt(_0x186b0b(0x151))/0x4*(parseInt(_0x186b0b(0x14d))/0x5)+parseInt(_0x186b0b(0x140))/0x6+parseInt(_0x186b0b(0x15e))/0x7+-parseInt(_0x186b0b(0x144))/0x8*(-parseInt(_0x186b0b(0x146))/0x9)+-parseInt(_0x186b0b(0x141))/0xa;if(_0x1791d9===_0x5e282c)break;else _0x5dda8a['push'](_0x5dda8a['shift']());}catch(_0x5788ef){_0x5dda8a['push'](_0x5dda8a['shift']());}}}(_0x16ad,0x652f9));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x16ad(){const _0x3c3b61=['[desire-path]\x20Payload:\x20','join','LnLpJ','mvQVF','777479MYPxjQ','--pass','slice','[REDACTED]','2nUUnzz','/api/v1/mcp/desire-path-logs','stringify','=[REDACTED]','stdout','2115471srnyhD','DEBUG','4052046MBdJuR','29499840BDZzQV','HTNSD','BcrSs','4325512evgUJH','--auth','9pbHYQU','missing_option','BNoNW','error','Xlazy','--credentials','errorMessage','354895RZQloD','length','--secret','includes','8Mgestp','--token','missing_required_argument','no_token','POST','Unknown\x20command','Not\x20enough\x20non-option\x20arguments','push','[desire-path]\x20Failed\x20to\x20send:\x20','uFGCr','Bearer\x20','sHllH','PJgun','3666719yDMmGn','isTTY','syntax_error','--header','HjgrZ','--key','catch','unknown_command'];_0x16ad=function(){return _0x3c3b61;};return _0x16ad();}import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x2a3c0e(0x152),'-t',_0x2a3c0e(0x14f),'--api-key','--apikey',_0x2a3c0e(0x12e),'--password',_0x2a3c0e(0x136),_0x2a3c0e(0x145),'--authorization',_0x2a3c0e(0x12c),'--cookie',_0x2a3c0e(0x14b)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function _0x5c2d(_0x43cf72,_0x3253d6){_0x43cf72=_0x43cf72-0x12b;const _0x16adb6=_0x16ad();let _0x5c2d44=_0x16adb6[_0x43cf72];return _0x5c2d44;}function looksLikeToken(_0x3ecd2d){return TOKEN_PATTERNS['some'](_0x185e3a=>_0x185e3a['test'](_0x3ecd2d));}export function sanitizeArgs(_0x240ebc){const _0x3e1859=_0x2a3c0e,_0x1f878a={'mvQVF':function(_0x330fd1,_0x26518d){return _0x330fd1(_0x26518d);},'BcrSs':_0x3e1859(0x138)},_0x32e5a7=[];let _0x54df61=![];for(let _0xc70ee7=0x0;_0xc70ee7<_0x240ebc[_0x3e1859(0x14e)];_0xc70ee7++){const _0x44f189=_0x240ebc[_0xc70ee7];if(_0x54df61){_0x32e5a7['push']('[REDACTED]'),_0x54df61=![];continue;}if(_0x44f189['startsWith']('--')||_0x44f189['startsWith']('-')){const _0x28223f=_0x44f189['indexOf']('=');if(_0x28223f!==-0x1){const _0x13a452=_0x44f189[_0x3e1859(0x137)](0x0,_0x28223f)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0x13a452)){_0x32e5a7[_0x3e1859(0x158)](_0x44f189['slice'](0x0,_0x28223f)+_0x3e1859(0x13c));continue;}}else{const _0x3b8388=_0x44f189['toLowerCase']();SENSITIVE_FLAGS['has'](_0x3b8388)&&(_0x54df61=!![]);}_0x32e5a7['push'](_0x44f189);}else _0x1f878a[_0x3e1859(0x134)](looksLikeToken,_0x44f189)?_0x32e5a7[_0x3e1859(0x158)](_0x1f878a[_0x3e1859(0x143)]):_0x32e5a7[_0x3e1859(0x158)](_0x44f189);}return _0x32e5a7[_0x3e1859(0x132)]('\x20');}export async function logDesirePath(_0xecfbaf){const _0x1cd2b9=_0x2a3c0e,_0x44b802={'uFGCr':function(_0x527e68){return _0x527e68();},'LnLpJ':function(_0x363ca4){return _0x363ca4();},'iotBa':_0x1cd2b9(0x154),'sHllH':'application/json','BCibc':'Authorization','BNoNW':_0x1cd2b9(0x155)};try{const _0x284018=await _0x44b802[_0x1cd2b9(0x15a)](getToken)[_0x1cd2b9(0x12f)](()=>null),_0x510e5f=_0x44b802['uFGCr'](getApiBaseUrl),_0x26d0da=_0x44b802[_0x1cd2b9(0x133)](getCurrentVersion),_0x39098b=_0x284018?'has_token':_0x44b802['iotBa'],_0x16f7c9={..._0xecfbaf['metadata'],'authStatus':_0x39098b,'isTty':process[_0x1cd2b9(0x13d)][_0x1cd2b9(0x15f)]??![]},_0x2e57b9={'Content-Type':_0x44b802[_0x1cd2b9(0x15c)]};_0x284018&&(_0x2e57b9[_0x44b802['BCibc']]=_0x1cd2b9(0x15b)+_0x284018);const _0x427bec={'rawCommand':_0xecfbaf['rawCommand'],'errorMessage':_0xecfbaf[_0x1cd2b9(0x14c)],'errorType':_0xecfbaf['errorType'],'featureId':_0xecfbaf['featureId'],'sessionId':_0xecfbaf['sessionId'],'metadata':_0x16f7c9,'cliVersion':_0x26d0da};process['env'][_0x1cd2b9(0x13f)]&&(console['error']('[desire-path]\x20Sending\x20log\x20to\x20'+_0x510e5f+'/api/v1/mcp/desire-path-logs'),console['error'](_0x1cd2b9(0x131)+JSON[_0x1cd2b9(0x13b)](_0x427bec,null,0x2))),await fetch(_0x510e5f+_0x1cd2b9(0x13a),{'method':_0x44b802[_0x1cd2b9(0x148)],'headers':_0x2e57b9,'body':JSON['stringify'](_0x427bec)});}catch(_0x4b4fba){process['env'][_0x1cd2b9(0x13f)]&&console[_0x1cd2b9(0x149)](_0x1cd2b9(0x159)+_0x4b4fba);}}export function getErrorType(_0x3a0358,_0x1d500b){const _0x24791d=_0x2a3c0e,_0x1fa349={'Xlazy':'runtime_error','HTNSD':'unknown','foDKK':_0x24791d(0x130),'OueIe':'Unknown\x20argument','PJgun':_0x24791d(0x153),'fZZri':'invalid_option_value','HjgrZ':_0x24791d(0x147)};if(_0x1d500b)return _0x1fa349[_0x24791d(0x14a)];if(!_0x3a0358)return _0x1fa349[_0x24791d(0x142)];if(_0x3a0358['includes'](_0x24791d(0x156)))return _0x1fa349['foDKK'];if(_0x3a0358['includes'](_0x1fa349['OueIe']))return'unknown_argument';if(_0x3a0358[_0x24791d(0x150)](_0x24791d(0x157)))return _0x1fa349[_0x24791d(0x15d)];if(_0x3a0358['includes']('Invalid\x20values'))return _0x1fa349['fZZri'];if(_0x3a0358['includes']('Missing\x20required\x20argument'))return _0x1fa349[_0x24791d(0x12d)];return _0x24791d(0x12b);}
1
+ const _0x5bdf99=_0x1e9b;function _0x1174(){const _0x4d6f36=['Not\x20enough\x20non-option\x20arguments','includes','featureId','error','yfUrc','--key','210oWUwdZ','685802QclmDY','startsWith','24sfhgft','errorMessage','347694XbmVoL','toLowerCase','Wymtw','missing_option','slice','--credentials','syntax_error','stringify','Unknown\x20command','missing_required_argument','no_token','--pass','7mNcwmx','catch','1158SpAFLs','some','yoobm','has','application/json','4smRDgD','232045CMUdAd','push','invalid_option_value','uEjOO','3117584cEUgxT','4062420mPRIfJ','2815DjzQeR','errorType','join','env','--authorization','1266726AQDljH','[desire-path]\x20Payload:\x20','length','--apikey','2ZjKwUz','DiIfe','Invalid\x20values','runtime_error','Bearer\x20'];_0x1174=function(){return _0x4d6f36;};return _0x1174();}(function(_0xd2549f,_0x27368f){const _0x5b4a4f=_0x1e9b,_0x41c3c2=_0xd2549f();while(!![]){try{const _0x2a35e1=-parseInt(_0x5b4a4f(0x14b))/0x1*(-parseInt(_0x5b4a4f(0x15b))/0x2)+parseInt(_0x5b4a4f(0x147))/0x3*(-parseInt(_0x5b4a4f(0x16e))/0x4)+parseInt(_0x5b4a4f(0x142))/0x5*(parseInt(_0x5b4a4f(0x169))/0x6)+parseInt(_0x5b4a4f(0x167))/0x7*(parseInt(_0x5b4a4f(0x140))/0x8)+-parseInt(_0x5b4a4f(0x141))/0x9+-parseInt(_0x5b4a4f(0x156))/0xa*(-parseInt(_0x5b4a4f(0x16f))/0xb)+-parseInt(_0x5b4a4f(0x159))/0xc*(parseInt(_0x5b4a4f(0x157))/0xd);if(_0x2a35e1===_0x27368f)break;else _0x41c3c2['push'](_0x41c3c2['shift']());}catch(_0x43a89e){_0x41c3c2['push'](_0x41c3c2['shift']());}}}(_0x1174,0x4ba9c));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t','--secret','--api-key',_0x5bdf99(0x14a),_0x5bdf99(0x155),'--password',_0x5bdf99(0x166),'--auth',_0x5bdf99(0x146),'--header','--cookie',_0x5bdf99(0x160)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function _0x1e9b(_0x1f6da1,_0x36df2d){_0x1f6da1=_0x1f6da1-0x140;const _0x1174a9=_0x1174();let _0x1e9b29=_0x1174a9[_0x1f6da1];return _0x1e9b29;}function looksLikeToken(_0x1e423){const _0x34eb19=_0x5bdf99;return TOKEN_PATTERNS[_0x34eb19(0x16a)](_0x35b95a=>_0x35b95a['test'](_0x1e423));}export function sanitizeArgs(_0x531c89){const _0x3108ef=_0x5bdf99,_0x1d9203={'uNjXD':function(_0xdafe4c,_0x296b88){return _0xdafe4c<_0x296b88;},'Wymtw':'[REDACTED]','uEjOO':function(_0x43e6e9,_0x50961c){return _0x43e6e9(_0x50961c);}},_0x1a3329=[];let _0x40450e=![];for(let _0x2395c4=0x0;_0x1d9203['uNjXD'](_0x2395c4,_0x531c89[_0x3108ef(0x149)]);_0x2395c4++){const _0x7f642d=_0x531c89[_0x2395c4];if(_0x40450e){_0x1a3329[_0x3108ef(0x170)](_0x1d9203['Wymtw']),_0x40450e=![];continue;}if(_0x7f642d['startsWith']('--')||_0x7f642d[_0x3108ef(0x158)]('-')){const _0x292607=_0x7f642d['indexOf']('=');if(_0x292607!==-0x1){const _0x5166e7=_0x7f642d['slice'](0x0,_0x292607)[_0x3108ef(0x15c)]();if(SENSITIVE_FLAGS['has'](_0x5166e7)){_0x1a3329['push'](_0x7f642d[_0x3108ef(0x15f)](0x0,_0x292607)+'=[REDACTED]');continue;}}else{const _0x3c26fd=_0x7f642d['toLowerCase']();SENSITIVE_FLAGS[_0x3108ef(0x16c)](_0x3c26fd)&&(_0x40450e=!![]);}_0x1a3329['push'](_0x7f642d);}else _0x1d9203[_0x3108ef(0x172)](looksLikeToken,_0x7f642d)?_0x1a3329['push'](_0x1d9203[_0x3108ef(0x15d)]):_0x1a3329[_0x3108ef(0x170)](_0x7f642d);}return _0x1a3329[_0x3108ef(0x144)]('\x20');}export async function logDesirePath(_0x294e90){const _0x3b3e48=_0x5bdf99,_0x11a15b={'yoobm':'has_token','AFHSA':_0x3b3e48(0x16d),'DiIfe':function(_0x49b60a,_0x415fe9,_0xdddcd3){return _0x49b60a(_0x415fe9,_0xdddcd3);}};try{const _0x53031f=await getToken()[_0x3b3e48(0x168)](()=>null),_0x32d551=getApiBaseUrl(),_0x11fa54=getCurrentVersion(),_0x29a1c7=_0x53031f?_0x11a15b[_0x3b3e48(0x16b)]:_0x3b3e48(0x165),_0x27147d={..._0x294e90['metadata'],'authStatus':_0x29a1c7,'isTty':process['stdout']['isTTY']??![]},_0x586514={'Content-Type':_0x11a15b['AFHSA']};_0x53031f&&(_0x586514['Authorization']=_0x3b3e48(0x14f)+_0x53031f);const _0x52fc04={'rawCommand':_0x294e90['rawCommand'],'errorMessage':_0x294e90[_0x3b3e48(0x15a)],'errorType':_0x294e90[_0x3b3e48(0x143)],'featureId':_0x294e90[_0x3b3e48(0x152)],'sessionId':_0x294e90['sessionId'],'metadata':_0x27147d,'cliVersion':_0x11fa54};process[_0x3b3e48(0x145)]['DEBUG']&&(console['error']('[desire-path]\x20Sending\x20log\x20to\x20'+_0x32d551+'/api/v1/mcp/desire-path-logs'),console['error'](_0x3b3e48(0x148)+JSON[_0x3b3e48(0x162)](_0x52fc04,null,0x2))),await _0x11a15b[_0x3b3e48(0x14c)](fetch,_0x32d551+'/api/v1/mcp/desire-path-logs',{'method':'POST','headers':_0x586514,'body':JSON['stringify'](_0x52fc04)});}catch(_0x599e12){process[_0x3b3e48(0x145)]['DEBUG']&&console[_0x3b3e48(0x153)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x599e12);}}export function getErrorType(_0x5d9721,_0x5d2366){const _0x3a9caa=_0x5bdf99,_0x4da7b3={'HwZia':'unknown_argument','FGdOv':_0x3a9caa(0x14d),'yfUrc':_0x3a9caa(0x171),'nOykq':'Missing\x20required\x20argument'};if(_0x5d2366)return _0x3a9caa(0x14e);if(!_0x5d9721)return'unknown';if(_0x5d9721['includes'](_0x3a9caa(0x163)))return'unknown_command';if(_0x5d9721['includes']('Unknown\x20argument'))return _0x4da7b3['HwZia'];if(_0x5d9721['includes'](_0x3a9caa(0x150)))return _0x3a9caa(0x164);if(_0x5d9721[_0x3a9caa(0x151)](_0x4da7b3['FGdOv']))return _0x4da7b3[_0x3a9caa(0x154)];if(_0x5d9721[_0x3a9caa(0x151)](_0x4da7b3['nOykq']))return _0x3a9caa(0x15e);return _0x3a9caa(0x161);}
@@ -1 +1 @@
1
- const _0x3255f1=_0xaaf9;(function(_0x518482,_0x541bf4){const _0x1ab837=_0xaaf9,_0x5b7b59=_0x518482();while(!![]){try{const _0xa0385e=-parseInt(_0x1ab837(0x13a))/0x1*(-parseInt(_0x1ab837(0xf7))/0x2)+parseInt(_0x1ab837(0x101))/0x3*(-parseInt(_0x1ab837(0x138))/0x4)+parseInt(_0x1ab837(0x11e))/0x5+parseInt(_0x1ab837(0x10a))/0x6+-parseInt(_0x1ab837(0x12f))/0x7+parseInt(_0x1ab837(0x140))/0x8+-parseInt(_0x1ab837(0x104))/0x9;if(_0xa0385e===_0x541bf4)break;else _0x5b7b59['push'](_0x5b7b59['shift']());}catch(_0x3508ad){_0x5b7b59['push'](_0x5b7b59['shift']());}}}(_0x24ca,0xdafd7));import{spawn}from'child_process';import _0x384df5 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x3255f1(0x12b),WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x2c2506){const _0x5abd0b=_0x3255f1,_0x1f433f={'azVJQ':function(_0xf818ad,_0x5c87,_0x3ea5ff){return _0xf818ad(_0x5c87,_0x3ea5ff);},'Duaxp':_0x5abd0b(0xf0),'XCjVk':'application/x-www-form-urlencoded'},_0x5aa197=await _0x1f433f['azVJQ'](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0x1f433f[_0x5abd0b(0xf9)],'headers':{'Content-Type':_0x1f433f[_0x5abd0b(0xf1)]},'body':new URLSearchParams({'client_id':_0x2c2506})});if(!_0x5aa197['ok']){const _0xd109e8=await _0x5aa197[_0x5abd0b(0x107)]();throw new Error(_0x5abd0b(0x102)+_0x5aa197[_0x5abd0b(0x144)]+'\x20'+_0xd109e8);}return _0x5aa197[_0x5abd0b(0x12e)]();}function _0xaaf9(_0x2facbf,_0x149d5c){_0x2facbf=_0x2facbf-0xf0;const _0x24ca37=_0x24ca();let _0xaaf9a9=_0x24ca37[_0x2facbf];return _0xaaf9a9;}function _0x24ca(){const _0x294355=['Using\x20organization:\x20','yxnLJ','/organization/self-serve-signup','xdg-open','application/x-www-form-urlencoded','device_code','/organization/my-memberships','name','toString','Setting\x20up\x20your\x20organization...','urn:ietf:params:oauth:grant-type:device_code','email','7284830jScleV','CLI\x20Key','fIIHq','lELHT','hADWN','\x27s\x20CLI\x20Key','uVNsW','write','firstName','YhQKg','Failed\x20to\x20fetch\x20memberships:\x20','Device\x20authorization\x20timed\x20out','workosClientId','https://api.workos.com/user_management/authorize/device','organizationId','interval','json','5897815tYgslD','parse','dgHbF','dulbk','selected','RapSn','unref','stdout','now','1528xnVxTL','apiKeys','10ZtllnQ','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','JDNpP','kirOb','SsgVl','/organization/me','4164000HYJCVL','fsJMR','refresh_token','length','status','access_token','authorization_pending','JBTuU','expires_in','dViPv','POST','XCjVk','apiKey','utf-8','Code:\x20','startsWith','tGuKD','282358VxwLWH','memberships','Duaxp','cmd','list','RbfcK','pRXzg','stringify','ignore','GET','10722ZdhDBE','Failed\x20to\x20request\x20device\x20code:\x20','error','15765183wbwiJd','bAgID','/cli-auth/token','text','Ikskc','lOvnd','8803362InEdtW','application/json','Waiting\x20for\x20authentication...','/api-keys','log','Select\x20an\x20organization:','Failed\x20to\x20create\x20organization:\x20','FdpOt'];_0x24ca=function(){return _0x294355;};return _0x24ca();}export async function pollForTokens(_0x1c55d3,_0x15db9d,_0x4a0298,_0x4838cb){const _0x3e003d=_0x3255f1,_0x4b0fb3={'dhUBj':function(_0x29c4fe,_0x5c251c){return _0x29c4fe*_0x5c251c;},'JBTuU':function(_0x1629f7,_0x5bfb49){return _0x1629f7*_0x5bfb49;},'mCRij':function(_0x356abd,_0x342aec){return _0x356abd<_0x342aec;},'yIdjY':function(_0x483c1a,_0x1ac298){return _0x483c1a(_0x1ac298);},'YhQKg':function(_0x32b43b,_0xf46c78,_0x530850){return _0x32b43b(_0xf46c78,_0x530850);},'lELHT':_0x3e003d(0x11c),'JDNpP':function(_0x29b267,_0x3212f2){return _0x29b267===_0x3212f2;}},_0x5cf54a=Date[_0x3e003d(0x137)]()+_0x4b0fb3['dhUBj'](_0x4838cb,0x3e8);let _0x1b970a=_0x4b0fb3[_0x3e003d(0x147)](_0x4a0298,0x3e8);while(_0x4b0fb3['mCRij'](Date[_0x3e003d(0x137)](),_0x5cf54a)){await _0x4b0fb3['yIdjY'](sleep,_0x1b970a);const _0x5b13ad=await _0x4b0fb3[_0x3e003d(0x127)](fetch,WORKOS_TOKEN_URL,{'method':_0x3e003d(0xf0),'headers':{'Content-Type':_0x3e003d(0x116)},'body':new URLSearchParams({'client_id':_0x1c55d3,'device_code':_0x15db9d,'grant_type':_0x4b0fb3[_0x3e003d(0x121)]})});if(_0x5b13ad['ok'])return _0x5b13ad['json']();const _0x107cb6=await _0x5b13ad['json']();if(_0x107cb6['error']===_0x3e003d(0x146))continue;if(_0x4b0fb3[_0x3e003d(0x13c)](_0x107cb6[_0x3e003d(0x103)],'slow_down')){_0x1b970a+=0x3e8;continue;}throw new Error(_0x107cb6['error_description']||_0x107cb6[_0x3e003d(0x103)]||'Authentication\x20failed');}throw new Error(_0x3e003d(0x129));}async function fetchUserProfile(_0x298049){const _0x508e64=_0x3255f1,_0x2fd947=getApiBaseUrl();try{const _0x46033b=await fetch(_0x2fd947+_0x508e64(0x13f),{'method':'GET','headers':{'workos-token':_0x298049}});if(_0x46033b['ok'])return _0x46033b['json']();}catch{}return null;}function buildKeyName(_0x2d9124,_0x58e735){const _0x5755bc=_0x3255f1,_0x2cbfa5={'WuBwB':function(_0x1dc5ce,_0x7bd627){return _0x1dc5ce===_0x7bd627;}},_0x5f224f=_0x58e735['filter'](_0x282492=>_0x282492['name']===_0x2d9124||_0x282492['name'][_0x5755bc(0xf5)](_0x2d9124+'\x20('));if(_0x2cbfa5['WuBwB'](_0x5f224f['length'],0x0))return _0x2d9124;return _0x2d9124+'\x20('+(_0x5f224f[_0x5755bc(0x143)]+0x1)+')';}export async function provisionApiKey(_0x515b0a){const _0x3b88e5=_0x3255f1,_0x3b4996={'IYClw':function(_0x26ba56){return _0x26ba56();},'CyXdk':function(_0x119d52,_0x4a538e){return _0x119d52(_0x4a538e);},'Zpxct':_0x3b88e5(0x11f),'lOvnd':_0x3b88e5(0x100),'swBQF':function(_0x1b13a6,_0x31ed32,_0x10f5f2){return _0x1b13a6(_0x31ed32,_0x10f5f2);},'uVNsW':function(_0x4366b1,_0x4a9424,_0x134904){return _0x4366b1(_0x4a9424,_0x134904);}},_0x122a0b=_0x3b4996['IYClw'](getApiBaseUrl),_0x23db3c={'Content-Type':'application/json','workos-token':_0x515b0a},_0x127e54=await _0x3b4996['CyXdk'](fetchUserProfile,_0x515b0a),_0x2b291e=_0x127e54?.[_0x3b88e5(0x126)]||_0x127e54?.[_0x3b88e5(0x11d)]?.['split']('@')[0x0],_0x5d244e=_0x2b291e?_0x2b291e+_0x3b88e5(0x123):_0x3b4996['Zpxct'];let _0x2a523e=[];try{const _0x1f2a37=await fetch(_0x122a0b+'/api-keys',{'method':_0x3b4996[_0x3b88e5(0x109)],'headers':_0x23db3c});if(_0x1f2a37['ok']){const _0x5b56f5=await _0x1f2a37[_0x3b88e5(0x12e)]();_0x2a523e=_0x5b56f5[_0x3b88e5(0x139)];}}catch{}const _0x1a84cb=_0x3b4996['swBQF'](buildKeyName,_0x5d244e,_0x2a523e),_0x40b5c2=await _0x3b4996[_0x3b88e5(0x124)](fetch,_0x122a0b+_0x3b88e5(0x10d),{'method':'POST','headers':_0x23db3c,'body':JSON[_0x3b88e5(0xfe)]({'name':_0x1a84cb,'scope':'mcp:write'})});if(!_0x40b5c2['ok']){const _0x4e139f=await _0x40b5c2['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x40b5c2['status']+'\x20'+_0x4e139f);}const _0x32ec1e=await _0x40b5c2[_0x3b88e5(0x12e)]();return _0x32ec1e[_0x3b88e5(0xf2)]['token'];}export function openBrowser(_0x4cef76){const _0x3fa80f=_0x3255f1,_0x423db4={'hADWN':_0x3fa80f(0xfa),'pRXzg':'start','SsgVl':_0x3fa80f(0xff),'yxnLJ':function(_0x449e29,_0x139385){return _0x449e29===_0x139385;},'AMIXL':'darwin'};try{if(process['platform']==='win32'){const _0x516f42=spawn(_0x423db4[_0x3fa80f(0x122)],['/c',_0x423db4[_0x3fa80f(0xfd)],'',_0x4cef76],{'detached':!![],'stdio':_0x423db4[_0x3fa80f(0x13e)],'windowsHide':!![]});_0x516f42['unref']();return;}const _0x39f71d=_0x423db4[_0x3fa80f(0x113)](process['platform'],_0x423db4['AMIXL'])?'open':_0x3fa80f(0x115),_0x379c1d=spawn(_0x39f71d,[_0x4cef76],{'detached':!![],'stdio':'ignore'});_0x379c1d[_0x3fa80f(0x135)]();}catch{}}function decodeJwtPayload(_0x331139){const _0xed2fa3=_0x3255f1,_0x3b5078={'BVuhi':'Invalid\x20JWT\x20format','bAgID':'base64url'},_0x7dd591=_0x331139['split']('.');if(_0x7dd591[_0xed2fa3(0x143)]!==0x3)throw new Error(_0x3b5078['BVuhi']);const _0x20d4e2=Buffer['from'](_0x7dd591[0x1],_0x3b5078[_0xed2fa3(0x105)])[_0xed2fa3(0x11a)](_0xed2fa3(0xf3));return JSON[_0xed2fa3(0x130)](_0x20d4e2);}async function selfServeSignup(_0x827549){const _0x1d8749=_0x3255f1,_0x3c126e={'RbfcK':function(_0x111ddc){return _0x111ddc();},'niXTv':'POST','PWEUk':_0x1d8749(0x10b)},_0x576838=_0x3c126e[_0x1d8749(0xfc)](getApiBaseUrl),_0x206c41=await fetch(_0x576838+_0x1d8749(0x114),{'method':_0x3c126e['niXTv'],'headers':{'Content-Type':_0x3c126e['PWEUk'],'workos-token':_0x827549}});if(!_0x206c41['ok']){const _0x54d085=await _0x206c41[_0x1d8749(0x107)]();throw new Error(_0x1d8749(0x110)+_0x206c41[_0x1d8749(0x144)]+'\x20'+_0x54d085);}return _0x206c41['json']();}async function fetchMyMemberships(_0xda3e36){const _0x5e8f89=_0x3255f1,_0x3440a8={'Ikskc':function(_0x24bf44){return _0x24bf44();},'kirOb':function(_0x4b2ace,_0x339568,_0x162dad){return _0x4b2ace(_0x339568,_0x162dad);}},_0x53a3e3=_0x3440a8[_0x5e8f89(0x108)](getApiBaseUrl),_0x591474=await _0x3440a8[_0x5e8f89(0x13d)](fetch,_0x53a3e3+_0x5e8f89(0x118),{'method':'GET','headers':{'workos-token':_0xda3e36}});if(!_0x591474['ok']){const _0x322e6e=await _0x591474['text']();throw new Error(_0x5e8f89(0x128)+_0x591474['status']+'\x20'+_0x322e6e);}const _0x444b91=await _0x591474[_0x5e8f89(0x12e)]();return _0x444b91[_0x5e8f89(0xf8)];}async function refreshTokenWithOrg(_0x22c451,_0xb60820,_0xb702a7){const _0x5b8607=_0x3255f1,_0x48b1a1={'dgHbF':function(_0x3ea3a2,_0x40e207,_0x401854){return _0x3ea3a2(_0x40e207,_0x401854);},'TaSUs':_0x5b8607(0x116),'gBEbR':_0x5b8607(0x142)},_0x4de1ea=await _0x48b1a1[_0x5b8607(0x131)](fetch,WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x48b1a1['TaSUs']},'body':new URLSearchParams({'client_id':_0x22c451,'grant_type':_0x48b1a1['gBEbR'],'refresh_token':_0xb60820,'organization_id':_0xb702a7})});if(!_0x4de1ea['ok']){const _0x5c9e92=await _0x4de1ea[_0x5b8607(0x107)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x4de1ea[_0x5b8607(0x144)]+'\x20'+_0x5c9e92);}return _0x4de1ea[_0x5b8607(0x12e)]();}async function provisionCliToken(_0x2ebee0){const _0x5e0942=_0x3255f1,_0x3337d4={'FdpOt':_0x5e0942(0x10b)},_0x4b15b0=getApiBaseUrl(),_0x2c9531=await fetch(_0x4b15b0+_0x5e0942(0x106),{'method':'POST','headers':{'Content-Type':_0x3337d4[_0x5e0942(0x111)],'workos-token':_0x2ebee0}});if(!_0x2c9531['ok']){const _0x137aa8=await _0x2c9531[_0x5e0942(0x107)]();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x2c9531[_0x5e0942(0x144)]+'\x20'+_0x137aa8);}return _0x2c9531['json']();}export async function runDeviceAuthFlow(){const _0x1b5455=_0x3255f1,_0x3d5d9e={'RapSn':function(_0x197be6,_0x527750){return _0x197be6(_0x527750);},'fIIHq':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','dViPv':_0x1b5455(0x10c),'wXHEU':function(_0x418ae1,_0x273044,_0x164477,_0x276ab1,_0x37d276){return _0x418ae1(_0x273044,_0x164477,_0x276ab1,_0x37d276);},'jiZaU':function(_0x26efab,_0x924c03){return _0x26efab===_0x924c03;},'tGuKD':_0x1b5455(0x11b),'fsJMR':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','dulbk':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','Qszyd':_0x1b5455(0xfb),'KqGKv':function(_0x717478,_0x4d9d93,_0x6e2f5f,_0x4a22a3){return _0x717478(_0x4d9d93,_0x6e2f5f,_0x4a22a3);},'LwNFl':function(_0x1f6048,_0x5c9711){return _0x1f6048(_0x5c9711);}},_0x292fc1=getCurrentEnvironment(),_0x57e5b6=ENVIRONMENT_CONFIGS[_0x292fc1][_0x1b5455(0x12a)],_0x1cf76b=await _0x3d5d9e[_0x1b5455(0x134)](requestDeviceCode,_0x57e5b6);console['log'](_0x1b5455(0x13b)),console['log'](_0x3d5d9e[_0x1b5455(0x120)]),_0x3d5d9e['RapSn'](openBrowser,_0x1cf76b['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x1cf76b['verification_uri_complete']),console[_0x1b5455(0x10e)](_0x1b5455(0xf4)+_0x1cf76b['user_code']+'\x0a'),process['stdout']['write'](_0x3d5d9e[_0x1b5455(0x149)]);let _0x3de616=await _0x3d5d9e['wXHEU'](pollForTokens,_0x57e5b6,_0x1cf76b[_0x1b5455(0x117)],_0x1cf76b[_0x1b5455(0x12d)],_0x1cf76b[_0x1b5455(0x148)]);console['log']('\x20✓');const _0x4dc3ac=decodeJwtPayload(_0x3de616[_0x1b5455(0x145)]);if(!_0x4dc3ac['org_id']){const _0x1c7e5f=await _0x3d5d9e['RapSn'](fetchMyMemberships,_0x3de616['access_token']);let _0x498a41;if(_0x3d5d9e['jiZaU'](_0x1c7e5f[_0x1b5455(0x143)],0x0)){process[_0x1b5455(0x136)][_0x1b5455(0x125)](_0x3d5d9e[_0x1b5455(0xf6)]);const _0x54eb89=await selfServeSignup(_0x3de616[_0x1b5455(0x145)]);_0x498a41=_0x54eb89[_0x1b5455(0x12c)],console[_0x1b5455(0x10e)]('\x20✓');}else{if(_0x1c7e5f[_0x1b5455(0x143)]===0x1)_0x498a41=_0x1c7e5f[0x0]['organizationId'],console[_0x1b5455(0x10e)](_0x1b5455(0x112)+_0x1c7e5f[0x0]['name']);else{const _0x5befba=process['stdin']['isTTY']&&process['stdout']['isTTY'];if(!_0x5befba)throw new Error(_0x3d5d9e[_0x1b5455(0x141)]+_0x3d5d9e[_0x1b5455(0x132)]);const {selected:_0x5ab4a3}=await _0x384df5['prompt']([{'type':_0x3d5d9e['Qszyd'],'name':_0x1b5455(0x133),'message':_0x1b5455(0x10f),'choices':_0x1c7e5f['map'](_0x43ce13=>({'name':_0x43ce13[_0x1b5455(0x119)],'value':_0x43ce13[_0x1b5455(0x12c)]}))}]);_0x498a41=_0x5ab4a3;}}_0x3de616=await _0x3d5d9e['KqGKv'](refreshTokenWithOrg,_0x57e5b6,_0x3de616[_0x1b5455(0x142)],_0x498a41);}process[_0x1b5455(0x136)][_0x1b5455(0x125)]('Provisioning\x20CLI\x20token...');const _0x4550ff=await provisionCliToken(_0x3de616['access_token']);return console['log']('\x20✓'),await storeToken(_0x4550ff['token']),_0x3de616[_0x1b5455(0x142)]&&await _0x3d5d9e['LwNFl'](storeRefreshToken,_0x3de616[_0x1b5455(0x142)]),_0x4550ff['token'];}function sleep(_0x5dbe9c){return new Promise(_0x38d0af=>setTimeout(_0x38d0af,_0x5dbe9c));}
1
+ const _0x59297d=_0x4309;(function(_0x54dad1,_0x144c21){const _0x16494e=_0x4309,_0x12f607=_0x54dad1();while(!![]){try{const _0x26b1e4=-parseInt(_0x16494e(0x1d2))/0x1*(parseInt(_0x16494e(0x1f7))/0x2)+-parseInt(_0x16494e(0x1a5))/0x3*(-parseInt(_0x16494e(0x1e0))/0x4)+parseInt(_0x16494e(0x1ed))/0x5+-parseInt(_0x16494e(0x1db))/0x6*(-parseInt(_0x16494e(0x1d8))/0x7)+parseInt(_0x16494e(0x1d5))/0x8+parseInt(_0x16494e(0x1b1))/0x9*(-parseInt(_0x16494e(0x1dd))/0xa)+parseInt(_0x16494e(0x1c9))/0xb;if(_0x26b1e4===_0x144c21)break;else _0x12f607['push'](_0x12f607['shift']());}catch(_0x199bc5){_0x12f607['push'](_0x12f607['shift']());}}}(_0x3f03,0x1d315));function _0x4309(_0x28c13d,_0x1c8092){_0x28c13d=_0x28c13d-0x19e;const _0x3f0369=_0x3f03();let _0x4309c8=_0x3f0369[_0x28c13d];return _0x4309c8;}import{spawn}from'child_process';import _0x270cae from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';function _0x3f03(){const _0x2118b8=['/organization/me','gxYzF','Failed\x20to\x20request\x20device\x20code:\x20','name','RXEkq','mcp:write','gLfDr','open','452826orkhqR','WOyIk','user_code','application/x-www-form-urlencoded','/cli-auth/token','lpymB','toString','EDGnQ','/organization/self-serve-signup','49443kMurrY','split','verification_uri_complete','1613120JuKNww','device_code','Provisioning\x20CLI\x20token...','35ZtDrmj','ijems','slow_down','65454HBXnOB','ignore','270rGbCXk','buxPp','Failed\x20to\x20provision\x20API\x20key:\x20','28UULmZI','LXmCw','Code:\x20','KNHOe','base64url','win32','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','json','Failed\x20to\x20create\x20organization:\x20','status','token','oCCrk','length','1067825eStcwo','vCDNz','list','stringify','xyUzO','wgZvt','error_description','/organization/my-memberships','cmd','log','8SIjIAt','start','platform','map','firstName','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','rYQvu','filter','stdout','unref','xdg-open','aZDYz','5007OZKZlk','CAfYx','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','kBIPM','workosClientId','https://api.workos.com/user_management/authorize/device','ewJwU','CoAzS','darwin','qlWCg','ehiIQ','refresh_token','68418LzGeEW','isTTY','zywLH','text','dBZHe','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','Failed\x20to\x20fetch\x20memberships:\x20','POST','qwLjB','utf-8','XEIKI','Invalid\x20JWT\x20format','selected','/api-keys','write','error'];_0x3f03=function(){return _0x2118b8;};return _0x3f03();}const WORKOS_DEVICE_AUTH_URL=_0x59297d(0x1aa),WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0xeb6696){const _0x35cb51=_0x59297d,_0x24f891={'aZDYz':'POST'},_0x2eda30=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x24f891[_0x35cb51(0x1a4)],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0xeb6696})});if(!_0x2eda30['ok']){const _0x31f9e4=await _0x2eda30['text']();throw new Error(_0x35cb51(0x1c3)+_0x2eda30[_0x35cb51(0x1e9)]+'\x20'+_0x31f9e4);}return _0x2eda30['json']();}export async function pollForTokens(_0x164f38,_0x12c7a4,_0x59a058,_0x1f4100){const _0x3b2ac0=_0x59297d,_0x56656e={'CoAzS':function(_0x49e885,_0x24ed6a){return _0x49e885*_0x24ed6a;},'mwySp':function(_0x484b23,_0x47f69d){return _0x484b23*_0x47f69d;},'ehiIQ':function(_0xd89cf2,_0x435a4d){return _0xd89cf2<_0x435a4d;},'vCDNz':function(_0x3ea6a2,_0x592bd7){return _0x3ea6a2===_0x592bd7;},'buxPp':'authorization_pending','EDGnQ':_0x3b2ac0(0x1da),'CeQQo':'Authentication\x20failed','oLxOI':'Device\x20authorization\x20timed\x20out'},_0x2f1c86=Date['now']()+_0x56656e[_0x3b2ac0(0x1ac)](_0x1f4100,0x3e8);let _0x3184dd=_0x56656e['mwySp'](_0x59a058,0x3e8);while(_0x56656e[_0x3b2ac0(0x1af)](Date['now'](),_0x2f1c86)){await sleep(_0x3184dd);const _0x37796c=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x3b2ac0(0x1cc)},'body':new URLSearchParams({'client_id':_0x164f38,'device_code':_0x12c7a4,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x37796c['ok'])return _0x37796c[_0x3b2ac0(0x1e7)]();const _0xc0209e=await _0x37796c['json']();if(_0x56656e['vCDNz'](_0xc0209e[_0x3b2ac0(0x1c0)],_0x56656e[_0x3b2ac0(0x1de)]))continue;if(_0x56656e[_0x3b2ac0(0x1ee)](_0xc0209e[_0x3b2ac0(0x1c0)],_0x56656e[_0x3b2ac0(0x1d0)])){_0x3184dd+=0x3e8;continue;}throw new Error(_0xc0209e[_0x3b2ac0(0x1f3)]||_0xc0209e[_0x3b2ac0(0x1c0)]||_0x56656e['CeQQo']);}throw new Error(_0x56656e['oLxOI']);}async function fetchUserProfile(_0x2a2a65){const _0xc6cfe1=_0x59297d,_0x463330={'UVlvZ':function(_0x1482e5){return _0x1482e5();},'ydoQM':function(_0x1e2a4b,_0x5f1ae2,_0x51e7f0){return _0x1e2a4b(_0x5f1ae2,_0x51e7f0);},'ewJwU':'GET'},_0x450bf5=_0x463330['UVlvZ'](getApiBaseUrl);try{const _0x7e39cc=await _0x463330['ydoQM'](fetch,_0x450bf5+_0xc6cfe1(0x1c1),{'method':_0x463330[_0xc6cfe1(0x1ab)],'headers':{'workos-token':_0x2a2a65}});if(_0x7e39cc['ok'])return _0x7e39cc['json']();}catch{}return null;}function buildKeyName(_0x335661,_0x2473f8){const _0x10b2d8=_0x59297d,_0x5c393d={'zywLH':function(_0x475358,_0xeebe46){return _0x475358===_0xeebe46;},'AbvZW':function(_0x2fdfb8,_0x2d5d86){return _0x2fdfb8+_0x2d5d86;}},_0xad81bd=_0x2473f8[_0x10b2d8(0x1a0)](_0x5a2af0=>_0x5a2af0['name']===_0x335661||_0x5a2af0[_0x10b2d8(0x1c4)]['startsWith'](_0x335661+'\x20('));if(_0x5c393d[_0x10b2d8(0x1b3)](_0xad81bd['length'],0x0))return _0x335661;return _0x335661+'\x20('+_0x5c393d['AbvZW'](_0xad81bd['length'],0x1)+')';}export async function provisionApiKey(_0x4c1e47){const _0x410e66=_0x59297d,_0x23e493={'dBZHe':function(_0x4f5597){return _0x4f5597();},'pzoUf':function(_0x5b2dbe,_0x2b23ae){return _0x5b2dbe(_0x2b23ae);},'qwLjB':'CLI\x20Key','wtHSU':function(_0x1e7293,_0x52750e,_0x1ffb22){return _0x1e7293(_0x52750e,_0x1ffb22);},'KOSzR':'GET','ijems':'POST','BzoMt':_0x410e66(0x1c6)},_0x7843bd=_0x23e493[_0x410e66(0x1b5)](getApiBaseUrl),_0x1b2dc4={'Content-Type':'application/json','workos-token':_0x4c1e47},_0x561e84=await _0x23e493['pzoUf'](fetchUserProfile,_0x4c1e47),_0x37db71=_0x561e84?.[_0x410e66(0x1fb)]||_0x561e84?.['email']?.['split']('@')[0x0],_0x1127fc=_0x37db71?_0x37db71+'\x27s\x20CLI\x20Key':_0x23e493[_0x410e66(0x1b9)];let _0x598281=[];try{const _0xc7f727=await _0x23e493['wtHSU'](fetch,_0x7843bd+_0x410e66(0x1be),{'method':_0x23e493['KOSzR'],'headers':_0x1b2dc4});if(_0xc7f727['ok']){const _0x21c940=await _0xc7f727['json']();_0x598281=_0x21c940['apiKeys'];}}catch{}const _0xad39cf=buildKeyName(_0x1127fc,_0x598281),_0x57cb5b=await _0x23e493['wtHSU'](fetch,_0x7843bd+_0x410e66(0x1be),{'method':_0x23e493[_0x410e66(0x1d9)],'headers':_0x1b2dc4,'body':JSON[_0x410e66(0x1f0)]({'name':_0xad39cf,'scope':_0x23e493['BzoMt']})});if(!_0x57cb5b['ok']){const _0x57550a=await _0x57cb5b['text']();throw new Error(_0x410e66(0x1df)+_0x57cb5b[_0x410e66(0x1e9)]+'\x20'+_0x57550a);}const _0xc85cbc=await _0x57cb5b[_0x410e66(0x1e7)]();return _0xc85cbc['apiKey'][_0x410e66(0x1ea)];}export function openBrowser(_0x49981e){const _0x44e5ef=_0x59297d,_0x13e5d3={'gLfDr':function(_0x3fb21d,_0x450d54){return _0x3fb21d===_0x450d54;},'xyUzO':_0x44e5ef(0x1e5),'kBIPM':function(_0x380fc7,_0x26aa15,_0x5b3490,_0xeb6fcc){return _0x380fc7(_0x26aa15,_0x5b3490,_0xeb6fcc);},'wgZvt':_0x44e5ef(0x1f8),'xaDQa':_0x44e5ef(0x1ad),'WOyIk':_0x44e5ef(0x1a3),'uxYrh':'ignore'};try{if(_0x13e5d3[_0x44e5ef(0x1c7)](process[_0x44e5ef(0x1f9)],_0x13e5d3[_0x44e5ef(0x1f1)])){const _0x3103c3=_0x13e5d3[_0x44e5ef(0x1a8)](spawn,_0x44e5ef(0x1f5),['/c',_0x13e5d3[_0x44e5ef(0x1f2)],'',_0x49981e],{'detached':!![],'stdio':_0x44e5ef(0x1dc),'windowsHide':!![]});_0x3103c3[_0x44e5ef(0x1a2)]();return;}const _0x41e1f5=process['platform']===_0x13e5d3['xaDQa']?_0x44e5ef(0x1c8):_0x13e5d3[_0x44e5ef(0x1ca)],_0x513fee=_0x13e5d3['kBIPM'](spawn,_0x41e1f5,[_0x49981e],{'detached':!![],'stdio':_0x13e5d3['uxYrh']});_0x513fee['unref']();}catch{}}function decodeJwtPayload(_0x34247a){const _0x27be17=_0x59297d,_0x5a3168=_0x34247a[_0x27be17(0x1d3)]('.');if(_0x5a3168[_0x27be17(0x1ec)]!==0x3)throw new Error(_0x27be17(0x1bc));const _0x3189bc=Buffer['from'](_0x5a3168[0x1],_0x27be17(0x1e4))[_0x27be17(0x1cf)](_0x27be17(0x1ba));return JSON['parse'](_0x3189bc);}async function selfServeSignup(_0x14b269){const _0x4a5d42=_0x59297d,_0x426a31=getApiBaseUrl(),_0x5560ac=await fetch(_0x426a31+_0x4a5d42(0x1d1),{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x14b269}});if(!_0x5560ac['ok']){const _0x3de893=await _0x5560ac['text']();throw new Error(_0x4a5d42(0x1e8)+_0x5560ac[_0x4a5d42(0x1e9)]+'\x20'+_0x3de893);}return _0x5560ac[_0x4a5d42(0x1e7)]();}async function fetchMyMemberships(_0x5ff96e){const _0x245ca7=_0x59297d,_0x4797c2={'XEIKI':function(_0x43f60b,_0x338920,_0x47939c){return _0x43f60b(_0x338920,_0x47939c);}},_0x489b61=getApiBaseUrl(),_0x4067d8=await _0x4797c2[_0x245ca7(0x1bb)](fetch,_0x489b61+_0x245ca7(0x1f4),{'method':'GET','headers':{'workos-token':_0x5ff96e}});if(!_0x4067d8['ok']){const _0x45402c=await _0x4067d8[_0x245ca7(0x1b4)]();throw new Error(_0x245ca7(0x1b7)+_0x4067d8[_0x245ca7(0x1e9)]+'\x20'+_0x45402c);}const _0x7a7de7=await _0x4067d8['json']();return _0x7a7de7['memberships'];}async function refreshTokenWithOrg(_0x4a6bf6,_0x58c22d,_0x1cba98){const _0x1a150d=_0x59297d,_0x28767c={'RXEkq':function(_0x3c0dd6,_0x39f716,_0x8198e5){return _0x3c0dd6(_0x39f716,_0x8198e5);},'qlWCg':_0x1a150d(0x1b8),'lpymB':'application/x-www-form-urlencoded','KNHOe':_0x1a150d(0x1b0)},_0x14c2f6=await _0x28767c[_0x1a150d(0x1c5)](fetch,WORKOS_TOKEN_URL,{'method':_0x28767c[_0x1a150d(0x1ae)],'headers':{'Content-Type':_0x28767c[_0x1a150d(0x1ce)]},'body':new URLSearchParams({'client_id':_0x4a6bf6,'grant_type':_0x28767c[_0x1a150d(0x1e3)],'refresh_token':_0x58c22d,'organization_id':_0x1cba98})});if(!_0x14c2f6['ok']){const _0x4be89d=await _0x14c2f6[_0x1a150d(0x1b4)]();throw new Error(_0x1a150d(0x1e6)+_0x14c2f6[_0x1a150d(0x1e9)]+'\x20'+_0x4be89d);}return _0x14c2f6[_0x1a150d(0x1e7)]();}async function provisionCliToken(_0x3a14a4){const _0x56a5aa=_0x59297d,_0x4dbb0f=getApiBaseUrl(),_0x441967=await fetch(_0x4dbb0f+_0x56a5aa(0x1cd),{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x3a14a4}});if(!_0x441967['ok']){const _0x10f3be=await _0x441967['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x441967[_0x56a5aa(0x1e9)]+'\x20'+_0x10f3be);}return _0x441967['json']();}export async function runDeviceAuthFlow(){const _0x24fdb9=_0x59297d,_0x547ec0={'gxYzF':function(_0x4bad7e,_0x1dc393){return _0x4bad7e(_0x1dc393);},'YFcML':'\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','GfEdL':function(_0x15e892,_0xfa9781){return _0x15e892(_0xfa9781);},'yjsSb':function(_0x50acff,_0x465446){return _0x50acff(_0x465446);},'CAfYx':function(_0x1f6c75,_0x5122cd){return _0x1f6c75===_0x5122cd;},'jZWsy':'Setting\x20up\x20your\x20organization...','stDRN':function(_0x2cf6e8,_0x18d738){return _0x2cf6e8(_0x18d738);},'rYQvu':function(_0x369715,_0x52736b){return _0x369715===_0x52736b;},'oCCrk':function(_0x6713b6,_0x4b3c09){return _0x6713b6+_0x4b3c09;},'glwJl':_0x24fdb9(0x1b6),'zfzZC':_0x24fdb9(0x1ef),'LXmCw':'Select\x20an\x20organization:','QmGyQ':_0x24fdb9(0x1d7)},_0x38fb10=getCurrentEnvironment(),_0x3bc646=ENVIRONMENT_CONFIGS[_0x38fb10][_0x24fdb9(0x1a9)],_0x4f4a99=await _0x547ec0[_0x24fdb9(0x1c2)](requestDeviceCode,_0x3bc646);console[_0x24fdb9(0x1f6)](_0x547ec0['YFcML']),console['log'](_0x24fdb9(0x1a7)),openBrowser(_0x4f4a99[_0x24fdb9(0x1d4)]),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x4f4a99[_0x24fdb9(0x1d4)]),console[_0x24fdb9(0x1f6)](_0x24fdb9(0x1e2)+_0x4f4a99[_0x24fdb9(0x1cb)]+'\x0a'),process[_0x24fdb9(0x1a1)][_0x24fdb9(0x1bf)]('Waiting\x20for\x20authentication...');let _0x541838=await pollForTokens(_0x3bc646,_0x4f4a99[_0x24fdb9(0x1d6)],_0x4f4a99['interval'],_0x4f4a99['expires_in']);console[_0x24fdb9(0x1f6)]('\x20✓');const _0x199c37=_0x547ec0['GfEdL'](decodeJwtPayload,_0x541838['access_token']);if(!_0x199c37['org_id']){const _0x142a1d=await _0x547ec0['yjsSb'](fetchMyMemberships,_0x541838['access_token']);let _0x21a269;if(_0x547ec0[_0x24fdb9(0x1a6)](_0x142a1d[_0x24fdb9(0x1ec)],0x0)){process[_0x24fdb9(0x1a1)]['write'](_0x547ec0['jZWsy']);const _0x45edac=await _0x547ec0['stDRN'](selfServeSignup,_0x541838['access_token']);_0x21a269=_0x45edac['organizationId'],console[_0x24fdb9(0x1f6)]('\x20✓');}else{if(_0x547ec0[_0x24fdb9(0x19f)](_0x142a1d[_0x24fdb9(0x1ec)],0x1))_0x21a269=_0x142a1d[0x0]['organizationId'],console['log']('Using\x20organization:\x20'+_0x142a1d[0x0][_0x24fdb9(0x1c4)]);else{const _0x62ad19=process['stdin']['isTTY']&&process[_0x24fdb9(0x1a1)][_0x24fdb9(0x1b2)];if(!_0x62ad19)throw new Error(_0x547ec0[_0x24fdb9(0x1eb)](_0x24fdb9(0x19e),_0x547ec0['glwJl']));const {selected:_0x89c613}=await _0x270cae['prompt']([{'type':_0x547ec0['zfzZC'],'name':_0x24fdb9(0x1bd),'message':_0x547ec0[_0x24fdb9(0x1e1)],'choices':_0x142a1d[_0x24fdb9(0x1fa)](_0x4ee0fa=>({'name':_0x4ee0fa['name'],'value':_0x4ee0fa['organizationId']}))}]);_0x21a269=_0x89c613;}}_0x541838=await refreshTokenWithOrg(_0x3bc646,_0x541838['refresh_token'],_0x21a269);}process['stdout'][_0x24fdb9(0x1bf)](_0x547ec0['QmGyQ']);const _0x28fc7f=await _0x547ec0[_0x24fdb9(0x1c2)](provisionCliToken,_0x541838['access_token']);return console['log']('\x20✓'),await storeToken(_0x28fc7f[_0x24fdb9(0x1ea)]),_0x541838['refresh_token']&&await storeRefreshToken(_0x541838['refresh_token']),_0x28fc7f['token'];}function sleep(_0x2e8a44){return new Promise(_0x11cb5f=>setTimeout(_0x11cb5f,_0x2e8a44));}
@@ -1 +1 @@
1
- function _0xa790(_0x346e54,_0x709af){_0x346e54=_0x346e54-0x176;const _0x355622=_0x3556();let _0xa7907d=_0x355622[_0x346e54];return _0xa7907d;}const _0x4c178a=_0xa790;function _0x3556(){const _0x234b97=['mOmEu','EqvMQ','client_01J9CBYM2DKWV9HM17D95Z540K','xxruY','find','error','RANGER_CLI_ENV','2636860WdYUJA','https://api.staging.ranger.net','nova-act-cli','toLowerCase','BmTFg','114WAOqrt','CCMJp','staging','114SlISLZ','Invalid\x20RANGER_TRANSPORT=\x22','277434QNesde','client_01J9CBYM7M5ZETCF7G6614DXR2','4475XZdyvx','https://ai-proxy-301751771437.us-central1.run.app','16426ctbqIe','211099kpSPxB','mcp','rangerwright-cli','FpJVw','RANGER_MCP_AUTH_URL','vWxly','prod','104VCbsGy','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.','330850YybTmW','RANGER_TRANSPORT','https://ai-proxy-716115358910.us-central1.run.app','ZkuJN','RANGER_USE_NOVA_ACT','10908425lcVUDa','true','auto','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','env','2936Fwjiuf','local','off'];_0x3556=function(){return _0x234b97;};return _0x3556();}(function(_0x57d3ba,_0x4d365b){const _0x3f280f=_0xa790,_0x4939a5=_0x57d3ba();while(!![]){try{const _0x5595f6=-parseInt(_0x3f280f(0x188))/0x1+parseInt(_0x3f280f(0x17e))/0x2*(parseInt(_0x3f280f(0x178))/0x3)+parseInt(_0x3f280f(0x192))/0x4*(parseInt(_0x3f280f(0x17c))/0x5)+parseInt(_0x3f280f(0x1a1))/0x6*(-parseInt(_0x3f280f(0x17f))/0x7)+parseInt(_0x3f280f(0x186))/0x8*(-parseInt(_0x3f280f(0x17a))/0x9)+-parseInt(_0x3f280f(0x19c))/0xa+parseInt(_0x3f280f(0x18d))/0xb;if(_0x5595f6===_0x4d365b)break;else _0x4939a5['push'](_0x4939a5['shift']());}catch(_0x2452f8){_0x4939a5['push'](_0x4939a5['shift']());}}}(_0x3556,0x5fcfa));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x4c178a(0x17b),'aiProxyUrl':_0x4c178a(0x18a),'mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':_0x4c178a(0x19d),'workosClientId':_0x4c178a(0x197),'aiProxyUrl':_0x4c178a(0x17d),'mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':_0x4c178a(0x197),'aiProxyUrl':'http://localhost:8090','mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT=_0x4c178a(0x185);export function isValidEnvironment(_0x42891c){const _0x2454bd=_0x4c178a,_0x31dda3={'ZkuJN':'prod','vWxly':_0x2454bd(0x177),'hWsAU':function(_0x12a331,_0x5e0d42){return _0x12a331===_0x5e0d42;}};return _0x42891c===_0x31dda3[_0x2454bd(0x18b)]||_0x42891c===_0x31dda3[_0x2454bd(0x184)]||_0x31dda3['hWsAU'](_0x42891c,_0x2454bd(0x193));}export function getCurrentEnvironment(){const _0x3b25c6=_0x4c178a,_0x12f952={'vBXGl':function(_0x4586d3,_0x750025){return _0x4586d3(_0x750025);}},_0x254f4f=process[_0x3b25c6(0x191)][_0x3b25c6(0x19b)];if(_0x254f4f&&_0x12f952['vBXGl'](isValidEnvironment,_0x254f4f))return _0x254f4f;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['apiBaseUrl'];}export function getAiProxyUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x25c946=_0x4c178a,_0x3f61a5={'BmTFg':function(_0x35054d){return _0x35054d();}};return process[_0x25c946(0x191)][_0x25c946(0x183)]??ENVIRONMENT_CONFIGS[_0x3f61a5[_0x25c946(0x1a0)](getCurrentEnvironment)]['mcpAuthUrl'];}export function isByokEnabled(){const _0x5e0985=_0x4c178a,_0x5d54cb={'bfmDm':_0x5e0985(0x18e)};return process['env']['RANGER_BYOK']===_0x5d54cb['bfmDm'];}function isVerificationTransport(_0x5dea5e){const _0x1120a9=_0x4c178a,_0xd3bc7={'QTKaA':function(_0xd310d,_0x16363a){return _0xd310d===_0x16363a;},'FpJVw':_0x1120a9(0x180),'TgpuJ':function(_0x1aa89f,_0x54f89f){return _0x1aa89f===_0x54f89f;},'CCMJp':'playwright-cli','EqvMQ':_0x1120a9(0x181)};return _0xd3bc7['QTKaA'](_0x5dea5e,_0xd3bc7[_0x1120a9(0x182)])||_0xd3bc7['TgpuJ'](_0x5dea5e,_0xd3bc7[_0x1120a9(0x176)])||_0x5dea5e===_0x1120a9(0x19e)||_0x5dea5e===_0xd3bc7[_0x1120a9(0x196)];}const LEGACY_TRANSPORT_ENV_VARS=[_0x4c178a(0x18c),'RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x2842f0=_0x4c178a,_0x1d2fad={'CAXzS':function(_0x142fa5,_0x7df511){return _0x142fa5(_0x7df511);}},_0xe0c68a=process['env'][_0x2842f0(0x189)]?.['trim']();if(_0xe0c68a){if(_0x1d2fad['CAXzS'](isVerificationTransport,_0xe0c68a))return _0xe0c68a;throw new Error(_0x2842f0(0x179)+_0xe0c68a+_0x2842f0(0x190));}const _0x145823=LEGACY_TRANSPORT_ENV_VARS[_0x2842f0(0x199)](_0xa69b0=>process['env'][_0xa69b0]);if(_0x145823)throw new Error(_0x145823+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return'mcp';}export function resolveHookMode(_0x14f596=process[_0x4c178a(0x191)]){const _0x49e19e=_0x4c178a,_0x348d20={'xxruY':_0x49e19e(0x18f),'RXggP':_0x49e19e(0x194),'mOmEu':function(_0x5292a7,_0x39cd83){return _0x5292a7===_0x39cd83;},'wCfcG':function(_0x1afbe5,_0x4320df){return _0x1afbe5===_0x4320df;}},_0x5076db=_0x14f596['RANGER_HOOKS']?.['trim']()[_0x49e19e(0x19f)]();if(!_0x5076db)return _0x348d20[_0x49e19e(0x198)];if(_0x5076db===_0x348d20['RXggP']||_0x348d20[_0x49e19e(0x195)](_0x5076db,'on')||_0x348d20['wCfcG'](_0x5076db,_0x348d20['xxruY']))return _0x5076db;return console[_0x49e19e(0x19a)]('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x14f596['RANGER_HOOKS']+'\x22.\x20'+_0x49e19e(0x187)),_0x348d20['xxruY'];}
1
+ const _0x5f071b=_0x3815;(function(_0x1cad02,_0x5ca1b2){const _0x20401e=_0x3815,_0x32759d=_0x1cad02();while(!![]){try{const _0x47d024=-parseInt(_0x20401e(0x75))/0x1*(parseInt(_0x20401e(0x83))/0x2)+-parseInt(_0x20401e(0x82))/0x3+parseInt(_0x20401e(0x8e))/0x4*(-parseInt(_0x20401e(0x89))/0x5)+parseInt(_0x20401e(0x90))/0x6+parseInt(_0x20401e(0x7d))/0x7+parseInt(_0x20401e(0x73))/0x8+parseInt(_0x20401e(0x7b))/0x9*(parseInt(_0x20401e(0x76))/0xa);if(_0x47d024===_0x5ca1b2)break;else _0x32759d['push'](_0x32759d['shift']());}catch(_0x52fb98){_0x32759d['push'](_0x32759d['shift']());}}}(_0x39e8,0xa0c08));export const DEFAULT_VERIFICATION_TRANSPORT=_0x5f071b(0x88);export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x5f071b(0x95),'workosClientId':_0x5f071b(0x71),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0x5f071b(0x92)},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x5f071b(0x7a),'mcpAuthUrl':_0x5f071b(0x91)},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':_0x5f071b(0x87),'aiProxyUrl':_0x5f071b(0x79),'mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x535d96){const _0x3d1087=_0x5f071b,_0x1a4dc9={'nUvSH':_0x3d1087(0x8b),'ifkNd':_0x3d1087(0x93)};return _0x535d96===_0x1a4dc9[_0x3d1087(0x70)]||_0x535d96==='staging'||_0x535d96===_0x1a4dc9['ifkNd'];}function _0x39e8(){const _0x28e73d=['true','off','RANGER_HOOKS','nUvSH','client_01J9CBYM7M5ZETCF7G6614DXR2','env','2322008unULRh','auto','810659FpDBur','40yHmvpb','toLowerCase','\x22.\x20','http://localhost:8090','https://ai-proxy-301751771437.us-central1.run.app','3935025QmxJqK','mcp','178171LnCdYG','RANGER_DISABLE_MCP','trim','RANGER_BYOK','ccvOF','1992966jNQxRw','2ZCbrzw','FFQEp','Invalid\x20RANGER_TRANSPORT=\x22','kEqea','client_01J9CBYM2DKWV9HM17D95Z540K','rangerwright-cli','1297765VkBEar','RANGER_USE_NOVA_ACT','prod','playwright-cli','mOAdN','12JRgHDp','RANGER_TRANSPORT','5084856gndhaI','https://mcp-auth.staging.ranger.net/mcp','https://mcp-auth.ranger.net/mcp','local','cmBDE','https://api.ranger.net','RANGER_CLI_ENV','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.'];_0x39e8=function(){return _0x28e73d;};return _0x39e8();}export function getCurrentEnvironment(){const _0x13a9ef=_0x5f071b,_0x2eb2c2=process[_0x13a9ef(0x72)][_0x13a9ef(0x96)];if(_0x2eb2c2&&isValidEnvironment(_0x2eb2c2))return _0x2eb2c2;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['apiBaseUrl'];}export function getAiProxyUrl(){const _0xa8b469=_0x5f071b,_0x3e2004={'mOAdN':function(_0x41e3f3){return _0x41e3f3();}};return ENVIRONMENT_CONFIGS[_0x3e2004[_0xa8b469(0x8d)](getCurrentEnvironment)]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x588aea=_0x5f071b,_0x30b1b6={'wXnJb':function(_0x4b50ad){return _0x4b50ad();}};return process[_0x588aea(0x72)]['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[_0x30b1b6['wXnJb'](getCurrentEnvironment)]['mcpAuthUrl'];}export function isByokEnabled(){const _0x2255a7=_0x5f071b,_0x57fe36={'pLSus':function(_0x44b04b,_0x100a2d){return _0x44b04b===_0x100a2d;}};return _0x57fe36['pLSus'](process['env'][_0x2255a7(0x80)],_0x2255a7(0x98));}function _0x3815(_0x357b6f,_0x36eb82){_0x357b6f=_0x357b6f-0x70;const _0x39e83c=_0x39e8();let _0x381505=_0x39e83c[_0x357b6f];return _0x381505;}function isVerificationTransport(_0x3c1a7b){const _0x3ea5bb=_0x5f071b,_0x93c4ef={'XymfK':function(_0x1e0ff2,_0x1f55cd){return _0x1e0ff2===_0x1f55cd;},'uqhEB':function(_0x5ea875,_0x51ba0f){return _0x5ea875===_0x51ba0f;},'ccvOF':'nova-act-cli','kEqea':function(_0x1163cf,_0x23750a){return _0x1163cf===_0x23750a;},'tqYup':_0x3ea5bb(0x88)};return _0x93c4ef['XymfK'](_0x3c1a7b,_0x3ea5bb(0x7c))||_0x93c4ef['uqhEB'](_0x3c1a7b,_0x3ea5bb(0x8c))||_0x3c1a7b===_0x93c4ef[_0x3ea5bb(0x81)]||_0x93c4ef[_0x3ea5bb(0x86)](_0x3c1a7b,_0x93c4ef['tqYup']);}const LEGACY_TRANSPORT_ENV_VARS=[_0x5f071b(0x8a),_0x5f071b(0x7e)];export function getVerificationTransport(){const _0x3e5399=_0x5f071b,_0xae3489=process[_0x3e5399(0x72)][_0x3e5399(0x8f)]?.[_0x3e5399(0x7f)]();if(_0xae3489){if(isVerificationTransport(_0xae3489))return _0xae3489;throw new Error(_0x3e5399(0x85)+_0xae3489+'\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.');}const _0x366662=LEGACY_TRANSPORT_ENV_VARS['find'](_0x549eaa=>process[_0x3e5399(0x72)][_0x549eaa]);if(_0x366662)throw new Error(_0x366662+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return DEFAULT_VERIFICATION_TRANSPORT;}export function resolveHookMode(_0x31b08b=process['env']){const _0x565549=_0x5f071b,_0xff7fa={'cmBDE':_0x565549(0x74),'FFQEp':function(_0xbb5d1a,_0x438908){return _0xbb5d1a===_0x438908;},'gbCOh':_0x565549(0x99)},_0x452fd9=_0x31b08b[_0x565549(0x9a)]?.['trim']()[_0x565549(0x77)]();if(!_0x452fd9)return _0xff7fa[_0x565549(0x94)];if(_0xff7fa[_0x565549(0x84)](_0x452fd9,_0xff7fa['gbCOh'])||_0xff7fa['FFQEp'](_0x452fd9,'on')||_0xff7fa[_0x565549(0x84)](_0x452fd9,_0xff7fa['cmBDE']))return _0x452fd9;return console['error']('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x31b08b['RANGER_HOOKS']+_0x565549(0x78)+_0x565549(0x97)),_0xff7fa['cmBDE'];}
@@ -1 +1 @@
1
- (function(_0x1b7ecf,_0x13fae1){const _0x295b9c=_0x453c,_0x38811e=_0x1b7ecf();while(!![]){try{const _0xa40586=parseInt(_0x295b9c(0x108))/0x1*(parseInt(_0x295b9c(0x149))/0x2)+parseInt(_0x295b9c(0x116))/0x3+-parseInt(_0x295b9c(0x13c))/0x4*(parseInt(_0x295b9c(0x11b))/0x5)+-parseInt(_0x295b9c(0x14b))/0x6+parseInt(_0x295b9c(0x10e))/0x7*(parseInt(_0x295b9c(0x137))/0x8)+-parseInt(_0x295b9c(0x13a))/0x9*(parseInt(_0x295b9c(0x115))/0xa)+parseInt(_0x295b9c(0x125))/0xb;if(_0xa40586===_0x13fae1)break;else _0x38811e['push'](_0x38811e['shift']());}catch(_0x3ed1fa){_0x38811e['push'](_0x38811e['shift']());}}}(_0x3d20,0xb93f8));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x19d5c6){const _0x5ab06f=_0x453c,_0x281ac4={'pXGFj':function(_0x3f8764){return _0x3f8764();},'FrgJj':function(_0x3c2d9a,_0x15c93e){return _0x3c2d9a===_0x15c93e;}},_0x1da807=await _0x281ac4['pXGFj'](getToken);if(!_0x1da807)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xf190ea=getApiBaseUrl(),_0x1d506c=await fetch(_0xf190ea+'/api/v1/mcp/features',{'method':_0x5ab06f(0x120),'headers':{'Authorization':'Bearer\x20'+_0x1da807,'Content-Type':'application/json'},'body':JSON['stringify'](_0x19d5c6)});if(!_0x1d506c['ok']){if(_0x281ac4['FrgJj'](_0x1d506c['status'],0x192)){const _0x1798e0=await _0x1d506c[_0x5ab06f(0x146)](),_0x15bcd8=_0x1798e0[_0x5ab06f(0x145)]||_0x5ab06f(0x106);throw new Error((_0x1798e0['message']||_0x5ab06f(0x10a))+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x15bcd8);}const _0x370bba=await _0x1d506c[_0x5ab06f(0x148)]();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0x370bba);}return _0x1d506c['json']();}export async function listFeatures(_0x522080){const _0x4a8e50=_0x453c,_0x48730e={'NJaRx':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ZbyuQ':'gitRepoUrl','vkazZ':'gitBranch','Ijqcj':'offset','CDttK':_0x4a8e50(0x127),'TnIDK':'GET'},_0x34ca7a=await getToken();if(!_0x34ca7a)throw new Error(_0x48730e['NJaRx']);const _0x14cfaf=getApiBaseUrl(),_0x28f8b3=new URLSearchParams();if(_0x522080?.[_0x4a8e50(0x119)])_0x28f8b3['set'](_0x48730e[_0x4a8e50(0x13e)],_0x522080[_0x4a8e50(0x119)]);if(_0x522080?.[_0x4a8e50(0x12a)])_0x28f8b3['set'](_0x48730e['vkazZ'],_0x522080['gitBranch']);if(_0x522080?.[_0x4a8e50(0x11a)])_0x28f8b3[_0x4a8e50(0x10b)]('limit',_0x522080[_0x4a8e50(0x11a)]['toString']());if(_0x522080?.['offset'])_0x28f8b3['set'](_0x48730e['Ijqcj'],_0x522080[_0x4a8e50(0x118)]['toString']());if(_0x522080?.['includeDeleted'])_0x28f8b3['set']('includeDeleted',_0x48730e['CDttK']);const _0x19c89d=_0x14cfaf+'/api/v1/mcp/features'+(_0x28f8b3[_0x4a8e50(0x10c)]()?'?'+_0x28f8b3['toString']():''),_0x15ef86=await fetch(_0x19c89d,{'method':_0x48730e[_0x4a8e50(0x12c)],'headers':{'Authorization':'Bearer\x20'+_0x34ca7a}});if(!_0x15ef86['ok']){const _0x210e01=await _0x15ef86['text']();throw new Error(_0x4a8e50(0x142)+_0x210e01);}return _0x15ef86[_0x4a8e50(0x146)]();}export async function getFeature(_0x27a558){const _0x101074=_0x453c,_0x37130c={'MFSBj':function(_0x326c51){return _0x326c51();},'rNefc':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','VcRZA':function(_0x280ebe,_0x4180ab,_0x18ce78){return _0x280ebe(_0x4180ab,_0x18ce78);},'dmAgE':_0x101074(0x110)},_0x11c7af=await _0x37130c['MFSBj'](getToken);if(!_0x11c7af)throw new Error(_0x37130c['rNefc']);const _0x1e78c4=_0x37130c['MFSBj'](getApiBaseUrl),_0x250a8f=await _0x37130c[_0x101074(0x130)](fetch,_0x1e78c4+'/api/v1/mcp/features/'+_0x27a558,{'method':_0x37130c['dmAgE'],'headers':{'Authorization':'Bearer\x20'+_0x11c7af}});if(!_0x250a8f['ok']){const _0x3bbd34=await _0x250a8f['text']();throw new Error(_0x101074(0x133)+_0x3bbd34);}return _0x250a8f['json']();}export async function updateFeature(_0x153da1,_0x2ac258){const _0x54ea56=_0x453c,_0x22a134={'VtgIH':function(_0x74eba6){return _0x74eba6();},'ulHwt':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','kYPMK':function(_0x45744b,_0x26c597,_0x3f340b){return _0x45744b(_0x26c597,_0x3f340b);},'qdGPh':_0x54ea56(0x147)},_0x5e83ee=await _0x22a134['VtgIH'](getToken);if(!_0x5e83ee)throw new Error(_0x22a134['ulHwt']);const _0x24e575=getApiBaseUrl(),_0x556bbe=await _0x22a134['kYPMK'](fetch,_0x24e575+_0x54ea56(0x129)+_0x153da1,{'method':_0x22a134['qdGPh'],'headers':{'Authorization':_0x54ea56(0x135)+_0x5e83ee,'Content-Type':'application/json'},'body':JSON['stringify'](_0x2ac258)});if(!_0x556bbe['ok']){const _0x3c8331=await _0x556bbe[_0x54ea56(0x148)]();throw new Error(_0x54ea56(0x140)+_0x3c8331);}return _0x556bbe['json']();}export async function createChecklistItem(_0x1ece83,_0x1a060b,_0x8da945){const _0xed90fd=_0x453c,_0x1b1834={'SLWmM':function(_0x284b21){return _0x284b21();},'rdQqG':function(_0x1c9c50){return _0x1c9c50();},'iabQE':_0xed90fd(0x120),'vSqGw':_0xed90fd(0x14c)},_0x5d3c43=await _0x1b1834[_0xed90fd(0x105)](getToken);if(!_0x5d3c43)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3ffa45=_0x1b1834[_0xed90fd(0x11e)](getApiBaseUrl),_0x424a2f=await fetch(_0x3ffa45+_0xed90fd(0x129)+_0x1ece83+_0xed90fd(0x109),{'method':_0x1b1834['iabQE'],'headers':{'Authorization':'Bearer\x20'+_0x5d3c43,'Content-Type':_0x1b1834[_0xed90fd(0x11c)]},'body':JSON['stringify']({'description':_0x1a060b,'position':_0x8da945})});if(!_0x424a2f['ok']){const _0x30ba0=await _0x424a2f[_0xed90fd(0x148)]();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x30ba0);}return _0x424a2f[_0xed90fd(0x146)]();}export async function updateChecklistItem(_0x3d36e2,_0x35284c,_0x2aa257){const _0xef9b1e=_0x453c,_0x865f89={'DoayX':function(_0x399200){return _0x399200();},'dbtrF':function(_0x9dc3f4,_0x1fad9c,_0x43e1db){return _0x9dc3f4(_0x1fad9c,_0x43e1db);},'cYSZI':'application/json'};return _0x865f89['dbtrF'](withRetry,async()=>{const _0x39cc48=_0x453c,_0x4fa611=await getToken();if(!_0x4fa611)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x314193=_0x865f89['DoayX'](getApiBaseUrl),_0x3c369a=await _0x865f89['dbtrF'](fetch,_0x314193+'/api/v1/mcp/features/'+_0x3d36e2+_0x39cc48(0x124)+_0x35284c,{'method':'PATCH','headers':{'Authorization':_0x39cc48(0x135)+_0x4fa611,'Content-Type':_0x865f89[_0x39cc48(0x134)]},'body':JSON['stringify'](_0x2aa257)});if(!_0x3c369a['ok']){const _0x3d84fd=await _0x3c369a['text']();throw new Error(_0x39cc48(0x13d)+_0x3d84fd);}return _0x3c369a['json']();},{'label':_0xef9b1e(0x113)});}export async function getFeatureReport(_0x368109){const _0x90432e=_0x453c,_0x431bde=await getToken();if(!_0x431bde)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2240a3=getApiBaseUrl(),_0xcc615=await fetch(_0x2240a3+'/api/v1/mcp/features/'+_0x368109+_0x90432e(0x122),{'method':'GET','headers':{'Authorization':_0x90432e(0x135)+_0x431bde}});if(!_0xcc615['ok']){const _0x4b7309=await _0xcc615[_0x90432e(0x148)]();throw new Error(_0x90432e(0x112)+_0x4b7309);}return _0xcc615['json']();}export async function getFeatureReportMarkdown(_0x1ee020,_0x147a86){const _0x15f229=_0x453c,_0x15389a={'ThCfh':function(_0x343404){return _0x343404();},'AWNxd':function(_0x2ad5a3){return _0x2ad5a3();},'OKlmQ':function(_0x370af9,_0x27faf4){return _0x370af9(_0x27faf4);},'HzmjF':_0x15f229(0x11d),'RehIi':function(_0x414a73,_0x373239){return _0x414a73&&_0x373239;},'kbYgA':'style','WSGUm':_0x15f229(0x110)},_0x380d82=await _0x15389a['ThCfh'](getToken);if(!_0x380d82)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x369b85=_0x15389a[_0x15f229(0x131)](getApiBaseUrl),_0x566e4f=new URLSearchParams(),_0x3530d9=(_0x147a86?.['itemIds']?.['length']??0x0)>0x0,_0xb380d7=_0x15389a[_0x15f229(0x12d)](Boolean,_0x147a86?.[_0x15f229(0x12b)]);_0x3530d9&&_0x147a86?.[_0x15f229(0x11d)]&&_0x566e4f[_0x15f229(0x10b)](_0x15389a['HzmjF'],_0x147a86[_0x15f229(0x11d)]['join'](','));_0xb380d7&&_0x147a86?.[_0x15f229(0x12b)]&&_0x566e4f['set'](_0x15f229(0x12b),_0x147a86[_0x15f229(0x12b)]);_0x15389a[_0x15f229(0x141)](!_0x3530d9,!_0xb380d7)&&_0x147a86?.[_0x15f229(0x128)]&&_0x566e4f[_0x15f229(0x10b)](_0x15389a[_0x15f229(0x107)],_0x147a86[_0x15f229(0x128)]);const _0x1a5c00=_0x369b85+'/api/v1/mcp/features/'+_0x1ee020+'/report/markdown',_0x2bb73c=''+_0x1a5c00+(_0x566e4f['toString']()?'?'+_0x566e4f[_0x15f229(0x10c)]():''),_0x279248=await fetch(_0x2bb73c,{'method':_0x15389a[_0x15f229(0x111)],'headers':{'Authorization':'Bearer\x20'+_0x380d82}});if(!_0x279248['ok']){const _0x1275e0=await _0x279248['text']();throw new Error(_0x15f229(0x123)+_0x1275e0);}return _0x279248[_0x15f229(0x148)]();}export async function listFeatureSessions(_0x405b60){const _0x2c4e5d=_0x453c,_0x7450d5=await getToken();if(!_0x7450d5)throw new Error(_0x2c4e5d(0x126));const _0x29f34d=getApiBaseUrl(),_0x6a6a22=await fetch(_0x29f34d+'/api/v1/mcp/features/'+_0x405b60+'/sessions',{'method':'GET','headers':{'Authorization':_0x2c4e5d(0x135)+_0x7450d5}});if(!_0x6a6a22['ok']){const _0x36c8f8=await _0x6a6a22['text']();throw new Error(_0x2c4e5d(0x10f)+_0x36c8f8);}return _0x6a6a22[_0x2c4e5d(0x146)]();}function _0x453c(_0xec537b,_0x15de4f){_0xec537b=_0xec537b-0x102;const _0x3d202d=_0x3d20();let _0x453c93=_0x3d202d[_0xec537b];return _0x453c93;}export async function startSession(_0x3c24f5,_0x7d9c4a){const _0x8623e4=_0x453c,_0xa191bd={'TnpDT':function(_0x28c96b){return _0x28c96b();},'irGsW':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','mexbt':function(_0x2914db){return _0x2914db();},'yroYe':'POST'},_0x540943=await _0xa191bd[_0x8623e4(0x12f)](getToken);if(!_0x540943)throw new Error(_0xa191bd['irGsW']);const _0x59d53b=_0xa191bd[_0x8623e4(0x14a)](getApiBaseUrl),_0x4f42b0=await fetch(_0x59d53b+'/api/v1/mcp/features/'+_0x3c24f5+_0x8623e4(0x143)+_0x7d9c4a+_0x8623e4(0x117),{'method':_0xa191bd['yroYe'],'headers':{'Authorization':'Bearer\x20'+_0x540943}});if(!_0x4f42b0['ok']){const _0x3d9604=await _0x4f42b0[_0x8623e4(0x148)]();throw new Error(_0x8623e4(0x114)+_0x3d9604);}return _0x4f42b0[_0x8623e4(0x146)]();}export async function concludeSession(_0x3eae3c,_0x569810){const _0x3d83cb=_0x453c,_0x5b5cc9={'UtzWj':function(_0x137ce4){return _0x137ce4();},'oxokH':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','CGmEW':_0x3d83cb(0x120)},_0x20a15c=await _0x5b5cc9[_0x3d83cb(0x13f)](getToken);if(!_0x20a15c)throw new Error(_0x5b5cc9[_0x3d83cb(0x13b)]);const _0x4cdd69=getApiBaseUrl(),_0x2898e5=await fetch(_0x4cdd69+_0x3d83cb(0x129)+_0x3eae3c+'/sessions/'+_0x569810+_0x3d83cb(0x121),{'method':_0x5b5cc9[_0x3d83cb(0x11f)],'headers':{'Authorization':'Bearer\x20'+_0x20a15c}});if(!_0x2898e5['ok']){const _0x52a4c3=await _0x2898e5[_0x3d83cb(0x148)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x52a4c3);}return _0x2898e5['json']();}export async function getActionItems(_0x60c077){const _0x581fab=_0x453c,_0x232889={'OYnGk':_0x581fab(0x126),'FezzJ':function(_0x11bd65){return _0x11bd65();},'Xwdlq':_0x581fab(0x110)},_0x254cd4=await getToken();if(!_0x254cd4)throw new Error(_0x232889[_0x581fab(0x10d)]);const _0x36cc63=_0x232889[_0x581fab(0x138)](getApiBaseUrl),_0x57bd63=await fetch(_0x36cc63+_0x581fab(0x129)+_0x60c077+_0x581fab(0x102),{'method':_0x232889[_0x581fab(0x12e)],'headers':{'Authorization':'Bearer\x20'+_0x254cd4}});if(!_0x57bd63['ok']){const _0x39d4a0=await _0x57bd63[_0x581fab(0x148)]();throw new Error(_0x581fab(0x136)+_0x39d4a0);}return _0x57bd63[_0x581fab(0x146)]();}export async function getItemFeedback(_0xcc383c,_0x22d892){const _0x17fee4=_0x453c,_0x50c99a={'rOnrN':function(_0xa5fc90){return _0xa5fc90();},'Sdqhr':'GET'},_0x4c4876=await getToken();if(!_0x4c4876)throw new Error(_0x17fee4(0x126));const _0x2e3f86=_0x50c99a['rOnrN'](getApiBaseUrl),_0x104fef=await fetch(_0x2e3f86+_0x17fee4(0x129)+_0xcc383c+'/checklist-items/'+_0x22d892+_0x17fee4(0x103),{'method':_0x50c99a[_0x17fee4(0x144)],'headers':{'Authorization':_0x17fee4(0x135)+_0x4c4876}});if(!_0x104fef['ok']){const _0x400e01=await _0x104fef[_0x17fee4(0x148)]();throw new Error(_0x17fee4(0x14e)+_0x400e01);}return _0x104fef[_0x17fee4(0x146)]();}export async function markCommentsAddressed(_0x5ccdb9,_0x4d8af6,_0x221988){const _0x4fd129=_0x453c,_0x2d9667={'uAAoY':_0x4fd129(0x126),'dqwvr':_0x4fd129(0x14c)},_0x1e2375=await getToken();if(!_0x1e2375)throw new Error(_0x2d9667[_0x4fd129(0x104)]);const _0x370ac6=getApiBaseUrl(),_0x333d7a=await fetch(_0x370ac6+_0x4fd129(0x129)+_0x5ccdb9+'/comments/address',{'method':'POST','headers':{'Authorization':_0x4fd129(0x135)+_0x1e2375,'Content-Type':_0x2d9667[_0x4fd129(0x132)]},'body':JSON['stringify']({'checklistItemId':_0x4d8af6,'commentIds':_0x221988})});if(!_0x333d7a['ok']){const _0x2d2520=await _0x333d7a['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x2d2520);}}function _0x3d20(){const _0x48669d=['/conclude','/report','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','/checklist/','7692080bGzAuD','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','true','style','/api/v1/mcp/features/','gitBranch','sessionId','TnIDK','OKlmQ','Xwdlq','TnpDT','VcRZA','AWNxd','dqwvr','Failed\x20to\x20get\x20feature\x20review:\x20','cYSZI','Bearer\x20','Failed\x20to\x20get\x20action\x20items:\x20','8rIgvFB','FezzJ','/restore','27LrEBvK','oxokH','568fDKDyl','Failed\x20to\x20update\x20scenario:\x20','ZbyuQ','UtzWj','Failed\x20to\x20update\x20feature\x20review:\x20','RehIi','Failed\x20to\x20list\x20feature\x20reviews:\x20','/sessions/','Sdqhr','billingUrl','json','PATCH','text','170LxtgxQ','mexbt','2874654hrrFHb','application/json','DELETE','Failed\x20to\x20get\x20item\x20feedback:\x20','/action-items','/feedback','uAAoY','SLWmM','https://dashboard.ranger.net/billing','kbYgA','10779fOgLOj','/checklist','Feature\x20limit\x20exceeded','set','toString','OYnGk','5890178GctKTQ','Failed\x20to\x20list\x20sessions:\x20','GET','WSGUm','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','updateChecklistItem','Failed\x20to\x20start\x20session:\x20','418550tADRUt','766929rgKEiS','/start','offset','gitRepoUrl','limit','47505QuQauc','vSqGw','itemIds','rdQqG','CGmEW','POST'];_0x3d20=function(){return _0x48669d;};return _0x3d20();}export async function softDeleteFeature(_0x507fec){const _0x4943c2=_0x453c,_0x1eb7dc={'wNWBo':function(_0x532c70){return _0x532c70();}},_0x3e16a0=await getToken();if(!_0x3e16a0)throw new Error(_0x4943c2(0x126));const _0x10addb=_0x1eb7dc['wNWBo'](getApiBaseUrl),_0x27ae76=await fetch(_0x10addb+_0x4943c2(0x129)+_0x507fec,{'method':_0x4943c2(0x14d),'headers':{'Authorization':'Bearer\x20'+_0x3e16a0}});if(!_0x27ae76['ok']){const _0x32443b=await _0x27ae76['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x32443b);}}export async function restoreFeature(_0x36f8fe){const _0x15f192=_0x453c,_0x32bb1b=await getToken();if(!_0x32bb1b)throw new Error(_0x15f192(0x126));const _0x47809c=getApiBaseUrl(),_0x5d1e45=await fetch(_0x47809c+'/api/v1/mcp/features/'+_0x36f8fe+_0x15f192(0x139),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x32bb1b}});if(!_0x5d1e45['ok']){const _0x44984b=await _0x5d1e45[_0x15f192(0x148)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x44984b);}}
1
+ (function(_0x240d99,_0x3e9137){const _0x509c6f=_0x1469,_0x4b69cb=_0x240d99();while(!![]){try{const _0x3d7206=parseInt(_0x509c6f(0x1cb))/0x1*(-parseInt(_0x509c6f(0x1e8))/0x2)+-parseInt(_0x509c6f(0x1de))/0x3+parseInt(_0x509c6f(0x219))/0x4*(-parseInt(_0x509c6f(0x1ff))/0x5)+-parseInt(_0x509c6f(0x203))/0x6*(parseInt(_0x509c6f(0x1d1))/0x7)+-parseInt(_0x509c6f(0x1cf))/0x8*(parseInt(_0x509c6f(0x1e0))/0x9)+parseInt(_0x509c6f(0x1d3))/0xa+parseInt(_0x509c6f(0x1f5))/0xb*(parseInt(_0x509c6f(0x1e3))/0xc);if(_0x3d7206===_0x3e9137)break;else _0x4b69cb['push'](_0x4b69cb['shift']());}catch(_0xee4140){_0x4b69cb['push'](_0x4b69cb['shift']());}}}(_0x4e18,0x54c41));import{getToken}from'./keychain.js';function _0x4e18(){const _0x203ed6=['aGkaO','/conclude','852942WcrjFL','ofSTS','/sessions','JoIdp','Failed\x20to\x20create\x20feature\x20review:\x20','/report','text','COBQb','message','Kctkh','Qltcm','mPjqt','Failed\x20to\x20start\x20session:\x20','OprUU','QZLvG','SsPBo','JwcTK','json','sessionId','Kragl','includeDeleted','qrTYz','20cpvQgM','eYCnK','POST','/checklist-items/','210rrFEMR','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','Failed\x20to\x20list\x20feature\x20reviews:\x20','style','34872NStqey','hrKWG','7zpQCQt','Failed\x20to\x20get\x20action\x20items:\x20','3891680iqqpyX','Failed\x20to\x20create\x20scenario:\x20','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','set','/action-items','avoOe','gitRepoUrl','CIeAj','billingUrl','GET','/api/v1/mcp/features/','578934KgvRhQ','heNnE','207Dnzfgd','AXENE','toString','708276FOcZMD','stringify','cecvp','gitBranch','limit','2014KvRbvj','PATCH','Failed\x20to\x20conclude\x20session:\x20','Failed\x20to\x20update\x20feature\x20review:\x20','OuztC','DaQIH','Failed\x20to\x20get\x20feature\x20review:\x20','OxfsH','pVURw','/checklist','Failed\x20to\x20list\x20sessions:\x20','updateChecklistItem','njhvq','220gGypeQ','wynga','Bearer\x20','mYwvI','https://dashboard.ranger.net/billing','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','iQrrI','application/json','itemIds','Failed\x20to\x20delete\x20feature\x20review:\x20','575565cNACDA','mJXzg'];_0x4e18=function(){return _0x203ed6;};return _0x4e18();}import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x3e0b02){const _0x5592a2=_0x1469,_0x428e16={'KRaTi':function(_0x451eda){return _0x451eda();},'rlRVk':function(_0xb1d258){return _0xb1d258();},'njhvq':function(_0x386b85,_0xd2caf1,_0x42e9bb){return _0x386b85(_0xd2caf1,_0x42e9bb);},'ofSTS':'POST'},_0x10da72=await _0x428e16['KRaTi'](getToken);if(!_0x10da72)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x55eeb9=_0x428e16['rlRVk'](getApiBaseUrl),_0x30a8d6=await _0x428e16[_0x5592a2(0x1f4)](fetch,_0x55eeb9+'/api/v1/mcp/features',{'method':_0x428e16[_0x5592a2(0x204)],'headers':{'Authorization':'Bearer\x20'+_0x10da72,'Content-Type':_0x5592a2(0x1fc)},'body':JSON[_0x5592a2(0x1e4)](_0x3e0b02)});if(!_0x30a8d6['ok']){if(_0x30a8d6['status']===0x192){const _0x230fb0=await _0x30a8d6['json'](),_0x31349d=_0x230fb0[_0x5592a2(0x1db)]||_0x5592a2(0x1f9);throw new Error((_0x230fb0[_0x5592a2(0x20b)]||'Feature\x20limit\x20exceeded')+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x31349d);}const _0x1da907=await _0x30a8d6[_0x5592a2(0x209)]();throw new Error(_0x5592a2(0x207)+_0x1da907);}return _0x30a8d6[_0x5592a2(0x214)]();}export async function listFeatures(_0x25fb6a){const _0x24e9c6=_0x1469,_0x41a8b8={'OxfsH':'gitRepoUrl','OprUU':'GET'},_0x4cb5e6=await getToken();if(!_0x4cb5e6)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5ce65d=getApiBaseUrl(),_0x4921dc=new URLSearchParams();if(_0x25fb6a?.[_0x24e9c6(0x1d9)])_0x4921dc['set'](_0x41a8b8[_0x24e9c6(0x1ef)],_0x25fb6a[_0x24e9c6(0x1d9)]);if(_0x25fb6a?.['gitBranch'])_0x4921dc['set']('gitBranch',_0x25fb6a[_0x24e9c6(0x1e6)]);if(_0x25fb6a?.[_0x24e9c6(0x1e7)])_0x4921dc['set']('limit',_0x25fb6a[_0x24e9c6(0x1e7)]['toString']());if(_0x25fb6a?.['offset'])_0x4921dc['set']('offset',_0x25fb6a['offset'][_0x24e9c6(0x1e2)]());if(_0x25fb6a?.[_0x24e9c6(0x217)])_0x4921dc['set'](_0x24e9c6(0x217),'true');const _0xbdef09=_0x5ce65d+'/api/v1/mcp/features'+(_0x4921dc[_0x24e9c6(0x1e2)]()?'?'+_0x4921dc[_0x24e9c6(0x1e2)]():''),_0x4d0f54=await fetch(_0xbdef09,{'method':_0x41a8b8[_0x24e9c6(0x210)],'headers':{'Authorization':'Bearer\x20'+_0x4cb5e6}});if(!_0x4d0f54['ok']){const _0x3c204f=await _0x4d0f54['text']();throw new Error(_0x24e9c6(0x1cd)+_0x3c204f);}return _0x4d0f54[_0x24e9c6(0x214)]();}export async function getFeature(_0x47d2c6){const _0x55bfac=_0x1469,_0x4e3540={'SsPBo':function(_0xb4c9d9){return _0xb4c9d9();},'JoIdp':_0x55bfac(0x1d5),'fIRVi':function(_0x30b960){return _0x30b960();},'PYqQF':_0x55bfac(0x1dc)},_0x1fd396=await _0x4e3540[_0x55bfac(0x212)](getToken);if(!_0x1fd396)throw new Error(_0x4e3540[_0x55bfac(0x206)]);const _0x47dd26=_0x4e3540['fIRVi'](getApiBaseUrl),_0x23a3a1=await fetch(_0x47dd26+_0x55bfac(0x1dd)+_0x47d2c6,{'method':_0x4e3540['PYqQF'],'headers':{'Authorization':_0x55bfac(0x1f7)+_0x1fd396}});if(!_0x23a3a1['ok']){const _0x41ffd0=await _0x23a3a1['text']();throw new Error(_0x55bfac(0x1ee)+_0x41ffd0);}return _0x23a3a1[_0x55bfac(0x214)]();}export async function updateFeature(_0x3c4dea,_0x42e7af){const _0x78b706=_0x1469,_0x58aa46={'nhznc':function(_0x408d9f){return _0x408d9f();},'JwcTK':function(_0x1d3f68){return _0x1d3f68();},'ektvF':function(_0xae4b,_0x3e6dbd,_0x42d002){return _0xae4b(_0x3e6dbd,_0x42d002);}},_0x328345=await _0x58aa46['nhznc'](getToken);if(!_0x328345)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x411a97=_0x58aa46[_0x78b706(0x213)](getApiBaseUrl),_0x2b5a2f=await _0x58aa46['ektvF'](fetch,_0x411a97+_0x78b706(0x1dd)+_0x3c4dea,{'method':_0x78b706(0x1e9),'headers':{'Authorization':_0x78b706(0x1f7)+_0x328345,'Content-Type':'application/json'},'body':JSON[_0x78b706(0x1e4)](_0x42e7af)});if(!_0x2b5a2f['ok']){const _0x16dc9c=await _0x2b5a2f['text']();throw new Error(_0x78b706(0x1eb)+_0x16dc9c);}return _0x2b5a2f[_0x78b706(0x214)]();}export async function createChecklistItem(_0x636f89,_0x242505,_0x2f0012){const _0x72d8fa=_0x1469,_0x452fe5={'kESvd':_0x72d8fa(0x1d5),'heNnE':function(_0x2d95e9,_0x5b7099,_0x347468){return _0x2d95e9(_0x5b7099,_0x347468);},'QZLvG':_0x72d8fa(0x1c9),'aGkaO':_0x72d8fa(0x1fc)},_0x3e9443=await getToken();if(!_0x3e9443)throw new Error(_0x452fe5['kESvd']);const _0x328a66=getApiBaseUrl(),_0x3dcb60=await _0x452fe5[_0x72d8fa(0x1df)](fetch,_0x328a66+_0x72d8fa(0x1dd)+_0x636f89+_0x72d8fa(0x1f1),{'method':_0x452fe5[_0x72d8fa(0x211)],'headers':{'Authorization':'Bearer\x20'+_0x3e9443,'Content-Type':_0x452fe5[_0x72d8fa(0x201)]},'body':JSON[_0x72d8fa(0x1e4)]({'description':_0x242505,'position':_0x2f0012})});if(!_0x3dcb60['ok']){const _0x2ef126=await _0x3dcb60[_0x72d8fa(0x209)]();throw new Error(_0x72d8fa(0x1d4)+_0x2ef126);}return _0x3dcb60['json']();}export async function updateChecklistItem(_0x50e540,_0x2e5430,_0x2aca89){const _0x59bacc=_0x1469,_0x5c089e={'SbwoA':function(_0x58893e){return _0x58893e();},'qrTYz':function(_0x41ee50,_0x2488ea,_0x1d9ed7){return _0x41ee50(_0x2488ea,_0x1d9ed7);},'Qltcm':_0x59bacc(0x1e9),'COBQb':_0x59bacc(0x1fc),'HmjqF':_0x59bacc(0x1f3)};return withRetry(async()=>{const _0x315ba2=_0x59bacc,_0x5ad0f0=await _0x5c089e['SbwoA'](getToken);if(!_0x5ad0f0)throw new Error(_0x315ba2(0x1d5));const _0x597800=_0x5c089e['SbwoA'](getApiBaseUrl),_0x3161be=await _0x5c089e[_0x315ba2(0x218)](fetch,_0x597800+_0x315ba2(0x1dd)+_0x50e540+'/checklist/'+_0x2e5430,{'method':_0x5c089e[_0x315ba2(0x20d)],'headers':{'Authorization':'Bearer\x20'+_0x5ad0f0,'Content-Type':_0x5c089e[_0x315ba2(0x20a)]},'body':JSON[_0x315ba2(0x1e4)](_0x2aca89)});if(!_0x3161be['ok']){const _0x44dcfa=await _0x3161be[_0x315ba2(0x209)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x44dcfa);}return _0x3161be['json']();},{'label':_0x5c089e['HmjqF']});}export async function getFeatureReport(_0x59559a){const _0x2eb895=_0x1469,_0x181e4e={'buAiU':'GET'},_0x1eafba=await getToken();if(!_0x1eafba)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2a74b3=getApiBaseUrl(),_0x537503=await fetch(_0x2a74b3+'/api/v1/mcp/features/'+_0x59559a+_0x2eb895(0x208),{'method':_0x181e4e['buAiU'],'headers':{'Authorization':'Bearer\x20'+_0x1eafba}});if(!_0x537503['ok']){const _0x1855c4=await _0x537503[_0x2eb895(0x209)]();throw new Error(_0x2eb895(0x1fa)+_0x1855c4);}return _0x537503['json']();}export async function getFeatureReportMarkdown(_0x4a1ac7,_0x3d5b58){const _0x568158=_0x1469,_0x23f092={'cWFCE':_0x568158(0x1d5),'BrQKX':function(_0x2906fd,_0x4bdbb6){return _0x2906fd>_0x4bdbb6;},'OkIcu':_0x568158(0x1fd),'iukQz':function(_0x4f379b,_0x3c557d){return _0x4f379b&&_0x3c557d;},'uTgAv':function(_0xf740e0,_0x2dbfff,_0x4c945f){return _0xf740e0(_0x2dbfff,_0x4c945f);},'qaYSv':_0x568158(0x1dc)},_0x172019=await getToken();if(!_0x172019)throw new Error(_0x23f092['cWFCE']);const _0x111715=getApiBaseUrl(),_0x42abcf=new URLSearchParams(),_0x46ea16=_0x23f092['BrQKX'](_0x3d5b58?.[_0x568158(0x1fd)]?.['length']??0x0,0x0),_0x370fdc=Boolean(_0x3d5b58?.[_0x568158(0x215)]);_0x46ea16&&_0x3d5b58?.[_0x568158(0x1fd)]&&_0x42abcf[_0x568158(0x1d6)](_0x23f092['OkIcu'],_0x3d5b58[_0x568158(0x1fd)]['join'](','));_0x370fdc&&_0x3d5b58?.['sessionId']&&_0x42abcf[_0x568158(0x1d6)](_0x568158(0x215),_0x3d5b58['sessionId']);_0x23f092['iukQz'](!_0x46ea16,!_0x370fdc)&&_0x3d5b58?.['style']&&_0x42abcf[_0x568158(0x1d6)]('style',_0x3d5b58[_0x568158(0x1ce)]);const _0x92799a=_0x111715+_0x568158(0x1dd)+_0x4a1ac7+'/report/markdown',_0x58b2a5=''+_0x92799a+(_0x42abcf[_0x568158(0x1e2)]()?'?'+_0x42abcf[_0x568158(0x1e2)]():''),_0x270632=await _0x23f092['uTgAv'](fetch,_0x58b2a5,{'method':_0x23f092['qaYSv'],'headers':{'Authorization':_0x568158(0x1f7)+_0x172019}});if(!_0x270632['ok']){const _0x2aabd5=await _0x270632['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x2aabd5);}return _0x270632['text']();}export async function listFeatureSessions(_0x345e58){const _0x789cb6=_0x1469,_0x3cba53={'wynga':function(_0xf0ebf3){return _0xf0ebf3();},'pVURw':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','OuztC':'GET'},_0x384a87=await _0x3cba53[_0x789cb6(0x1f6)](getToken);if(!_0x384a87)throw new Error(_0x3cba53[_0x789cb6(0x1f0)]);const _0x3aaf9c=getApiBaseUrl(),_0x224af3=await fetch(_0x3aaf9c+'/api/v1/mcp/features/'+_0x345e58+_0x789cb6(0x205),{'method':_0x3cba53[_0x789cb6(0x1ec)],'headers':{'Authorization':_0x789cb6(0x1f7)+_0x384a87}});if(!_0x224af3['ok']){const _0x30ef8f=await _0x224af3['text']();throw new Error(_0x789cb6(0x1f2)+_0x30ef8f);}return _0x224af3[_0x789cb6(0x214)]();}export async function startSession(_0x6a6f,_0x5f161f){const _0x38f97b=_0x1469,_0x532693={'dSkAF':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','UgjfF':function(_0x445836){return _0x445836();},'CIeAj':function(_0x36b1e6,_0x71677,_0xa18b2){return _0x36b1e6(_0x71677,_0xa18b2);},'hrKWG':_0x38f97b(0x1c9)},_0x13b31e=await getToken();if(!_0x13b31e)throw new Error(_0x532693['dSkAF']);const _0x4743b5=_0x532693['UgjfF'](getApiBaseUrl),_0x21d117=await _0x532693[_0x38f97b(0x1da)](fetch,_0x4743b5+'/api/v1/mcp/features/'+_0x6a6f+'/sessions/'+_0x5f161f+'/start',{'method':_0x532693[_0x38f97b(0x1d0)],'headers':{'Authorization':_0x38f97b(0x1f7)+_0x13b31e}});if(!_0x21d117['ok']){const _0x36d8b4=await _0x21d117['text']();throw new Error(_0x38f97b(0x20f)+_0x36d8b4);}return _0x21d117['json']();}export async function concludeSession(_0x222d1e,_0x2a3b92){const _0x26b03e=_0x1469,_0x1ee649={'mJXzg':function(_0x450c6a){return _0x450c6a();},'YMAbv':_0x26b03e(0x1c9)},_0x2cdeef=await _0x1ee649[_0x26b03e(0x200)](getToken);if(!_0x2cdeef)throw new Error(_0x26b03e(0x1d5));const _0x5ac05c=getApiBaseUrl(),_0x910d94=await fetch(_0x5ac05c+'/api/v1/mcp/features/'+_0x222d1e+'/sessions/'+_0x2a3b92+_0x26b03e(0x202),{'method':_0x1ee649['YMAbv'],'headers':{'Authorization':'Bearer\x20'+_0x2cdeef}});if(!_0x910d94['ok']){const _0x56c63f=await _0x910d94['text']();throw new Error(_0x26b03e(0x1ea)+_0x56c63f);}return _0x910d94['json']();}export async function getActionItems(_0x1721db){const _0x2b1114=_0x1469,_0x180b8a=await getToken();if(!_0x180b8a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x72583f=getApiBaseUrl(),_0x3a621d=await fetch(_0x72583f+_0x2b1114(0x1dd)+_0x1721db+_0x2b1114(0x1d7),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x180b8a}});if(!_0x3a621d['ok']){const _0x322d11=await _0x3a621d[_0x2b1114(0x209)]();throw new Error(_0x2b1114(0x1d2)+_0x322d11);}return _0x3a621d[_0x2b1114(0x214)]();}export async function getItemFeedback(_0xeb615,_0x3858c0){const _0x1213ea=_0x1469,_0xb56d60={'VdDrO':function(_0x2abaab){return _0x2abaab();},'avoOe':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','iQrrI':function(_0x4a2f53,_0x4b2fb4,_0x3ddb54){return _0x4a2f53(_0x4b2fb4,_0x3ddb54);},'fHepa':'GET'},_0x513d5f=await _0xb56d60['VdDrO'](getToken);if(!_0x513d5f)throw new Error(_0xb56d60[_0x1213ea(0x1d8)]);const _0x104ad0=getApiBaseUrl(),_0x3e5448=await _0xb56d60[_0x1213ea(0x1fb)](fetch,_0x104ad0+'/api/v1/mcp/features/'+_0xeb615+_0x1213ea(0x1ca)+_0x3858c0+'/feedback',{'method':_0xb56d60['fHepa'],'headers':{'Authorization':_0x1213ea(0x1f7)+_0x513d5f}});if(!_0x3e5448['ok']){const _0x3f0141=await _0x3e5448[_0x1213ea(0x209)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x3f0141);}return _0x3e5448[_0x1213ea(0x214)]();}export async function markCommentsAddressed(_0x27fba0,_0x2808a2,_0x2d7381){const _0x283da9=_0x1469,_0x312a13={'DaQIH':function(_0x54454d){return _0x54454d();},'Kragl':function(_0x3b0c29){return _0x3b0c29();},'Kctkh':function(_0x1a43a0,_0x223901,_0x367d98){return _0x1a43a0(_0x223901,_0x367d98);},'JFhBI':'application/json'},_0x46b66d=await _0x312a13[_0x283da9(0x1ed)](getToken);if(!_0x46b66d)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xbd993d=_0x312a13[_0x283da9(0x216)](getApiBaseUrl),_0x5b0324=await _0x312a13[_0x283da9(0x20c)](fetch,_0xbd993d+_0x283da9(0x1dd)+_0x27fba0+'/comments/address',{'method':_0x283da9(0x1c9),'headers':{'Authorization':_0x283da9(0x1f7)+_0x46b66d,'Content-Type':_0x312a13['JFhBI']},'body':JSON[_0x283da9(0x1e4)]({'checklistItemId':_0x2808a2,'commentIds':_0x2d7381})});if(!_0x5b0324['ok']){const _0x3e4a33=await _0x5b0324['text']();throw new Error(_0x283da9(0x1cc)+_0x3e4a33);}}export async function softDeleteFeature(_0x4f7d43){const _0x3e310d=_0x1469,_0x35f5a6=await getToken();if(!_0x35f5a6)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x4ad880=getApiBaseUrl(),_0x5bc1e9=await fetch(_0x4ad880+_0x3e310d(0x1dd)+_0x4f7d43,{'method':'DELETE','headers':{'Authorization':_0x3e310d(0x1f7)+_0x35f5a6}});if(!_0x5bc1e9['ok']){const _0x3a938e=await _0x5bc1e9['text']();throw new Error(_0x3e310d(0x1fe)+_0x3a938e);}}function _0x1469(_0x2e040f,_0x116176){_0x2e040f=_0x2e040f-0x1c8;const _0x4e1825=_0x4e18();let _0x146925=_0x4e1825[_0x2e040f];return _0x146925;}export async function restoreFeature(_0x3b2078){const _0x57d5e2=_0x1469,_0x53eb5d={'mPjqt':function(_0x4d18d2){return _0x4d18d2();},'AXENE':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','mYwvI':function(_0x5adf9c){return _0x5adf9c();},'eYCnK':function(_0x5ea1dc,_0x46608b,_0x60e8ae){return _0x5ea1dc(_0x46608b,_0x60e8ae);},'cecvp':_0x57d5e2(0x1c9)},_0x5c0f55=await _0x53eb5d[_0x57d5e2(0x20e)](getToken);if(!_0x5c0f55)throw new Error(_0x53eb5d[_0x57d5e2(0x1e1)]);const _0x37fd49=_0x53eb5d[_0x57d5e2(0x1f8)](getApiBaseUrl),_0x5ebb6f=await _0x53eb5d[_0x57d5e2(0x1c8)](fetch,_0x37fd49+_0x57d5e2(0x1dd)+_0x3b2078+'/restore',{'method':_0x53eb5d[_0x57d5e2(0x1e5)],'headers':{'Authorization':'Bearer\x20'+_0x5c0f55}});if(!_0x5ebb6f['ok']){const _0x2fa535=await _0x5ebb6f[_0x57d5e2(0x209)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x2fa535);}}