@ranger-testing/ranger-cli 3.1.7-alpha.9ed0a8d-59 → 3.1.7-alpha.9f8e190-62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/actors.js +1 -0
  38. package/build/commands/utils/agentEnv.js +1 -1
  39. package/build/commands/utils/browserSessionsApi.js +1 -1
  40. package/build/commands/utils/claudeConfig.js +1 -1
  41. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  42. package/build/commands/utils/claudePlugin.js +1 -1
  43. package/build/commands/utils/cloudProfile.js +1 -1
  44. package/build/commands/utils/cloudProfileSession.js +1 -1
  45. package/build/commands/utils/crypto.js +1 -1
  46. package/build/commands/utils/desirePathLog.js +1 -1
  47. package/build/commands/utils/deviceAuth.js +1 -1
  48. package/build/commands/utils/environment.js +1 -1
  49. package/build/commands/utils/featureApi.js +1 -1
  50. package/build/commands/utils/fixWebmDuration.js +1 -1
  51. package/build/commands/utils/gitTracked.js +1 -1
  52. package/build/commands/utils/keychain.js +1 -1
  53. package/build/commands/utils/legacyWarning.js +1 -1
  54. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  55. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  56. package/build/commands/utils/mcpImageBase64.js +1 -1
  57. package/build/commands/utils/model.js +1 -1
  58. package/build/commands/utils/novaActCli.js +1 -1
  59. package/build/commands/utils/opencodeConfig.js +1 -1
  60. package/build/commands/utils/organizationEnvApi.js +1 -1
  61. package/build/commands/utils/playwrightCli.js +1 -1
  62. package/build/commands/utils/profileMessages.js +1 -1
  63. package/build/commands/utils/profileSetupBanner.js +1 -1
  64. package/build/commands/utils/projectsConfig.js +1 -1
  65. package/build/commands/utils/rangerConfig.js +1 -1
  66. package/build/commands/utils/rangerRoot.js +1 -1
  67. package/build/commands/utils/rangerwrightCli.js +1 -1
  68. package/build/commands/utils/resolveProfileContext.js +1 -1
  69. package/build/commands/utils/resolveProfileUrl.js +1 -1
  70. package/build/commands/utils/retry.js +1 -1
  71. package/build/commands/utils/scenarioOriginCheck.js +1 -1
  72. package/build/commands/utils/sessionCache.js +1 -1
  73. package/build/commands/utils/settings.js +1 -1
  74. package/build/commands/utils/skillContent.js +1 -1
  75. package/build/commands/utils/skills.js +1 -1
  76. package/build/commands/utils/stitchWebmFiles.js +1 -1
  77. package/build/commands/utils/telemetry.js +1 -1
  78. package/build/commands/utils/tokenRefresh.js +1 -1
  79. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  80. package/build/commands/utils/tunnelClient.js +1 -1
  81. package/build/commands/utils/userApi.js +1 -1
  82. package/build/commands/utils/version.js +1 -1
  83. package/build/commands/verifyFeature.js +1 -1
  84. package/build/commands/verifyFeatureCli.js +1 -1
  85. package/build/commands/verifyFeatureNovaCli.js +1 -1
  86. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  87. package/package.json +1 -1
@@ -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 _0x8ad5e7=_0x56dc;(function(_0x3b438d,_0x3d80a7){const _0x1df119=_0x56dc,_0x3a60f3=_0x3b438d();while(!![]){try{const _0xcd2f48=parseInt(_0x1df119(0x125))/0x1*(parseInt(_0x1df119(0x192))/0x2)+-parseInt(_0x1df119(0x104))/0x3+-parseInt(_0x1df119(0x12a))/0x4*(-parseInt(_0x1df119(0x18f))/0x5)+-parseInt(_0x1df119(0x177))/0x6*(-parseInt(_0x1df119(0x146))/0x7)+-parseInt(_0x1df119(0x13b))/0x8*(parseInt(_0x1df119(0xfa))/0x9)+parseInt(_0x1df119(0xe2))/0xa*(parseInt(_0x1df119(0xe7))/0xb)+-parseInt(_0x1df119(0x189))/0xc;if(_0xcd2f48===_0x3d80a7)break;else _0x3a60f3['push'](_0x3a60f3['shift']());}catch(_0x453d61){_0x3a60f3['push'](_0x3a60f3['shift']());}}}(_0x5033,0x6e620));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';function _0x56dc(_0x593795,_0x149e28){_0x593795=_0x593795-0xde;const _0x5033d5=_0x5033();let _0x56dc94=_0x5033d5[_0x593795];return _0x56dc94;}import{existsSync}from'fs';import _0x41d1e4 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(_0x222ec3){const _0x454a3c=_0x56dc,_0x2d99d1={'cXBAg':'invalid-url'};try{return new URL(_0x222ec3)[_0x454a3c(0x164)];}catch{return _0x2d99d1[_0x454a3c(0x16d)];}}function errorMessageForTelemetry(_0x46263c){const _0x3eab65=_0x56dc,_0x113d82={'xYhdk':function(_0x53ce28,_0x5701ca){return _0x53ce28 instanceof _0x5701ca;}};return _0x113d82[_0x3eab65(0x126)](_0x46263c,Error)?_0x46263c['message']:undefined;}function trackBridgeEvent(_0x4eafc8,_0x241ce8){const _0x5bba48=_0x56dc,_0x58b0a5={'DUTlo':'tunnel_bridge_event','LXXPf':function(_0x5662eb,_0x497ba3){return _0x5662eb===_0x497ba3;},'QIrqn':_0x5bba48(0x103)};if(!_0x4eafc8)return;const _0x3d8a43={'tunnelSessionId':_0x241ce8['sessionId'],'tunnelEventType':_0x241ce8[_0x5bba48(0x13d)],'connectionId':_0x241ce8[_0x5bba48(0x148)],'code':_0x241ce8[_0x5bba48(0x152)],'reason':_0x241ce8['reason'],'error':_0x241ce8['error'],'elapsedMs':_0x241ce8[_0x5bba48(0x11d)],'activeLocalConnections':_0x241ce8['activeLocalConnections'],'pendingLocalConnections':_0x241ce8['pendingLocalConnections']};_0x4eafc8['trackPhaseEnd'](_0x58b0a5[_0x5bba48(0x15a)],_0x3d8a43),(_0x58b0a5['LXXPf'](_0x241ce8[_0x5bba48(0x13d)],_0x5bba48(0x137))||_0x241ce8['type']===_0x58b0a5[_0x5bba48(0xf7)])&&void _0x4eafc8[_0x5bba48(0x198)](_0x5bba48(0x19e),new Error(_0x241ce8[_0x5bba48(0xff)]??_0x241ce8[_0x5bba48(0x13d)]),_0x3d8a43);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x55713c=_0x56dc,_0x5b1af8={'XhJGV':_0x55713c(0x1a2)},_0x5e2e22=await getToken();if(!_0x5e2e22)throw new Error(_0x5b1af8[_0x55713c(0x156)]);return _0x5e2e22;}async function apiRequest(_0x472a88,_0x2f0687={}){const _0x4c2e7c=_0x56dc,_0x1f25e5={'EdmJs':function(_0x2ad2f1,_0xe72bfb,_0x240084){return _0x2ad2f1(_0xe72bfb,_0x240084);},'ojWkD':_0x4c2e7c(0x10e),'uYmhz':'string','Exmnz':function(_0x5df28e,_0x266a51){return _0x5df28e===_0x266a51;}},_0xa5c488=await requireToken(),_0x55b4e6=getApiBaseUrl(),_0x1eeebf=await _0x1f25e5[_0x4c2e7c(0x178)](fetch,''+_0x55b4e6+_0x472a88,{..._0x2f0687,'headers':{'Authorization':_0x4c2e7c(0x100)+_0xa5c488,'Content-Type':_0x1f25e5[_0x4c2e7c(0x159)],..._0x2f0687['headers']??{}}});if(!_0x1eeebf['ok']){let _0x48d987='',_0xdf8cf5;try{const _0x3cd349=await _0x1eeebf['json'](),_0x2faec0=(typeof _0x3cd349[_0x4c2e7c(0xff)]===_0x1f25e5[_0x4c2e7c(0x161)]?_0x3cd349[_0x4c2e7c(0xff)]:undefined)??JSON[_0x4c2e7c(0x136)](_0x3cd349);_0x48d987=_0x2faec0;typeof _0x3cd349[_0x4c2e7c(0x14a)]===_0x1f25e5['uYmhz']&&_0x3cd349[_0x4c2e7c(0x14a)]&&(_0x48d987=_0x48d987+'\x0a'+_0x3cd349['test_output']);if(typeof _0x3cd349['code']===_0x1f25e5[_0x4c2e7c(0x161)])_0xdf8cf5=_0x3cd349['code'];}catch{_0x48d987=_0x1eeebf[_0x4c2e7c(0x141)];}throw new ApiError(_0x4c2e7c(0x17a)+_0x472a88+'\x20failed\x20('+_0x1eeebf[_0x4c2e7c(0x1a7)]+'):\x20'+_0x48d987,_0x1eeebf[_0x4c2e7c(0x1a7)],_0x48d987,_0xdf8cf5);}if(_0x1f25e5['Exmnz'](_0x1eeebf['status'],0xcc))return undefined;return _0x1eeebf['json']();}export class ApiError extends Error{['status'];['detail'];['code'];constructor(_0x2635a5,_0x5999fb,_0x3580ba,_0x4a147e){const _0x434bbc=_0x56dc,_0x1bc425={'VdcTy':'ApiError'};super(_0x2635a5),this[_0x434bbc(0x1a7)]=_0x5999fb,this[_0x434bbc(0x144)]=_0x3580ba,this['code']=_0x4a147e,this[_0x434bbc(0x179)]=_0x1bc425[_0x434bbc(0x183)];}}export async function fetchCloudProfile(_0x3dea4){const _0x517ced=_0x56dc,_0x112c38={'lyRgn':function(_0x16dc35,_0x54f983,_0x518392){return _0x16dc35(_0x54f983,_0x518392);}};try{return await _0x112c38['lyRgn'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x3dea4),{'signal':AbortSignal['timeout'](0x3a98)});}catch(_0x48012b){if(_0x48012b instanceof ApiError&&_0x48012b[_0x517ced(0x1a7)]===0x194)return null;throw _0x48012b;}}export async function listCloudProfiles(){const _0x4b5481=_0x56dc,_0x46e372={'sQyWk':function(_0x384e2e,_0x3da5e8){return _0x384e2e(_0x3da5e8);},'pAMuR':'/api/v1/profiles'},_0x241c4e=await _0x46e372[_0x4b5481(0x154)](apiRequest,_0x46e372[_0x4b5481(0x195)]);return _0x241c4e[_0x4b5481(0x11b)];}export async function deleteCloudProfile(_0x3df09e){const _0xdee15f=_0x56dc,_0x39030a={'QvwRp':function(_0x25e65,_0x26465f,_0x58347e){return _0x25e65(_0x26465f,_0x58347e);},'LTPDW':function(_0x6434fc,_0x449457){return _0x6434fc(_0x449457);},'dlnha':function(_0x3f0781,_0x42eb1d){return _0x3f0781 instanceof _0x42eb1d;}};try{await _0x39030a[_0xdee15f(0x169)](apiRequest,'/api/v1/profiles/'+_0x39030a[_0xdee15f(0x1a0)](encodeURIComponent,_0x3df09e),{'method':_0xdee15f(0x13c)});}catch(_0x457679){if(_0x39030a[_0xdee15f(0x173)](_0x457679,ApiError)&&_0x457679['status']===0x194)throw new Error(_0xdee15f(0x142)+_0x3df09e+_0xdee15f(0x12e));throw _0x457679;}}export async function createCloudProfile(_0x241538,_0x465d58,_0x54ff26={}){const _0xb052d2=_0x56dc,_0x380460={'yiqcB':_0xb052d2(0xf8),'xKbtc':'POST'},_0x13bb19={'name':_0x241538};if(_0x465d58)_0x13bb19[_0xb052d2(0x17e)]=_0x465d58;_0x54ff26[_0xb052d2(0x116)]&&Object['keys'](_0x54ff26['settings'])['length']>0x0&&(_0x13bb19['settings']=_0x54ff26['settings']);if(_0x54ff26[_0xb052d2(0x1aa)])_0x13bb19['username']=_0x54ff26['username'];if(_0x54ff26[_0xb052d2(0x133)])_0x13bb19['password']=_0x54ff26[_0xb052d2(0x133)];return await apiRequest(_0x380460[_0xb052d2(0x1ac)],{'method':_0x380460['xKbtc'],'body':JSON['stringify'](_0x13bb19)});}export async function uploadCloudProfileSession(_0x4c0f71,_0x2decf1){const _0x27e1d2={'rRVZE':function(_0xb0fbb3,_0x47277a,_0x1531e7){return _0xb0fbb3(_0x47277a,_0x1531e7);},'mHpjI':'POST'};return await _0x27e1d2['rRVZE'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x4c0f71)+'/session',{'method':_0x27e1d2['mHpjI'],'body':JSON['stringify']({'session_state':_0x2decf1})});}export async function saveCloudProfileCredentials(_0x52cf05,_0x31e117,_0x36a40d){const _0x2b4cc6=_0x56dc,_0x524c49={'nkFsh':function(_0x2374e2,_0x4358e1){return _0x2374e2(_0x4358e1);},'eiwqB':_0x2b4cc6(0x1a6)};await apiRequest(_0x2b4cc6(0x132)+_0x524c49[_0x2b4cc6(0x114)](encodeURIComponent,_0x52cf05),{'method':_0x524c49['eiwqB'],'body':JSON[_0x2b4cc6(0x136)]({'username':_0x31e117,'password':_0x36a40d})});}export async function fetchAuthConfig(){const _0x5572f0=_0x56dc,_0x2bef4a={'LdLXg':function(_0x40450f,_0x4793f4){return _0x40450f(_0x4793f4);},'XFXVz':function(_0xb19bd5,_0x463fa3){return _0xb19bd5!==_0x463fa3;}};try{const _0x35d977=await _0x2bef4a['LdLXg'](apiRequest,'/api/v1/profiles/auth-config');return _0x35d977[_0x5572f0(0x158)];}catch(_0x19923d){return _0x19923d instanceof ApiError&&_0x2bef4a[_0x5572f0(0xfe)](_0x19923d['status'],0x194)&&console[_0x5572f0(0xff)](_0x5572f0(0x180)+_0x19923d[_0x5572f0(0x188)]),null;}}async function createTunnelSession(_0x39656f){const _0x5621b7=_0x56dc,_0x3a1838={'gRokC':'/api/v1/tunnel/sessions','yigkO':_0x5621b7(0x121)};return await apiRequest(_0x3a1838[_0x5621b7(0x118)],{'method':_0x5621b7(0x147),'body':JSON['stringify']({'targetUrl':_0x39656f,'mode':_0x3a1838['yigkO']})});}async function deleteTunnelSession(_0xab8e67){const _0x13836d=_0x56dc,_0x3407ad={'eVeNr':function(_0x3c8638,_0x2acea2,_0x293647){return _0x3c8638(_0x2acea2,_0x293647);},'GxEuQ':_0x13836d(0x13c)};await _0x3407ad[_0x13836d(0x14f)](apiRequest,'/api/v1/tunnel/sessions/'+_0xab8e67,{'method':_0x3407ad['GxEuQ']});}export function pickAdHocEnvKey(_0x305aa1,_0x1579c2,_0x1fbb4a){const _0x4c01ce=_0x56dc,_0x2e52ec={'BJDSm':function(_0x12fd82,_0x3cb886){return _0x12fd82+_0x3cb886;},'mHpmR':function(_0x2605d9,_0x5c3437){return _0x2605d9+_0x5c3437;},'TGebH':_0x4c01ce(0x11a),'tXJdE':'ambiguous','pbzvt':function(_0x135a6d,_0x2b5a51){return _0x135a6d(_0x2b5a51);},'sjbmi':function(_0x4f524a,_0x3ac65c){return _0x4f524a+_0x3ac65c;},'Jatpl':function(_0x4bd1d8,_0x48783b){return _0x4bd1d8+_0x48783b;},'lTuCe':function(_0x598985,_0x5a2842){return _0x598985===_0x5a2842;}};if(_0x1fbb4a){if(!_0x305aa1?.['environments']?.[_0x1fbb4a]){const _0x3781df=Object[_0x4c01ce(0x15c)](_0x305aa1?.[_0x4c01ce(0xf3)]??{});throw new Error(_0x2e52ec[_0x4c01ce(0x110)](_0x2e52ec['mHpmR']('Auth\x20environment\x20\x22'+_0x1fbb4a+_0x4c01ce(0x138),_0x3781df[_0x4c01ce(0x1a4)]?_0x4c01ce(0x102)+_0x3781df[_0x4c01ce(0x167)](',\x20')+'.':_0x2e52ec['TGebH']),'\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)'));}return _0x1fbb4a;}if(!_0x305aa1)return null;if(_0x1579c2){const _0x23a687=matchAuthEnvironmentExact(_0x1579c2,_0x305aa1);if(_0x23a687)return _0x23a687;const _0x62bce0=matchAuthEnvironmentByHost(_0x1579c2,_0x305aa1);if(_0x62bce0&&_0x4c01ce(0x186)in _0x62bce0)return console['log'](_0x4c01ce(0x134)+_0x62bce0['key']+_0x4c01ce(0x13f)+_0x1579c2+'\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).'),_0x62bce0[_0x4c01ce(0x186)];if(_0x62bce0&&_0x2e52ec['tXJdE']in _0x62bce0)throw new Error(_0x4c01ce(0x120)+_0x62bce0['ambiguous'][_0x4c01ce(0x167)](',\x20')+_0x4c01ce(0x17b));if(_0x2e52ec['pbzvt'](needsTunnel,_0x1579c2))throw new Error(_0x2e52ec[_0x4c01ce(0x110)](_0x2e52ec['sjbmi'](_0x2e52ec['Jatpl']('No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22'+_0x1579c2+_0x4c01ce(0x194)+_0x4c01ce(0x163),_0x4c01ce(0x130))+'\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a',_0x4c01ce(0xf5)+_0x1579c2['replace'](/\/+$/,'')+_0x4c01ce(0x11f)),'\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20'+_0x1579c2+_0x4c01ce(0xfb)));}if(_0x305aa1['defaultEnvironmentKey'])return _0x305aa1['defaultEnvironmentKey'];const _0x3b976f=Object[_0x4c01ce(0x15c)](_0x305aa1['environments']??{});if(_0x3b976f[_0x4c01ce(0x1a4)]===0x1)return _0x3b976f[0x0];if(_0x2e52ec[_0x4c01ce(0x187)](_0x3b976f[_0x4c01ce(0x1a4)],0x0))return null;throw new Error(_0x4c01ce(0x184)+_0x3b976f[_0x4c01ce(0x167)](',\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>`.');}export function adHocProfileName(_0x4693fe,_0x5d9b73,_0x5c3770){const _0x5da312={'MgvDO':function(_0xed7c4f,_0x361bd3){return _0xed7c4f===_0x361bd3;}};if(!_0x5d9b73||_0x5da312['MgvDO'](_0x5d9b73,_0x5c3770))return _0x4693fe;return _0x4693fe+':'+_0x5d9b73;}export async function resolveAdHocProfile(_0x4705fe={},_0x1995ee=process[_0x8ad5e7(0x128)]){const _0x4903ca=_0x8ad5e7,_0x1ebb54={'PhPhy':function(_0x33014d){return _0x33014d();},'aXNCp':function(_0x5b7c1e,_0x5be6de,_0x30c8f8,_0x2427b7){return _0x5b7c1e(_0x5be6de,_0x30c8f8,_0x2427b7);},'sgNoP':function(_0x34f986,_0x529a0a){return _0x34f986(_0x529a0a);},'LlzZY':function(_0x3caaaf,_0x23ecf7){return _0x3caaaf&&_0x23ecf7;},'AdehP':function(_0x451c97,_0x5ed291){return _0x451c97!==_0x5ed291;},'LRQDV':_0x4903ca(0xef),'XRWRV':function(_0x520499,_0x3ed75a){return _0x520499??_0x3ed75a;}},_0x31c2b9=_0x1995ee['RANGER_TEST_USERNAME'];if(!_0x31c2b9)return null;const _0x1dcda1=await _0x1ebb54['PhPhy'](fetchAuthConfig),_0x595d8c=_0x1ebb54[_0x4903ca(0x15b)](pickAdHocEnvKey,_0x1dcda1,_0x4705fe[_0x4903ca(0xe3)],_0x4705fe[_0x4903ca(0x11c)]);let _0x9c793a=_0x1ebb54['aXNCp'](adHocProfileName,_0x31c2b9,_0x595d8c,_0x1dcda1?.['defaultEnvironmentKey']),_0x4bbf4d=await _0x1ebb54['sgNoP'](fetchCloudProfile,_0x9c793a);_0x1ebb54['LlzZY'](_0x4bbf4d,_0x595d8c)&&_0x1ebb54[_0x4903ca(0x101)](_0x4bbf4d[_0x4903ca(0x15d)],_0x595d8c)&&(console['log'](_0x4903ca(0x12d)+_0x9c793a+'\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22'+(_0x4bbf4d[_0x4903ca(0x15d)]??_0x1ebb54[_0x4903ca(0x117)])+_0x4903ca(0x182)+_0x595d8c+_0x4903ca(0xec)+_0x31c2b9+':'+_0x595d8c+_0x4903ca(0xee)),_0x9c793a=_0x31c2b9+':'+_0x595d8c,_0x4bbf4d=await _0x1ebb54[_0x4903ca(0xf0)](fetchCloudProfile,_0x9c793a));if(_0x4bbf4d)return{'name':_0x4bbf4d[_0x4903ca(0x179)],'profile':_0x4bbf4d};const _0x29337a=_0x1995ee[_0x4903ca(0x145)],_0x56d9f9=await _0x1ebb54['aXNCp'](createCloudProfile,_0x9c793a,_0x1ebb54[_0x4903ca(0x191)](_0x595d8c,undefined),{'username':_0x31c2b9,'password':_0x29337a});return console['log'](_0x4903ca(0xeb)+_0x56d9f9['name']+'\x22\x20for\x20'+_0x31c2b9+(_0x595d8c?'\x20(auth\x20env:\x20'+_0x595d8c+')':'')),{'name':_0x56d9f9[_0x4903ca(0x179)],'profile':_0x56d9f9};}export async function writeSessionToLocalCache(_0x43fccc,_0x413289,_0x78130a,_0x45c558,_0x26639e,_0x2ce5b1,_0x3fe5b3){const _0x178d31=_0x8ad5e7,_0x543883={'xYRNV':function(_0x357f53,_0x8c9d5f){return _0x357f53(_0x8c9d5f);},'fovsH':function(_0x112bc7,_0x2fb2d3,_0x393d6c){return _0x112bc7(_0x2fb2d3,_0x393d6c);},'UehVK':function(_0x295674){return _0x295674();},'ejJhd':function(_0x1e65aa,_0x144c57){return _0x1e65aa>_0x144c57;}},_0x3d2434=_0x543883[_0x178d31(0x16b)](sessionCacheHash,{'orgId':_0x413289,'profileName':_0x43fccc,'effectiveBaseUrl':_0x78130a,'setupHeaders':_0x45c558,'invalidateOn':_0x3fe5b3?.[_0x178d31(0x129)],'userAgent':_0x3fe5b3?.[_0x178d31(0xe9)],'clientIp':_0x3fe5b3?.[_0x178d31(0x17c)]}),_0xc43906=_0x543883['fovsH'](getSessionCachePath,_0x3d2434,_0x43fccc),_0x3cc556=join(_0x543883['UehVK'](getRangerHomeDir),'auth');!existsSync(_0x3cc556)&&await mkdir(_0x3cc556,{'recursive':!![]});const _0x7cd838={..._0x26639e};_0x2ce5b1&&_0x543883[_0x178d31(0x175)](_0x2ce5b1['length'],0x0)&&Array['isArray'](_0x7cd838[_0x178d31(0xe1)])&&(_0x7cd838['cookies']=_0x543883['fovsH'](duplicateCookiesForDomains,_0x7cd838['cookies'],_0x2ce5b1));const _0x313e3c={'cached_at':new Date()[_0x178d31(0x12f)](),'session_state':_0x7cd838};await _0x543883[_0x178d31(0x162)](writeFile,_0xc43906,JSON[_0x178d31(0x136)](_0x313e3c,null,0x2));const _0x1e74bd=getStorageStatePath(_0xc43906);return await writeFile(_0x1e74bd,JSON['stringify'](_0x7cd838,null,0x2)),_0x1e74bd;}export async function checkLocalCache(_0x309913,_0x35f05e,_0x28ac97,_0x53502b,_0x9b8a0e){const _0x97d1a9=_0x8ad5e7,_0x2b4134={'jKFTE':function(_0x3872ca,_0x4589aa,_0x15a4c6){return _0x3872ca(_0x4589aa,_0x15a4c6);},'QTPGB':function(_0x31f49d,_0x5be4b4){return _0x31f49d(_0x5be4b4);},'Fwajk':'utf-8'},_0x34571a=sessionCacheHash({'orgId':_0x35f05e,'profileName':_0x309913,'effectiveBaseUrl':_0x28ac97,'setupHeaders':_0x53502b,'invalidateOn':_0x9b8a0e?.['invalidateOn'],'userAgent':_0x9b8a0e?.['userAgent'],'clientIp':_0x9b8a0e?.[_0x97d1a9(0x17c)]}),_0x5cc705=_0x2b4134[_0x97d1a9(0x131)](getSessionCachePath,_0x34571a,_0x309913),_0x1161b1=_0x2b4134[_0x97d1a9(0xe6)](getStorageStatePath,_0x5cc705);if(!existsSync(_0x5cc705)||!existsSync(_0x1161b1))return null;try{const _0x5a5156=await readFile(_0x5cc705,_0x2b4134[_0x97d1a9(0xf2)]);return JSON['parse'](_0x5a5156),{'storageStatePath':_0x1161b1};}catch{return null;}}function launchRealBrowser(){const _0xf4ab63=_0x8ad5e7;return chromium[_0xf4ab63(0x157)]({'headless':!![]});}function emitSessionValidationHint(_0x5b9827,_0x3936bd){const _0x45bbe8=_0x8ad5e7,_0x5aed22={'MqwAR':function(_0x45ae20,_0xc3e25d){return _0x45ae20===_0xc3e25d;},'XkyNp':function(_0x3397b3,_0x28c33f){return _0x3397b3+_0x28c33f;},'fQzCn':function(_0x5e6981,_0x575ba1){return _0x5e6981+_0x575ba1;}};if(!_0x3936bd||!_0x3936bd['domains']?.['length'])return;let _0x3667ae;try{_0x3667ae=new URL(_0x5b9827);}catch{return;}const _0x4e30b4=[];for(const _0x25c068 of _0x3936bd[_0x45bbe8(0x149)]){try{_0x4e30b4['push']({'raw':_0x25c068,'url':new URL(_0x25c068)});}catch{}}if(_0x5aed22[_0x45bbe8(0x14c)](_0x4e30b4['length'],0x0))return;if(_0x4e30b4['some'](_0x55df29=>_0x55df29[_0x45bbe8(0x16f)][_0x45bbe8(0x19f)]===_0x3667ae[_0x45bbe8(0x19f)]))return;const _0x2e5ed4=_0x4e30b4['map'](_0x24596c=>'\x22'+_0x24596c[_0x45bbe8(0x199)]+'\x22')[_0x45bbe8(0x167)](',\x20');console[_0x45bbe8(0x13a)](_0x5aed22[_0x45bbe8(0x19b)](_0x5aed22[_0x45bbe8(0xf1)](_0x45bbe8(0x10f)+_0x2e5ed4+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x5b9827+_0x45bbe8(0x181)),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0xd881a8,_0x1f4fe3){const _0x340254=_0x8ad5e7,_0x9b0366={'BmQvh':function(_0x20a5c7,_0x542d53){return _0x20a5c7(_0x542d53);},'YVycg':function(_0x3ee500,_0x553a3e){return _0x3ee500 instanceof _0x553a3e;},'CUaFK':_0x340254(0xfd)},_0x5673f6=process[_0x340254(0x128)]['RANGER_TEST_USERNAME'],_0x275c85=process['env'][_0x340254(0x145)],_0x1aefa4={};if(_0x5673f6)_0x1aefa4[_0x340254(0x1aa)]=_0x5673f6;if(_0x275c85)_0x1aefa4[_0x340254(0x133)]=_0x275c85;if(_0x1f4fe3?.['force'])_0x1aefa4['force']=!![];if(_0x1f4fe3?.[_0x340254(0xe3)])_0x1aefa4['target_url']=_0x1f4fe3[_0x340254(0xe3)];if(_0x1f4fe3?.[_0x340254(0x128)])_0x1aefa4['env']=_0x1f4fe3['env'];_0x1f4fe3?.['tunnel']&&(_0x1aefa4[_0x340254(0x17d)]=_0x1f4fe3[_0x340254(0x10d)]['sessionId'],_0x1aefa4[_0x340254(0x14d)]=_0x1f4fe3[_0x340254(0x10d)][_0x340254(0x139)]);try{return await apiRequest('/api/v1/profiles/'+_0x9b0366['BmQvh'](encodeURIComponent,_0xd881a8)+'/login',{'method':_0x340254(0x147),'body':JSON[_0x340254(0x136)](_0x1aefa4)});}catch(_0xc85528){if(_0x9b0366['YVycg'](_0xc85528,ApiError)&&_0xc85528['status']===0x190&&_0xc85528[_0x340254(0x152)]===_0x9b0366[_0x340254(0x15e)])return{'status':_0x340254(0xfd),'error':_0xc85528['detail']};throw _0xc85528;}}function _0x5033(){const _0x4edf44=['\x20\x20Auth\x20env\x20\x22','\x22\x20failed\x20validation\x20—\x20refreshing...','stringify','tunnel_error','\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.','pwEndpoint','log','23288WMxBkm','DELETE','type','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','\x22\x20matched\x20by\x20host\x20for\x20','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','statusText','Cloud\x20profile\x20\x22','VkEJT','detail','RANGER_TEST_PASSWORD','7IfJFVh','POST','connectionId','domains','test_output','storageStatePath','MqwAR','pw_endpoint','\x20\x20•\x20capture\x20one\x20(a\x20browser\x20opens):\x20ranger\x20profile\x20add\x20','eVeNr','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','sessionCheckPath','code','baseUrl','sQyWk','\x22,\x20cached\x20locally','XhJGV','launch','auth_config','ojWkD','DUTlo','aXNCp','keys','environmentKey','CUaFK','wHehf','\x20\x20No\x20live\x20session\x20for\x20\x22','uYmhz','fovsH','\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a','host','\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...','Xtfqv','join','RANGER_TEST_USERNAME','QvwRp','cli:manual-login','xYRNV','KhMZg','cXBAg','UXLrk','url','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','newPage','dlnha','vFpfE','ejJhd','niqXF','2092386qMlHMT','EdmJs','name','API\x20request\x20',');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.','clientIp','tunnel_session_id','environment_key','\x20\x20•\x20or\x20pass\x20--env\x20<key>\x20to\x20run\x20an\x20automated\x20login\x20for\x20this\x20target.','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22','VdcTy','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','azOue','key','lTuCe','message','3662196ADAqVJ','loginInstructions','RDtmB','\x22,\x20refreshing\x20session...','tunnel_login_cleanup','trackPhaseEnd','468340ovuvXb','tunnel_login_setup','XRWRV','4WEBgAr','forceLogin','\x22.\x0a','pAMuR','persistSessionState','trim','trackPhaseError','raw','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','XkyNp','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','\x20--url\x20','tunnel_bridge','origin','LTPDW','ZLMEv','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','prompt','length','toLowerCase','PUT','status','session_state','nJniG','username','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','yiqcB','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','HCNro','about:blank','cookies','170320XIQpZL','targetUrl','\x22,\x20and\x20cloud\x20sessions\x20don\x27t\x20apply\x20to\x20localhost.\x0a','sessionId','QTPGB','319rHIcrk','close','userAgent','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','\x20\x20Created\x20cloud\x20profile\x20\x22','\x22;\x20using\x20\x22','setupHeaders','\x22\x20instead.','none','sgNoP','fQzCn','Fwajk','environments','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22','FTOZm','QIrqn','/api/v1/profiles','assertedEnv','2763gnEldu','\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.','trackPhaseStart','not_configured','XFXVz','error','Bearer\x20','AdehP','\x20Available:\x20','local_ws_error','281787iXOwIU','\x22;\x20proceeding\x20with\x20loginInstructions.','force','gBSFS','catch','XEoNg','VzwWn','pEyQb','IILTK','tunnel','application/json','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','BJDSm','oKZzu','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','PtmOG','nkFsh','organizationId','settings','LRQDV','gRokC','LxIGq','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','profiles','envKey','elapsedMs','\x22,\x20attempting\x20login...','\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a','Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20(','agent','0|4|2|1|3','telemetry','wsEndpoint','404295ZXLgch','xYhdk','nAqbE','env','invalidateOn','4uwHqfp','sessionState','buuDm','\x20\x20Cloud\x20profile\x20\x22','\x22\x20not\x20found.','toISOString','\x20\x20Options:\x0a','jKFTE','/api/v1/profiles/','password'];_0x5033=function(){return _0x4edf44;};return _0x5033();}async function serverSideLoginWithOptionalTunnel(_0x560c75,_0x55d354,_0xa06fc8={}){const _0x56f024=_0x8ad5e7,_0x3d385d={'niqXF':'tunnel_login_request','PtmOG':function(_0x7c021e,_0x58d26e){return _0x7c021e(_0x58d26e);},'LQWdS':function(_0x76243,_0x353f31){return _0x76243(_0x353f31);},'VkEJT':function(_0x4f6554,_0x4e8558){return _0x4f6554===_0x4e8558;},'MAUCH':'true','HCNro':'tunnel_login_setup','buuDm':function(_0x2e39f9,_0x1dde08,_0x27b7c3){return _0x2e39f9(_0x1dde08,_0x27b7c3);},'Xtfqv':function(_0x3d94f5,_0x1d9210){return _0x3d94f5(_0x1d9210);},'myMeZ':_0x56f024(0x122),'QACSs':_0x56f024(0x18d)};if(!needsTunnel(_0x55d354))return await serverSideLogin(_0x560c75,{'force':_0xa06fc8[_0x56f024(0x106)],'env':_0xa06fc8[_0x56f024(0x128)]});let _0x13fc31=null,_0x1b19e6=null,_0x122caf=null,_0x36ec74=null,_0x3f2bcf=![];const _0x60678d=process['env']['RANGER_TUNNEL_LOGIN_HEADED']?.[_0x56f024(0x1a5)](),_0x1e9558=_0x3d385d['VkEJT'](_0x60678d,'1')||_0x3d385d[_0x56f024(0x143)](_0x60678d,_0x3d385d['MAUCH']),_0x151f51={'profileName':_0x560c75,'targetUrlHost':_0x3d385d[_0x56f024(0x113)](targetHostForTelemetry,_0x55d354),'tunnelRequired':!![],'forceLogin':Boolean(_0xa06fc8[_0x56f024(0x106)]),'localBrowserServerHeaded':_0x1e9558};try{_0xa06fc8[_0x56f024(0x123)]?.[_0x56f024(0xfc)](_0x56f024(0x190),_0x151f51);_0x1e9558&&console[_0x56f024(0x13a)](_0x56f024(0x165));_0x13fc31=await launchBrowserServer({'headless':!_0x1e9558}),_0x1b19e6=await createTunnelSession(_0x55d354);const _0x25b264=await requireToken();_0x122caf=await createTunnelBridge({'localWsUrl':_0x13fc31[_0x56f024(0x124)],'tunnelServerUrl':_0x1b19e6['tunnelUrl'],'sessionId':_0x1b19e6['sessionId'],'apiKey':_0x25b264,'onError':_0x411fc1=>{_0x36ec74=_0x411fc1;},'onClose':()=>{_0x36ec74??=new Error('Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20'+_0x560c75);},'onEvent':_0x2a3c28=>trackBridgeEvent(_0xa06fc8[_0x56f024(0x123)],_0x2a3c28)}),_0xa06fc8['telemetry']?.[_0x56f024(0x18e)](_0x3d385d[_0x56f024(0xdf)],{..._0x151f51,'tunnelSessionId':_0x1b19e6['sessionId'],'localBrowserServer':!![],'localBrowserServerHeaded':_0x1e9558}),_0x3f2bcf=!![];try{return _0xa06fc8[_0x56f024(0x123)]?.[_0x56f024(0xfc)]('tunnel_login_request',{..._0x151f51,'tunnelSessionId':_0x1b19e6[_0x56f024(0xe5)]}),await _0x3d385d[_0x56f024(0x12c)](serverSideLogin,_0x560c75,{'force':_0xa06fc8[_0x56f024(0x106)],'targetUrl':_0x55d354,'env':_0xa06fc8['env'],'tunnel':{'sessionId':_0x1b19e6['sessionId'],'pwEndpoint':_0x1b19e6[_0x56f024(0x139)]}})['then'](_0x15d5ce=>{const _0x274977=_0x56f024;return _0xa06fc8['telemetry']?.[_0x274977(0x18e)](_0x3d385d[_0x274977(0x176)],{..._0x151f51,'tunnelSessionId':_0x1b19e6?.[_0x274977(0xe5)],'loginStatus':_0x15d5ce[_0x274977(0x1a7)],'hasSessionState':_0x3d385d[_0x274977(0x113)](Boolean,_0x15d5ce[_0x274977(0x1a8)]),'hasTestOutput':Boolean(_0x15d5ce['test_output']),'bridgeError':_0x3d385d['LQWdS'](errorMessageForTelemetry,_0x36ec74)}),_0x15d5ce;});}catch(_0x14df07){await _0xa06fc8[_0x56f024(0x123)]?.[_0x56f024(0x198)](_0x3d385d['niqXF'],_0x36ec74??_0x14df07,{..._0x151f51,'tunnelSessionId':_0x1b19e6[_0x56f024(0xe5)],'bridgeError':_0x3d385d[_0x56f024(0x166)](errorMessageForTelemetry,_0x36ec74)});throw _0x36ec74??_0x14df07;}}catch(_0xc94993){!_0x3f2bcf&&await _0xa06fc8[_0x56f024(0x123)]?.[_0x56f024(0x198)](_0x3d385d[_0x56f024(0xdf)],_0xc94993,{..._0x151f51,'tunnelSessionId':_0x1b19e6?.['sessionId']});throw _0xc94993;}finally{if(_0x1b19e6||_0x13fc31||_0x122caf){const _0x3e7167=_0x3d385d['myMeZ']['split']('|');let _0x4c0037=0x0;while(!![]){switch(_0x3e7167[_0x4c0037++]){case'0':_0xa06fc8[_0x56f024(0x123)]?.['trackPhaseStart']('tunnel_login_cleanup',{..._0x151f51,'tunnelSessionId':_0x1b19e6?.[_0x56f024(0xe5)]});continue;case'1':_0x1b19e6&&await deleteTunnelSession(_0x1b19e6[_0x56f024(0xe5)])['catch'](()=>{});continue;case'2':_0x13fc31&&await _0x13fc31[_0x56f024(0xe8)]()[_0x56f024(0x108)](()=>{});continue;case'3':_0xa06fc8[_0x56f024(0x123)]?.[_0x56f024(0x18e)](_0x3d385d['QACSs'],{..._0x151f51,'tunnelSessionId':_0x1b19e6?.['sessionId']});continue;case'4':_0x122caf?.[_0x56f024(0xe8)]();continue;}break;}}}}export async function manualBrowserLogin(_0x2fda9f,_0x18b6b7,_0x23c29f={}){const _0x20a951=_0x8ad5e7,_0x4cac94={'Yybql':function(_0x4dd723){return _0x4dd723();},'dcvJv':function(_0x29350f,_0x23c492){return _0x29350f+_0x23c492;},'beXgr':function(_0x3027f3,_0x4cca1f){return _0x3027f3+_0x4cca1f;},'aLpJf':function(_0x7715d3,_0x10f5fa){return _0x7715d3>_0x10f5fa;},'jAkmx':function(_0x2dc692,_0x312c81){return _0x2dc692!==_0x312c81;},'pEyQb':function(_0x37d646,_0x438e8c){return _0x37d646(_0x438e8c);},'XEoNg':'POST'};if(!isInteractive())throw new Error(_0x4cac94['dcvJv'](_0x4cac94['beXgr'](_0x20a951(0xf4)+_0x2fda9f[_0x20a951(0x179)]+'\x22.\x0a',_0x20a951(0xea)),_0x20a951(0xde)));const _0x351864=_0x18b6b7&&_0x4cac94['aLpJf'](_0x18b6b7[_0x20a951(0x149)][_0x20a951(0x1a4)],0x0)?_0x18b6b7[_0x20a951(0x149)][0x0]:_0x20a951(0xe0);console[_0x20a951(0x13a)](_0x20a951(0x1ab)),console['log']('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x2515d4=>setTimeout(_0x2515d4,0x7d0));const _0x4f9c7e=await chromium['launch']({'headless':![]});let _0x105796=null;try{const _0x14e9a7={'ignoreHTTPSErrors':!![]};_0x18b6b7?.['setupHeaders']&&(_0x14e9a7['extraHTTPHeaders']=_0x18b6b7[_0x20a951(0xed)]);const _0x48eb19=await _0x4f9c7e['newContext'](_0x14e9a7);await addProfileSetupBanner(_0x48eb19);const _0x24003a=await _0x48eb19[_0x20a951(0x172)]();await _0x24003a['goto'](_0x351864);let _0x3e549a=![];await new Promise(_0x4d0e84=>{const _0x28cb1f=_0x20a951,_0x174963={'vFpfE':function(_0x1d0572){return _0x4cac94['Yybql'](_0x1d0572);}},_0x2a4f95=setTimeout(()=>{const _0xb49463=_0x56dc;_0x3e549a=!![],console[_0xb49463(0xff)]('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+_0xb49463(0x171)),_0x174963[_0xb49463(0x174)](_0x4d0e84);},MANUAL_LOGIN_TIMEOUT_MS);_0x24003a['on'](_0x28cb1f(0xe8),async()=>{const _0x140fa6=_0x28cb1f;clearTimeout(_0x2a4f95);try{const _0x1beafb=await _0x48eb19['storageState']();_0x105796=_0x1beafb;}catch{}_0x174963[_0x140fa6(0x174)](_0x4d0e84);});});if(_0x3e549a&&!_0x105796)throw new Error('Browser\x20login\x20timed\x20out\x20before\x20completion.');}finally{await _0x4f9c7e[_0x20a951(0xe8)]()['catch'](()=>{});}if(!_0x105796)throw new Error(_0x20a951(0x19c));return _0x4cac94['jAkmx'](_0x23c29f[_0x20a951(0x196)],![])&&await apiRequest('/api/v1/profiles/'+_0x4cac94[_0x20a951(0x10b)](encodeURIComponent,_0x2fda9f[_0x20a951(0x179)])+'/session',{'method':_0x4cac94[_0x20a951(0x109)],'body':JSON['stringify']({'session_state':_0x105796,'updated_by':_0x20a951(0x16a)})}),{'sessionState':_0x105796};}export async function promptSaveCredentials(_0x3c1902){const _0x15576a=_0x8ad5e7,_0x22172c={'wHehf':'confirm','FyqKa':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?'},_0x39ab36=process[_0x15576a(0x128)]['RANGER_TEST_USERNAME'],_0x3f9d1d=process[_0x15576a(0x128)]['RANGER_TEST_PASSWORD'];if(!_0x39ab36||!_0x3f9d1d)return;if(!isInteractive())return;const {save:_0x32feda}=await _0x41d1e4[_0x15576a(0x1a3)]([{'type':_0x22172c[_0x15576a(0x15f)],'name':'save','message':_0x22172c['FyqKa'],'default':![]}]);if(!_0x32feda)return;await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x3c1902),{'method':_0x15576a(0x1a6),'body':JSON['stringify']({'username':_0x39ab36,'password':_0x3f9d1d})}),console[_0x15576a(0x13a)](_0x15576a(0x140));}export async function resolveCloudProfileSession(_0x542218,_0x5d5dfd={}){const _0x5007ab=_0x8ad5e7,_0x4d63a4={'RDtmB':function(_0x669c77,_0x57b254){return _0x669c77===_0x57b254;},'oKZzu':'string','FTOZm':function(_0xfe51db,_0x49b2fc){return _0xfe51db(_0x49b2fc);},'EZdbK':function(_0x9e020c,_0x159c3a,_0x1e2e85,_0x51eb3d,_0x3802b6,_0x2fd0da){return _0x9e020c(_0x159c3a,_0x1e2e85,_0x51eb3d,_0x3802b6,_0x2fd0da);},'KhMZg':function(_0x53c1d7,_0x42a49d){return _0x53c1d7&&_0x42a49d;},'ZLMEv':function(_0x4e0043,_0x4610f2,_0x412c79){return _0x4e0043(_0x4610f2,_0x412c79);},'VzwWn':function(_0x48894a,_0x2e1ecd){return _0x48894a||_0x2e1ecd;},'gBSFS':function(_0x5f0505,_0x4441a5){return _0x5f0505===_0x4441a5;},'nAqbE':'\x20\x20Login\x20successful.\x20Session\x20cached.','IILTK':_0x5007ab(0x19a),'azOue':function(_0x961abb,_0x3e8afb){return _0x961abb instanceof _0x3e8afb;},'UXLrk':function(_0x6aab9c){return _0x6aab9c();},'nJniG':function(_0x832baa,_0xfbb996){return _0x832baa+_0xfbb996;},'LxIGq':function(_0x37f979,_0x515eda,_0x19f882,_0x1f96ab){return _0x37f979(_0x515eda,_0x19f882,_0x1f96ab);}},_0x420de9=_0x542218['settings']??{},_0x49d053=await fetchAuthConfig(),_0x32f4e1=_0x49d053?resolveAuthEnvironmentLocally(_0x49d053,_0x5d5dfd['assertedEnv']??_0x542218[_0x5007ab(0x15d)]):null,_0x2af12e=_0x4d63a4[_0x5007ab(0x18b)](typeof _0x32f4e1?.['loginInstructions'],_0x4d63a4[_0x5007ab(0x111)])&&_0x32f4e1['loginInstructions']['trim']()?_0x32f4e1['loginInstructions']:undefined,_0x50ca94=typeof _0x420de9['loginInstructions']==='string'&&_0x420de9[_0x5007ab(0x18a)][_0x5007ab(0x197)]()?_0x420de9[_0x5007ab(0x18a)]:undefined,_0x2ced7=_0x50ca94||!_0x2af12e?_0x420de9:{..._0x420de9,'loginInstructions':_0x2af12e},_0x4f326b=_0x4d63a4[_0x5007ab(0xf6)](Boolean,_0x2ced7['loginInstructions']?.[_0x5007ab(0x197)]()),_0x46efdf=Boolean(_0x420de9['forceLogin']||_0x32f4e1?.[_0x5007ab(0x193)]),_0x57821b=_0x32f4e1?.[_0x5007ab(0x149)],_0x5d00b6=_0x420de9[_0x5007ab(0xed)],_0x3b1eee=_0x5d00b6??_0x32f4e1?.['setupHeaders'],_0x2c39f3=_0x5d5dfd['effectiveBaseUrl']??_0x420de9[_0x5007ab(0x153)]??(_0x57821b&&_0x57821b[_0x5007ab(0x1a4)]>0x0?_0x57821b[0x0]:''),_0x3cdfcf=_0x2c39f3?needsTunnel(_0x2c39f3):![],_0x421e6a={'invalidateOn':_0x32f4e1?.[_0x5007ab(0x129)],'userAgent':_0x32f4e1?.['browserOptions']?.[_0x5007ab(0xe9)]??_0x420de9['userAgent']};_0x46efdf&&console[_0x5007ab(0x13a)]('\x20\x20forceLogin\x20enabled\x20for\x20\x22'+_0x542218['name']+_0x5007ab(0x18c));if(!_0x46efdf){const _0x2de93c=await _0x4d63a4['EZdbK'](checkLocalCache,_0x542218[_0x5007ab(0x179)],_0x542218[_0x5007ab(0x115)],_0x2c39f3,_0x3b1eee,_0x421e6a);if(_0x2de93c){if(_0x4d63a4[_0x5007ab(0x16c)](_0x2c39f3,!_0x3cdfcf)){const _0xcb4cdf=await isCachedSessionLive(_0x2de93c[_0x5007ab(0x14b)],_0x2c39f3,{'sessionCheckPath':_0x32f4e1?.[_0x5007ab(0x151)],'setupHeaders':_0x3b1eee},{'launchBrowser':launchRealBrowser});if(_0xcb4cdf)return console['log'](_0x5007ab(0x1ad)+_0x542218[_0x5007ab(0x179)]+'\x22'),{'authPath':_0x2de93c[_0x5007ab(0x14b)],'settings':_0x2ced7,'resolvedEnv':_0x32f4e1};console[_0x5007ab(0x13a)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0x542218[_0x5007ab(0x179)]+_0x5007ab(0x135)),emitSessionValidationHint(_0x2c39f3,_0x32f4e1);}else return _0x3cdfcf&&console[_0x5007ab(0x13a)](_0x5007ab(0x13e)+_0x542218['name']+'\x22'),{'authPath':_0x2de93c['storageStatePath'],'settings':_0x2ced7,'resolvedEnv':_0x32f4e1};}}if(!_0x46efdf&&_0x542218['sessionState']){const _0xfe114e=await writeSessionToLocalCache(_0x542218['name'],_0x542218['organizationId'],_0x2c39f3,_0x3b1eee,_0x542218[_0x5007ab(0x12b)],_0x57821b,_0x421e6a);if(_0x2c39f3){const _0x27de47=await isCachedSessionLive(_0xfe114e,_0x2c39f3,{'sessionCheckPath':_0x32f4e1?.[_0x5007ab(0x151)],'setupHeaders':_0x3b1eee},{'launchBrowser':launchRealBrowser});if(_0x27de47)return console[_0x5007ab(0x13a)](_0x5007ab(0x170)+_0x542218[_0x5007ab(0x179)]+_0x5007ab(0x155)),{'authPath':_0xfe114e,'settings':_0x2ced7,'resolvedEnv':_0x32f4e1};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x542218[_0x5007ab(0x179)]+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),_0x4d63a4[_0x5007ab(0x1a1)](emitSessionValidationHint,_0x2c39f3,_0x32f4e1);}else return{'authPath':_0xfe114e,'settings':_0x2ced7,'resolvedEnv':_0x32f4e1};}if(_0x4f326b)return console[_0x5007ab(0x13a)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x542218[_0x5007ab(0x179)]+_0x5007ab(0x105)),{'authPath':undefined,'settings':_0x2ced7,'resolvedEnv':_0x32f4e1};console[_0x5007ab(0x13a)](_0x5007ab(0x160)+_0x542218['name']+_0x5007ab(0x11e));const _0x183db5=Boolean(process['env'][_0x5007ab(0x168)])&&Boolean(process[_0x5007ab(0x128)]['RANGER_TEST_PASSWORD']),_0x3089dc=Boolean(_0x542218[_0x5007ab(0x1aa)]),_0x58d1cd=_0x4d63a4[_0x5007ab(0xf6)](Boolean,_0x5d5dfd[_0x5007ab(0xf9)]),_0x44b34c=_0x2c39f3?isBareLocalhost(_0x2c39f3):![],_0x5b39c7=(_0x183db5||_0x3089dc)&&_0x4d63a4[_0x5007ab(0x10a)](!_0x44b34c,_0x58d1cd);if(_0x5b39c7)try{const _0x456699=_0x2c39f3?await serverSideLoginWithOptionalTunnel(_0x542218[_0x5007ab(0x179)],_0x2c39f3,{'force':_0x46efdf,'telemetry':_0x5d5dfd[_0x5007ab(0x123)],'env':_0x5d5dfd['assertedEnv']}):await _0x4d63a4[_0x5007ab(0x1a1)](serverSideLogin,_0x542218[_0x5007ab(0x179)],{'force':_0x46efdf,'env':_0x5d5dfd['assertedEnv']});if(_0x4d63a4[_0x5007ab(0x107)](_0x456699['status'],'not_configured'))console[_0x5007ab(0x13a)](_0x5007ab(0x112));else{if(_0x456699[_0x5007ab(0x1a7)]==='success'&&_0x456699['session_state']){console[_0x5007ab(0x13a)](_0x4d63a4[_0x5007ab(0x127)]);const _0x1d3e81=await writeSessionToLocalCache(_0x542218[_0x5007ab(0x179)],_0x542218['organizationId'],_0x2c39f3,_0x3b1eee,_0x456699[_0x5007ab(0x1a8)],_0x57821b,_0x421e6a);return _0x183db5&&!_0x3089dc&&await _0x4d63a4[_0x5007ab(0xf6)](promptSaveCredentials,_0x542218[_0x5007ab(0x179)]),{'authPath':_0x1d3e81,'settings':_0x2ced7,'resolvedEnv':_0x32f4e1};}else _0x456699[_0x5007ab(0x14a)]&&(console['log'](_0x4d63a4[_0x5007ab(0x10c)]),console[_0x5007ab(0x13a)](_0x456699[_0x5007ab(0x14a)])),console['log'](_0x5007ab(0x150));}}catch(_0x401aa0){console[_0x5007ab(0x13a)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x4d63a4[_0x5007ab(0x185)](_0x401aa0,Error)?_0x401aa0['message']:String(_0x401aa0))),console[_0x5007ab(0x13a)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}if(_0x44b34c&&!_0x58d1cd&&!_0x4d63a4[_0x5007ab(0x16e)](isInteractive))throw new Error(_0x4d63a4[_0x5007ab(0x1a9)]('No\x20saved\x20session\x20for\x20\x22'+_0x2c39f3+'\x22\x20on\x20profile\x20\x22'+_0x542218[_0x5007ab(0x179)]+_0x5007ab(0xe4)+(_0x5007ab(0x14e)+_0x542218['name']+_0x5007ab(0x19d)+_0x2c39f3+'\x0a'),_0x5007ab(0x17f)));const _0x5ee639=_0x32f4e1?{..._0x32f4e1,'domains':_0x4d63a4['ZLMEv'](orderLoginDomains,_0x2c39f3,_0x32f4e1['domains']),'setupHeaders':_0x3b1eee}:_0x2c39f3?{'key':_0x542218[_0x5007ab(0x15d)]??'','domains':[_0x2c39f3],'setupHeaders':_0x3b1eee}:null,{sessionState:_0x5db97a}=await _0x4d63a4[_0x5007ab(0x119)](manualBrowserLogin,_0x542218,_0x5ee639,{'persistSessionState':!_0x3cdfcf}),_0x18cc81=await writeSessionToLocalCache(_0x542218[_0x5007ab(0x179)],_0x542218[_0x5007ab(0x115)],_0x2c39f3,_0x3b1eee,_0x5db97a,_0x57821b,_0x421e6a);return{'authPath':_0x18cc81,'settings':_0x2ced7,'resolvedEnv':_0x32f4e1};}
@@ -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
+ (function(_0x473c94,_0x2ab4b4){const _0x4135bb=_0x4cfb,_0x219d02=_0x473c94();while(!![]){try{const _0x237208=parseInt(_0x4135bb(0x96))/0x1*(-parseInt(_0x4135bb(0x8f))/0x2)+-parseInt(_0x4135bb(0x94))/0x3+-parseInt(_0x4135bb(0xa6))/0x4*(-parseInt(_0x4135bb(0xab))/0x5)+parseInt(_0x4135bb(0x90))/0x6+-parseInt(_0x4135bb(0x81))/0x7*(parseInt(_0x4135bb(0xad))/0x8)+parseInt(_0x4135bb(0x7e))/0x9*(parseInt(_0x4135bb(0x7c))/0xa)+parseInt(_0x4135bb(0x9a))/0xb*(parseInt(_0x4135bb(0x9d))/0xc);if(_0x237208===_0x2ab4b4)break;else _0x219d02['push'](_0x219d02['shift']());}catch(_0x39692b){_0x219d02['push'](_0x219d02['shift']());}}}(_0x1721,0x29e9c));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';function _0x4cfb(_0x88302d,_0xc6c798){_0x88302d=_0x88302d-0x75;const _0x172138=_0x1721();let _0x4cfbf1=_0x172138[_0x88302d];return _0x4cfbf1;}export function isInteractive(_0x12cea0=process['env'],_0x5d9139={'stdin':process['stdin'],'stdout':process['stdout']}){const _0x4c4d85=_0x4cfb,_0x292692={'kzuSc':function(_0x2ce93d,_0x1f5986){return _0x2ce93d(_0x1f5986);}};if(_0x12cea0['CI'])return![];return _0x292692[_0x4c4d85(0x8a)](Boolean,_0x5d9139[_0x4c4d85(0x9e)]['isTTY'])&&_0x292692[_0x4c4d85(0x8a)](Boolean,_0x5d9139[_0x4c4d85(0xa2)]['isTTY']);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x3ddb10){const _0x418f87=_0x4cfb,_0x271d95={'zUDfW':function(_0xd6bfce,_0x5af89c){return _0xd6bfce(_0x5af89c);},'mIhNk':'baseUrl','TOFgN':'setupHeaders','oGXBF':_0x418f87(0x88),'QtRcD':'userAgent','IQAGW':function(_0x54488c,_0x2a06b1){return _0x54488c!==_0x2a06b1;},'fsulc':_0x418f87(0x84),'nxRiK':function(_0x1ff17b,_0x23e6f9){return _0x1ff17b!==_0x23e6f9;},'wlkjf':function(_0x331ac0,_0x533134){return _0x331ac0(_0x533134);},'YBmpv':'hex'},_0x19b1f2=new Set(_0x3ddb10[_0x418f87(0xa8)]??DEFAULT_INVALIDATE_ON);_0x3ddb10[_0x418f87(0x8e)]&&_0x271d95[_0x418f87(0x7d)](needsTunnel,_0x3ddb10['effectiveBaseUrl'])&&_0x19b1f2['add'](_0x271d95[_0x418f87(0xa5)]);const _0x4450fc={'orgId':_0x3ddb10[_0x418f87(0x97)],'profileName':_0x3ddb10['profileName']};return _0x19b1f2[_0x418f87(0xae)](_0x271d95['mIhNk'])&&(_0x4450fc['effectiveBaseUrl']=_0x3ddb10['effectiveBaseUrl']),_0x19b1f2['has'](_0x271d95['TOFgN'])&&(_0x4450fc['setupHeaders']=_0x3ddb10['setupHeaders']?sortObjectKeys(_0x3ddb10[_0x418f87(0x82)]):_0x3ddb10[_0x418f87(0x82)]),_0x19b1f2[_0x418f87(0xae)](_0x271d95['oGXBF'])&&(_0x4450fc['port']=extractPort(_0x3ddb10['effectiveBaseUrl'])),_0x19b1f2['has'](_0x271d95[_0x418f87(0x9c)])&&_0x271d95[_0x418f87(0xa9)](_0x3ddb10['userAgent'],undefined)&&(_0x4450fc[_0x418f87(0x8c)]=_0x3ddb10['userAgent']),_0x19b1f2[_0x418f87(0xae)](_0x271d95[_0x418f87(0x7a)])&&_0x271d95[_0x418f87(0xa0)](_0x3ddb10[_0x418f87(0x84)],undefined)&&(_0x4450fc['clientIp']=_0x3ddb10[_0x418f87(0x84)]),_0x271d95['wlkjf'](createHash,_0x418f87(0x80))[_0x418f87(0x7b)](JSON[_0x418f87(0x7f)](_0x4450fc))['digest'](_0x271d95['YBmpv'])[_0x418f87(0x85)](0x0,0xc);}function extractPort(_0x148e28){const _0x2442e9=_0x4cfb;try{return new URL(_0x148e28)[_0x2442e9(0x88)];}catch{return'';}}function sortObjectKeys(_0x573ace){const _0x2cdf72=_0x4cfb,_0x14d954={};for(const _0xa2aae of Object[_0x2cdf72(0x75)](_0x573ace)[_0x2cdf72(0x9b)]()){_0x14d954[_0xa2aae]=_0x573ace[_0xa2aae];}return _0x14d954;}export function getSessionCachePath(_0x3d22ae,_0x2b4ee3){const _0x3262f0=_0x4cfb,_0x325c9e={'rmnLw':function(_0x2216dc){return _0x2216dc();}};return join(_0x325c9e['rmnLw'](getRangerHomeDir),_0x3262f0(0xa3),_0x3d22ae+'-'+_0x2b4ee3+'.json');}export function getStorageStatePath(_0x55095c){const _0x3d31a1=_0x4cfb;return _0x55095c[_0x3d31a1(0x8d)](/\.json$/,'.storageState.json');}export function needsTunnel(_0x15511b){const _0x28da7c=_0x4cfb,_0x33ece6={'rgZCO':function(_0x33e0fb,_0x184e35){return _0x33e0fb===_0x184e35;},'KWJXE':'localhost','EcymB':_0x28da7c(0x89),'cvKgw':'localhost.'};let _0x451f73;try{_0x451f73=new URL(_0x15511b)[_0x28da7c(0x76)];}catch{return![];}if(_0x33ece6[_0x28da7c(0x8b)](_0x451f73,_0x33ece6['KWJXE'])||_0x33ece6[_0x28da7c(0x8b)](_0x451f73,_0x33ece6[_0x28da7c(0x95)]))return!![];if(_0x451f73['endsWith'](_0x28da7c(0x91)))return!![];if(_0x451f73[_0x28da7c(0x93)](_0x33ece6['cvKgw']))return!![];return![];}export function isBareLocalhost(_0x884cbf){const _0x333090=_0x4cfb,_0x5e8358={'xJVZN':function(_0x18c9db,_0x108214){return _0x18c9db===_0x108214;},'DqZQD':'localhost','Umohb':_0x333090(0xaa),'Mvyca':function(_0x462c5b,_0x4f827e){return _0x462c5b===_0x4f827e;},'TOyMZ':_0x333090(0x87)};let _0x14f341;try{_0x14f341=new URL(_0x884cbf)['hostname'];}catch{return![];}return _0x5e8358['xJVZN'](_0x14f341,_0x5e8358['DqZQD'])||_0x5e8358[_0x333090(0x78)](_0x14f341,'127.0.0.1')||_0x14f341===_0x5e8358['Umohb']||_0x5e8358[_0x333090(0x83)](_0x14f341,_0x5e8358['TOyMZ']);}export function orderLoginDomains(_0x302d83,_0x2c1e38){const _0x142f2f=_0x2c1e38??[];if(!_0x302d83)return _0x142f2f;return[_0x302d83,..._0x142f2f['filter'](_0x3deee3=>_0x3deee3!==_0x302d83)];}export function hostnameOf(_0x59e6ce){return new URL(_0x59e6ce)['hostname'];}export function duplicateCookiesForDomains(_0x289108,_0x1524aa){const _0x3e3a59=_0x4cfb,_0x73805={'VtIms':function(_0x53d709,_0x5b286b){return _0x53d709(_0x5b286b);}},_0x362d58=[..._0x289108],_0x59ec10=new Set(_0x289108[_0x3e3a59(0x9f)](_0x2b1ab3=>_0x2b1ab3[_0x3e3a59(0xa7)]));for(const _0x119749 of _0x1524aa){let _0x561e39;try{_0x561e39=_0x73805[_0x3e3a59(0x79)](hostnameOf,_0x119749);}catch{continue;}if(!_0x561e39)continue;const _0x4bcb9c=_0x561e39[_0x3e3a59(0x86)]('.')?_0x561e39:'.'+_0x561e39;if(_0x59ec10['has'](_0x561e39)||_0x59ec10[_0x3e3a59(0xae)](_0x4bcb9c))continue;for(const _0x3a6e99 of _0x289108){_0x362d58['push']({..._0x3a6e99,'domain':_0x4bcb9c});}_0x59ec10[_0x3e3a59(0x98)](_0x4bcb9c);}return _0x362d58;}export function resolveAuthEnvironmentLocally(_0x5cd37a,_0x300193){const _0x1e212e=_0x4cfb,_0x41a470={'gzctK':function(_0x232875,_0x521bf4){return _0x232875===_0x521bf4;}},_0x235d38=_0x5cd37a['environments'];if(_0x300193){const _0x3e3ac7=_0x235d38[_0x300193];if(!_0x3e3ac7)return null;return{'key':_0x300193,..._0x3e3ac7};}if(_0x5cd37a[_0x1e212e(0x99)]){const _0x53e823=_0x235d38[_0x5cd37a[_0x1e212e(0x99)]];if(!_0x53e823)return null;return{'key':_0x5cd37a[_0x1e212e(0x99)],..._0x53e823};}const _0x3912c6=Object[_0x1e212e(0x75)](_0x235d38);if(_0x41a470[_0x1e212e(0x92)](_0x3912c6['length'],0x1)){const _0x25186e=_0x3912c6[0x0];return{'key':_0x25186e,..._0x235d38[_0x25186e]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;function _0x1721(){const _0x9fe66c=['Mvyca','clientIp','slice','startsWith','[::1]','port','127.0.0.1','kzuSc','rgZCO','userAgent','replace','effectiveBaseUrl','2XUrdMq','455136RIkrir','.localhost','gzctK','includes','228609jSqntO','EcymB','128689bzVLGc','orgId','add','defaultEnvironmentKey','11VDqgZS','sort','QtRcD','1020372GbMrqI','stdin','map','nxRiK','domcontentloaded','stdout','auth','launchBrowser','mIhNk','4xIqTXi','domain','invalidateOn','IQAGW','::1','711175QrjxPX','test','25912yqlzTE','has','keys','hostname','toString','xJVZN','VtIms','fsulc','update','2730SbsnAY','zUDfW','4023QUXGsN','stringify','sha256','105xdIkby','setupHeaders'];_0x1721=function(){return _0x9fe66c;};return _0x1721();}export function buildSessionCheckUrl(_0x70318b,_0x7df277){const _0x2ebd64=_0x4cfb;try{if(_0x7df277)return new URL(_0x7df277,_0x70318b)[_0x2ebd64(0x77)]();return new URL(_0x70318b)[_0x2ebd64(0x77)]();}catch{return null;}}export function looksLikeLoginUrl(_0x242bce){const _0x511d32=_0x4cfb;try{const _0x54b30b=new URL(_0x242bce);return LOGIN_URL_PATTERN[_0x511d32(0xac)](_0x54b30b['pathname']);}catch{return LOGIN_URL_PATTERN['test'](_0x242bce);}}export async function isCachedSessionLive(_0x439713,_0x3236c7,_0x2f3f9e={},_0x37ab82={}){const _0x1f0789=_0x4cfb,_0x3c1a9f={'ZwEmL':function(_0x3051f1,_0x5be342,_0x215b5d){return _0x3051f1(_0x5be342,_0x215b5d);}},_0x59e2e8=_0x3c1a9f['ZwEmL'](buildSessionCheckUrl,_0x3236c7,_0x2f3f9e['sessionCheckPath']);if(!_0x59e2e8)return!![];if(!_0x37ab82['launchBrowser'])return!![];let _0x370a83=null;try{_0x370a83=await _0x37ab82[_0x1f0789(0xa4)]();const _0x282cfc=await _0x370a83['newContext']({'storageState':_0x439713,'ignoreHTTPSErrors':!![],..._0x2f3f9e[_0x1f0789(0x82)]?{'extraHTTPHeaders':_0x2f3f9e[_0x1f0789(0x82)]}:{}}),_0x5344f6=await _0x282cfc['newPage'](),_0x416d0f=await _0x5344f6['goto'](_0x59e2e8,{'waitUntil':_0x1f0789(0xa1),'timeout':0x3a98}),_0x22b3f0=_0x416d0f?.['status']();if(_0x22b3f0===0x191||_0x22b3f0===0x193)return![];const _0x3722ba=_0x5344f6['url']();if(looksLikeLoginUrl(_0x3722ba))return![];return!![];}catch{return![];}finally{if(_0x370a83)await _0x370a83['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
+ const _0x467fe3=_0x4289;(function(_0x43f50c,_0x50d3d3){const _0x41600b=_0x4289,_0x3d8268=_0x43f50c();while(!![]){try{const _0x2e7a37=-parseInt(_0x41600b(0x13f))/0x1+-parseInt(_0x41600b(0x143))/0x2+-parseInt(_0x41600b(0x139))/0x3*(parseInt(_0x41600b(0x13d))/0x4)+parseInt(_0x41600b(0x140))/0x5*(parseInt(_0x41600b(0x12e))/0x6)+parseInt(_0x41600b(0x12f))/0x7+-parseInt(_0x41600b(0x135))/0x8+parseInt(_0x41600b(0x13c))/0x9*(parseInt(_0x41600b(0x13a))/0xa);if(_0x2e7a37===_0x50d3d3)break;else _0x3d8268['push'](_0x3d8268['shift']());}catch(_0x194ea5){_0x3d8268['push'](_0x3d8268['shift']());}}}(_0x20cc,0x7e2c0));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT=_0x467fe3(0x131),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0x20cc(){const _0x54b19f=['utf8','ranger-auth-encryption','sha256','hoWMU','setAuthTag','283056QUmLfO','subarray','final','update','99NxYXaK','30NHsLId','MPhiC','3324042jIMsNV','67624ouQEKS','aPNNp','468985xRsoxZ','5olUmJj','bJMjk','concat','886322RcypkD','697914FZNhDo','5585251EVehvE'];_0x20cc=function(){return _0x54b19f;};return _0x20cc();}export function deriveKey(_0x27c655){const _0x14643d=_0x467fe3,_0x1ce08e={'aPNNp':function(_0x4d0a50,_0x198059,_0x38b9e4,_0x1f260a,_0x2c975c,_0x42b6ba){return _0x4d0a50(_0x198059,_0x38b9e4,_0x1f260a,_0x2c975c,_0x42b6ba);},'hoWMU':_0x14643d(0x132)};return _0x1ce08e[_0x14643d(0x13e)](pbkdf2Sync,_0x27c655,SALT,0x186a0,KEY_LENGTH,_0x1ce08e[_0x14643d(0x133)]);}function _0x4289(_0x231cdd,_0x1ea85d){_0x231cdd=_0x231cdd-0x12e;const _0x20cc16=_0x20cc();let _0x428996=_0x20cc16[_0x231cdd];return _0x428996;}export function encrypt(_0xb0aaac,_0x34e340){const _0x12602b=_0x467fe3,_0x8671df={'bJMjk':function(_0x484e6c,_0x36068f,_0x277f55,_0x310297){return _0x484e6c(_0x36068f,_0x277f55,_0x310297);}},_0x5c522e=deriveKey(_0x34e340),_0x5f3482=randomBytes(IV_LENGTH),_0x3d80f3=_0x8671df[_0x12602b(0x141)](createCipheriv,ALGORITHM,_0x5c522e,_0x5f3482),_0x2df5e7=Buffer['concat']([_0x3d80f3[_0x12602b(0x138)](_0xb0aaac,_0x12602b(0x130)),_0x3d80f3[_0x12602b(0x137)]()]),_0x23aeb3=_0x3d80f3['getAuthTag']();return Buffer[_0x12602b(0x142)]([_0x5f3482,_0x23aeb3,_0x2df5e7]);}export function decrypt(_0x4add72,_0x34c3ce){const _0x37de96=_0x467fe3,_0x2bce59={'MPhiC':function(_0x5b2fbe,_0x8afb72){return _0x5b2fbe+_0x8afb72;}},_0x108a4b=deriveKey(_0x34c3ce),_0x767120=_0x4add72[_0x37de96(0x136)](0x0,IV_LENGTH),_0x3f1aca=_0x4add72['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x552ed7=_0x4add72[_0x37de96(0x136)](_0x2bce59[_0x37de96(0x13b)](IV_LENGTH,TAG_LENGTH)),_0x32acbf=createDecipheriv(ALGORITHM,_0x108a4b,_0x767120);return _0x32acbf[_0x37de96(0x134)](_0x3f1aca),_0x2bce59['MPhiC'](_0x32acbf['update'](_0x552ed7),_0x32acbf['final']('utf8'));}
@@ -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 _0x14dd05=_0x4db3;function _0x4db3(_0xdf9c16,_0x5ae852){_0xdf9c16=_0xdf9c16-0x172;const _0x2beace=_0x2bea();let _0x4db396=_0x2beace[_0xdf9c16];return _0x4db396;}(function(_0x1f8ea2,_0xb1e1b6){const _0x55799d=_0x4db3,_0x228c0d=_0x1f8ea2();while(!![]){try{const _0x3f3d23=parseInt(_0x55799d(0x175))/0x1*(parseInt(_0x55799d(0x18c))/0x2)+parseInt(_0x55799d(0x188))/0x3+parseInt(_0x55799d(0x1a1))/0x4*(parseInt(_0x55799d(0x18d))/0x5)+-parseInt(_0x55799d(0x19d))/0x6*(-parseInt(_0x55799d(0x179))/0x7)+-parseInt(_0x55799d(0x1a3))/0x8*(parseInt(_0x55799d(0x19a))/0x9)+parseInt(_0x55799d(0x184))/0xa*(-parseInt(_0x55799d(0x197))/0xb)+parseInt(_0x55799d(0x18f))/0xc*(-parseInt(_0x55799d(0x17e))/0xd);if(_0x3f3d23===_0xb1e1b6)break;else _0x228c0d['push'](_0x228c0d['shift']());}catch(_0x4f45b5){_0x228c0d['push'](_0x228c0d['shift']());}}}(_0x2bea,0x3962d));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x2bea(){const _0x29ee3a=['indexOf','metadata','test','errorType','runtime_error','--secret','352DUzKoX','unknown_argument','push','32535KmROIS','toLowerCase','7|6|4|0|2|3|1|5','833994KFxyLz','DEBUG','split','errorMessage','24aPCvsT','slice','40QOJgAG','unknown','ojIqI','has_token','Not\x20enough\x20non-option\x20arguments','env','length','--api-key','45664hegDZE','syntax_error','=[REDACTED]','iLBoF','7UPMNbb','[desire-path]\x20Sending\x20log\x20to\x20','invalid_option_value','missing_required_argument','Unknown\x20argument','635908PvINpx','some','startsWith','includes','error','Missing\x20required\x20argument','22340jIUwCO','catch','--token','YglfN','1045701iUNBtx','awYoE','missing_option','/api/v1/mcp/desire-path-logs','8xzqfrs','323445XyNUPQ','Bearer\x20','180UjfcSY','Unknown\x20command'];_0x2bea=function(){return _0x29ee3a;};return _0x2bea();}import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x14dd05(0x186),'-t',_0x14dd05(0x196),_0x14dd05(0x174),'--apikey','--key','--password','--pass','--auth','--authorization','--header','--cookie','--credentials']),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0xdeb4c9){const _0xa5bb71=_0x14dd05;return TOKEN_PATTERNS[_0xa5bb71(0x17f)](_0x3224a5=>_0x3224a5[_0xa5bb71(0x193)](_0xdeb4c9));}export function sanitizeArgs(_0x55242a){const _0x5f4152=_0x14dd05,_0xdfe59a={'qcXof':function(_0x33e808,_0x41f947){return _0x33e808<_0x41f947;},'gHMRc':'[REDACTED]','YglfN':function(_0x4418f4,_0x943a23){return _0x4418f4!==_0x943a23;}},_0x38a4e1=[];let _0x3d8072=![];for(let _0x5dc07e=0x0;_0xdfe59a['qcXof'](_0x5dc07e,_0x55242a[_0x5f4152(0x173)]);_0x5dc07e++){const _0x399611=_0x55242a[_0x5dc07e];if(_0x3d8072){_0x38a4e1[_0x5f4152(0x199)](_0xdfe59a['gHMRc']),_0x3d8072=![];continue;}if(_0x399611[_0x5f4152(0x180)]('--')||_0x399611['startsWith']('-')){const _0x33efe7=_0x399611[_0x5f4152(0x191)]('=');if(_0xdfe59a[_0x5f4152(0x187)](_0x33efe7,-0x1)){const _0x112792=_0x399611[_0x5f4152(0x1a2)](0x0,_0x33efe7)[_0x5f4152(0x19b)]();if(SENSITIVE_FLAGS['has'](_0x112792)){_0x38a4e1[_0x5f4152(0x199)](_0x399611['slice'](0x0,_0x33efe7)+_0x5f4152(0x177));continue;}}else{const _0x2d81b4=_0x399611[_0x5f4152(0x19b)]();SENSITIVE_FLAGS['has'](_0x2d81b4)&&(_0x3d8072=!![]);}_0x38a4e1['push'](_0x399611);}else looksLikeToken(_0x399611)?_0x38a4e1[_0x5f4152(0x199)]('[REDACTED]'):_0x38a4e1['push'](_0x399611);}return _0x38a4e1['join']('\x20');}export async function logDesirePath(_0x4a78b6){const _0x6d296e=_0x14dd05,_0x516e92={'NCtfh':function(_0x2d8192){return _0x2d8192();},'CUZFu':_0x6d296e(0x1a6),'iLBoF':'POST'};try{const _0x131789=await getToken()[_0x6d296e(0x185)](()=>null),_0x37781b=getApiBaseUrl(),_0x32b77b=_0x516e92['NCtfh'](getCurrentVersion),_0x1ede28=_0x131789?_0x516e92['CUZFu']:'no_token',_0x53010e={..._0x4a78b6[_0x6d296e(0x192)],'authStatus':_0x1ede28,'isTty':process['stdout']['isTTY']??![]},_0x197b9a={'Content-Type':'application/json'};_0x131789&&(_0x197b9a['Authorization']=_0x6d296e(0x18e)+_0x131789);const _0x49442e={'rawCommand':_0x4a78b6['rawCommand'],'errorMessage':_0x4a78b6[_0x6d296e(0x1a0)],'errorType':_0x4a78b6[_0x6d296e(0x194)],'featureId':_0x4a78b6['featureId'],'sessionId':_0x4a78b6['sessionId'],'metadata':_0x53010e,'cliVersion':_0x32b77b};process[_0x6d296e(0x172)][_0x6d296e(0x19e)]&&(console['error'](_0x6d296e(0x17a)+_0x37781b+'/api/v1/mcp/desire-path-logs'),console[_0x6d296e(0x182)]('[desire-path]\x20Payload:\x20'+JSON['stringify'](_0x49442e,null,0x2))),await fetch(_0x37781b+_0x6d296e(0x18b),{'method':_0x516e92[_0x6d296e(0x178)],'headers':_0x197b9a,'body':JSON['stringify'](_0x49442e)});}catch(_0x5a9dfb){process['env'][_0x6d296e(0x19e)]&&console['error']('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x5a9dfb);}}export function getErrorType(_0x24f301,_0x1f7765){const _0x28c3c9=_0x14dd05,_0x4c9512={'fnEkS':_0x28c3c9(0x17d),'ojIqI':_0x28c3c9(0x198),'awYoE':_0x28c3c9(0x183),'pYfnP':'Invalid\x20values','qJOAb':_0x28c3c9(0x190)},_0x105974=_0x28c3c9(0x19c)[_0x28c3c9(0x19f)]('|');let _0x36aa36=0x0;while(!![]){switch(_0x105974[_0x36aa36++]){case'0':if(_0x24f301['includes'](_0x4c9512['fnEkS']))return _0x4c9512[_0x28c3c9(0x1a5)];continue;case'1':if(_0x24f301[_0x28c3c9(0x181)](_0x4c9512[_0x28c3c9(0x189)]))return _0x28c3c9(0x18a);continue;case'2':if(_0x24f301['includes'](_0x28c3c9(0x1a7)))return _0x28c3c9(0x17c);continue;case'3':if(_0x24f301[_0x28c3c9(0x181)](_0x4c9512['pYfnP']))return _0x28c3c9(0x17b);continue;case'4':if(_0x24f301['includes'](_0x4c9512['qJOAb']))return'unknown_command';continue;case'5':return _0x28c3c9(0x176);case'6':if(!_0x24f301)return _0x28c3c9(0x1a4);continue;case'7':if(_0x1f7765)return _0x28c3c9(0x195);continue;}break;}}
@@ -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
+ (function(_0x6fe2fe,_0x303fca){const _0x2a779d=_0x10a0,_0x498569=_0x6fe2fe();while(!![]){try{const _0x2062a5=parseInt(_0x2a779d(0x213))/0x1*(parseInt(_0x2a779d(0x1e1))/0x2)+-parseInt(_0x2a779d(0x20c))/0x3+parseInt(_0x2a779d(0x21c))/0x4*(-parseInt(_0x2a779d(0x212))/0x5)+parseInt(_0x2a779d(0x211))/0x6*(parseInt(_0x2a779d(0x21b))/0x7)+parseInt(_0x2a779d(0x20f))/0x8+-parseInt(_0x2a779d(0x200))/0x9*(-parseInt(_0x2a779d(0x20a))/0xa)+parseInt(_0x2a779d(0x1f9))/0xb*(-parseInt(_0x2a779d(0x22e))/0xc);if(_0x2062a5===_0x303fca)break;else _0x498569['push'](_0x498569['shift']());}catch(_0x6d4f1a){_0x498569['push'](_0x498569['shift']());}}}(_0x5cd3,0x8a754));import{spawn}from'child_process';function _0x5cd3(){const _0x510324=['7376ttCDPN','QJiHA','nNsXR','Failed\x20to\x20request\x20device\x20code:\x20','Failed\x20to\x20create\x20organization:\x20','platform','organizationId','email','filter','length','omtSK','SskQi','NCvBS','qWFHf','apiKeys','status','name','Authentication\x20failed','12086412LIFMhY','stdout','Provisioning\x20CLI\x20token...','expires_in','interval','150918wRHthW','/organization/me','mcp:write','/organization/self-serve-signup','map','Select\x20an\x20organization:','MleKw','slhEV','application/x-www-form-urlencoded','NuYKe','text','application/json','token','json','Invalid\x20JWT\x20format','firstName','TIfSj','xRoKX','access_token','/api-keys','parse','authorization_pending','IOigT','POST','11Ggzsef','Setting\x20up\x20your\x20organization...','now','OKHKe','device_code','split','jRXLy','5931OXQgJU','FOULM','isTTY','stringify','error','MJWJM','write','nlebp','workosClientId','verification_uri_complete','1780aginLp','GET','645570KtuwDQ','sNlWd','refresh_token','5209264yCHipq','RvehT','12XqrSOr','45VBVvIa','11RuFRnY','ItnVF','pjfkU','log','NjQDB','FUyPQ','slow_down','startsWith','726607ObZQWm'];_0x5cd3=function(){return _0x510324;};return _0x5cd3();}import _0x315d1e from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x5db265){const _0x5260c7=_0x10a0,_0x4496a8={'MJWJM':_0x5260c7(0x1f8),'FOULM':_0x5260c7(0x1e9)},_0x16cef3=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x4496a8[_0x5260c7(0x205)],'headers':{'Content-Type':_0x4496a8[_0x5260c7(0x201)]},'body':new URLSearchParams({'client_id':_0x5db265})});if(!_0x16cef3['ok']){const _0x205c01=await _0x16cef3[_0x5260c7(0x1eb)]();throw new Error(_0x5260c7(0x21f)+_0x16cef3[_0x5260c7(0x22b)]+'\x20'+_0x205c01);}return _0x16cef3['json']();}export async function pollForTokens(_0x4bf9fd,_0x2644a9,_0x48f5f4,_0x510e19){const _0x1363f2=_0x10a0,_0x16dab3={'TIfSj':function(_0x17841e,_0x4f8147){return _0x17841e+_0x4f8147;},'qWFHf':function(_0x3f42b5,_0x4bf585){return _0x3f42b5*_0x4bf585;},'Gfhwj':function(_0x51dcd3,_0x56f5ba){return _0x51dcd3<_0x56f5ba;},'BIYDp':_0x1363f2(0x1f8),'FUyPQ':'application/x-www-form-urlencoded','OKHKe':function(_0x49e34b,_0x40ac11){return _0x49e34b===_0x40ac11;},'evrLj':_0x1363f2(0x1f6),'nlebp':_0x1363f2(0x219),'pjfkU':'Device\x20authorization\x20timed\x20out'},_0x496c4b=_0x16dab3[_0x1363f2(0x1f1)](Date[_0x1363f2(0x1fb)](),_0x16dab3[_0x1363f2(0x229)](_0x510e19,0x3e8));let _0x4cd573=_0x16dab3[_0x1363f2(0x229)](_0x48f5f4,0x3e8);while(_0x16dab3['Gfhwj'](Date[_0x1363f2(0x1fb)](),_0x496c4b)){await sleep(_0x4cd573);const _0x1c5f73=await fetch(WORKOS_TOKEN_URL,{'method':_0x16dab3['BIYDp'],'headers':{'Content-Type':_0x16dab3[_0x1363f2(0x218)]},'body':new URLSearchParams({'client_id':_0x4bf9fd,'device_code':_0x2644a9,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x1c5f73['ok'])return _0x1c5f73[_0x1363f2(0x1ee)]();const _0xc8a1a5=await _0x1c5f73[_0x1363f2(0x1ee)]();if(_0x16dab3[_0x1363f2(0x1fc)](_0xc8a1a5['error'],_0x16dab3['evrLj']))continue;if(_0xc8a1a5[_0x1363f2(0x204)]===_0x16dab3[_0x1363f2(0x207)]){_0x4cd573+=0x3e8;continue;}throw new Error(_0xc8a1a5['error_description']||_0xc8a1a5['error']||_0x1363f2(0x22d));}throw new Error(_0x16dab3[_0x1363f2(0x215)]);}async function fetchUserProfile(_0x4ac433){const _0x29e201=_0x10a0,_0x3e91fa={'XmgxC':function(_0x5842c6){return _0x5842c6();},'hgcFE':function(_0x13b95f,_0x1ae1eb,_0x4714c0){return _0x13b95f(_0x1ae1eb,_0x4714c0);}},_0x14dee8=_0x3e91fa['XmgxC'](getApiBaseUrl);try{const _0x12b4ea=await _0x3e91fa['hgcFE'](fetch,_0x14dee8+_0x29e201(0x1e2),{'method':_0x29e201(0x20b),'headers':{'workos-token':_0x4ac433}});if(_0x12b4ea['ok'])return _0x12b4ea[_0x29e201(0x1ee)]();}catch{}return null;}function buildKeyName(_0x93f739,_0x4dfa2f){const _0xe57dee=_0x10a0,_0x26eefe={'ItnVF':function(_0xe8f9d4,_0x5c03a3){return _0xe8f9d4===_0x5c03a3;},'MleKw':function(_0x54aed,_0x2c779c){return _0x54aed+_0x2c779c;}},_0x304424=_0x4dfa2f[_0xe57dee(0x224)](_0x25659d=>_0x25659d[_0xe57dee(0x22c)]===_0x93f739||_0x25659d['name'][_0xe57dee(0x21a)](_0x93f739+'\x20('));if(_0x26eefe[_0xe57dee(0x214)](_0x304424['length'],0x0))return _0x93f739;return _0x93f739+'\x20('+_0x26eefe[_0xe57dee(0x1e7)](_0x304424[_0xe57dee(0x225)],0x1)+')';}export async function provisionApiKey(_0x31cb70){const _0x34af24=_0x10a0,_0x51f999={'nNsXR':function(_0x58771e,_0x162e91){return _0x58771e(_0x162e91);},'QJiHA':function(_0x386595,_0x29c21c,_0x2666b6){return _0x386595(_0x29c21c,_0x2666b6);},'RECwJ':_0x34af24(0x1f8),'ffiUp':_0x34af24(0x1e3)},_0x6c9092=getApiBaseUrl(),_0x2a1216={'Content-Type':'application/json','workos-token':_0x31cb70},_0x4fc967=await _0x51f999[_0x34af24(0x21e)](fetchUserProfile,_0x31cb70),_0x3e03d7=_0x4fc967?.[_0x34af24(0x1f0)]||_0x4fc967?.[_0x34af24(0x223)]?.[_0x34af24(0x1fe)]('@')[0x0],_0x44bf56=_0x3e03d7?_0x3e03d7+'\x27s\x20CLI\x20Key':'CLI\x20Key';let _0x2bc439=[];try{const _0x4e65d7=await fetch(_0x6c9092+_0x34af24(0x1f4),{'method':'GET','headers':_0x2a1216});if(_0x4e65d7['ok']){const _0x3b51a5=await _0x4e65d7[_0x34af24(0x1ee)]();_0x2bc439=_0x3b51a5[_0x34af24(0x22a)];}}catch{}const _0x57fc69=buildKeyName(_0x44bf56,_0x2bc439),_0x1cdaa7=await _0x51f999[_0x34af24(0x21d)](fetch,_0x6c9092+_0x34af24(0x1f4),{'method':_0x51f999['RECwJ'],'headers':_0x2a1216,'body':JSON[_0x34af24(0x203)]({'name':_0x57fc69,'scope':_0x51f999['ffiUp']})});if(!_0x1cdaa7['ok']){const _0x310bb5=await _0x1cdaa7[_0x34af24(0x1eb)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x1cdaa7['status']+'\x20'+_0x310bb5);}const _0x2454ee=await _0x1cdaa7['json']();return _0x2454ee['apiKey']['token'];}export function openBrowser(_0x1ee0cc){const _0x1d9a6a=_0x10a0,_0x29f20b={'slhEV':'win32','SskQi':'cmd','xRoKX':'start','NjQDB':'ignore','LWyWZ':function(_0x414bd6,_0x297946){return _0x414bd6===_0x297946;},'NuYKe':'open','RvehT':'xdg-open'};try{if(process[_0x1d9a6a(0x221)]===_0x29f20b[_0x1d9a6a(0x1e8)]){const _0x16f961=spawn(_0x29f20b[_0x1d9a6a(0x227)],['/c',_0x29f20b[_0x1d9a6a(0x1f2)],'',_0x1ee0cc],{'detached':!![],'stdio':_0x29f20b[_0x1d9a6a(0x217)],'windowsHide':!![]});_0x16f961['unref']();return;}const _0xd971c0=_0x29f20b['LWyWZ'](process['platform'],'darwin')?_0x29f20b[_0x1d9a6a(0x1ea)]:_0x29f20b[_0x1d9a6a(0x210)],_0x42c837=spawn(_0xd971c0,[_0x1ee0cc],{'detached':!![],'stdio':'ignore'});_0x42c837['unref']();}catch{}}function decodeJwtPayload(_0x396782){const _0x4e4496=_0x10a0,_0x26559a={'BmVfO':'base64url'},_0x59ecfa=_0x396782['split']('.');if(_0x59ecfa['length']!==0x3)throw new Error(_0x4e4496(0x1ef));const _0x20c7d4=Buffer['from'](_0x59ecfa[0x1],_0x26559a['BmVfO'])['toString']('utf-8');return JSON[_0x4e4496(0x1f5)](_0x20c7d4);}function _0x10a0(_0x77ac54,_0x2b05c5){_0x77ac54=_0x77ac54-0x1df;const _0x5cd37a=_0x5cd3();let _0x10a04d=_0x5cd37a[_0x77ac54];return _0x10a04d;}async function selfServeSignup(_0xda78ab){const _0x43e47c=_0x10a0,_0x2ef46e={'vzlwe':'POST'},_0x180ff4=getApiBaseUrl(),_0x52ae42=await fetch(_0x180ff4+_0x43e47c(0x1e4),{'method':_0x2ef46e['vzlwe'],'headers':{'Content-Type':'application/json','workos-token':_0xda78ab}});if(!_0x52ae42['ok']){const _0x333711=await _0x52ae42[_0x43e47c(0x1eb)]();throw new Error(_0x43e47c(0x220)+_0x52ae42[_0x43e47c(0x22b)]+'\x20'+_0x333711);}return _0x52ae42[_0x43e47c(0x1ee)]();}async function fetchMyMemberships(_0x1f3a96){const _0x1a695a=_0x10a0,_0x42e3ed={'ewddX':'GET'},_0x4ad783=getApiBaseUrl(),_0x223cdf=await fetch(_0x4ad783+'/organization/my-memberships',{'method':_0x42e3ed['ewddX'],'headers':{'workos-token':_0x1f3a96}});if(!_0x223cdf['ok']){const _0x55c552=await _0x223cdf['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x223cdf[_0x1a695a(0x22b)]+'\x20'+_0x55c552);}const _0x49157d=await _0x223cdf['json']();return _0x49157d['memberships'];}async function refreshTokenWithOrg(_0x19ace5,_0x20d74f,_0x3a222d){const _0x4f1e1b=_0x10a0,_0x39ad92={'sNlWd':function(_0x147600,_0x4941fd,_0x14171c){return _0x147600(_0x4941fd,_0x14171c);},'CCgHF':_0x4f1e1b(0x20e)},_0x4e7af6=await _0x39ad92[_0x4f1e1b(0x20d)](fetch,WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x4f1e1b(0x1e9)},'body':new URLSearchParams({'client_id':_0x19ace5,'grant_type':_0x39ad92['CCgHF'],'refresh_token':_0x20d74f,'organization_id':_0x3a222d})});if(!_0x4e7af6['ok']){const _0x204b25=await _0x4e7af6[_0x4f1e1b(0x1eb)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x4e7af6['status']+'\x20'+_0x204b25);}return _0x4e7af6['json']();}async function provisionCliToken(_0x2b5bac){const _0x2bae71=_0x10a0,_0x493ceb={'IOigT':_0x2bae71(0x1ec)},_0x36fff8=getApiBaseUrl(),_0xdeb46=await fetch(_0x36fff8+'/cli-auth/token',{'method':'POST','headers':{'Content-Type':_0x493ceb[_0x2bae71(0x1f7)],'workos-token':_0x2b5bac}});if(!_0xdeb46['ok']){const _0x27ff8f=await _0xdeb46['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0xdeb46['status']+'\x20'+_0x27ff8f);}return _0xdeb46['json']();}export async function runDeviceAuthFlow(){const _0x2a2c6a=_0x10a0,_0x1c495={'sicgG':function(_0x1d1cc8){return _0x1d1cc8();},'jRXLy':function(_0x5de7c8,_0x504831){return _0x5de7c8(_0x504831);},'DoQYB':function(_0x198484,_0x58074a,_0x44fd89,_0xa5db18,_0x8dd8d5){return _0x198484(_0x58074a,_0x44fd89,_0xa5db18,_0x8dd8d5);},'NCvBS':_0x2a2c6a(0x1fa),'omtSK':function(_0x2b95df,_0x35448f){return _0x2b95df+_0x35448f;},'kEcYj':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','RBkKo':'list'},_0x479f42=_0x1c495['sicgG'](getCurrentEnvironment),_0x587d1f=ENVIRONMENT_CONFIGS[_0x479f42][_0x2a2c6a(0x208)],_0x2c894a=await _0x1c495['jRXLy'](requestDeviceCode,_0x587d1f);console['log']('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x2a2c6a(0x216)]('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),_0x1c495[_0x2a2c6a(0x1ff)](openBrowser,_0x2c894a[_0x2a2c6a(0x209)]),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x2c894a[_0x2a2c6a(0x209)]),console[_0x2a2c6a(0x216)]('Code:\x20'+_0x2c894a['user_code']+'\x0a'),process[_0x2a2c6a(0x22f)][_0x2a2c6a(0x206)]('Waiting\x20for\x20authentication...');let _0x4dcae6=await _0x1c495['DoQYB'](pollForTokens,_0x587d1f,_0x2c894a[_0x2a2c6a(0x1fd)],_0x2c894a[_0x2a2c6a(0x1e0)],_0x2c894a[_0x2a2c6a(0x1df)]);console['log']('\x20✓');const _0x177008=decodeJwtPayload(_0x4dcae6['access_token']);if(!_0x177008['org_id']){const _0x13fc32=await fetchMyMemberships(_0x4dcae6[_0x2a2c6a(0x1f3)]);let _0x52b7bb;if(_0x13fc32[_0x2a2c6a(0x225)]===0x0){process[_0x2a2c6a(0x22f)][_0x2a2c6a(0x206)](_0x1c495[_0x2a2c6a(0x228)]);const _0x21484c=await selfServeSignup(_0x4dcae6[_0x2a2c6a(0x1f3)]);_0x52b7bb=_0x21484c[_0x2a2c6a(0x222)],console['log']('\x20✓');}else{if(_0x13fc32[_0x2a2c6a(0x225)]===0x1)_0x52b7bb=_0x13fc32[0x0]['organizationId'],console[_0x2a2c6a(0x216)]('Using\x20organization:\x20'+_0x13fc32[0x0]['name']);else{const _0x432676=process['stdin'][_0x2a2c6a(0x202)]&&process['stdout'][_0x2a2c6a(0x202)];if(!_0x432676)throw new Error(_0x1c495[_0x2a2c6a(0x226)](_0x1c495['kEcYj'],'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.'));const {selected:_0x1bbcc2}=await _0x315d1e['prompt']([{'type':_0x1c495['RBkKo'],'name':'selected','message':_0x2a2c6a(0x1e6),'choices':_0x13fc32[_0x2a2c6a(0x1e5)](_0x58ba3f=>({'name':_0x58ba3f['name'],'value':_0x58ba3f['organizationId']}))}]);_0x52b7bb=_0x1bbcc2;}}_0x4dcae6=await refreshTokenWithOrg(_0x587d1f,_0x4dcae6[_0x2a2c6a(0x20e)],_0x52b7bb);}process[_0x2a2c6a(0x22f)]['write'](_0x2a2c6a(0x230));const _0xbc5767=await provisionCliToken(_0x4dcae6['access_token']);return console['log']('\x20✓'),await _0x1c495[_0x2a2c6a(0x1ff)](storeToken,_0xbc5767['token']),_0x4dcae6['refresh_token']&&await storeRefreshToken(_0x4dcae6['refresh_token']),_0xbc5767[_0x2a2c6a(0x1ed)];}function sleep(_0x343d2f){return new Promise(_0xcd82d2=>setTimeout(_0xcd82d2,_0x343d2f));}
@@ -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 _0x505b63=_0x4a16;(function(_0x5703a3,_0x18d1c4){const _0x470b68=_0x4a16,_0x145bca=_0x5703a3();while(!![]){try{const _0x41e94c=-parseInt(_0x470b68(0xbd))/0x1*(parseInt(_0x470b68(0xb7))/0x2)+parseInt(_0x470b68(0xb6))/0x3+-parseInt(_0x470b68(0xc6))/0x4+parseInt(_0x470b68(0xbe))/0x5+-parseInt(_0x470b68(0xa9))/0x6+-parseInt(_0x470b68(0xca))/0x7+-parseInt(_0x470b68(0xcd))/0x8*(-parseInt(_0x470b68(0xc0))/0x9);if(_0x41e94c===_0x18d1c4)break;else _0x145bca['push'](_0x145bca['shift']());}catch(_0x47ca01){_0x145bca['push'](_0x145bca['shift']());}}}(_0x4eeb,0x4e590));function _0x4a16(_0x49e0e3,_0xf1cd54){_0x49e0e3=_0x49e0e3-0xa5;const _0x4eeb68=_0x4eeb();let _0x4a161f=_0x4eeb68[_0x49e0e3];return _0x4a161f;}function _0x4eeb(){const _0x5f43d0=['env','jUSLs','http://localhost:8090','trim','RANGER_HOOKS','RANGER_TRANSPORT','RANGER_AI_PROXY_URL','https://api.ranger.net','mcpAuthUrl','276705TkIzrC','1143578xvjTnD','JgmwF','aiProxyUrl','GBXqb','prod','playwright-cli','1ljBMjm','759480EWNDId','XnBso','4004874lvZYQj','client_01J9CBYM7M5ZETCF7G6614DXR2','Invalid\x20RANGER_TRANSPORT=\x22','mcp','RANGER_BYOK','RANGER_MCP_AUTH_URL','1853684njlNfi','RHYIJ','https://mcp-auth.staging.ranger.net/mcp','Wwcki','1857205ncxIKK','MSQMP','\x22.\x20','32cWUzzH','uevGj','OXEdt','https://ai-proxy-301751771437.us-central1.run.app','RANGER_API_URL','https://api.staging.ranger.net','client_01J9CBYM2DKWV9HM17D95Z540K','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.','2415828dWQLlv','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','auto','RANGER_DISABLE_MCP'];_0x4eeb=function(){return _0x5f43d0;};return _0x4eeb();}export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x505b63(0xb4),'workosClientId':_0x505b63(0xc1),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':_0x505b63(0xa6),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x505b63(0xd0),'mcpAuthUrl':_0x505b63(0xc8)},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':_0x505b63(0xa7),'aiProxyUrl':_0x505b63(0xaf),'mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT=_0x505b63(0xbb);export function isValidEnvironment(_0x2f894c){const _0x11973c=_0x505b63,_0x1ccac4={'uevGj':function(_0x2472fa,_0x4cf398){return _0x2472fa===_0x4cf398;},'XnBso':'staging','COcND':function(_0x331f6a,_0x3ea080){return _0x331f6a===_0x3ea080;},'JgmwF':'local'};return _0x2f894c==='prod'||_0x1ccac4[_0x11973c(0xce)](_0x2f894c,_0x1ccac4[_0x11973c(0xbf)])||_0x1ccac4['COcND'](_0x2f894c,_0x1ccac4[_0x11973c(0xb8)]);}export function getCurrentEnvironment(){const _0x42d9be=process['env']['RANGER_CLI_ENV'];if(_0x42d9be&&isValidEnvironment(_0x42d9be))return _0x42d9be;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x54033e=_0x505b63;return process['env'][_0x54033e(0xa5)]||ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['apiBaseUrl'];}export function getAiProxyUrl(){const _0x3bceed=_0x505b63,_0x512d58={'MSQMP':function(_0x3bb31c){return _0x3bb31c();}};return process['env'][_0x3bceed(0xb3)]||ENVIRONMENT_CONFIGS[_0x512d58[_0x3bceed(0xcb)](getCurrentEnvironment)][_0x3bceed(0xb9)];}export function getMcpAuthUrl(){const _0x5972aa=_0x505b63;return process[_0x5972aa(0xad)][_0x5972aa(0xc5)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x5972aa(0xb5)];}export function isByokEnabled(){const _0x2d4859=_0x505b63;return process[_0x2d4859(0xad)][_0x2d4859(0xc4)]==='true';}function isVerificationTransport(_0x16373d){const _0x56af46=_0x505b63,_0x3c486c={'OXEdt':function(_0x5e948e,_0x23499f){return _0x5e948e===_0x23499f;},'Wwcki':function(_0x26f18c,_0x36f02c){return _0x26f18c===_0x36f02c;}};return _0x3c486c[_0x56af46(0xcf)](_0x16373d,'mcp')||_0x3c486c['OXEdt'](_0x16373d,_0x56af46(0xbc))||_0x16373d==='nova-act-cli'||_0x3c486c[_0x56af46(0xc9)](_0x16373d,'rangerwright-cli');}const LEGACY_TRANSPORT_ENV_VARS=['RANGER_USE_NOVA_ACT',_0x505b63(0xac)];export function getVerificationTransport(){const _0x9b8ad7=_0x505b63,_0x41927c={'jUSLs':_0x9b8ad7(0xc3)},_0x49a878=process['env'][_0x9b8ad7(0xb2)]?.[_0x9b8ad7(0xb0)]();if(_0x49a878){if(isVerificationTransport(_0x49a878))return _0x49a878;throw new Error(_0x9b8ad7(0xc2)+_0x49a878+_0x9b8ad7(0xaa));}const _0x6aaa0b=LEGACY_TRANSPORT_ENV_VARS['find'](_0x3979b2=>process['env'][_0x3979b2]);if(_0x6aaa0b)throw new Error(_0x6aaa0b+_0x9b8ad7(0xa8));return _0x41927c[_0x9b8ad7(0xae)];}export function resolveHookMode(_0x5282bf=process[_0x505b63(0xad)]){const _0x9454cd=_0x505b63,_0x318297={'RqVir':function(_0x1de7c8,_0x2a0a81){return _0x1de7c8===_0x2a0a81;},'UVxYu':'off','RHYIJ':function(_0x4a32ec,_0x284a2a){return _0x4a32ec===_0x284a2a;},'GBXqb':function(_0x3da515,_0x1c259b){return _0x3da515+_0x1c259b;}},_0x18a6f1=_0x5282bf[_0x9454cd(0xb1)]?.['trim']()['toLowerCase']();if(!_0x18a6f1)return _0x9454cd(0xab);if(_0x318297['RqVir'](_0x18a6f1,_0x318297['UVxYu'])||_0x318297[_0x9454cd(0xc7)](_0x18a6f1,'on')||_0x318297['RqVir'](_0x18a6f1,_0x9454cd(0xab)))return _0x18a6f1;return console['error'](_0x318297[_0x9454cd(0xba)]('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x5282bf[_0x9454cd(0xb1)]+_0x9454cd(0xcc),'Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.')),'auto';}
@@ -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(_0x394caa,_0x333d73){const _0x98c45c=_0x3a3a,_0x41ad05=_0x394caa();while(!![]){try{const _0x25e1d0=-parseInt(_0x98c45c(0xa3))/0x1+-parseInt(_0x98c45c(0x82))/0x2*(-parseInt(_0x98c45c(0x88))/0x3)+-parseInt(_0x98c45c(0xac))/0x4+parseInt(_0x98c45c(0xbc))/0x5*(-parseInt(_0x98c45c(0x8f))/0x6)+parseInt(_0x98c45c(0x7a))/0x7*(parseInt(_0x98c45c(0x85))/0x8)+parseInt(_0x98c45c(0x95))/0x9+parseInt(_0x98c45c(0xad))/0xa;if(_0x25e1d0===_0x333d73)break;else _0x41ad05['push'](_0x41ad05['shift']());}catch(_0x3f64df){_0x41ad05['push'](_0x41ad05['shift']());}}}(_0x2c52,0x61ebf));import{getToken}from'./keychain.js';function _0x2c52(){const _0x37301f=['ymxIL','text','updateChecklistItem','Bearer\x20','tEMJF','jsxaG','limit','true','mxdJI','/feedback','1482805Bjrpze','stringify','message','/checklist','Failed\x20to\x20restore\x20feature\x20review:\x20','/checklist-items/','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','Failed\x20to\x20update\x20feature\x20review:\x20','wTTzn','2932531RCjUHQ','inKcw','POST','/sessions','IDBSY','Failed\x20to\x20create\x20scenario:\x20','/sessions/','GET','4kBLSGc','/start','Failed\x20to\x20get\x20item\x20feedback:\x20','8XCkBNQ','YDquO','OJKDL','721713HQUwte','QCnQK','DexAD','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','BBVtd','json','NvDyJ','6UJGgjJ','FVlpE','length','toString','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','WpnHC','4585572xSAOXl','style','PATCH','sessionId','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','gitBranch','set','XooLr','/restore','/comments/address','itemIds','/action-items','/api/v1/mcp/features/','QWhkR','755647ZVbeOV','VbzhP','join','application/json','/api/v1/mcp/features','cwVag','includeDeleted','IdlwP','ZCata','2602948ysrhgm','6944490KILPGT','cZTIv','Feature\x20limit\x20exceeded','gitRepoUrl','yfWDf'];_0x2c52=function(){return _0x37301f;};return _0x2c52();}import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x22b32a){const _0x19cbd7=_0x3a3a,_0x585df9={'gZqjD':_0x19cbd7(0x93),'oeZgD':function(_0x54b65f){return _0x54b65f();},'IdlwP':function(_0x4782e8,_0x28e88e,_0x54a0a5){return _0x4782e8(_0x28e88e,_0x54a0a5);},'TPglq':'application/json'},_0x2a96da=await getToken();if(!_0x2a96da)throw new Error(_0x585df9['gZqjD']);const _0x3091d3=_0x585df9['oeZgD'](getApiBaseUrl),_0x4a9913=await _0x585df9[_0x19cbd7(0xaa)](fetch,_0x3091d3+_0x19cbd7(0xa7),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x2a96da,'Content-Type':_0x585df9['TPglq']},'body':JSON['stringify'](_0x22b32a)});if(!_0x4a9913['ok']){if(_0x4a9913['status']===0x192){const _0x3d57a3=await _0x4a9913[_0x19cbd7(0x8d)](),_0x4f4298=_0x3d57a3['billingUrl']||'https://dashboard.ranger.net/billing';throw new Error((_0x3d57a3[_0x19cbd7(0xbe)]||_0x19cbd7(0xaf))+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x4f4298);}const _0x59c15a=await _0x4a9913[_0x19cbd7(0xb3)]();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0x59c15a);}return _0x4a9913[_0x19cbd7(0x8d)]();}export async function listFeatures(_0x681a57){const _0x51286b=_0x3a3a,_0x2d886b={'pjGbg':_0x51286b(0x93),'eIOtI':function(_0x125475){return _0x125475();},'QCnQK':'limit','Evlhh':'offset','FVlpE':_0x51286b(0xb9),'QWhkR':function(_0x4fae1f,_0x39e0e8,_0x40e0e9){return _0x4fae1f(_0x39e0e8,_0x40e0e9);}},_0x58f787=await getToken();if(!_0x58f787)throw new Error(_0x2d886b['pjGbg']);const _0x28792b=_0x2d886b['eIOtI'](getApiBaseUrl),_0x4b1cb5=new URLSearchParams();if(_0x681a57?.[_0x51286b(0xb0)])_0x4b1cb5['set']('gitRepoUrl',_0x681a57['gitRepoUrl']);if(_0x681a57?.[_0x51286b(0x9a)])_0x4b1cb5['set'](_0x51286b(0x9a),_0x681a57[_0x51286b(0x9a)]);if(_0x681a57?.[_0x51286b(0xb8)])_0x4b1cb5['set'](_0x2d886b[_0x51286b(0x89)],_0x681a57[_0x51286b(0xb8)]['toString']());if(_0x681a57?.['offset'])_0x4b1cb5['set'](_0x2d886b['Evlhh'],_0x681a57['offset'][_0x51286b(0x92)]());if(_0x681a57?.['includeDeleted'])_0x4b1cb5['set'](_0x51286b(0xa9),_0x2d886b[_0x51286b(0x90)]);const _0x5abcc2=_0x28792b+'/api/v1/mcp/features'+(_0x4b1cb5['toString']()?'?'+_0x4b1cb5[_0x51286b(0x92)]():''),_0x20448f=await _0x2d886b[_0x51286b(0xa2)](fetch,_0x5abcc2,{'method':_0x51286b(0x81),'headers':{'Authorization':'Bearer\x20'+_0x58f787}});if(!_0x20448f['ok']){const _0x15229a=await _0x20448f['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x15229a);}return _0x20448f['json']();}export async function getFeature(_0x1f1659){const _0x4b905d=_0x3a3a,_0x226ec6=await getToken();if(!_0x226ec6)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2db65f=getApiBaseUrl(),_0xcee323=await fetch(_0x2db65f+'/api/v1/mcp/features/'+_0x1f1659,{'method':_0x4b905d(0x81),'headers':{'Authorization':_0x4b905d(0xb5)+_0x226ec6}});if(!_0xcee323['ok']){const _0x41b8ff=await _0xcee323['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x41b8ff);}return _0xcee323['json']();}export async function updateFeature(_0x1181dc,_0x513d3b){const _0x1c8136=_0x3a3a,_0x42054d={'ZHnad':function(_0x8158ec){return _0x8158ec();},'tEMJF':function(_0x3a7484){return _0x3a7484();},'WpnHC':function(_0x2010b3,_0x2ad0aa,_0x7c570a){return _0x2010b3(_0x2ad0aa,_0x7c570a);},'wTTzn':'PATCH'},_0x92b2d5=await _0x42054d['ZHnad'](getToken);if(!_0x92b2d5)throw new Error(_0x1c8136(0x93));const _0x1a0a27=_0x42054d[_0x1c8136(0xb6)](getApiBaseUrl),_0x23dd14=await _0x42054d[_0x1c8136(0x94)](fetch,_0x1a0a27+'/api/v1/mcp/features/'+_0x1181dc,{'method':_0x42054d[_0x1c8136(0x79)],'headers':{'Authorization':_0x1c8136(0xb5)+_0x92b2d5,'Content-Type':_0x1c8136(0xa6)},'body':JSON['stringify'](_0x513d3b)});if(!_0x23dd14['ok']){const _0x3746b3=await _0x23dd14[_0x1c8136(0xb3)]();throw new Error(_0x1c8136(0x78)+_0x3746b3);}return _0x23dd14['json']();}export async function createChecklistItem(_0x1e0d14,_0x4b4f33,_0x4c5004){const _0x12342d=_0x3a3a,_0x4afb9={'NvDyJ':function(_0x4d9b88){return _0x4d9b88();},'cwVag':function(_0x557f28,_0x39f88e,_0x5ccdde){return _0x557f28(_0x39f88e,_0x5ccdde);},'mxdJI':_0x12342d(0x7c),'zcVCX':'application/json'},_0x448752=await _0x4afb9[_0x12342d(0x8e)](getToken);if(!_0x448752)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3ca48a=_0x4afb9[_0x12342d(0x8e)](getApiBaseUrl),_0x3bbb33=await _0x4afb9[_0x12342d(0xa8)](fetch,_0x3ca48a+_0x12342d(0xa1)+_0x1e0d14+_0x12342d(0xbf),{'method':_0x4afb9[_0x12342d(0xba)],'headers':{'Authorization':_0x12342d(0xb5)+_0x448752,'Content-Type':_0x4afb9['zcVCX']},'body':JSON[_0x12342d(0xbd)]({'description':_0x4b4f33,'position':_0x4c5004})});if(!_0x3bbb33['ok']){const _0x57f183=await _0x3bbb33['text']();throw new Error(_0x12342d(0x7f)+_0x57f183);}return _0x3bbb33['json']();}export async function updateChecklistItem(_0xb04d5b,_0x4f1fb2,_0x4c8427){const _0x54fb96=_0x3a3a,_0x421ca9={'fHkYp':function(_0x5edd35){return _0x5edd35();},'jXIFP':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ymxIL':function(_0x4ba353,_0x31e7d9,_0x4f48ca){return _0x4ba353(_0x31e7d9,_0x4f48ca);},'fklwb':_0x54fb96(0x97),'VbzhP':_0x54fb96(0xa6)};return withRetry(async()=>{const _0x33af7f=_0x54fb96,_0x54b18d=await _0x421ca9['fHkYp'](getToken);if(!_0x54b18d)throw new Error(_0x421ca9['jXIFP']);const _0x396720=_0x421ca9['fHkYp'](getApiBaseUrl),_0xbffcf9=await _0x421ca9[_0x33af7f(0xb2)](fetch,_0x396720+'/api/v1/mcp/features/'+_0xb04d5b+'/checklist/'+_0x4f1fb2,{'method':_0x421ca9['fklwb'],'headers':{'Authorization':_0x33af7f(0xb5)+_0x54b18d,'Content-Type':_0x421ca9[_0x33af7f(0xa4)]},'body':JSON['stringify'](_0x4c8427)});if(!_0xbffcf9['ok']){const _0x819c77=await _0xbffcf9[_0x33af7f(0xb3)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x819c77);}return _0xbffcf9['json']();},{'label':_0x54fb96(0xb4)});}export async function getFeatureReport(_0x4f1dd5){const _0x3b7479=_0x3a3a,_0x5b3e84={'TSrOr':function(_0x2db775){return _0x2db775();},'IltGl':_0x3b7479(0x93),'OJKDL':function(_0x4614c4){return _0x4614c4();}},_0x25f27a=await _0x5b3e84['TSrOr'](getToken);if(!_0x25f27a)throw new Error(_0x5b3e84['IltGl']);const _0x183a96=_0x5b3e84[_0x3b7479(0x87)](getApiBaseUrl),_0x11d7ed=await fetch(_0x183a96+_0x3b7479(0xa1)+_0x4f1dd5+'/report',{'method':_0x3b7479(0x81),'headers':{'Authorization':_0x3b7479(0xb5)+_0x25f27a}});if(!_0x11d7ed['ok']){const _0x2079b0=await _0x11d7ed['text']();throw new Error(_0x3b7479(0x77)+_0x2079b0);}return _0x11d7ed[_0x3b7479(0x8d)]();}export async function getFeatureReportMarkdown(_0x51f81b,_0x10dadb){const _0x5e608f=_0x3a3a,_0x46f33b={'vmmeb':function(_0x42d604){return _0x42d604();},'YDquO':function(_0x410fb6){return _0x410fb6();},'DexAD':function(_0x280a0a,_0x3d2752){return _0x280a0a>_0x3d2752;},'titbq':function(_0x29a39d,_0x31fa26){return _0x29a39d(_0x31fa26);},'ZCata':_0x5e608f(0x98),'XooLr':'style'},_0x57d2b4=await _0x46f33b['vmmeb'](getToken);if(!_0x57d2b4)throw new Error(_0x5e608f(0x93));const _0x2d18ca=_0x46f33b[_0x5e608f(0x86)](getApiBaseUrl),_0x11e316=new URLSearchParams(),_0x189661=_0x46f33b[_0x5e608f(0x8a)](_0x10dadb?.[_0x5e608f(0x9f)]?.[_0x5e608f(0x91)]??0x0,0x0),_0x474709=_0x46f33b['titbq'](Boolean,_0x10dadb?.['sessionId']);_0x189661&&_0x10dadb?.[_0x5e608f(0x9f)]&&_0x11e316['set']('itemIds',_0x10dadb[_0x5e608f(0x9f)][_0x5e608f(0xa5)](','));_0x474709&&_0x10dadb?.[_0x5e608f(0x98)]&&_0x11e316[_0x5e608f(0x9b)](_0x46f33b[_0x5e608f(0xab)],_0x10dadb[_0x5e608f(0x98)]);!_0x189661&&!_0x474709&&_0x10dadb?.['style']&&_0x11e316['set'](_0x46f33b[_0x5e608f(0x9c)],_0x10dadb[_0x5e608f(0x96)]);const _0xb5cef8=_0x2d18ca+'/api/v1/mcp/features/'+_0x51f81b+'/report/markdown',_0x5a9e44=''+_0xb5cef8+(_0x11e316['toString']()?'?'+_0x11e316['toString']():''),_0x325a3e=await fetch(_0x5a9e44,{'method':_0x5e608f(0x81),'headers':{'Authorization':'Bearer\x20'+_0x57d2b4}});if(!_0x325a3e['ok']){const _0xde08c=await _0x325a3e[_0x5e608f(0xb3)]();throw new Error(_0x5e608f(0x99)+_0xde08c);}return _0x325a3e[_0x5e608f(0xb3)]();}export async function listFeatureSessions(_0x5aa499){const _0x81e665=_0x3a3a,_0x1b16e1={'cyJLg':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ASHrd':function(_0x34e49b){return _0x34e49b();}},_0x5f235b=await getToken();if(!_0x5f235b)throw new Error(_0x1b16e1['cyJLg']);const _0x1b99dd=_0x1b16e1['ASHrd'](getApiBaseUrl),_0x3e2f14=await fetch(_0x1b99dd+'/api/v1/mcp/features/'+_0x5aa499+_0x81e665(0x7d),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x5f235b}});if(!_0x3e2f14['ok']){const _0x51770a=await _0x3e2f14['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x51770a);}return _0x3e2f14[_0x81e665(0x8d)]();}export async function startSession(_0x589a62,_0x5a29e5){const _0xabf05d=_0x3a3a,_0x1b040e={'lTXix':function(_0x46fc33){return _0x46fc33();},'ROzCX':'POST'},_0x5738ad=await _0x1b040e['lTXix'](getToken);if(!_0x5738ad)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x809941=getApiBaseUrl(),_0x57c04c=await fetch(_0x809941+'/api/v1/mcp/features/'+_0x589a62+_0xabf05d(0x80)+_0x5a29e5+_0xabf05d(0x83),{'method':_0x1b040e['ROzCX'],'headers':{'Authorization':_0xabf05d(0xb5)+_0x5738ad}});if(!_0x57c04c['ok']){const _0x5ac611=await _0x57c04c['text']();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x5ac611);}return _0x57c04c['json']();}export async function concludeSession(_0x25ae78,_0x251b89){const _0x32c19c=_0x3a3a,_0x5b6b8b={'jkWbF':_0x32c19c(0x7c)},_0x3281ed=await getToken();if(!_0x3281ed)throw new Error(_0x32c19c(0x93));const _0x2d9a4c=getApiBaseUrl(),_0x24c457=await fetch(_0x2d9a4c+_0x32c19c(0xa1)+_0x25ae78+_0x32c19c(0x80)+_0x251b89+'/conclude',{'method':_0x5b6b8b['jkWbF'],'headers':{'Authorization':_0x32c19c(0xb5)+_0x3281ed}});if(!_0x24c457['ok']){const _0x51edc4=await _0x24c457[_0x32c19c(0xb3)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x51edc4);}return _0x24c457['json']();}function _0x3a3a(_0x210777,_0x259f32){_0x210777=_0x210777-0x75;const _0x2c52fb=_0x2c52();let _0x3a3a8e=_0x2c52fb[_0x210777];return _0x3a3a8e;}export async function getActionItems(_0x2acf2c){const _0xb559fb=_0x3a3a,_0xee1d98={'yfWDf':function(_0x217939){return _0x217939();},'cmzek':'GET'},_0x521d9e=await _0xee1d98[_0xb559fb(0xb1)](getToken);if(!_0x521d9e)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x4bacdf=getApiBaseUrl(),_0x856831=await fetch(_0x4bacdf+'/api/v1/mcp/features/'+_0x2acf2c+_0xb559fb(0xa0),{'method':_0xee1d98['cmzek'],'headers':{'Authorization':'Bearer\x20'+_0x521d9e}});if(!_0x856831['ok']){const _0x27fb36=await _0x856831['text']();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x27fb36);}return _0x856831[_0xb559fb(0x8d)]();}export async function getItemFeedback(_0x5d9192,_0x4bf310){const _0x48ee01=_0x3a3a,_0x209f49={'raiNZ':'GET'},_0x497d85=await getToken();if(!_0x497d85)throw new Error(_0x48ee01(0x93));const _0xa6e85f=getApiBaseUrl(),_0x4c427e=await fetch(_0xa6e85f+'/api/v1/mcp/features/'+_0x5d9192+_0x48ee01(0x76)+_0x4bf310+_0x48ee01(0xbb),{'method':_0x209f49['raiNZ'],'headers':{'Authorization':'Bearer\x20'+_0x497d85}});if(!_0x4c427e['ok']){const _0xdd3dc2=await _0x4c427e[_0x48ee01(0xb3)]();throw new Error(_0x48ee01(0x84)+_0xdd3dc2);}return _0x4c427e[_0x48ee01(0x8d)]();}export async function markCommentsAddressed(_0x41f967,_0x280cdb,_0x2a42e7){const _0x2f30e3=_0x3a3a,_0x14277c={'JnYEt':function(_0x14fa81){return _0x14fa81();},'cZTIv':_0x2f30e3(0x93),'pdaFK':function(_0xf2559b){return _0xf2559b();},'IDBSY':function(_0xd119ea,_0x408fd3,_0x1dd025){return _0xd119ea(_0x408fd3,_0x1dd025);},'jsxaG':'application/json'},_0x3f3c4c=await _0x14277c['JnYEt'](getToken);if(!_0x3f3c4c)throw new Error(_0x14277c[_0x2f30e3(0xae)]);const _0x263a1f=_0x14277c['pdaFK'](getApiBaseUrl),_0x2b252d=await _0x14277c[_0x2f30e3(0x7e)](fetch,_0x263a1f+'/api/v1/mcp/features/'+_0x41f967+_0x2f30e3(0x9e),{'method':_0x2f30e3(0x7c),'headers':{'Authorization':'Bearer\x20'+_0x3f3c4c,'Content-Type':_0x14277c[_0x2f30e3(0xb7)]},'body':JSON[_0x2f30e3(0xbd)]({'checklistItemId':_0x280cdb,'commentIds':_0x2a42e7})});if(!_0x2b252d['ok']){const _0x1ef818=await _0x2b252d[_0x2f30e3(0xb3)]();throw new Error(_0x2f30e3(0x8b)+_0x1ef818);}}export async function softDeleteFeature(_0x45d8a2){const _0x3446af=_0x3a3a,_0x327540={'GCABE':function(_0x146726){return _0x146726();},'OFvvd':'DELETE'},_0xb71735=await _0x327540['GCABE'](getToken);if(!_0xb71735)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x4838f4=getApiBaseUrl(),_0x3099f4=await fetch(_0x4838f4+_0x3446af(0xa1)+_0x45d8a2,{'method':_0x327540['OFvvd'],'headers':{'Authorization':_0x3446af(0xb5)+_0xb71735}});if(!_0x3099f4['ok']){const _0x5cb881=await _0x3099f4['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x5cb881);}}export async function restoreFeature(_0x2fda9a){const _0x1f93db=_0x3a3a,_0x231a24={'inKcw':_0x1f93db(0x93),'BBVtd':function(_0x320690){return _0x320690();}},_0x2bfe3d=await getToken();if(!_0x2bfe3d)throw new Error(_0x231a24[_0x1f93db(0x7b)]);const _0x10cef=_0x231a24[_0x1f93db(0x8c)](getApiBaseUrl),_0x47b50a=await fetch(_0x10cef+_0x1f93db(0xa1)+_0x2fda9a+_0x1f93db(0x9d),{'method':_0x1f93db(0x7c),'headers':{'Authorization':_0x1f93db(0xb5)+_0x2bfe3d}});if(!_0x47b50a['ok']){const _0x968301=await _0x47b50a[_0x1f93db(0xb3)]();throw new Error(_0x1f93db(0x75)+_0x968301);}}