@ranger-testing/ranger-cli 2.5.4-alpha.a70fc60-4 → 2.5.4-alpha.a98f848-6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/skills/ranger/SKILL.md +17 -3
- package/build/skills/ranger/create.md +6 -0
- package/build/skills/ranger/verify.md +23 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2e4b1c=_0x484d;(function(_0x1fe1ae,_0xae4569){const _0x1d4276=_0x484d,_0x44837f=_0x1fe1ae();while(!![]){try{const _0x410082=parseInt(_0x1d4276(0x1b7))/0x1+parseInt(_0x1d4276(0x175))/0x2+-parseInt(_0x1d4276(0x176))/0x3+-parseInt(_0x1d4276(0x198))/0x4+parseInt(_0x1d4276(0x17b))/0x5+parseInt(_0x1d4276(0x1b0))/0x6+parseInt(_0x1d4276(0x1a2))/0x7*(-parseInt(_0x1d4276(0x193))/0x8);if(_0x410082===_0xae4569)break;else _0x44837f['push'](_0x44837f['shift']());}catch(_0x309df3){_0x44837f['push'](_0x44837f['shift']());}}}(_0x3248,0x26fbb));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x2befbc from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';function _0x3248(){const _0x377b67=['250192MOfBmo','845409krKBob','force','wuTcq','sessionCheckPath','\x20failed\x20(','1485770GnlWwc','prompt','status','keys','launch','stringify','EsoyB','confirm','GGGre','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','YaFVK','Bearer\x20','cookies','DAxRv','DCTjG','/api/v1/profiles/','parse','TTioG','txyqA','setupHeaders','organizationId','/login','Browser\x20login\x20timed\x20out\x20after\x20','265736NVjTTS','xqgiH','environment_key','length','message','463792mwLDYN','baseUrl','\x20\x20No\x20live\x20session\x20for\x20\x22','POST','WZEva','):\x20','newPage','wDwoV','ZnjsE','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','28QNoVlu','settings','profiles','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','/api/v1/profiles','gIoAs','not_configured','gCIgc','code','detail','NuRex','error','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','name','98688vOGotw','yhQBa','asAGo','aokLg','toISOString','IjGAv','SBAGh','251596tMJcrk','env','iEuLR','/api/v1/profiles/auth-config','\x22,\x20cached\x20locally','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','JEatJ','LvWqH','OZbKm','gVPEd','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','sessionState','AXiJQ','ywcgM','\x20\x20Cached\x20session\x20for\x20\x22','Browser\x20login\x20timed\x20out\x20before\x20completion.','log','catch','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'];_0x3248=function(){return _0x377b67;};return _0x3248();}import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x1f850f=_0x484d,_0x5bf2c9={'LieDu':function(_0x26a4b3){return _0x26a4b3();},'ZnjsE':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x2c67fe=await _0x5bf2c9['LieDu'](getToken);if(!_0x2c67fe)throw new Error(_0x5bf2c9[_0x1f850f(0x1a0)]);return _0x2c67fe;}async function apiRequest(_0x33e494,_0x180b9d={}){const _0xdc3fbb=_0x484d,_0x2eabd8={'Dntcl':function(_0x31575b){return _0x31575b();},'asAGo':'application/json','yhQBa':'string'},_0x27bf33=await _0x2eabd8['Dntcl'](requireToken),_0x25c4a9=getApiBaseUrl(),_0x14a0db=await fetch(''+_0x25c4a9+_0x33e494,{..._0x180b9d,'headers':{'Authorization':_0xdc3fbb(0x187)+_0x27bf33,'Content-Type':_0x2eabd8[_0xdc3fbb(0x1b2)],..._0x180b9d['headers']??{}}});if(!_0x14a0db['ok']){let _0x5aa68c='',_0x3089db;try{const _0xb553fd=await _0x14a0db['json']();_0x5aa68c=(typeof _0xb553fd['error']==='string'?_0xb553fd[_0xdc3fbb(0x1ad)]:undefined)??JSON['stringify'](_0xb553fd);if(typeof _0xb553fd['code']===_0x2eabd8[_0xdc3fbb(0x1b1)])_0x3089db=_0xb553fd['code'];}catch{_0x5aa68c=_0x14a0db['statusText'];}throw new ApiError('API\x20request\x20'+_0x33e494+_0xdc3fbb(0x17a)+_0x14a0db['status']+_0xdc3fbb(0x19d)+_0x5aa68c,_0x14a0db['status'],_0x5aa68c,_0x3089db);}return _0x14a0db['json']();}export class ApiError extends Error{[_0x2e4b1c(0x17d)];['detail'];[_0x2e4b1c(0x1aa)];constructor(_0x57f826,_0x14e563,_0x396336,_0x129e3c){const _0x2f9a2f=_0x2e4b1c,_0x5c25b6={'OZbKm':'ApiError'};super(_0x57f826),this['status']=_0x14e563,this[_0x2f9a2f(0x1ab)]=_0x396336,this[_0x2f9a2f(0x1aa)]=_0x129e3c,this['name']=_0x5c25b6[_0x2f9a2f(0x16a)];}}export async function fetchCloudProfile(_0x390aa9){const _0x522794=_0x2e4b1c,_0x1477e1={'XqRmp':function(_0x129c90,_0x1d5aad){return _0x129c90(_0x1d5aad);},'WZEva':function(_0x310b8f,_0x9a83a){return _0x310b8f instanceof _0x9a83a;},'TTioG':function(_0x582435,_0x5cac8b){return _0x582435===_0x5cac8b;}};try{return await apiRequest(_0x522794(0x18b)+_0x1477e1['XqRmp'](encodeURIComponent,_0x390aa9));}catch(_0x9fc754){if(_0x1477e1[_0x522794(0x19c)](_0x9fc754,ApiError)&&_0x1477e1[_0x522794(0x18d)](_0x9fc754[_0x522794(0x17d)],0x194))return null;throw _0x9fc754;}}export async function listCloudProfiles(){const _0x57290c=_0x2e4b1c,_0x186ba2=await apiRequest(_0x57290c(0x1a6));return _0x186ba2[_0x57290c(0x1a4)];}export async function createCloudProfile(_0x2b5b6a,_0xd1d365,_0x24e7bf){const _0x51d54f=_0x2e4b1c,_0x47738a={'HuRFE':function(_0xffe666,_0x5ad5a8){return _0xffe666>_0x5ad5a8;},'gCIgc':_0x51d54f(0x19b)},_0x49f43d={'name':_0x2b5b6a};if(_0xd1d365)_0x49f43d[_0x51d54f(0x195)]=_0xd1d365;if(_0x24e7bf&&_0x47738a['HuRFE'](Object[_0x51d54f(0x17e)](_0x24e7bf)[_0x51d54f(0x196)],0x0))_0x49f43d[_0x51d54f(0x1a3)]=_0x24e7bf;return await apiRequest(_0x51d54f(0x1a6),{'method':_0x47738a[_0x51d54f(0x1a9)],'body':JSON[_0x51d54f(0x180)](_0x49f43d)});}export async function uploadCloudProfileSession(_0x5b5950,_0x3f6ded){const _0x2d04d2=_0x2e4b1c;return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x5b5950)+'/session',{'method':'POST','body':JSON[_0x2d04d2(0x180)]({'session_state':_0x3f6ded})});}function _0x484d(_0x2063ee,_0x15a05d){_0x2063ee=_0x2063ee-0x164;const _0x32489f=_0x3248();let _0x484dbe=_0x32489f[_0x2063ee];return _0x484dbe;}export async function saveCloudProfileCredentials(_0x241d5e,_0x17c814,_0x13cd96){const _0xf32534=_0x2e4b1c,_0x8138e={'YaFVK':function(_0x2f162a,_0xdba975,_0x279eb6){return _0x2f162a(_0xdba975,_0x279eb6);}};await _0x8138e[_0xf32534(0x186)](apiRequest,_0xf32534(0x18b)+encodeURIComponent(_0x241d5e),{'method':'PUT','body':JSON['stringify']({'username':_0x17c814,'password':_0x13cd96})});}export async function fetchAuthConfig(){const _0xbfcfe6=_0x2e4b1c,_0x3136fa={'AXiJQ':_0xbfcfe6(0x165)};try{const _0xa0d1dd=await apiRequest(_0x3136fa[_0xbfcfe6(0x16e)]);return _0xa0d1dd['auth_config'];}catch{return null;}}export async function writeSessionToLocalCache(_0x2045df,_0x3328ea,_0x213188,_0x3a87c5,_0x498999,_0x1fa9f8){const _0x2fe7a3=_0x2e4b1c,_0x3f794d={'EsoyB':function(_0x15fad8,_0x2f8832){return _0x15fad8(_0x2f8832);},'eYXGd':function(_0x125380,_0x56f796,_0x562442){return _0x125380(_0x56f796,_0x562442);},'DAxRv':'auth','NuRex':function(_0x5985fd,_0x1c3b89,_0x2839e0){return _0x5985fd(_0x1c3b89,_0x2839e0);}},_0x4d6b18=_0x3f794d[_0x2fe7a3(0x181)](sessionCacheHash,{'orgId':_0x3328ea,'profileName':_0x2045df,'effectiveBaseUrl':_0x213188,'setupHeaders':_0x3a87c5}),_0x2a63c5=getSessionCachePath(_0x4d6b18,_0x2045df),_0x94a35f=_0x3f794d['eYXGd'](join,getRangerHomeDir(),_0x3f794d[_0x2fe7a3(0x189)]);!existsSync(_0x94a35f)&&await mkdir(_0x94a35f,{'recursive':!![]});const _0x2121c3={..._0x498999};_0x1fa9f8&&_0x1fa9f8['length']>0x0&&Array['isArray'](_0x2121c3[_0x2fe7a3(0x188)])&&(_0x2121c3[_0x2fe7a3(0x188)]=duplicateCookiesForDomains(_0x2121c3['cookies'],_0x1fa9f8));const _0x4d55c7={'cached_at':new Date()[_0x2fe7a3(0x1b4)](),'session_state':_0x2121c3};await _0x3f794d[_0x2fe7a3(0x1ac)](writeFile,_0x2a63c5,JSON['stringify'](_0x4d55c7,null,0x2));const _0x366e50=getStorageStatePath(_0x2a63c5);return await _0x3f794d['NuRex'](writeFile,_0x366e50,JSON['stringify'](_0x2121c3,null,0x2)),_0x366e50;}export async function checkLocalCache(_0x5a4340,_0x3d5be9,_0x59d86f,_0x41ebf7){const _0x342071=_0x2e4b1c,_0x2a15f4={'jeHzi':function(_0x14d288,_0x24e144){return _0x14d288(_0x24e144);},'JIwQB':function(_0x3552d4,_0x49789d,_0x41b63f){return _0x3552d4(_0x49789d,_0x41b63f);},'SEfIU':'utf-8'},_0x555bf9=_0x2a15f4['jeHzi'](sessionCacheHash,{'orgId':_0x3d5be9,'profileName':_0x5a4340,'effectiveBaseUrl':_0x59d86f,'setupHeaders':_0x41ebf7}),_0x2db954=_0x2a15f4['JIwQB'](getSessionCachePath,_0x555bf9,_0x5a4340),_0x3ea18b=_0x2a15f4['jeHzi'](getStorageStatePath,_0x2db954);if(!existsSync(_0x2db954)||!existsSync(_0x3ea18b))return null;try{const _0x3f813b=await readFile(_0x2db954,_0x2a15f4['SEfIU']);return JSON[_0x342071(0x18c)](_0x3f813b),{'storageStatePath':_0x3ea18b};}catch{return null;}}function launchRealBrowser(){const _0x486aeb=_0x2e4b1c;return chromium[_0x486aeb(0x17f)]({'headless':!![]});}export async function serverSideLogin(_0x568ae7,_0x2b75cf){const _0x5561b8=_0x2e4b1c,_0x513e75={'JEatJ':_0x5561b8(0x19b),'IjGAv':_0x5561b8(0x1a8)},_0x5f363a=process['env']['RANGER_TEST_USERNAME'],_0x3ed651=process[_0x5561b8(0x1b8)]['RANGER_TEST_PASSWORD'],_0x5dc0bf={};if(_0x5f363a)_0x5dc0bf['username']=_0x5f363a;if(_0x3ed651)_0x5dc0bf['password']=_0x3ed651;if(_0x2b75cf?.[_0x5561b8(0x177)])_0x5dc0bf['force']=!![];try{return await apiRequest(_0x5561b8(0x18b)+encodeURIComponent(_0x568ae7)+_0x5561b8(0x191),{'method':_0x513e75[_0x5561b8(0x168)],'body':JSON['stringify'](_0x5dc0bf)});}catch(_0x27daab){if(_0x27daab instanceof ApiError&&_0x27daab['status']===0x190&&_0x27daab[_0x5561b8(0x1aa)]===_0x5561b8(0x1a8))return{'status':_0x513e75[_0x5561b8(0x1b5)],'error':_0x27daab['detail']};throw _0x27daab;}}export async function manualBrowserLogin(_0x50df6a,_0x362ffe){const _0x3f541b=_0x2e4b1c,_0x29a6cf={'DCTjG':function(_0x572824,_0x49c20f){return _0x572824+_0x49c20f;},'vdbmo':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','gWBCN':'loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','wYIxb':function(_0x9931f1,_0x477978){return _0x9931f1>_0x477978;},'LvWqH':function(_0x466a8d,_0x176be5){return _0x466a8d(_0x176be5);},'dbjfJ':function(_0x2b5052,_0x372395){return _0x2b5052&&_0x372395;},'aokLg':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','xqgiH':function(_0x179a1d,_0x52bb3b,_0x16ea89){return _0x179a1d(_0x52bb3b,_0x16ea89);},'iEuLR':'cli:manual-login'};if(!isInteractive())throw new Error(_0x29a6cf[_0x3f541b(0x18a)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x50df6a[_0x3f541b(0x1af)]+'\x22.\x0a',_0x29a6cf['vdbmo'])+_0x29a6cf['gWBCN']);const _0xae36c1=_0x362ffe&&_0x29a6cf['wYIxb'](_0x362ffe['domains'][_0x3f541b(0x196)],0x0)?_0x362ffe['domains'][0x0]:'about:blank';console['log']('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console[_0x3f541b(0x172)](_0x3f541b(0x16c)),await new Promise(_0x9f9a2d=>setTimeout(_0x9f9a2d,0x7d0));const _0x1c860d=await chromium['launch']({'headless':![]});let _0x4a0000=null;try{const _0x5758a5={'ignoreHTTPSErrors':!![]};_0x362ffe?.['setupHeaders']&&(_0x5758a5['extraHTTPHeaders']=_0x362ffe[_0x3f541b(0x18f)]);const _0x483732=await _0x1c860d['newContext'](_0x5758a5);await _0x29a6cf[_0x3f541b(0x169)](addProfileSetupBanner,_0x483732);const _0xd41794=await _0x483732[_0x3f541b(0x19e)]();await _0xd41794['goto'](_0xae36c1);let _0x5d2989=![];await new Promise(_0x4e72b7=>{const _0x2adc5f=setTimeout(()=>{const _0x2a7209=_0x484d;_0x5d2989=!![],console['error'](_0x2a7209(0x192)+MANUAL_LOGIN_TIMEOUT_MS/0xea60+_0x2a7209(0x184)),_0x4e72b7();},MANUAL_LOGIN_TIMEOUT_MS);_0xd41794['on']('close',async()=>{clearTimeout(_0x2adc5f);try{const _0x2cf90f=await _0x483732['storageState']();_0x4a0000=_0x2cf90f;}catch{}_0x4e72b7();});});if(_0x29a6cf['dbjfJ'](_0x5d2989,!_0x4a0000))throw new Error(_0x3f541b(0x171));}finally{await _0x1c860d['close']()[_0x3f541b(0x173)](()=>{});}if(!_0x4a0000)throw new Error(_0x29a6cf[_0x3f541b(0x1b3)]);return await _0x29a6cf[_0x3f541b(0x194)](apiRequest,_0x3f541b(0x18b)+encodeURIComponent(_0x50df6a['name'])+'/session',{'method':_0x3f541b(0x19b),'body':JSON['stringify']({'session_state':_0x4a0000,'updated_by':_0x29a6cf[_0x3f541b(0x164)]})}),{'sessionState':_0x4a0000};}export async function promptSaveCredentials(_0x5503df){const _0x44e01b=_0x2e4b1c,_0x5985dc={'KvSjQ':function(_0x46e212){return _0x46e212();},'wqktx':_0x44e01b(0x182),'KsPOT':'save','mHNFP':'PUT','txyqA':'\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.'},_0x19c01a=process['env']['RANGER_TEST_USERNAME'],_0x5b4942=process[_0x44e01b(0x1b8)]['RANGER_TEST_PASSWORD'];if(!_0x19c01a||!_0x5b4942)return;if(!_0x5985dc['KvSjQ'](isInteractive))return;const {save:_0x31fe38}=await _0x2befbc[_0x44e01b(0x17c)]([{'type':_0x5985dc['wqktx'],'name':_0x5985dc['KsPOT'],'message':_0x44e01b(0x1ae),'default':![]}]);if(!_0x31fe38)return;await apiRequest(_0x44e01b(0x18b)+encodeURIComponent(_0x5503df),{'method':_0x5985dc['mHNFP'],'body':JSON[_0x44e01b(0x180)]({'username':_0x19c01a,'password':_0x5b4942})}),console[_0x44e01b(0x172)](_0x5985dc[_0x44e01b(0x18e)]);}export async function resolveCloudProfileSession(_0xd557b1,_0xf1f83={}){const _0x2c8eb8=_0x2e4b1c,_0x3a4077={'RCiQY':function(_0x3e15ae){return _0x3e15ae();},'gVPEd':function(_0x15fa0a,_0x40a8c6,_0x1f94b1,_0xfc1abe,_0x99c2c9){return _0x15fa0a(_0x40a8c6,_0x1f94b1,_0xfc1abe,_0x99c2c9);},'wDwoV':function(_0x1e7855,_0x116772,_0x22faa3,_0x2b52ec,_0x32a744,_0x3930bf,_0x1013fc){return _0x1e7855(_0x116772,_0x22faa3,_0x2b52ec,_0x32a744,_0x3930bf,_0x1013fc);},'ywcgM':function(_0xd53af6,_0x5d955d){return _0xd53af6(_0x5d955d);},'gIoAs':'not_configured','OCnIC':_0x2c8eb8(0x167),'GGGre':'success','xafzR':function(_0x34cd97,_0x3ec70f){return _0x34cd97&&_0x3ec70f;},'FaFBQ':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','SBAGh':_0x2c8eb8(0x185),'uwljk':function(_0xcd4d66,_0x2e0402){return _0xcd4d66 instanceof _0x2e0402;},'wuTcq':function(_0x51eed9,_0x470c24,_0x344ff5){return _0x51eed9(_0x470c24,_0x344ff5);}},_0x39bd55=_0xd557b1[_0x2c8eb8(0x1a3)]??{},_0x469c71=await _0x3a4077['RCiQY'](fetchAuthConfig),_0x5bcf73=_0x469c71?resolveAuthEnvironmentLocally(_0x469c71,_0xd557b1['environmentKey']):null,_0x51d390=_0x5bcf73?.['domains'],_0xc95616=_0x39bd55['setupHeaders'],_0x2ab059=_0xc95616??_0x5bcf73?.[_0x2c8eb8(0x18f)],_0x119863=_0xf1f83['effectiveBaseUrl']??_0x39bd55[_0x2c8eb8(0x199)]??(_0x51d390&&_0x51d390['length']>0x0?_0x51d390[0x0]:''),_0x1fd49e=await _0x3a4077[_0x2c8eb8(0x16b)](checkLocalCache,_0xd557b1[_0x2c8eb8(0x1af)],_0xd557b1['organizationId'],_0x119863,_0x2ab059);if(_0x1fd49e){if(_0x119863){const _0x145efb=await isCachedSessionLive(_0x1fd49e['storageStatePath'],_0x119863,{'sessionCheckPath':_0x5bcf73?.[_0x2c8eb8(0x179)],'setupHeaders':_0x2ab059},{'launchBrowser':launchRealBrowser});if(_0x145efb)return console['log'](_0x2c8eb8(0x1a5)+_0xd557b1['name']+'\x22'),{'authPath':_0x1fd49e['storageStatePath'],'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};console['log'](_0x2c8eb8(0x170)+_0xd557b1[_0x2c8eb8(0x1af)]+'\x22\x20failed\x20validation\x20—\x20refreshing...');}else return{'authPath':_0x1fd49e['storageStatePath'],'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};}if(_0xd557b1['sessionState']){const _0x1e64de=await _0x3a4077[_0x2c8eb8(0x19f)](writeSessionToLocalCache,_0xd557b1['name'],_0xd557b1[_0x2c8eb8(0x190)],_0x119863,_0x2ab059,_0xd557b1[_0x2c8eb8(0x16d)],_0x51d390);if(_0x119863){const _0x15c897=await isCachedSessionLive(_0x1e64de,_0x119863,{'sessionCheckPath':_0x5bcf73?.[_0x2c8eb8(0x179)],'setupHeaders':_0x2ab059},{'launchBrowser':launchRealBrowser});if(_0x15c897)return console['log'](_0x2c8eb8(0x1a1)+_0xd557b1[_0x2c8eb8(0x1af)]+_0x2c8eb8(0x166)),{'authPath':_0x1e64de,'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};console[_0x2c8eb8(0x172)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0xd557b1[_0x2c8eb8(0x1af)]+_0x2c8eb8(0x174));}else return{'authPath':_0x1e64de,'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};}console[_0x2c8eb8(0x172)](_0x2c8eb8(0x19a)+_0xd557b1['name']+'\x22,\x20attempting\x20login...');const _0x3d5fb4=Boolean(process['env']['RANGER_TEST_USERNAME'])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x583a69=_0x3a4077['ywcgM'](Boolean,_0xd557b1['username']);if(_0x3d5fb4||_0x583a69)try{const _0x191001=await _0x3a4077[_0x2c8eb8(0x16f)](serverSideLogin,_0xd557b1['name']);if(_0x191001['status']===_0x3a4077[_0x2c8eb8(0x1a7)])console[_0x2c8eb8(0x172)](_0x3a4077['OCnIC']);else{if(_0x191001['status']===_0x3a4077[_0x2c8eb8(0x183)]&&_0x191001['session_state']){console[_0x2c8eb8(0x172)]('\x20\x20Login\x20successful.\x20Session\x20cached.');const _0x14717d=await writeSessionToLocalCache(_0xd557b1[_0x2c8eb8(0x1af)],_0xd557b1['organizationId'],_0x119863,_0x2ab059,_0x191001['session_state'],_0x51d390);return _0x3a4077['xafzR'](_0x3d5fb4,!_0x583a69)&&await _0x3a4077[_0x2c8eb8(0x16f)](promptSaveCredentials,_0xd557b1['name']),{'authPath':_0x14717d,'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};}else _0x191001['test_output']&&(console['log'](_0x3a4077['FaFBQ']),console[_0x2c8eb8(0x172)](_0x191001['test_output'])),console[_0x2c8eb8(0x172)](_0x3a4077[_0x2c8eb8(0x1b6)]);}}catch(_0x1b7da2){console[_0x2c8eb8(0x172)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x3a4077['uwljk'](_0x1b7da2,Error)?_0x1b7da2[_0x2c8eb8(0x197)]:String(_0x1b7da2))),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const {sessionState:_0x3f11bf}=await _0x3a4077[_0x2c8eb8(0x178)](manualBrowserLogin,_0xd557b1,_0x5bcf73),_0x40427f=await _0x3a4077['wDwoV'](writeSessionToLocalCache,_0xd557b1['name'],_0xd557b1[_0x2c8eb8(0x190)],_0x119863,_0x2ab059,_0x3f11bf,_0x51d390);return{'authPath':_0x40427f,'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};}
|
|
1
|
+
const _0x3b72f8=_0x4080;(function(_0x25434f,_0x1b6144){const _0x5b9f95=_0x4080,_0x2ce761=_0x25434f();while(!![]){try{const _0x4d608e=parseInt(_0x5b9f95(0x1f8))/0x1*(-parseInt(_0x5b9f95(0x212))/0x2)+-parseInt(_0x5b9f95(0x1f0))/0x3+-parseInt(_0x5b9f95(0x1ee))/0x4*(-parseInt(_0x5b9f95(0x24b))/0x5)+-parseInt(_0x5b9f95(0x218))/0x6*(-parseInt(_0x5b9f95(0x217))/0x7)+-parseInt(_0x5b9f95(0x1f7))/0x8*(parseInt(_0x5b9f95(0x250))/0x9)+parseInt(_0x5b9f95(0x225))/0xa+-parseInt(_0x5b9f95(0x1eb))/0xb;if(_0x4d608e===_0x1b6144)break;else _0x2ce761['push'](_0x2ce761['shift']());}catch(_0x847b96){_0x2ce761['push'](_0x2ce761['shift']());}}}(_0x6b28,0x44622));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x75ca49 from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isCachedSessionLive,isInteractive,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;function _0x6b28(){const _0x998b2e=['auth','/api/v1/profiles/','error','environments','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','HHhJA','parse','domains','\x20\x20Login\x20successful.\x20Session\x20cached.','Browser\x20login\x20timed\x20out\x20after\x20','organizationId','14556AzrUzG','test_output','nXSJv','length','bPYIR','3848005zimNKd','6UHebnv','xKCjA','success','Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.','setupHeaders','environmentKey','about:blank','CDDDT','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','cli:manual-login','WqrMN','utf-8','goto','3549380gFiumg','not_configured','SYRbs','gggNu','ZDDsN','JixEN','/session','PUT','gWgdj','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','/login','string','aPcZw','defaultEnvironmentKey','bvCPb','DxfhH','name','statusText','QxyhT','RubdK','env','session_state','BBcAt','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','username','join','XdJqF','HsSQP','loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','BVIZf','dhXfo','status','\x22.\x0a',').\x20','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','toISOString','cookies','password','5BfiHjT','effectiveBaseUrl','log','hbkdY','headers','45pfuhYQ','application/json','settings','DaJBh','7250529wDXcYB','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','detail','2136280EMxgvi','sessionCheckPath','1194921NJlXwC','xsoxB','bapgG','save','EgzJi','sessionState','code','126952LzMNNW','3HVDPlP','isArray','XzfzN','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','Qsxad','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','split','/api/v1/profiles','message','POST','2|4|3|1|0','pVIuC','WzGDU','stringify'];_0x6b28=function(){return _0x998b2e;};return _0x6b28();}async function requireToken(){const _0xc99b6f={'iCInU':function(_0x4ca48e){return _0x4ca48e();}},_0x156842=await _0xc99b6f['iCInU'](getToken);if(!_0x156842)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');return _0x156842;}async function apiRequest(_0x541e51,_0x249a75={}){const _0x29c874=_0x4080,_0x447573={'nXSJv':function(_0xd589a2,_0x3ecff6,_0x6fb18a){return _0xd589a2(_0x3ecff6,_0x6fb18a);},'DxfhH':'string','HsSQP':function(_0x1f1522,_0x4c81d5){return _0x1f1522===_0x4c81d5;}},_0x219754=await requireToken(),_0x3b511=getApiBaseUrl(),_0x5f40f0=await _0x447573[_0x29c874(0x214)](fetch,''+_0x3b511+_0x541e51,{..._0x249a75,'headers':{'Authorization':'Bearer\x20'+_0x219754,'Content-Type':_0x29c874(0x1e8),..._0x249a75[_0x29c874(0x24f)]??{}}});if(!_0x5f40f0['ok']){let _0x57866a='',_0x9ecd31;try{const _0x41fd87=await _0x5f40f0['json']();_0x57866a=(typeof _0x41fd87[_0x29c874(0x209)]===_0x447573[_0x29c874(0x234)]?_0x41fd87['error']:undefined)??JSON['stringify'](_0x41fd87);if(_0x447573[_0x29c874(0x240)](typeof _0x41fd87[_0x29c874(0x1f6)],_0x29c874(0x230)))_0x9ecd31=_0x41fd87[_0x29c874(0x1f6)];}catch{_0x57866a=_0x5f40f0[_0x29c874(0x236)];}throw new ApiError('API\x20request\x20'+_0x541e51+'\x20failed\x20('+_0x5f40f0[_0x29c874(0x244)]+'):\x20'+_0x57866a,_0x5f40f0['status'],_0x57866a,_0x9ecd31);}return _0x5f40f0['json']();}export class ApiError extends Error{['status'];[_0x3b72f8(0x1ed)];[_0x3b72f8(0x1f6)];constructor(_0x1e276f,_0x464a20,_0x2bc571,_0x5b501a){const _0x3a4da5=_0x3b72f8,_0x2bd65a={'DaJBh':'ApiError'},_0x8d5263=_0x3a4da5(0x203)[_0x3a4da5(0x1ff)]('|');let _0x5ce0d3=0x0;while(!![]){switch(_0x8d5263[_0x5ce0d3++]){case'0':this['name']=_0x2bd65a[_0x3a4da5(0x1ea)];continue;case'1':this['code']=_0x5b501a;continue;case'2':super(_0x1e276f);continue;case'3':this['detail']=_0x2bc571;continue;case'4':this['status']=_0x464a20;continue;}break;}}}export async function fetchCloudProfile(_0x198118){const _0x5da033=_0x3b72f8,_0xd0badb={'sVYzh':function(_0x12c72f,_0x4d4b4e){return _0x12c72f(_0x4d4b4e);},'WqrMN':function(_0x27d653,_0x2014f6){return _0x27d653 instanceof _0x2014f6;},'oqYUQ':function(_0x95113a,_0x548d4a){return _0x95113a===_0x548d4a;}};try{return await _0xd0badb['sVYzh'](apiRequest,_0x5da033(0x208)+encodeURIComponent(_0x198118));}catch(_0x51f718){if(_0xd0badb[_0x5da033(0x222)](_0x51f718,ApiError)&&_0xd0badb['oqYUQ'](_0x51f718[_0x5da033(0x244)],0x194))return null;throw _0x51f718;}}export async function listCloudProfiles(){const _0x32300c=_0x3b72f8,_0x46f2c2={'Qsxad':_0x32300c(0x200)},_0x5413df=await apiRequest(_0x46f2c2[_0x32300c(0x1fc)]);return _0x5413df['profiles'];}export async function createCloudProfile(_0x375bba,_0x5b64e8,_0x1a9040={}){const _0x32890d=_0x3b72f8,_0xe36022={'VoaaB':_0x32890d(0x200),'vKgve':_0x32890d(0x202)},_0x530ae9={'name':_0x375bba};if(_0x5b64e8)_0x530ae9['environment_key']=_0x5b64e8;_0x1a9040['settings']&&Object['keys'](_0x1a9040['settings'])[_0x32890d(0x215)]>0x0&&(_0x530ae9[_0x32890d(0x1e9)]=_0x1a9040['settings']);if(_0x1a9040['username'])_0x530ae9['username']=_0x1a9040['username'];if(_0x1a9040[_0x32890d(0x24a)])_0x530ae9[_0x32890d(0x24a)]=_0x1a9040['password'];return await apiRequest(_0xe36022['VoaaB'],{'method':_0xe36022['vKgve'],'body':JSON[_0x32890d(0x206)](_0x530ae9)});}export async function uploadCloudProfileSession(_0x53c68e,_0x2459b6){const _0x104519=_0x3b72f8,_0x2cc33a={'gggNu':function(_0x4ff948,_0x3bf094){return _0x4ff948(_0x3bf094);},'dhXfo':'POST'};return await apiRequest('/api/v1/profiles/'+_0x2cc33a[_0x104519(0x228)](encodeURIComponent,_0x53c68e)+'/session',{'method':_0x2cc33a[_0x104519(0x243)],'body':JSON['stringify']({'session_state':_0x2459b6})});}export async function saveCloudProfileCredentials(_0x3a79f7,_0x497913,_0x4e5773){const _0x16a382=_0x3b72f8,_0x1b4c15={'HHhJA':'PUT'};await apiRequest(_0x16a382(0x208)+encodeURIComponent(_0x3a79f7),{'method':_0x1b4c15[_0x16a382(0x20c)],'body':JSON[_0x16a382(0x206)]({'username':_0x497913,'password':_0x4e5773})});}export async function fetchAuthConfig(){try{const _0x3319db=await apiRequest('/api/v1/profiles/auth-config');return _0x3319db['auth_config'];}catch{return null;}}export function pickAdHocEnvKey(_0xdee949){const _0x2fb3d2=_0x3b72f8,_0x4d1446={'LpUam':function(_0x1140bf,_0x4d01a1){return _0x1140bf===_0x4d01a1;},'SYRbs':function(_0x834646,_0x46ec6c){return _0x834646+_0x46ec6c;}};if(!_0xdee949)return null;if(_0xdee949[_0x2fb3d2(0x232)])return _0xdee949['defaultEnvironmentKey'];const _0x1d4e0a=Object['keys'](_0xdee949[_0x2fb3d2(0x20a)]??{});if(_0x4d1446['LpUam'](_0x1d4e0a[_0x2fb3d2(0x215)],0x1))return _0x1d4e0a[0x0];if(_0x1d4e0a['length']===0x0)return null;throw new Error(_0x4d1446[_0x2fb3d2(0x227)]('Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20('+_0x1d4e0a[_0x2fb3d2(0x23e)](',\x20')+_0x2fb3d2(0x246),_0x2fb3d2(0x21b)));}export async function resolveAdHocProfile(_0x305738=process[_0x3b72f8(0x239)]){const _0x6812ab=_0x3b72f8,_0x3cd298={'WzGDU':function(_0x24754f,_0x4a0b69){return _0x24754f(_0x4a0b69);},'bvCPb':function(_0x1e1f3d){return _0x1e1f3d();},'XdJqF':function(_0x5213c6,_0x4e4719){return _0x5213c6??_0x4e4719;}},_0x37266e=_0x305738['RANGER_TEST_USERNAME'];if(!_0x37266e)return null;const _0x4c4bac=await _0x3cd298['WzGDU'](fetchCloudProfile,_0x37266e);if(_0x4c4bac)return{'name':_0x4c4bac['name'],'profile':_0x4c4bac};const _0x96f9f6=await _0x3cd298[_0x6812ab(0x233)](fetchAuthConfig),_0x291b3f=_0x3cd298[_0x6812ab(0x205)](pickAdHocEnvKey,_0x96f9f6),_0xabbb0d=_0x305738['RANGER_TEST_PASSWORD'],_0x38397a=await createCloudProfile(_0x37266e,_0x3cd298[_0x6812ab(0x23f)](_0x291b3f,undefined),{'username':_0x37266e,'password':_0xabbb0d});return{'name':_0x38397a[_0x6812ab(0x235)],'profile':_0x38397a};}function _0x4080(_0x2d8463,_0x4e42a0){_0x2d8463=_0x2d8463-0x1e8;const _0x6b28d=_0x6b28();let _0x40800c=_0x6b28d[_0x2d8463];return _0x40800c;}export async function writeSessionToLocalCache(_0x535665,_0x281ff2,_0x346c9e,_0x21c73f,_0x2c95cf,_0x410310){const _0x3ab618=_0x3b72f8,_0x6b680f={'bPYIR':function(_0x25d05b,_0x375b7c){return _0x25d05b(_0x375b7c);},'QxyhT':function(_0x3c55a8,_0x4117b0,_0x50a882){return _0x3c55a8(_0x4117b0,_0x50a882);},'EBReu':function(_0x4f04c0,_0x5579d4,_0x287f2a){return _0x4f04c0(_0x5579d4,_0x287f2a);},'EgzJi':function(_0x14c3f0){return _0x14c3f0();},'tbZtk':_0x3ab618(0x207),'RubdK':function(_0x4a91bc,_0x5bec55,_0x3e281d){return _0x4a91bc(_0x5bec55,_0x3e281d);}},_0x22396b=_0x6b680f['bPYIR'](sessionCacheHash,{'orgId':_0x281ff2,'profileName':_0x535665,'effectiveBaseUrl':_0x346c9e,'setupHeaders':_0x21c73f}),_0x3f3899=_0x6b680f[_0x3ab618(0x237)](getSessionCachePath,_0x22396b,_0x535665),_0x83015f=_0x6b680f['EBReu'](join,_0x6b680f[_0x3ab618(0x1f4)](getRangerHomeDir),_0x6b680f['tbZtk']);!_0x6b680f[_0x3ab618(0x216)](existsSync,_0x83015f)&&await _0x6b680f[_0x3ab618(0x238)](mkdir,_0x83015f,{'recursive':!![]});const _0x143a4f={..._0x2c95cf};_0x410310&&_0x410310['length']>0x0&&Array[_0x3ab618(0x1f9)](_0x143a4f[_0x3ab618(0x249)])&&(_0x143a4f['cookies']=duplicateCookiesForDomains(_0x143a4f[_0x3ab618(0x249)],_0x410310));const _0x30ea74={'cached_at':new Date()[_0x3ab618(0x248)](),'session_state':_0x143a4f};await _0x6b680f['QxyhT'](writeFile,_0x3f3899,JSON['stringify'](_0x30ea74,null,0x2));const _0x217f19=_0x6b680f[_0x3ab618(0x216)](getStorageStatePath,_0x3f3899);return await writeFile(_0x217f19,JSON['stringify'](_0x143a4f,null,0x2)),_0x217f19;}export async function checkLocalCache(_0x5f049e,_0x515e45,_0x48dd84,_0x58e56c){const _0x44113a=_0x3b72f8,_0x4adaed={'swFhI':function(_0x132462,_0x1990a5,_0x14c469){return _0x132462(_0x1990a5,_0x14c469);},'xsoxB':function(_0x1169ac,_0x5c4001){return _0x1169ac(_0x5c4001);},'TdXcD':function(_0x409331,_0x527a2f,_0x38fcfe){return _0x409331(_0x527a2f,_0x38fcfe);},'lvHmA':_0x44113a(0x223)},_0x2a8afb=sessionCacheHash({'orgId':_0x515e45,'profileName':_0x5f049e,'effectiveBaseUrl':_0x48dd84,'setupHeaders':_0x58e56c}),_0x2c4982=_0x4adaed['swFhI'](getSessionCachePath,_0x2a8afb,_0x5f049e),_0x50efe1=getStorageStatePath(_0x2c4982);if(!existsSync(_0x2c4982)||!_0x4adaed[_0x44113a(0x1f1)](existsSync,_0x50efe1))return null;try{const _0x3ddbf9=await _0x4adaed['TdXcD'](readFile,_0x2c4982,_0x4adaed['lvHmA']);return JSON[_0x44113a(0x20d)](_0x3ddbf9),{'storageStatePath':_0x50efe1};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}export async function serverSideLogin(_0x5a4b2e,_0x244f85){const _0x30a6bc=_0x3b72f8,_0x547cf3={'bapgG':function(_0x382ca8,_0x1d5011,_0x2c4977){return _0x382ca8(_0x1d5011,_0x2c4977);},'aPcZw':function(_0x596601,_0x366d85){return _0x596601(_0x366d85);},'IyTZL':'POST','ZDDsN':function(_0x271b66,_0x19c309){return _0x271b66===_0x19c309;}},_0x30c3f5=process['env']['RANGER_TEST_USERNAME'],_0x335f43=process[_0x30a6bc(0x239)]['RANGER_TEST_PASSWORD'],_0x59d2ca={};if(_0x30c3f5)_0x59d2ca['username']=_0x30c3f5;if(_0x335f43)_0x59d2ca[_0x30a6bc(0x24a)]=_0x335f43;if(_0x244f85?.['force'])_0x59d2ca['force']=!![];try{return await _0x547cf3[_0x30a6bc(0x1f2)](apiRequest,'/api/v1/profiles/'+_0x547cf3[_0x30a6bc(0x231)](encodeURIComponent,_0x5a4b2e)+_0x30a6bc(0x22f),{'method':_0x547cf3['IyTZL'],'body':JSON['stringify'](_0x59d2ca)});}catch(_0x39ee18){if(_0x39ee18 instanceof ApiError&&_0x39ee18['status']===0x190&&_0x547cf3[_0x30a6bc(0x229)](_0x39ee18[_0x30a6bc(0x1f6)],'not_configured'))return{'status':_0x30a6bc(0x226),'error':_0x39ee18['detail']};throw _0x39ee18;}}export async function manualBrowserLogin(_0x5daad7,_0x41d0e2){const _0x1bcc76=_0x3b72f8,_0xa1531={'YKeoO':function(_0x1050dc,_0x491424){return _0x1050dc/_0x491424;},'BBcAt':function(_0x5f00de){return _0x5f00de();},'tmuSn':function(_0x272246,_0x1b3f97){return _0x272246>_0x1b3f97;},'vmuif':_0x1bcc76(0x1ec),'pHSPG':function(_0x213b3e,_0x5d440e){return _0x213b3e(_0x5d440e);},'PfUbq':'Browser\x20login\x20timed\x20out\x20before\x20completion.','AhazH':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','Gztcj':function(_0x6ca7db,_0x4e6f2d,_0x5d2896){return _0x6ca7db(_0x4e6f2d,_0x5d2896);},'tNWKw':'POST','CDDDT':_0x1bcc76(0x221)};if(!_0xa1531[_0x1bcc76(0x23b)](isInteractive))throw new Error('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x5daad7[_0x1bcc76(0x235)]+_0x1bcc76(0x245)+_0x1bcc76(0x1fb)+_0x1bcc76(0x241));const _0x191f7a=_0x41d0e2&&_0xa1531['tmuSn'](_0x41d0e2['domains'][_0x1bcc76(0x215)],0x0)?_0x41d0e2['domains'][0x0]:_0x1bcc76(0x21e);console['log'](_0x1bcc76(0x22e)),console[_0x1bcc76(0x24d)](_0xa1531['vmuif']),await new Promise(_0x4418f6=>setTimeout(_0x4418f6,0x7d0));const _0x5a1990=await chromium['launch']({'headless':![]});let _0x13f11a=null;try{const _0x18640b={'ignoreHTTPSErrors':!![]};_0x41d0e2?.['setupHeaders']&&(_0x18640b['extraHTTPHeaders']=_0x41d0e2['setupHeaders']);const _0x504d9f=await _0x5a1990['newContext'](_0x18640b);await _0xa1531['pHSPG'](addProfileSetupBanner,_0x504d9f);const _0x3a5f36=await _0x504d9f['newPage']();await _0x3a5f36[_0x1bcc76(0x224)](_0x191f7a);let _0x32d800=![];await new Promise(_0x4be4a5=>{const _0x5636db=setTimeout(()=>{const _0xcd6f29=_0x4080;_0x32d800=!![],console['error'](_0xcd6f29(0x210)+_0xa1531['YKeoO'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0xcd6f29(0x1fe)),_0x4be4a5();},MANUAL_LOGIN_TIMEOUT_MS);_0x3a5f36['on']('close',async()=>{clearTimeout(_0x5636db);try{const _0x187085=await _0x504d9f['storageState']();_0x13f11a=_0x187085;}catch{}_0x4be4a5();});});if(_0x32d800&&!_0x13f11a)throw new Error(_0xa1531['PfUbq']);}finally{await _0x5a1990['close']()['catch'](()=>{});}if(!_0x13f11a)throw new Error(_0xa1531['AhazH']);return await _0xa1531['Gztcj'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x5daad7[_0x1bcc76(0x235)])+_0x1bcc76(0x22b),{'method':_0xa1531['tNWKw'],'body':JSON['stringify']({'session_state':_0x13f11a,'updated_by':_0xa1531[_0x1bcc76(0x21f)]})}),{'sessionState':_0x13f11a};}export async function promptSaveCredentials(_0x2f00f6){const _0x546501=_0x3b72f8,_0x6177ee={'JixEN':function(_0x435cba,_0x3999af){return _0x435cba||_0x3999af;},'BVIZf':_0x546501(0x1f3),'ErSbW':function(_0x5fb81e,_0x39a90c){return _0x5fb81e(_0x39a90c);},'yijtw':_0x546501(0x22c),'hbkdY':'\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.'},_0xca05dd=process[_0x546501(0x239)]['RANGER_TEST_USERNAME'],_0x43cc04=process['env']['RANGER_TEST_PASSWORD'];if(_0x6177ee[_0x546501(0x22a)](!_0xca05dd,!_0x43cc04))return;if(!isInteractive())return;const {save:_0x571fe9}=await _0x75ca49['prompt']([{'type':'confirm','name':_0x6177ee[_0x546501(0x242)],'message':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','default':![]}]);if(!_0x571fe9)return;await apiRequest(_0x546501(0x208)+_0x6177ee['ErSbW'](encodeURIComponent,_0x2f00f6),{'method':_0x6177ee['yijtw'],'body':JSON['stringify']({'username':_0xca05dd,'password':_0x43cc04})}),console[_0x546501(0x24d)](_0x6177ee[_0x546501(0x24e)]);}export async function resolveCloudProfileSession(_0x1a9475,_0x46da18={}){const _0x3712c2=_0x3b72f8,_0x8cfa99={'CSyXS':function(_0x46893f){return _0x46893f();},'YZoTZ':function(_0x4e408f,_0x5bcbce,_0x301bb5){return _0x4e408f(_0x5bcbce,_0x301bb5);},'XzfzN':function(_0x22c0dd,_0x434478,_0xf87222,_0x290519,_0x3810a2){return _0x22c0dd(_0x434478,_0xf87222,_0x290519,_0x3810a2);},'YWwPg':function(_0x456a0a,_0x517a1a){return _0x456a0a(_0x517a1a);},'uMHJZ':function(_0x42e88c,_0x67f66a){return _0x42e88c||_0x67f66a;},'xKCjA':'not_configured','klebJ':_0x3712c2(0x20f),'pVIuC':function(_0x24ee9b,_0x559b58){return _0x24ee9b(_0x559b58);},'gWgdj':_0x3712c2(0x220),'Kojab':_0x3712c2(0x247)},_0xc2c0fa=_0x1a9475['settings']??{},_0x70e053=await _0x8cfa99['CSyXS'](fetchAuthConfig),_0x25f380=_0x70e053?_0x8cfa99['YZoTZ'](resolveAuthEnvironmentLocally,_0x70e053,_0x1a9475[_0x3712c2(0x21d)]):null,_0x3f3bef=_0x25f380?.[_0x3712c2(0x20e)],_0x4763c7=_0xc2c0fa[_0x3712c2(0x21c)],_0x55fb8b=_0x4763c7??_0x25f380?.['setupHeaders'],_0x258607=_0x46da18[_0x3712c2(0x24c)]??_0xc2c0fa['baseUrl']??(_0x3f3bef&&_0x3f3bef['length']>0x0?_0x3f3bef[0x0]:''),_0x258dea=await _0x8cfa99[_0x3712c2(0x1fa)](checkLocalCache,_0x1a9475[_0x3712c2(0x235)],_0x1a9475['organizationId'],_0x258607,_0x55fb8b);if(_0x258dea){if(_0x258607){const _0x25636a=await isCachedSessionLive(_0x258dea['storageStatePath'],_0x258607,{'sessionCheckPath':_0x25f380?.[_0x3712c2(0x1ef)],'setupHeaders':_0x55fb8b},{'launchBrowser':launchRealBrowser});if(_0x25636a)return console[_0x3712c2(0x24d)](_0x3712c2(0x20b)+_0x1a9475[_0x3712c2(0x235)]+'\x22'),{'authPath':_0x258dea['storageStatePath'],'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};console[_0x3712c2(0x24d)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0x1a9475[_0x3712c2(0x235)]+'\x22\x20failed\x20validation\x20—\x20refreshing...');}else return{'authPath':_0x258dea['storageStatePath'],'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};}if(_0x1a9475['sessionState']){const _0xaad98f=await writeSessionToLocalCache(_0x1a9475[_0x3712c2(0x235)],_0x1a9475[_0x3712c2(0x211)],_0x258607,_0x55fb8b,_0x1a9475[_0x3712c2(0x1f5)],_0x3f3bef);if(_0x258607){const _0x983ded=await _0x8cfa99[_0x3712c2(0x1fa)](isCachedSessionLive,_0xaad98f,_0x258607,{'sessionCheckPath':_0x25f380?.['sessionCheckPath'],'setupHeaders':_0x55fb8b},{'launchBrowser':launchRealBrowser});if(_0x983ded)return console['log'](_0x3712c2(0x1fd)+_0x1a9475['name']+'\x22,\x20cached\x20locally'),{'authPath':_0xaad98f,'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};console[_0x3712c2(0x24d)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x1a9475['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...');}else return{'authPath':_0xaad98f,'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};}console[_0x3712c2(0x24d)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x1a9475[_0x3712c2(0x235)]+'\x22,\x20attempting\x20login...');const _0x2e4c47=_0x8cfa99['YWwPg'](Boolean,process['env']['RANGER_TEST_USERNAME'])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x3f1b1b=Boolean(_0x1a9475[_0x3712c2(0x23d)]);if(_0x8cfa99['uMHJZ'](_0x2e4c47,_0x3f1b1b))try{const _0x2864b3=await _0x8cfa99['YWwPg'](serverSideLogin,_0x1a9475[_0x3712c2(0x235)]);if(_0x2864b3['status']===_0x8cfa99[_0x3712c2(0x219)])console[_0x3712c2(0x24d)](_0x3712c2(0x23c));else{if(_0x2864b3[_0x3712c2(0x244)]===_0x3712c2(0x21a)&&_0x2864b3[_0x3712c2(0x23a)]){console[_0x3712c2(0x24d)](_0x8cfa99['klebJ']);const _0x33fc0f=await writeSessionToLocalCache(_0x1a9475[_0x3712c2(0x235)],_0x1a9475[_0x3712c2(0x211)],_0x258607,_0x55fb8b,_0x2864b3[_0x3712c2(0x23a)],_0x3f3bef);return _0x2e4c47&&!_0x3f1b1b&&await _0x8cfa99[_0x3712c2(0x204)](promptSaveCredentials,_0x1a9475['name']),{'authPath':_0x33fc0f,'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};}else _0x2864b3[_0x3712c2(0x213)]&&(console[_0x3712c2(0x24d)](_0x8cfa99[_0x3712c2(0x22d)]),console['log'](_0x2864b3[_0x3712c2(0x213)])),console[_0x3712c2(0x24d)](_0x8cfa99['Kojab']);}}catch(_0x3fefb2){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x3fefb2 instanceof Error?_0x3fefb2[_0x3712c2(0x201)]:String(_0x3fefb2))),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const {sessionState:_0x5b37c6}=await manualBrowserLogin(_0x1a9475,_0x25f380),_0x38f5b5=await writeSessionToLocalCache(_0x1a9475[_0x3712c2(0x235)],_0x1a9475['organizationId'],_0x258607,_0x55fb8b,_0x5b37c6,_0x3f3bef);return{'authPath':_0x38f5b5,'settings':_0xc2c0fa,'resolvedEnv':_0x25f380};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x540789=_0x191a;(function(_0x2f6943,_0xa58bdc){const _0x985ba8=_0x191a,_0xf546c6=_0x2f6943();while(!![]){try{const _0x1ac5ca=-parseInt(_0x985ba8(0x1bc))/0x1*(-parseInt(_0x985ba8(0x1ab))/0x2)+-parseInt(_0x985ba8(0x19a))/0x3+parseInt(_0x985ba8(0x1a9))/0x4*(-parseInt(_0x985ba8(0x1a4))/0x5)+parseInt(_0x985ba8(0x198))/0x6*(parseInt(_0x985ba8(0x19f))/0x7)+parseInt(_0x985ba8(0x19d))/0x8*(parseInt(_0x985ba8(0x1b5))/0x9)+parseInt(_0x985ba8(0x1c2))/0xa+parseInt(_0x985ba8(0x1a1))/0xb*(-parseInt(_0x985ba8(0x1aa))/0xc);if(_0x1ac5ca===_0xa58bdc)break;else _0xf546c6['push'](_0xf546c6['shift']());}catch(_0x5a4d53){_0xf546c6['push'](_0xf546c6['shift']());}}}(_0x3238,0xb6ebc));import{createHash}from'crypto';import{join}from'path';function _0x191a(_0x46e3e2,_0x4abb65){_0x46e3e2=_0x46e3e2-0x197;const _0x3238ef=_0x3238();let _0x191af3=_0x3238ef[_0x46e3e2];return _0x191af3;}import{getRangerHomeDir}from'./rangerRoot.js';function _0x3238(){const _0x72e4d1=['2739105UyDpfu','setupHeaders','defaultEnvironmentKey','fqqKb','hostname','has','toString','1198urdiWB','userAgent','digest','localhost.','map','close','3761370yjoJHG','port','stringify','profileName','push','3930708NDfJnF','endsWith','603378HgPtVP','grIiP','YByrg','8VUSrbl','sessionDeps','14SNGNmP','test','12419NorylC','qlAne','replace','204235Hisysq','clientIp','length','stdout','domain','44vvwIpq','21804DVpPUh','2438WZgsRY','catch','.json','baseUrl','.localhost','sessionCheckPath','effectiveBaseUrl','newPage','hex','isTTY'];_0x3238=function(){return _0x72e4d1;};return _0x3238();}export function isInteractive(_0x32c838=process['env'],_0x40f09f={'stdin':process['stdin'],'stdout':process[_0x540789(0x1a7)]}){const _0x561bb1=_0x540789,_0x477591={'afNHM':function(_0x5d5617,_0x386c70){return _0x5d5617(_0x386c70);}};if(_0x32c838['CI'])return![];return Boolean(_0x40f09f['stdin']['isTTY'])&&_0x477591['afNHM'](Boolean,_0x40f09f[_0x561bb1(0x1a7)][_0x561bb1(0x1b4)]);}export const DEFAULT_SESSION_DEPS=[_0x540789(0x1ae),_0x540789(0x1b6)];export function sessionCacheHash(_0x5cc007){const _0x5f3882=_0x540789,_0x34b0bc={'YpDQM':_0x5f3882(0x1c3),'YByrg':_0x5f3882(0x1a5),'HxDFo':function(_0x36e910,_0x51e658){return _0x36e910(_0x51e658);},'AqhTH':'sha256','fJZeB':_0x5f3882(0x1b3)},_0x211733=_0x5cc007[_0x5f3882(0x19e)]??DEFAULT_SESSION_DEPS,_0x32ea15=new Set(_0x211733),_0x29f948={'orgId':_0x5cc007['orgId'],'profileName':_0x5cc007[_0x5f3882(0x1c5)]};return(_0x32ea15['has']('baseUrl')||!_0x5cc007['sessionDeps'])&&(_0x29f948['effectiveBaseUrl']=_0x5cc007[_0x5f3882(0x1b1)]),(_0x32ea15[_0x5f3882(0x1ba)]('setupHeaders')||!_0x5cc007['sessionDeps'])&&(_0x29f948[_0x5f3882(0x1b6)]=_0x5cc007['setupHeaders']?sortObjectKeys(_0x5cc007['setupHeaders']):_0x5cc007[_0x5f3882(0x1b6)]),_0x32ea15['has'](_0x34b0bc['YpDQM'])&&(_0x29f948[_0x5f3882(0x1c3)]=extractPort(_0x5cc007[_0x5f3882(0x1b1)])),_0x32ea15[_0x5f3882(0x1ba)]('userAgent')&&_0x5cc007['userAgent']!==undefined&&(_0x29f948[_0x5f3882(0x1bd)]=_0x5cc007[_0x5f3882(0x1bd)]),_0x32ea15[_0x5f3882(0x1ba)](_0x34b0bc[_0x5f3882(0x19c)])&&_0x5cc007['clientIp']!==undefined&&(_0x29f948[_0x5f3882(0x1a5)]=_0x5cc007[_0x5f3882(0x1a5)]),_0x34b0bc['HxDFo'](createHash,_0x34b0bc['AqhTH'])['update'](JSON[_0x5f3882(0x1c4)](_0x29f948))[_0x5f3882(0x1be)](_0x34b0bc['fJZeB'])['slice'](0x0,0xc);}function extractPort(_0x44bd31){try{return new URL(_0x44bd31)['port'];}catch{return'';}}function sortObjectKeys(_0xfdf065){const _0x24f96c={};for(const _0x48c48d of Object['keys'](_0xfdf065)['sort']()){_0x24f96c[_0x48c48d]=_0xfdf065[_0x48c48d];}return _0x24f96c;}export function getSessionCachePath(_0x71ec31,_0x3b2c5d){const _0x4e3371=_0x540789,_0x7de28a={'GsLJz':function(_0x4c52c1,_0x47fbff,_0xd22b63,_0x48feb6){return _0x4c52c1(_0x47fbff,_0xd22b63,_0x48feb6);},'grIiP':'auth'};return _0x7de28a['GsLJz'](join,getRangerHomeDir(),_0x7de28a[_0x4e3371(0x19b)],_0x71ec31+'-'+_0x3b2c5d+_0x4e3371(0x1ad));}export function getStorageStatePath(_0x585261){const _0x2fd1d6=_0x540789,_0xe84bdc={'VuYYN':'.storageState.json'};return _0x585261[_0x2fd1d6(0x1a3)](/\.json$/,_0xe84bdc['VuYYN']);}export function needsTunnel(_0x2666d4){const _0x163b17=_0x540789,_0x45f8fb={'PITsJ':function(_0x207208,_0x3b019e){return _0x207208===_0x3b019e;},'qlAne':_0x163b17(0x1af),'yvGqV':_0x163b17(0x1bf)};let _0x1e2fd3;try{_0x1e2fd3=new URL(_0x2666d4)[_0x163b17(0x1b9)];}catch{return![];}if(_0x45f8fb['PITsJ'](_0x1e2fd3,'localhost')||_0x1e2fd3==='127.0.0.1')return!![];if(_0x1e2fd3[_0x163b17(0x199)](_0x45f8fb[_0x163b17(0x1a2)]))return!![];if(_0x1e2fd3['includes'](_0x45f8fb['yvGqV']))return!![];return![];}export function hostnameOf(_0x2db0de){return new URL(_0x2db0de)['hostname'];}export function duplicateCookiesForDomains(_0x2e9a1d,_0x360436){const _0x425525=_0x540789,_0xdafff0={'fqqKb':function(_0xf0af9,_0x1542c2){return _0xf0af9(_0x1542c2);}},_0x45f540=[..._0x2e9a1d],_0x45890a=new Set(_0x2e9a1d[_0x425525(0x1c0)](_0x5bdf9e=>_0x5bdf9e[_0x425525(0x1a8)]));for(const _0x4871b3 of _0x360436){let _0xf6900e;try{_0xf6900e=_0xdafff0[_0x425525(0x1b8)](hostnameOf,_0x4871b3);}catch{continue;}if(!_0xf6900e)continue;const _0x20859b=_0xf6900e['startsWith']('.')?_0xf6900e:'.'+_0xf6900e;if(_0x45890a['has'](_0xf6900e)||_0x45890a['has'](_0x20859b))continue;for(const _0x12d905 of _0x2e9a1d){_0x45f540[_0x425525(0x197)]({..._0x12d905,'domain':_0x20859b});}_0x45890a['add'](_0x20859b);}return _0x45f540;}export function resolveAuthEnvironmentLocally(_0x276642,_0x3d153d){const _0x35d5a2=_0x540789,_0x512499=_0x276642['environments'];if(_0x3d153d){const _0x230b46=_0x512499[_0x3d153d];if(!_0x230b46)return null;return{'key':_0x3d153d,..._0x230b46};}if(_0x276642['defaultEnvironmentKey']){const _0x222e65=_0x512499[_0x276642['defaultEnvironmentKey']];if(!_0x222e65)return null;return{'key':_0x276642[_0x35d5a2(0x1b7)],..._0x222e65};}const _0x4dc05d=Object['keys'](_0x512499);if(_0x4dc05d[_0x35d5a2(0x1a6)]===0x1){const _0x2dc731=_0x4dc05d[0x0];return{'key':_0x2dc731,..._0x512499[_0x2dc731]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x1e8dcb,_0x4209c8){const _0x280879=_0x540789;try{if(_0x4209c8)return new URL(_0x4209c8,_0x1e8dcb)['toString']();return new URL(_0x1e8dcb)[_0x280879(0x1bb)]();}catch{return null;}}export function looksLikeLoginUrl(_0x3a6cc3){const _0x5ec03a=_0x540789;try{const _0x1498da=new URL(_0x3a6cc3);return LOGIN_URL_PATTERN[_0x5ec03a(0x1a0)](_0x1498da['pathname']);}catch{return LOGIN_URL_PATTERN['test'](_0x3a6cc3);}}export async function isCachedSessionLive(_0x53f3d0,_0x3e4618,_0x5ee335={},_0x2ebafa={}){const _0x1a4c74=_0x540789,_0x14ace8=buildSessionCheckUrl(_0x3e4618,_0x5ee335[_0x1a4c74(0x1b0)]);if(!_0x14ace8)return!![];if(!_0x2ebafa['launchBrowser'])return!![];let _0x33b789=null;try{_0x33b789=await _0x2ebafa['launchBrowser']();const _0x41ab17=await _0x33b789['newContext']({'storageState':_0x53f3d0,'ignoreHTTPSErrors':!![],..._0x5ee335[_0x1a4c74(0x1b6)]?{'extraHTTPHeaders':_0x5ee335[_0x1a4c74(0x1b6)]}:{}}),_0xcfc771=await _0x41ab17[_0x1a4c74(0x1b2)](),_0x21a87d=await _0xcfc771['goto'](_0x14ace8,{'waitUntil':'domcontentloaded','timeout':0x3a98}),_0x14a0a5=_0x21a87d?.['status']();if(_0x14a0a5===0x191||_0x14a0a5===0x193)return![];const _0x177f3b=_0xcfc771['url']();if(looksLikeLoginUrl(_0x177f3b))return![];return!![];}catch{return![];}finally{if(_0x33b789)await _0x33b789[_0x1a4c74(0x1c1)]()[_0x1a4c74(0x1ac)](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x21a969=_0x4321;function _0x4321(_0x9b074c,_0x4bb7be){_0x9b074c=_0x9b074c-0x108;const _0x1149cc=_0x1149();let _0x4321ed=_0x1149cc[_0x9b074c];return _0x4321ed;}(function(_0x404d99,_0x3370a1){const _0x284b1d=_0x4321,_0x38b455=_0x404d99();while(!![]){try{const _0x5e12bd=-parseInt(_0x284b1d(0x10b))/0x1+parseInt(_0x284b1d(0x117))/0x2+-parseInt(_0x284b1d(0x114))/0x3*(-parseInt(_0x284b1d(0x108))/0x4)+parseInt(_0x284b1d(0x115))/0x5+parseInt(_0x284b1d(0x113))/0x6+parseInt(_0x284b1d(0x116))/0x7*(-parseInt(_0x284b1d(0x10f))/0x8)+parseInt(_0x284b1d(0x10c))/0x9*(-parseInt(_0x284b1d(0x10e))/0xa);if(_0x5e12bd===_0x3370a1)break;else _0x38b455['push'](_0x38b455['shift']());}catch(_0x18c931){_0x38b455['push'](_0x38b455['shift']());}}}(_0x1149,0x54a36));function _0x1149(){const _0x706ab6=['2667165qhlIIb','182aFDEZN','753900CFPtIA','2541928EkDouf','sha256','ranger-auth-encryption','379150spJFiq','2007qvOMfM','concat','55640YzMUSi','22384YRSdQz','final','update','getAuthTag','2960898RgwBUY','3icSaNM'];_0x1149=function(){return _0x706ab6;};return _0x1149();}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT=_0x21a969(0x10a),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x3bb241){const _0x34a796=_0x21a969;return pbkdf2Sync(_0x3bb241,SALT,0x186a0,KEY_LENGTH,_0x34a796(0x109));}export function encrypt(_0x2ebf7d,_0xe910d7){const _0x176cc6=_0x21a969,_0x54eea0={'FUcOQ':'utf8'},_0x1d2bb1=deriveKey(_0xe910d7),_0x29a132=randomBytes(IV_LENGTH),_0x1a8988=createCipheriv(ALGORITHM,_0x1d2bb1,_0x29a132),_0x7169e3=Buffer['concat']([_0x1a8988['update'](_0x2ebf7d,_0x54eea0['FUcOQ']),_0x1a8988[_0x176cc6(0x110)]()]),_0xd0a74e=_0x1a8988[_0x176cc6(0x112)]();return Buffer[_0x176cc6(0x10d)]([_0x29a132,_0xd0a74e,_0x7169e3]);}export function decrypt(_0x3cbc52,_0x2f19b0){const _0x23102=_0x21a969,_0x429c55={'zUKVM':function(_0xf1ee01,_0x47747e){return _0xf1ee01+_0x47747e;},'HtFXM':function(_0x54912c,_0x183231,_0x149f9f,_0x101b46){return _0x54912c(_0x183231,_0x149f9f,_0x101b46);}},_0x42dd49=deriveKey(_0x2f19b0),_0x38ed95=_0x3cbc52['subarray'](0x0,IV_LENGTH),_0x64684a=_0x3cbc52['subarray'](IV_LENGTH,_0x429c55['zUKVM'](IV_LENGTH,TAG_LENGTH)),_0x3e0254=_0x3cbc52['subarray'](_0x429c55['zUKVM'](IV_LENGTH,TAG_LENGTH)),_0x5da820=_0x429c55['HtFXM'](createDecipheriv,ALGORITHM,_0x42dd49,_0x38ed95);return _0x5da820['setAuthTag'](_0x64684a),_0x5da820[_0x23102(0x111)](_0x3e0254)+_0x5da820[_0x23102(0x110)]('utf8');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x274677=_0x41e3;(function(_0x2f2fb1,_0x565d0e){const _0x24f50a=_0x41e3,_0x3db437=_0x2f2fb1();while(!![]){try{const _0x4af765=-parseInt(_0x24f50a(0x143))/0x1*(parseInt(_0x24f50a(0x170))/0x2)+parseInt(_0x24f50a(0x16c))/0x3+parseInt(_0x24f50a(0x15d))/0x4+-parseInt(_0x24f50a(0x142))/0x5*(-parseInt(_0x24f50a(0x147))/0x6)+parseInt(_0x24f50a(0x157))/0x7*(parseInt(_0x24f50a(0x15f))/0x8)+-parseInt(_0x24f50a(0x151))/0x9*(-parseInt(_0x24f50a(0x14f))/0xa)+-parseInt(_0x24f50a(0x16d))/0xb;if(_0x4af765===_0x565d0e)break;else _0x3db437['push'](_0x3db437['shift']());}catch(_0x9c4ba){_0x3db437['push'](_0x3db437['shift']());}}}(_0x54be,0x9caf7));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x274677(0x166),'-t',_0x274677(0x172),'--api-key',_0x274677(0x146),'--key',_0x274677(0x141),'--pass','--auth',_0x274677(0x144),_0x274677(0x140),_0x274677(0x16e),_0x274677(0x15e)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x3d8a0e){const _0x5ab295=_0x274677;return TOKEN_PATTERNS[_0x5ab295(0x155)](_0x1b9156=>_0x1b9156['test'](_0x3d8a0e));}export function sanitizeArgs(_0x1af0fc){const _0x28d672=_0x274677,_0x42b9ec={'hhCHD':'[REDACTED]'},_0x151466=[];let _0x3d635b=![];for(let _0x3d4caa=0x0;_0x3d4caa<_0x1af0fc['length'];_0x3d4caa++){const _0x480fad=_0x1af0fc[_0x3d4caa];if(_0x3d635b){_0x151466[_0x28d672(0x165)](_0x28d672(0x163)),_0x3d635b=![];continue;}if(_0x480fad[_0x28d672(0x161)]('--')||_0x480fad['startsWith']('-')){const _0x576c31=_0x480fad[_0x28d672(0x16a)]('=');if(_0x576c31!==-0x1){const _0x2da13f=_0x480fad[_0x28d672(0x14c)](0x0,_0x576c31)[_0x28d672(0x169)]();if(SENSITIVE_FLAGS[_0x28d672(0x15c)](_0x2da13f)){_0x151466['push'](_0x480fad[_0x28d672(0x14c)](0x0,_0x576c31)+'=[REDACTED]');continue;}}else{const _0x236fa5=_0x480fad[_0x28d672(0x169)]();SENSITIVE_FLAGS[_0x28d672(0x15c)](_0x236fa5)&&(_0x3d635b=!![]);}_0x151466[_0x28d672(0x165)](_0x480fad);}else looksLikeToken(_0x480fad)?_0x151466['push'](_0x42b9ec['hhCHD']):_0x151466[_0x28d672(0x165)](_0x480fad);}return _0x151466[_0x28d672(0x160)]('\x20');}export async function logDesirePath(_0x59e710){const _0x1d130e=_0x274677,_0x3c4746={'YWhvI':function(_0x280cfe){return _0x280cfe();},'npnVB':'application/json','VcBUU':'POST'};try{const _0x4c8282=await _0x3c4746[_0x1d130e(0x158)](getToken)['catch'](()=>null),_0x44ec8a=getApiBaseUrl(),_0x588414=_0x3c4746[_0x1d130e(0x158)](getCurrentVersion),_0x410e2a=_0x4c8282?_0x1d130e(0x159):'no_token',_0xaf70e={..._0x59e710['metadata'],'authStatus':_0x410e2a,'isTty':process['stdout'][_0x1d130e(0x162)]??![]},_0x186db6={'Content-Type':_0x3c4746[_0x1d130e(0x154)]};_0x4c8282&&(_0x186db6['Authorization']=_0x1d130e(0x15b)+_0x4c8282);const _0x49588e={'rawCommand':_0x59e710['rawCommand'],'errorMessage':_0x59e710[_0x1d130e(0x171)],'errorType':_0x59e710['errorType'],'featureId':_0x59e710['featureId'],'sessionId':_0x59e710['sessionId'],'metadata':_0xaf70e,'cliVersion':_0x588414};process[_0x1d130e(0x14d)][_0x1d130e(0x152)]&&(console[_0x1d130e(0x156)]('[desire-path]\x20Sending\x20log\x20to\x20'+_0x44ec8a+'/api/v1/mcp/desire-path-logs'),console['error']('[desire-path]\x20Payload:\x20'+JSON['stringify'](_0x49588e,null,0x2))),await fetch(_0x44ec8a+_0x1d130e(0x14a),{'method':_0x3c4746[_0x1d130e(0x14e)],'headers':_0x186db6,'body':JSON[_0x1d130e(0x168)](_0x49588e)});}catch(_0x346c38){process['env']['DEBUG']&&console[_0x1d130e(0x156)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x346c38);}}function _0x54be(){const _0x487cb7=['some','error','718193zDeGeo','YWhvI','has_token','Not\x20enough\x20non-option\x20arguments','Bearer\x20','has','3447708RFCXzu','--credentials','80nLIVkZ','join','startsWith','isTTY','[REDACTED]','runtime_error','push','--token','Invalid\x20values','stringify','toLowerCase','indexOf','invalid_option_value','3723657cQfcnC','40420193AyjcFL','--cookie','unknown','42454SNWAco','errorMessage','--secret','dAplx','--header','--password','5SokpGw','31xoAlRO','--authorization','Unknown\x20argument','--apikey','7360026gNriCh','unknown_argument','missing_required_argument','/api/v1/mcp/desire-path-logs','6|4|2|5|3|1|7|0','slice','env','VcBUU','73640VcVvfU','includes','756onmiiu','DEBUG','split','npnVB'];_0x54be=function(){return _0x487cb7;};return _0x54be();}function _0x41e3(_0x2f0d13,_0x59699c){_0x2f0d13=_0x2f0d13-0x13f;const _0x54becd=_0x54be();let _0x41e36e=_0x54becd[_0x2f0d13];return _0x41e36e;}export function getErrorType(_0x3a7c35,_0xc35d3d){const _0x12cacf=_0x274677,_0x3ce6a6={'VSZYo':_0x12cacf(0x16b),'dAplx':'Unknown\x20command','LaTFR':_0x12cacf(0x15a),'LvRoc':_0x12cacf(0x145)},_0x55c6dc=_0x12cacf(0x14b)[_0x12cacf(0x153)]('|');let _0x2b4fc5=0x0;while(!![]){switch(_0x55c6dc[_0x2b4fc5++]){case'0':return'syntax_error';case'1':if(_0x3a7c35['includes'](_0x12cacf(0x167)))return _0x3ce6a6['VSZYo'];continue;case'2':if(_0x3a7c35[_0x12cacf(0x150)](_0x3ce6a6[_0x12cacf(0x13f)]))return'unknown_command';continue;case'3':if(_0x3a7c35['includes'](_0x3ce6a6['LaTFR']))return _0x12cacf(0x149);continue;case'4':if(!_0x3a7c35)return _0x12cacf(0x16f);continue;case'5':if(_0x3a7c35['includes'](_0x3ce6a6['LvRoc']))return _0x12cacf(0x148);continue;case'6':if(_0xc35d3d)return _0x12cacf(0x164);continue;case'7':if(_0x3a7c35[_0x12cacf(0x150)]('Missing\x20required\x20argument'))return'missing_option';continue;}break;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x1652(){const _0x126f54=['7142712OSTOoy','SEeoZ','/organization/my-memberships','UcSFU','toString','user_code','Provisioning\x20CLI\x20token...','split','write','BHSxl','kNtxo','platform','https://api.workos.com/user_management/authenticate','device_code','EiGnf','memberships','length','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','POST','unref','\x27s\x20CLI\x20Key','/organization/self-serve-signup','from','GET','name','org_id','Device\x20authorization\x20timed\x20out','open','EIgHN','selected','Failed\x20to\x20request\x20device\x20code:\x20','status','8097705PbexZc','verification_uri_complete','1904682ITmQey','vMHQN','qvDEo','yRned','Failed\x20to\x20create\x20organization:\x20','DuYhI','/api-keys','18BLLNZG','isTTY','Code:\x20','4kBteCl','text','json','3741376MjLcDL','prompt','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','now','win32','8121830mrhwKM','parse','AHhpg','EiXPt','377665AkVxCL','organizationId','HQBwO','application/x-www-form-urlencoded','workosClientId','utf-8','email','ojAmL','access_token','ceXgj','6613208JfaVqv','token','mcp:write','refresh_token','nkvox','https://api.workos.com/user_management/authorize/device','iqwOu','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','/organization/me','ignore','application/json','stdout','log'];_0x1652=function(){return _0x126f54;};return _0x1652();}const _0x561a7b=_0x2308;(function(_0x5032cf,_0x24106d){const _0x59fbbd=_0x2308,_0xac07d=_0x5032cf();while(!![]){try{const _0x339ea0=-parseInt(_0x59fbbd(0x13b))/0x1*(parseInt(_0x59fbbd(0x12f))/0x2)+parseInt(_0x59fbbd(0x125))/0x3+parseInt(_0x59fbbd(0x132))/0x4+-parseInt(_0x59fbbd(0x137))/0x5+parseInt(_0x59fbbd(0x103))/0x6+-parseInt(_0x59fbbd(0x123))/0x7+-parseInt(_0x59fbbd(0x145))/0x8*(-parseInt(_0x59fbbd(0x12c))/0x9);if(_0x339ea0===_0x24106d)break;else _0xac07d['push'](_0xac07d['shift']());}catch(_0x44348d){_0xac07d['push'](_0xac07d['shift']());}}}(_0x1652,0xd63a9));import{spawn}from'child_process';import _0x28b495 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x561a7b(0x14a),WORKOS_TOKEN_URL=_0x561a7b(0x10f);export async function requestDeviceCode(_0x3a59fe){const _0x283d76=_0x561a7b,_0x546c05={'wLJgo':_0x283d76(0x115),'NdyZx':'application/x-www-form-urlencoded'},_0x2e0417=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x546c05['wLJgo'],'headers':{'Content-Type':_0x546c05['NdyZx']},'body':new URLSearchParams({'client_id':_0x3a59fe})});if(!_0x2e0417['ok']){const _0x3abddc=await _0x2e0417['text']();throw new Error(_0x283d76(0x121)+_0x2e0417[_0x283d76(0x122)]+'\x20'+_0x3abddc);}return _0x2e0417['json']();}export async function pollForTokens(_0x508a38,_0x5bbb36,_0x33343c,_0x3531d9){const _0x41c1b7=_0x561a7b,_0x313262={'TMOqy':function(_0x1c72a9,_0x3e2d3a){return _0x1c72a9*_0x3e2d3a;},'qvDEo':function(_0xe212d5,_0x108145){return _0xe212d5(_0x108145);},'qOBqf':function(_0x4159c5,_0x32ad55,_0x10d5a3){return _0x4159c5(_0x32ad55,_0x10d5a3);},'fdfMA':'POST','ZPzwL':'application/x-www-form-urlencoded','bMrov':'urn:ietf:params:oauth:grant-type:device_code','SGfGg':'authorization_pending','nkvox':function(_0x2a3495,_0x1cf892){return _0x2a3495===_0x1cf892;},'EiXPt':'Authentication\x20failed'},_0x50ba14=Date[_0x41c1b7(0x135)]()+_0x3531d9*0x3e8;let _0x2559da=_0x313262['TMOqy'](_0x33343c,0x3e8);while(Date[_0x41c1b7(0x135)]()<_0x50ba14){await _0x313262[_0x41c1b7(0x127)](sleep,_0x2559da);const _0x29b0bf=await _0x313262['qOBqf'](fetch,WORKOS_TOKEN_URL,{'method':_0x313262['fdfMA'],'headers':{'Content-Type':_0x313262['ZPzwL']},'body':new URLSearchParams({'client_id':_0x508a38,'device_code':_0x5bbb36,'grant_type':_0x313262['bMrov']})});if(_0x29b0bf['ok'])return _0x29b0bf[_0x41c1b7(0x131)]();const _0x3803fa=await _0x29b0bf[_0x41c1b7(0x131)]();if(_0x3803fa['error']===_0x313262['SGfGg'])continue;if(_0x313262[_0x41c1b7(0x149)](_0x3803fa['error'],'slow_down')){_0x2559da+=0x3e8;continue;}throw new Error(_0x3803fa['error_description']||_0x3803fa['error']||_0x313262[_0x41c1b7(0x13a)]);}throw new Error(_0x41c1b7(0x11d));}async function fetchUserProfile(_0x24a033){const _0x3aa86d=_0x561a7b,_0x3353ce=getApiBaseUrl();try{const _0xe7a20a=await fetch(_0x3353ce+_0x3aa86d(0x14d),{'method':'GET','headers':{'workos-token':_0x24a033}});if(_0xe7a20a['ok'])return _0xe7a20a['json']();}catch{}return null;}function buildKeyName(_0x101fad,_0xf85a0d){const _0x4ee7dc=_0x561a7b,_0x47d37f=_0xf85a0d['filter'](_0x3c7183=>_0x3c7183['name']===_0x101fad||_0x3c7183['name']['startsWith'](_0x101fad+'\x20('));if(_0x47d37f['length']===0x0)return _0x101fad;return _0x101fad+'\x20('+(_0x47d37f[_0x4ee7dc(0x113)]+0x1)+')';}export async function provisionApiKey(_0x706d5c){const _0x14982a=_0x561a7b,_0x5ebba9={'DCPKo':function(_0x64c9d8){return _0x64c9d8();},'ZQjpM':'application/json','fucac':function(_0x252d46,_0x327bcb){return _0x252d46(_0x327bcb);},'qreGy':'CLI\x20Key','AHhpg':_0x14982a(0x11a),'HQBwO':function(_0x363505,_0x354d1d,_0x499356){return _0x363505(_0x354d1d,_0x499356);},'kNtxo':_0x14982a(0x147)},_0x11fa0e=_0x5ebba9['DCPKo'](getApiBaseUrl),_0x3a5747={'Content-Type':_0x5ebba9['ZQjpM'],'workos-token':_0x706d5c},_0x45ed15=await _0x5ebba9['fucac'](fetchUserProfile,_0x706d5c),_0x2ec252=_0x45ed15?.['firstName']||_0x45ed15?.[_0x14982a(0x141)]?.['split']('@')[0x0],_0x184ae5=_0x2ec252?_0x2ec252+_0x14982a(0x117):_0x5ebba9['qreGy'];let _0x1ac137=[];try{const _0x1e5c33=await fetch(_0x11fa0e+_0x14982a(0x12b),{'method':_0x5ebba9[_0x14982a(0x139)],'headers':_0x3a5747});if(_0x1e5c33['ok']){const _0x11e83c=await _0x1e5c33['json']();_0x1ac137=_0x11e83c['apiKeys'];}}catch{}const _0x133955=_0x5ebba9[_0x14982a(0x13d)](buildKeyName,_0x184ae5,_0x1ac137),_0x11253=await _0x5ebba9['HQBwO'](fetch,_0x11fa0e+_0x14982a(0x12b),{'method':'POST','headers':_0x3a5747,'body':JSON['stringify']({'name':_0x133955,'scope':_0x5ebba9[_0x14982a(0x10d)]})});if(!_0x11253['ok']){const _0x17d372=await _0x11253['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x11253['status']+'\x20'+_0x17d372);}const _0xedf26a=await _0x11253['json']();return _0xedf26a['apiKey'][_0x14982a(0x146)];}export function openBrowser(_0x19a26f){const _0x340d18=_0x561a7b,_0x26b5d7={'iqwOu':function(_0x40f733,_0x3daad5,_0x2fd6db,_0x624d88){return _0x40f733(_0x3daad5,_0x2fd6db,_0x624d88);},'EiGnf':_0x340d18(0x14e),'eOBlo':function(_0x40e49,_0x8bf3c8){return _0x40e49===_0x8bf3c8;},'MrYkT':'xdg-open'};try{if(process['platform']===_0x340d18(0x136)){const _0x3c2ebb=_0x26b5d7[_0x340d18(0x14b)](spawn,'cmd',['/c','start','',_0x19a26f],{'detached':!![],'stdio':_0x26b5d7[_0x340d18(0x111)],'windowsHide':!![]});_0x3c2ebb[_0x340d18(0x116)]();return;}const _0x4da56c=_0x26b5d7['eOBlo'](process[_0x340d18(0x10e)],'darwin')?_0x340d18(0x11e):_0x26b5d7['MrYkT'],_0x579e2b=spawn(_0x4da56c,[_0x19a26f],{'detached':!![],'stdio':'ignore'});_0x579e2b[_0x340d18(0x116)]();}catch{}}function decodeJwtPayload(_0x37745e){const _0x22cc97=_0x561a7b,_0x4fd5bc={'coTeF':function(_0x3b1afa,_0x5bd8e3){return _0x3b1afa!==_0x5bd8e3;},'EIgHN':'Invalid\x20JWT\x20format','NQuSy':'base64url'},_0x29a953=_0x37745e[_0x22cc97(0x10a)]('.');if(_0x4fd5bc['coTeF'](_0x29a953[_0x22cc97(0x113)],0x3))throw new Error(_0x4fd5bc[_0x22cc97(0x11f)]);const _0x50bf52=Buffer[_0x22cc97(0x119)](_0x29a953[0x1],_0x4fd5bc['NQuSy'])[_0x22cc97(0x107)](_0x22cc97(0x140));return JSON[_0x22cc97(0x138)](_0x50bf52);}async function selfServeSignup(_0x3f7a02){const _0x3ffc55=_0x561a7b,_0x3545a0=getApiBaseUrl(),_0x56724e=await fetch(_0x3545a0+_0x3ffc55(0x118),{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x3f7a02}});if(!_0x56724e['ok']){const _0x7ad562=await _0x56724e['text']();throw new Error(_0x3ffc55(0x129)+_0x56724e['status']+'\x20'+_0x7ad562);}return _0x56724e[_0x3ffc55(0x131)]();}async function fetchMyMemberships(_0x3cf8ac){const _0x5918ce=_0x561a7b,_0x38ab99={'BHSxl':function(_0x34ae3b){return _0x34ae3b();},'sLTjQ':'GET'},_0x5d643c=_0x38ab99[_0x5918ce(0x10c)](getApiBaseUrl),_0x3bce73=await fetch(_0x5d643c+_0x5918ce(0x105),{'method':_0x38ab99['sLTjQ'],'headers':{'workos-token':_0x3cf8ac}});if(!_0x3bce73['ok']){const _0x55fbd0=await _0x3bce73['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x3bce73[_0x5918ce(0x122)]+'\x20'+_0x55fbd0);}const _0x4c68a3=await _0x3bce73[_0x5918ce(0x131)]();return _0x4c68a3[_0x5918ce(0x112)];}async function refreshTokenWithOrg(_0x3b506f,_0x335e80,_0x29ba98){const _0x5812df=_0x561a7b,_0x5245dc={'uLGkG':_0x5812df(0x13e)},_0x2fe694=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x5245dc['uLGkG']},'body':new URLSearchParams({'client_id':_0x3b506f,'grant_type':_0x5812df(0x148),'refresh_token':_0x335e80,'organization_id':_0x29ba98})});if(!_0x2fe694['ok']){const _0x11ba09=await _0x2fe694[_0x5812df(0x130)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x2fe694['status']+'\x20'+_0x11ba09);}return _0x2fe694[_0x5812df(0x131)]();}function _0x2308(_0xcd9f27,_0x26f542){_0xcd9f27=_0xcd9f27-0x103;const _0x1652a6=_0x1652();let _0x2308fa=_0x1652a6[_0xcd9f27];return _0x2308fa;}async function provisionCliToken(_0x538934){const _0x36b9ed=_0x561a7b,_0x3de618={'exsOI':function(_0x76fad3){return _0x76fad3();},'ceXgj':function(_0x2b395b,_0x30ed70,_0x418829){return _0x2b395b(_0x30ed70,_0x418829);},'DuYhI':_0x36b9ed(0x115)},_0x135aa3=_0x3de618['exsOI'](getApiBaseUrl),_0x600c65=await _0x3de618[_0x36b9ed(0x144)](fetch,_0x135aa3+'/cli-auth/token',{'method':_0x3de618[_0x36b9ed(0x12a)],'headers':{'Content-Type':_0x36b9ed(0x14f),'workos-token':_0x538934}});if(!_0x600c65['ok']){const _0xe0295b=await _0x600c65[_0x36b9ed(0x130)]();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x600c65[_0x36b9ed(0x122)]+'\x20'+_0xe0295b);}return _0x600c65['json']();}export async function runDeviceAuthFlow(){const _0x3c0bf8=_0x561a7b,_0x50af26={'ojAmL':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','GmBSL':function(_0x2a8e68,_0x2c6f6e){return _0x2a8e68===_0x2c6f6e;},'CmleJ':'Setting\x20up\x20your\x20organization...','yRned':function(_0x49d0de,_0x36dfc9){return _0x49d0de+_0x36dfc9;},'AgZxa':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','vMHQN':_0x3c0bf8(0x120),'UcSFU':'Select\x20an\x20organization:','SEeoZ':_0x3c0bf8(0x109)},_0x4ebe69=getCurrentEnvironment(),_0x28cae1=ENVIRONMENT_CONFIGS[_0x4ebe69][_0x3c0bf8(0x13f)],_0x145821=await requestDeviceCode(_0x28cae1);console[_0x3c0bf8(0x151)](_0x3c0bf8(0x114)),console[_0x3c0bf8(0x151)](_0x50af26[_0x3c0bf8(0x142)]),openBrowser(_0x145821[_0x3c0bf8(0x124)]),console['log'](_0x3c0bf8(0x134)+_0x145821[_0x3c0bf8(0x124)]),console[_0x3c0bf8(0x151)](_0x3c0bf8(0x12e)+_0x145821[_0x3c0bf8(0x108)]+'\x0a'),process['stdout'][_0x3c0bf8(0x10b)]('Waiting\x20for\x20authentication...');let _0x401ac8=await pollForTokens(_0x28cae1,_0x145821[_0x3c0bf8(0x110)],_0x145821['interval'],_0x145821['expires_in']);console[_0x3c0bf8(0x151)]('\x20✓');const _0x5c7a0a=decodeJwtPayload(_0x401ac8[_0x3c0bf8(0x143)]);if(!_0x5c7a0a[_0x3c0bf8(0x11c)]){const _0x342a5a=await fetchMyMemberships(_0x401ac8[_0x3c0bf8(0x143)]);let _0x36cc69;if(_0x50af26['GmBSL'](_0x342a5a[_0x3c0bf8(0x113)],0x0)){process['stdout'][_0x3c0bf8(0x10b)](_0x50af26['CmleJ']);const _0x293df1=await selfServeSignup(_0x401ac8['access_token']);_0x36cc69=_0x293df1[_0x3c0bf8(0x13c)],console['log']('\x20✓');}else{if(_0x50af26['GmBSL'](_0x342a5a['length'],0x1))_0x36cc69=_0x342a5a[0x0][_0x3c0bf8(0x13c)],console['log']('Using\x20organization:\x20'+_0x342a5a[0x0]['name']);else{const _0x479e46=process['stdin'][_0x3c0bf8(0x12d)]&&process[_0x3c0bf8(0x150)]['isTTY'];if(!_0x479e46)throw new Error(_0x50af26[_0x3c0bf8(0x128)](_0x3c0bf8(0x14c),_0x50af26['AgZxa']));const {selected:_0x435f4b}=await _0x28b495[_0x3c0bf8(0x133)]([{'type':'list','name':_0x50af26[_0x3c0bf8(0x126)],'message':_0x50af26[_0x3c0bf8(0x106)],'choices':_0x342a5a['map'](_0x7fe6a=>({'name':_0x7fe6a[_0x3c0bf8(0x11b)],'value':_0x7fe6a['organizationId']}))}]);_0x36cc69=_0x435f4b;}}_0x401ac8=await refreshTokenWithOrg(_0x28cae1,_0x401ac8[_0x3c0bf8(0x148)],_0x36cc69);}process[_0x3c0bf8(0x150)][_0x3c0bf8(0x10b)](_0x50af26[_0x3c0bf8(0x104)]);const _0xb879fd=await provisionCliToken(_0x401ac8[_0x3c0bf8(0x143)]);return console[_0x3c0bf8(0x151)]('\x20✓'),await storeToken(_0xb879fd[_0x3c0bf8(0x146)]),_0x401ac8[_0x3c0bf8(0x148)]&&await storeRefreshToken(_0x401ac8['refresh_token']),_0xb879fd[_0x3c0bf8(0x146)];}function sleep(_0x1d09d1){return new Promise(_0x43289a=>setTimeout(_0x43289a,_0x1d09d1));}
|
|
1
|
+
const _0x27acee=_0x4bd0;(function(_0x585ba3,_0x417b69){const _0x1a304b=_0x4bd0,_0x3aa6b0=_0x585ba3();while(!![]){try{const _0x1a2dd6=-parseInt(_0x1a304b(0x204))/0x1+parseInt(_0x1a304b(0x209))/0x2*(parseInt(_0x1a304b(0x213))/0x3)+parseInt(_0x1a304b(0x210))/0x4*(-parseInt(_0x1a304b(0x1fb))/0x5)+-parseInt(_0x1a304b(0x203))/0x6+-parseInt(_0x1a304b(0x207))/0x7*(parseInt(_0x1a304b(0x22c))/0x8)+-parseInt(_0x1a304b(0x214))/0x9*(parseInt(_0x1a304b(0x1f5))/0xa)+-parseInt(_0x1a304b(0x1db))/0xb*(-parseInt(_0x1a304b(0x1f2))/0xc);if(_0x1a2dd6===_0x417b69)break;else _0x3aa6b0['push'](_0x3aa6b0['shift']());}catch(_0x1931b1){_0x3aa6b0['push'](_0x3aa6b0['shift']());}}}(_0x2978,0x2c818));import{spawn}from'child_process';import _0x2ed47b from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x27acee(0x21e),WORKOS_TOKEN_URL=_0x27acee(0x1ee);export async function requestDeviceCode(_0x2d0fde){const _0x48e2c5=_0x27acee,_0x291a92={'KNzEQ':_0x48e2c5(0x1fa)},_0x3f0fa7=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x291a92[_0x48e2c5(0x1de)],'headers':{'Content-Type':_0x48e2c5(0x1f1)},'body':new URLSearchParams({'client_id':_0x2d0fde})});if(!_0x3f0fa7['ok']){const _0x6e77e7=await _0x3f0fa7['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x3f0fa7[_0x48e2c5(0x216)]+'\x20'+_0x6e77e7);}return _0x3f0fa7['json']();}export async function pollForTokens(_0x3b5a1f,_0x426f2e,_0x3583d6,_0x4116cc){const _0x27e4a5=_0x27acee,_0x3f9261={'JaWLI':function(_0x30e6e2,_0x28c01f){return _0x30e6e2+_0x28c01f;},'VFxur':function(_0x10b1d1,_0x327a94){return _0x10b1d1*_0x327a94;},'yRNmE':_0x27e4a5(0x1fa),'nsqZb':'application/x-www-form-urlencoded','DoIoR':function(_0x51833c,_0xd1f813){return _0x51833c===_0xd1f813;},'MGUHX':_0x27e4a5(0x200),'KlmQy':function(_0x482746,_0x52485){return _0x482746===_0x52485;},'KqEPZ':_0x27e4a5(0x1fe)},_0x434f7a=_0x3f9261[_0x27e4a5(0x20b)](Date['now'](),_0x4116cc*0x3e8);let _0x5a6eff=_0x3f9261['VFxur'](_0x3583d6,0x3e8);while(Date[_0x27e4a5(0x1f6)]()<_0x434f7a){await sleep(_0x5a6eff);const _0x57d4a5=await fetch(WORKOS_TOKEN_URL,{'method':_0x3f9261[_0x27e4a5(0x1e0)],'headers':{'Content-Type':_0x3f9261[_0x27e4a5(0x208)]},'body':new URLSearchParams({'client_id':_0x3b5a1f,'device_code':_0x426f2e,'grant_type':_0x27e4a5(0x1e2)})});if(_0x57d4a5['ok'])return _0x57d4a5['json']();const _0x406e05=await _0x57d4a5['json']();if(_0x3f9261['DoIoR'](_0x406e05['error'],_0x3f9261[_0x27e4a5(0x1ec)]))continue;if(_0x3f9261['KlmQy'](_0x406e05[_0x27e4a5(0x229)],'slow_down')){_0x5a6eff+=0x3e8;continue;}throw new Error(_0x406e05['error_description']||_0x406e05[_0x27e4a5(0x229)]||_0x27e4a5(0x1d2));}throw new Error(_0x3f9261['KqEPZ']);}async function fetchUserProfile(_0x3af8a7){const _0x509bd3={'XVduL':function(_0x5ea31f){return _0x5ea31f();},'dLklb':'GET'},_0x4427c3=_0x509bd3['XVduL'](getApiBaseUrl);try{const _0x337471=await fetch(_0x4427c3+'/organization/me',{'method':_0x509bd3['dLklb'],'headers':{'workos-token':_0x3af8a7}});if(_0x337471['ok'])return _0x337471['json']();}catch{}return null;}function buildKeyName(_0x5e7ae3,_0x555764){const _0x56478f=_0x27acee,_0x27d027={'XilAm':function(_0x403e4b,_0x320631){return _0x403e4b===_0x320631;},'XZjsC':function(_0x82bde1,_0x14e21d){return _0x82bde1+_0x14e21d;}},_0x53bcb2=_0x555764[_0x56478f(0x212)](_0x5f3f43=>_0x5f3f43['name']===_0x5e7ae3||_0x5f3f43['name'][_0x56478f(0x1eb)](_0x5e7ae3+'\x20('));if(_0x27d027['XilAm'](_0x53bcb2[_0x56478f(0x22a)],0x0))return _0x5e7ae3;return _0x5e7ae3+'\x20('+_0x27d027[_0x56478f(0x1f0)](_0x53bcb2[_0x56478f(0x22a)],0x1)+')';}export async function provisionApiKey(_0x5f92ca){const _0x231bb2=_0x27acee,_0x3673eb={'vuAcE':function(_0x27d706,_0x100415){return _0x27d706(_0x100415);},'spDRq':function(_0x52087f,_0x510ade,_0x55624d){return _0x52087f(_0x510ade,_0x55624d);},'DvwMb':function(_0x26e0e4,_0x55124b,_0x2bb896){return _0x26e0e4(_0x55124b,_0x2bb896);}},_0xb3b084=getApiBaseUrl(),_0x687056={'Content-Type':'application/json','workos-token':_0x5f92ca},_0x28e96e=await _0x3673eb[_0x231bb2(0x1e1)](fetchUserProfile,_0x5f92ca),_0x565b11=_0x28e96e?.['firstName']||_0x28e96e?.[_0x231bb2(0x20d)]?.['split']('@')[0x0],_0x5d0ff8=_0x565b11?_0x565b11+'\x27s\x20CLI\x20Key':'CLI\x20Key';let _0x33c2d4=[];try{const _0x4e16dd=await fetch(_0xb3b084+'/api-keys',{'method':'GET','headers':_0x687056});if(_0x4e16dd['ok']){const _0x4b4099=await _0x4e16dd[_0x231bb2(0x1e4)]();_0x33c2d4=_0x4b4099[_0x231bb2(0x217)];}}catch{}const _0x52f000=_0x3673eb[_0x231bb2(0x21f)](buildKeyName,_0x5d0ff8,_0x33c2d4),_0x3aa83a=await _0x3673eb[_0x231bb2(0x226)](fetch,_0xb3b084+'/api-keys',{'method':'POST','headers':_0x687056,'body':JSON['stringify']({'name':_0x52f000,'scope':_0x231bb2(0x1d8)})});if(!_0x3aa83a['ok']){const _0x2bf2fa=await _0x3aa83a[_0x231bb2(0x1fc)]();throw new Error(_0x231bb2(0x211)+_0x3aa83a[_0x231bb2(0x216)]+'\x20'+_0x2bf2fa);}const _0x443037=await _0x3aa83a[_0x231bb2(0x1e4)]();return _0x443037[_0x231bb2(0x228)][_0x231bb2(0x201)];}function _0x2978(){const _0x33c726=['Device\x20authorization\x20timed\x20out','mtpyx','authorization_pending','token','Waiting\x20for\x20authentication...','1938108jrGoGo','257469kKcBxq','ignore','log','225281GAHbBk','nsqZb','18sqnLHH','ZGfPo','JaWLI','platform','email','xdg-open','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','4ombCNr','Failed\x20to\x20provision\x20API\x20key:\x20','filter','108183qSyQDv','67023TaIuUk','application/json','status','apiKeys','VprFp','unref','prompt','stdout','/organization/my-memberships','iUvtu','https://api.workos.com/user_management/authorize/device','spDRq','open','cmd','organizationId','Code:\x20','toString','KwQbx','DvwMb','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','apiKey','error','length','start','8zEExcu','Authentication\x20failed','Setting\x20up\x20your\x20organization...','selected','AMIeW','EkitM','interval','mcp:write','fYSnW','Invalid\x20JWT\x20format','803Lkddso','OExEn','verification_uri_complete','KNzEQ','darwin','yRNmE','vuAcE','urn:ietf:params:oauth:grant-type:device_code','device_code','json','XsdsI','access_token','name','isTTY','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','xAxZZ','startsWith','MGUHX','/organization/self-serve-signup','https://api.workos.com/user_management/authenticate','Select\x20an\x20organization:','XZjsC','application/x-www-form-urlencoded','119772FurgMq','write','GET','170jGFmye','now','refresh_token','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','utf-8','POST','657985xgBrMo','text','NvAdo'];_0x2978=function(){return _0x33c726;};return _0x2978();}export function openBrowser(_0x98d726){const _0x26ef31=_0x27acee,_0x28560b={'orwUD':function(_0x1f9dbf,_0x401691){return _0x1f9dbf===_0x401691;},'Xtlcf':_0x26ef31(0x221),'VprFp':_0x26ef31(0x22b),'fYSnW':function(_0x2f9562,_0x3dae89){return _0x2f9562===_0x3dae89;},'KwQbx':_0x26ef31(0x1df),'iUvtu':_0x26ef31(0x20e)};try{if(_0x28560b['orwUD'](process[_0x26ef31(0x20c)],'win32')){const _0x1cefe0=spawn(_0x28560b['Xtlcf'],['/c',_0x28560b[_0x26ef31(0x218)],'',_0x98d726],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x1cefe0['unref']();return;}const _0x3ab579=_0x28560b[_0x26ef31(0x1d9)](process[_0x26ef31(0x20c)],_0x28560b[_0x26ef31(0x225)])?_0x26ef31(0x220):_0x28560b[_0x26ef31(0x21d)],_0x16ba5e=spawn(_0x3ab579,[_0x98d726],{'detached':!![],'stdio':_0x26ef31(0x205)});_0x16ba5e[_0x26ef31(0x219)]();}catch{}}function _0x4bd0(_0xf409ff,_0x204fca){_0xf409ff=_0xf409ff-0x1d2;const _0x297827=_0x2978();let _0x4bd0fe=_0x297827[_0xf409ff];return _0x4bd0fe;}function decodeJwtPayload(_0x591617){const _0x59f553=_0x27acee,_0x234943={'wCjle':_0x59f553(0x1da),'xAxZZ':'base64url','wwcRt':_0x59f553(0x1f9)},_0x4df65a=_0x591617['split']('.');if(_0x4df65a['length']!==0x3)throw new Error(_0x234943['wCjle']);const _0x3df7bc=Buffer['from'](_0x4df65a[0x1],_0x234943[_0x59f553(0x1ea)])[_0x59f553(0x224)](_0x234943['wwcRt']);return JSON['parse'](_0x3df7bc);}async function selfServeSignup(_0x5eb7bb){const _0x28c506=_0x27acee,_0x492593={'MWecn':'POST'},_0x314021=getApiBaseUrl(),_0x55b73d=await fetch(_0x314021+_0x28c506(0x1ed),{'method':_0x492593['MWecn'],'headers':{'Content-Type':_0x28c506(0x215),'workos-token':_0x5eb7bb}});if(!_0x55b73d['ok']){const _0xdc2b88=await _0x55b73d[_0x28c506(0x1fc)]();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x55b73d[_0x28c506(0x216)]+'\x20'+_0xdc2b88);}return _0x55b73d[_0x28c506(0x1e4)]();}async function fetchMyMemberships(_0x2e1943){const _0x18f2ca=_0x27acee,_0x4049d9={'ODnSB':function(_0x4a44d0){return _0x4a44d0();}},_0x49f944=_0x4049d9['ODnSB'](getApiBaseUrl),_0x320855=await fetch(_0x49f944+_0x18f2ca(0x21c),{'method':_0x18f2ca(0x1f4),'headers':{'workos-token':_0x2e1943}});if(!_0x320855['ok']){const _0x129859=await _0x320855[_0x18f2ca(0x1fc)]();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x320855['status']+'\x20'+_0x129859);}const _0x4dba27=await _0x320855[_0x18f2ca(0x1e4)]();return _0x4dba27['memberships'];}async function refreshTokenWithOrg(_0x28d947,_0x2a9862,_0x3bca87){const _0x400a3d=_0x27acee,_0x2b551b={'EkitM':'refresh_token'},_0x254b43=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x28d947,'grant_type':_0x2b551b[_0x400a3d(0x1d6)],'refresh_token':_0x2a9862,'organization_id':_0x3bca87})});if(!_0x254b43['ok']){const _0x26c00c=await _0x254b43['text']();throw new Error(_0x400a3d(0x20f)+_0x254b43[_0x400a3d(0x216)]+'\x20'+_0x26c00c);}return _0x254b43[_0x400a3d(0x1e4)]();}async function provisionCliToken(_0x51bc1d){const _0x5b47eb=_0x27acee,_0x163ee0={'XsdsI':function(_0x299a0c,_0x53faaa,_0x10ba6a){return _0x299a0c(_0x53faaa,_0x10ba6a);}},_0x40b909=getApiBaseUrl(),_0x74abbd=await _0x163ee0[_0x5b47eb(0x1e5)](fetch,_0x40b909+'/cli-auth/token',{'method':_0x5b47eb(0x1fa),'headers':{'Content-Type':_0x5b47eb(0x215),'workos-token':_0x51bc1d}});if(!_0x74abbd['ok']){const _0x53a6f8=await _0x74abbd[_0x5b47eb(0x1fc)]();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x74abbd[_0x5b47eb(0x216)]+'\x20'+_0x53a6f8);}return _0x74abbd[_0x5b47eb(0x1e4)]();}export async function runDeviceAuthFlow(){const _0x121fec=_0x27acee,_0x13f327={'NvAdo':function(_0x14e860){return _0x14e860();},'SrCnQ':_0x121fec(0x227),'ZGfPo':function(_0x42bb45,_0x1eab78){return _0x42bb45(_0x1eab78);},'yDWpq':function(_0x2204c3,_0x3d1642){return _0x2204c3(_0x3d1642);},'AMIeW':_0x121fec(0x1d3),'gAgHH':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','mtpyx':'list','bbBis':_0x121fec(0x1d4),'OExEn':_0x121fec(0x1ef),'ESjXq':'Provisioning\x20CLI\x20token...'},_0x99db28=_0x13f327[_0x121fec(0x1fd)](getCurrentEnvironment),_0x50dfb6=ENVIRONMENT_CONFIGS[_0x99db28]['workosClientId'],_0x162f95=await requestDeviceCode(_0x50dfb6);console['log'](_0x121fec(0x1e9)),console['log'](_0x13f327['SrCnQ']),_0x13f327['ZGfPo'](openBrowser,_0x162f95['verification_uri_complete']),console[_0x121fec(0x206)](_0x121fec(0x1f8)+_0x162f95[_0x121fec(0x1dd)]),console[_0x121fec(0x206)](_0x121fec(0x223)+_0x162f95['user_code']+'\x0a'),process[_0x121fec(0x21b)]['write'](_0x121fec(0x202));let _0x1b9e24=await pollForTokens(_0x50dfb6,_0x162f95[_0x121fec(0x1e3)],_0x162f95[_0x121fec(0x1d7)],_0x162f95['expires_in']);console[_0x121fec(0x206)]('\x20✓');const _0x1d2196=decodeJwtPayload(_0x1b9e24['access_token']);if(!_0x1d2196['org_id']){const _0x742d57=await _0x13f327['yDWpq'](fetchMyMemberships,_0x1b9e24['access_token']);let _0x8e17c8;if(_0x742d57[_0x121fec(0x22a)]===0x0){process[_0x121fec(0x21b)]['write'](_0x13f327[_0x121fec(0x1d5)]);const _0x1e2f04=await selfServeSignup(_0x1b9e24[_0x121fec(0x1e6)]);_0x8e17c8=_0x1e2f04[_0x121fec(0x222)],console['log']('\x20✓');}else{if(_0x742d57['length']===0x1)_0x8e17c8=_0x742d57[0x0]['organizationId'],console['log']('Using\x20organization:\x20'+_0x742d57[0x0][_0x121fec(0x1e7)]);else{const _0x21be86=process['stdin']['isTTY']&&process['stdout'][_0x121fec(0x1e8)];if(!_0x21be86)throw new Error('Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a'+_0x13f327['gAgHH']);const {selected:_0x57266e}=await _0x2ed47b[_0x121fec(0x21a)]([{'type':_0x13f327[_0x121fec(0x1ff)],'name':_0x13f327['bbBis'],'message':_0x13f327[_0x121fec(0x1dc)],'choices':_0x742d57['map'](_0x1774fb=>({'name':_0x1774fb['name'],'value':_0x1774fb[_0x121fec(0x222)]}))}]);_0x8e17c8=_0x57266e;}}_0x1b9e24=await refreshTokenWithOrg(_0x50dfb6,_0x1b9e24['refresh_token'],_0x8e17c8);}process['stdout'][_0x121fec(0x1f3)](_0x13f327['ESjXq']);const _0x96f8bf=await provisionCliToken(_0x1b9e24[_0x121fec(0x1e6)]);return console[_0x121fec(0x206)]('\x20✓'),await storeToken(_0x96f8bf['token']),_0x1b9e24[_0x121fec(0x1f7)]&&await _0x13f327[_0x121fec(0x20a)](storeRefreshToken,_0x1b9e24['refresh_token']),_0x96f8bf['token'];}function sleep(_0x2a129d){return new Promise(_0x476dae=>setTimeout(_0x476dae,_0x2a129d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x5f315a=_0x1dba;(function(_0x1c2bc8,_0x26ad19){const _0x489eed=_0x1dba,_0x2bba4e=_0x1c2bc8();while(!![]){try{const _0x5ab2eb=parseInt(_0x489eed(0x7b))/0x1*(-parseInt(_0x489eed(0x84))/0x2)+parseInt(_0x489eed(0x77))/0x3+parseInt(_0x489eed(0x8e))/0x4*(parseInt(_0x489eed(0x95))/0x5)+-parseInt(_0x489eed(0x7e))/0x6+-parseInt(_0x489eed(0x90))/0x7+parseInt(_0x489eed(0x89))/0x8*(parseInt(_0x489eed(0x8d))/0x9)+parseInt(_0x489eed(0x80))/0xa*(parseInt(_0x489eed(0x87))/0xb);if(_0x5ab2eb===_0x26ad19)break;else _0x2bba4e['push'](_0x2bba4e['shift']());}catch(_0x15bd26){_0x2bba4e['push'](_0x2bba4e['shift']());}}}(_0x3c39,0x870cd));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x5f315a(0x7c),'workosClientId':'client_01J9CBYM7M5ZETCF7G6614DXR2','aiProxyUrl':_0x5f315a(0x94),'mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x5f315a(0x78),'mcpAuthUrl':_0x5f315a(0x82)},'local':{'apiBaseUrl':_0x5f315a(0x81),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'http://localhost:8090','mcpAuthUrl':_0x5f315a(0x7a)}};export const DEFAULT_ENVIRONMENT=_0x5f315a(0x85);export function isValidEnvironment(_0x214cd7){const _0x3d0eb4=_0x5f315a,_0x58d033={'RKpYn':_0x3d0eb4(0x83),'sNKAv':_0x3d0eb4(0x93)};return _0x214cd7===_0x3d0eb4(0x85)||_0x214cd7===_0x58d033[_0x3d0eb4(0x7d)]||_0x214cd7===_0x58d033['sNKAv'];}function _0x3c39(){const _0x3f64e9=['711739aqtQmL','QHfuh','roPZl','local','https://ai-proxy-716115358910.us-central1.run.app','35jTjrXz','532764PuPNbx','https://ai-proxy-301751771437.us-central1.run.app','QUIQx','http://localhost:8080/mcp','25199GwKvxK','https://api.ranger.net','RKpYn','143982BtWbzT','true','10YiMqhq','http://localhost:8080','https://mcp-auth.staging.ranger.net/mcp','staging','74wJIHlb','prod','env','2959561eApjtk','SxPmK','751424xMnqBI','RANGER_DISABLE_MCP','RANGER_BYOK','LkFSW','36fsKABu','450772TfIKth','mcpAuthUrl'];_0x3c39=function(){return _0x3f64e9;};return _0x3c39();}export function getCurrentEnvironment(){const _0x10e097=process['env']['RANGER_CLI_ENV'];if(_0x10e097&&isValidEnvironment(_0x10e097))return _0x10e097;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x2b52a8=_0x5f315a,_0x453018={'QUIQx':function(_0x5b1acc){return _0x5b1acc();}};return ENVIRONMENT_CONFIGS[_0x453018[_0x2b52a8(0x79)](getCurrentEnvironment)]['apiBaseUrl'];}export function getAiProxyUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['aiProxyUrl'];}function _0x1dba(_0x41f0c6,_0x59f232){_0x41f0c6=_0x41f0c6-0x77;const _0x3c39e3=_0x3c39();let _0x1dba90=_0x3c39e3[_0x41f0c6];return _0x1dba90;}export function getMcpAuthUrl(){const _0xec72df=_0x5f315a,_0x2f28b7={'xMqvg':function(_0x560fce){return _0x560fce();}};return process[_0xec72df(0x86)]['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[_0x2f28b7['xMqvg'](getCurrentEnvironment)][_0xec72df(0x8f)];}export function isByokEnabled(){const _0x5a6013=_0x5f315a,_0x141da4={'SxPmK':function(_0x5a43f3,_0x36aaa6){return _0x5a43f3===_0x36aaa6;},'LkFSW':_0x5a6013(0x7f)};return _0x141da4[_0x5a6013(0x88)](process[_0x5a6013(0x86)][_0x5a6013(0x8b)],_0x141da4[_0x5a6013(0x8c)]);}export function isMcpDisabled(){const _0x441aa6=_0x5f315a,_0x5a8ac4={'QHfuh':function(_0x3e2c52,_0x206bc2){return _0x3e2c52===_0x206bc2;},'roPZl':'true'};return _0x5a8ac4[_0x441aa6(0x91)](process['env'][_0x441aa6(0x8a)],_0x5a8ac4[_0x441aa6(0x92)]);}export function getVerificationTransport(){return isMcpDisabled()?'playwright-cli':'mcp';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4fc85f,_0x31da40){const _0x35bff2=_0x369a,_0x24a0b1=_0x4fc85f();while(!![]){try{const _0x18958c=parseInt(_0x35bff2(0xb8))/0x1+-parseInt(_0x35bff2(0xd5))/0x2*(-parseInt(_0x35bff2(0xba))/0x3)+parseInt(_0x35bff2(0xf4))/0x4*(parseInt(_0x35bff2(0xef))/0x5)+parseInt(_0x35bff2(0xd2))/0x6+-parseInt(_0x35bff2(0xeb))/0x7*(parseInt(_0x35bff2(0xd8))/0x8)+parseInt(_0x35bff2(0xbd))/0x9+-parseInt(_0x35bff2(0xc1))/0xa;if(_0x18958c===_0x31da40)break;else _0x24a0b1['push'](_0x24a0b1['shift']());}catch(_0x1fabb7){_0x24a0b1['push'](_0x24a0b1['shift']());}}}(_0x8aa9,0x3bf49));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x518e25){const _0xf739be=_0x369a,_0x1f7ab6={'CUwyH':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','jAPDK':function(_0x422f07){return _0x422f07();},'oYLda':function(_0x5ba93f,_0x4a9087,_0x594a28){return _0x5ba93f(_0x4a9087,_0x594a28);},'MKmkY':'application/json','JOtmU':function(_0x520d83,_0x4df333){return _0x520d83===_0x4df333;},'UMzNP':'https://dashboard.ranger.net/billing','UTygo':_0xf739be(0xe4)},_0x5183da=await getToken();if(!_0x5183da)throw new Error(_0x1f7ab6['CUwyH']);const _0x4af579=_0x1f7ab6['jAPDK'](getApiBaseUrl),_0x1c4b51=await _0x1f7ab6['oYLda'](fetch,_0x4af579+'/api/v1/mcp/features',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x5183da,'Content-Type':_0x1f7ab6['MKmkY']},'body':JSON[_0xf739be(0xdf)](_0x518e25)});if(!_0x1c4b51['ok']){if(_0x1f7ab6['JOtmU'](_0x1c4b51['status'],0x192)){const _0x5262bf=await _0x1c4b51[_0xf739be(0xbe)](),_0x386839=_0x5262bf['billingUrl']||_0x1f7ab6['UMzNP'];throw new Error((_0x5262bf['message']||_0x1f7ab6['UTygo'])+_0xf739be(0xe7)+_0x386839);}const _0x1e2cf5=await _0x1c4b51['text']();throw new Error(_0xf739be(0xd3)+_0x1e2cf5);}return _0x1c4b51[_0xf739be(0xbe)]();}export async function listFeatures(_0x593029){const _0x2a7f56=_0x369a,_0x2d4b84={'bqmqQ':function(_0x275c1c){return _0x275c1c();},'lkKvm':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','gGDbB':_0x2a7f56(0xb5),'apaTs':_0x2a7f56(0xb6),'IAPUH':_0x2a7f56(0xe6),'SIKiR':_0x2a7f56(0xe0),'DFvnV':function(_0x259dc1,_0x299524,_0x4fab9b){return _0x259dc1(_0x299524,_0x4fab9b);}},_0x3760e6=await _0x2d4b84[_0x2a7f56(0xc0)](getToken);if(!_0x3760e6)throw new Error(_0x2d4b84[_0x2a7f56(0xec)]);const _0x3ed50c=getApiBaseUrl(),_0x2c6962=new URLSearchParams();if(_0x593029?.[_0x2a7f56(0xd7)])_0x2c6962['set']('gitRepoUrl',_0x593029[_0x2a7f56(0xd7)]);if(_0x593029?.['gitBranch'])_0x2c6962['set'](_0x2d4b84['gGDbB'],_0x593029['gitBranch']);if(_0x593029?.[_0x2a7f56(0xb9)])_0x2c6962[_0x2a7f56(0xcb)](_0x2a7f56(0xb9),_0x593029['limit'][_0x2a7f56(0xb7)]());if(_0x593029?.['offset'])_0x2c6962[_0x2a7f56(0xcb)](_0x2d4b84[_0x2a7f56(0xe1)],_0x593029[_0x2a7f56(0xb6)][_0x2a7f56(0xb7)]());if(_0x593029?.[_0x2a7f56(0xe6)])_0x2c6962['set'](_0x2d4b84[_0x2a7f56(0xde)],_0x2d4b84['SIKiR']);const _0x3ec18d=_0x3ed50c+'/api/v1/mcp/features'+(_0x2c6962['toString']()?'?'+_0x2c6962['toString']():''),_0x4812a7=await _0x2d4b84[_0x2a7f56(0xea)](fetch,_0x3ec18d,{'method':_0x2a7f56(0xe8),'headers':{'Authorization':_0x2a7f56(0xd1)+_0x3760e6}});if(!_0x4812a7['ok']){const _0x4ddc96=await _0x4812a7[_0x2a7f56(0xc2)]();throw new Error(_0x2a7f56(0xf6)+_0x4ddc96);}return _0x4812a7['json']();}export async function getFeature(_0x14156d){const _0x4c208f=_0x369a,_0x20234e={'dywmV':function(_0x60b673){return _0x60b673();},'rdLwr':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x24cf7d=await _0x20234e[_0x4c208f(0xdc)](getToken);if(!_0x24cf7d)throw new Error(_0x20234e['rdLwr']);const _0x1ba3d6=_0x20234e[_0x4c208f(0xdc)](getApiBaseUrl),_0x2b4ca9=await fetch(_0x1ba3d6+_0x4c208f(0xcf)+_0x14156d,{'method':_0x4c208f(0xe8),'headers':{'Authorization':'Bearer\x20'+_0x24cf7d}});if(!_0x2b4ca9['ok']){const _0x1935b2=await _0x2b4ca9['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x1935b2);}return _0x2b4ca9[_0x4c208f(0xbe)]();}export async function updateFeature(_0x1c39d9,_0x13f26b){const _0x514cec=_0x369a,_0x2a8b8e={'XmSIC':function(_0x4f9f17){return _0x4f9f17();},'PEFJE':function(_0x188abb){return _0x188abb();}},_0x281d03=await _0x2a8b8e['XmSIC'](getToken);if(!_0x281d03)throw new Error(_0x514cec(0xd6));const _0x1ef68a=_0x2a8b8e[_0x514cec(0xc9)](getApiBaseUrl),_0x432e88=await fetch(_0x1ef68a+_0x514cec(0xcf)+_0x1c39d9,{'method':'PATCH','headers':{'Authorization':'Bearer\x20'+_0x281d03,'Content-Type':'application/json'},'body':JSON[_0x514cec(0xdf)](_0x13f26b)});if(!_0x432e88['ok']){const _0x507adb=await _0x432e88['text']();throw new Error(_0x514cec(0xc5)+_0x507adb);}return _0x432e88[_0x514cec(0xbe)]();}export async function createChecklistItem(_0x17a872,_0x146423,_0x41bcc7){const _0x11af49=_0x369a,_0x5c7c8f={'nrxFv':function(_0x4c3c09){return _0x4c3c09();},'XtGHG':'application/json'},_0x56de78=await getToken();if(!_0x56de78)throw new Error(_0x11af49(0xd6));const _0x2f4666=_0x5c7c8f[_0x11af49(0xd0)](getApiBaseUrl),_0x2c8825=await fetch(_0x2f4666+_0x11af49(0xcf)+_0x17a872+_0x11af49(0xe9),{'method':_0x11af49(0xf8),'headers':{'Authorization':_0x11af49(0xd1)+_0x56de78,'Content-Type':_0x5c7c8f['XtGHG']},'body':JSON[_0x11af49(0xdf)]({'description':_0x146423,'position':_0x41bcc7})});if(!_0x2c8825['ok']){const _0x310b0b=await _0x2c8825['text']();throw new Error(_0x11af49(0xed)+_0x310b0b);}return _0x2c8825['json']();}export async function updateChecklistItem(_0x3e02f8,_0x2d9377,_0x4c9f34){const _0x5ac179={'xfoAH':function(_0x3363be,_0xa6808a,_0x52d020){return _0x3363be(_0xa6808a,_0x52d020);},'WOKdB':'PATCH'};return withRetry(async()=>{const _0x4316c4=_0x369a,_0x5c6398=await getToken();if(!_0x5c6398)throw new Error(_0x4316c4(0xd6));const _0x211a81=getApiBaseUrl(),_0x43a4be=await _0x5ac179[_0x4316c4(0xce)](fetch,_0x211a81+'/api/v1/mcp/features/'+_0x3e02f8+'/checklist/'+_0x2d9377,{'method':_0x5ac179['WOKdB'],'headers':{'Authorization':'Bearer\x20'+_0x5c6398,'Content-Type':_0x4316c4(0xee)},'body':JSON['stringify'](_0x4c9f34)});if(!_0x43a4be['ok']){const _0x3917c4=await _0x43a4be[_0x4316c4(0xc2)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x3917c4);}return _0x43a4be[_0x4316c4(0xbe)]();},{'label':'updateChecklistItem'});}function _0x369a(_0x4d7183,_0x567ca7){_0x4d7183=_0x4d7183-0xb4;const _0x8aa99d=_0x8aa9();let _0x369ab4=_0x8aa99d[_0x4d7183];return _0x369ab4;}export async function getFeatureReport(_0x3963ae){const _0x3f0e60=_0x369a,_0x26eb19=await getToken();if(!_0x26eb19)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x39b6a6=getApiBaseUrl(),_0x4bbdf2=await fetch(_0x39b6a6+'/api/v1/mcp/features/'+_0x3963ae+_0x3f0e60(0xf5),{'method':'GET','headers':{'Authorization':_0x3f0e60(0xd1)+_0x26eb19}});if(!_0x4bbdf2['ok']){const _0xc1a49a=await _0x4bbdf2['text']();throw new Error(_0x3f0e60(0xdd)+_0xc1a49a);}return _0x4bbdf2['json']();}export async function getFeatureReportMarkdown(_0x15fab5,_0xdbd9a6){const _0x561dd2=_0x369a,_0x547650={'EmeiZ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ejBxG':function(_0x1e1d0f){return _0x1e1d0f();},'DzzCN':function(_0x41338c,_0xc6e172){return _0x41338c>_0xc6e172;},'AAIEo':_0x561dd2(0xda),'LYNvs':_0x561dd2(0xd9),'shrvj':function(_0x2bd172,_0x563775){return _0x2bd172&&_0x563775;},'xyvVS':_0x561dd2(0xe8)},_0x26f4cd=await getToken();if(!_0x26f4cd)throw new Error(_0x547650['EmeiZ']);const _0xcbe631=_0x547650['ejBxG'](getApiBaseUrl),_0x7724ee=new URLSearchParams(),_0x9d1e9b=_0x547650[_0x561dd2(0xe5)](_0xdbd9a6?.['itemIds']?.['length']??0x0,0x0),_0x5ab3da=Boolean(_0xdbd9a6?.[_0x561dd2(0xd9)]);_0x9d1e9b&&_0xdbd9a6?.['itemIds']&&_0x7724ee['set'](_0x547650['AAIEo'],_0xdbd9a6['itemIds'][_0x561dd2(0xb4)](','));_0x5ab3da&&_0xdbd9a6?.[_0x561dd2(0xd9)]&&_0x7724ee['set'](_0x547650['LYNvs'],_0xdbd9a6['sessionId']);_0x547650[_0x561dd2(0xc4)](!_0x9d1e9b,!_0x5ab3da)&&_0xdbd9a6?.['style']&&_0x7724ee['set'](_0x561dd2(0xdb),_0xdbd9a6['style']);const _0xd1911b=_0xcbe631+_0x561dd2(0xcf)+_0x15fab5+'/report/markdown',_0x5548c0=''+_0xd1911b+(_0x7724ee['toString']()?'?'+_0x7724ee['toString']():''),_0x48a807=await fetch(_0x5548c0,{'method':_0x547650['xyvVS'],'headers':{'Authorization':'Bearer\x20'+_0x26f4cd}});if(!_0x48a807['ok']){const _0x1fd367=await _0x48a807[_0x561dd2(0xc2)]();throw new Error(_0x561dd2(0xcd)+_0x1fd367);}return _0x48a807[_0x561dd2(0xc2)]();}export async function listFeatureSessions(_0x424306){const _0x58d1a9=_0x369a,_0x40e10c={'bhFOW':function(_0x23be6e){return _0x23be6e();},'eoZcX':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x42cb30=await _0x40e10c['bhFOW'](getToken);if(!_0x42cb30)throw new Error(_0x40e10c[_0x58d1a9(0xf0)]);const _0x402836=getApiBaseUrl(),_0x453a66=await fetch(_0x402836+_0x58d1a9(0xcf)+_0x424306+_0x58d1a9(0xe2),{'method':'GET','headers':{'Authorization':_0x58d1a9(0xd1)+_0x42cb30}});if(!_0x453a66['ok']){const _0x47030e=await _0x453a66['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x47030e);}return _0x453a66['json']();}export async function startSession(_0x47dc56,_0x3f9bd1){const _0xc1f96d=_0x369a,_0x142bb2={'VSXPe':_0xc1f96d(0xd6)},_0x4af65b=await getToken();if(!_0x4af65b)throw new Error(_0x142bb2[_0xc1f96d(0xca)]);const _0x1afb77=getApiBaseUrl(),_0x2a3081=await fetch(_0x1afb77+'/api/v1/mcp/features/'+_0x47dc56+'/sessions/'+_0x3f9bd1+'/start',{'method':'POST','headers':{'Authorization':_0xc1f96d(0xd1)+_0x4af65b}});if(!_0x2a3081['ok']){const _0x2f4e59=await _0x2a3081['text']();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x2f4e59);}return _0x2a3081['json']();}export async function concludeSession(_0x41643c,_0x20e632){const _0xf1f7de=_0x369a,_0x3711b5={'xSFVe':function(_0x2e90fd){return _0x2e90fd();},'RVKCn':_0xf1f7de(0xd6),'ZlEIh':function(_0x385e0e,_0x2f09fc,_0x1ca193){return _0x385e0e(_0x2f09fc,_0x1ca193);},'XYdWX':'POST'},_0x4d8c6b=await _0x3711b5['xSFVe'](getToken);if(!_0x4d8c6b)throw new Error(_0x3711b5[_0xf1f7de(0xbb)]);const _0x10e559=_0x3711b5[_0xf1f7de(0xc6)](getApiBaseUrl),_0x54c33c=await _0x3711b5['ZlEIh'](fetch,_0x10e559+'/api/v1/mcp/features/'+_0x41643c+_0xf1f7de(0xe3)+_0x20e632+'/conclude',{'method':_0x3711b5[_0xf1f7de(0xbc)],'headers':{'Authorization':'Bearer\x20'+_0x4d8c6b}});if(!_0x54c33c['ok']){const _0x4084f0=await _0x54c33c[_0xf1f7de(0xc2)]();throw new Error(_0xf1f7de(0xc3)+_0x4084f0);}return _0x54c33c[_0xf1f7de(0xbe)]();}export async function getActionItems(_0x113757){const _0x53c01f=_0x369a,_0xa8bed2={'AfVBg':function(_0x33299a){return _0x33299a();},'FiajW':function(_0x5baef2,_0x12f6a3,_0x306807){return _0x5baef2(_0x12f6a3,_0x306807);}},_0xa5d668=await _0xa8bed2['AfVBg'](getToken);if(!_0xa5d668)throw new Error(_0x53c01f(0xd6));const _0x345450=getApiBaseUrl(),_0x20cc83=await _0xa8bed2[_0x53c01f(0xf3)](fetch,_0x345450+'/api/v1/mcp/features/'+_0x113757+'/action-items',{'method':_0x53c01f(0xe8),'headers':{'Authorization':_0x53c01f(0xd1)+_0xa5d668}});if(!_0x20cc83['ok']){const _0x44abe1=await _0x20cc83['text']();throw new Error(_0x53c01f(0xc7)+_0x44abe1);}return _0x20cc83['json']();}export async function getItemFeedback(_0x332fb4,_0x4f4bcd){const _0x5114a4=_0x369a,_0x23c737={'bWlcM':function(_0x336c44){return _0x336c44();},'oKOZU':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','JiYok':function(_0x279e74,_0x43267e,_0x3aad88){return _0x279e74(_0x43267e,_0x3aad88);}},_0x9b5b31=await _0x23c737['bWlcM'](getToken);if(!_0x9b5b31)throw new Error(_0x23c737[_0x5114a4(0xc8)]);const _0x31f3f5=getApiBaseUrl(),_0x10fda7=await _0x23c737[_0x5114a4(0xf7)](fetch,_0x31f3f5+_0x5114a4(0xcf)+_0x332fb4+'/checklist-items/'+_0x4f4bcd+'/feedback',{'method':_0x5114a4(0xe8),'headers':{'Authorization':_0x5114a4(0xd1)+_0x9b5b31}});if(!_0x10fda7['ok']){const _0x5bf6f2=await _0x10fda7[_0x5114a4(0xc2)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x5bf6f2);}return _0x10fda7[_0x5114a4(0xbe)]();}export async function markCommentsAddressed(_0x208ea2,_0x5f2c98,_0x555b15){const _0x14f8aa=_0x369a,_0x572ea8={'pUavn':function(_0x165d29){return _0x165d29();},'sqLTq':function(_0x2dce09){return _0x2dce09();},'uwMlx':function(_0x1d346e,_0x3f8ba2,_0x475314){return _0x1d346e(_0x3f8ba2,_0x475314);},'WJvnV':_0x14f8aa(0xf8)},_0x34e4b6=await _0x572ea8['pUavn'](getToken);if(!_0x34e4b6)throw new Error(_0x14f8aa(0xd6));const _0x29f886=_0x572ea8[_0x14f8aa(0xf2)](getApiBaseUrl),_0x2ebeea=await _0x572ea8[_0x14f8aa(0xbf)](fetch,_0x29f886+_0x14f8aa(0xcf)+_0x208ea2+_0x14f8aa(0xd4),{'method':_0x572ea8['WJvnV'],'headers':{'Authorization':_0x14f8aa(0xd1)+_0x34e4b6,'Content-Type':_0x14f8aa(0xee)},'body':JSON['stringify']({'checklistItemId':_0x5f2c98,'commentIds':_0x555b15})});if(!_0x2ebeea['ok']){const _0x57422=await _0x2ebeea[_0x14f8aa(0xc2)]();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x57422);}}function _0x8aa9(){const _0x72b668=['application/json','15jVaNpT','eoZcX','Failed\x20to\x20delete\x20feature\x20review:\x20','sqLTq','FiajW','379244lStphC','/report','Failed\x20to\x20list\x20feature\x20reviews:\x20','JiYok','POST','join','gitBranch','offset','toString','99107PGCzhf','limit','9606LVFEQw','RVKCn','XYdWX','990216cWVacY','json','uwMlx','bqmqQ','7536290tPRiLM','text','Failed\x20to\x20conclude\x20session:\x20','shrvj','Failed\x20to\x20update\x20feature\x20review:\x20','xSFVe','Failed\x20to\x20get\x20action\x20items:\x20','oKOZU','PEFJE','VSXPe','set','Failed\x20to\x20restore\x20feature\x20review:\x20','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','xfoAH','/api/v1/mcp/features/','nrxFv','Bearer\x20','1815360xQYinq','Failed\x20to\x20create\x20feature\x20review:\x20','/comments/address','178XxByjC','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','gitRepoUrl','327584cnBKtP','sessionId','itemIds','style','dywmV','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','IAPUH','stringify','true','apaTs','/sessions','/sessions/','Feature\x20limit\x20exceeded','DzzCN','includeDeleted','\x0a\x0aUpgrade\x20your\x20plan:\x20','GET','/checklist','DFvnV','14Hrkzps','lkKvm','Failed\x20to\x20create\x20scenario:\x20'];_0x8aa9=function(){return _0x72b668;};return _0x8aa9();}export async function softDeleteFeature(_0x527ed3){const _0x158f90=_0x369a,_0x3b477f={'YyoHF':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','QjZQd':function(_0x34fede,_0x239fa7,_0x144090){return _0x34fede(_0x239fa7,_0x144090);}},_0x4f8223=await getToken();if(!_0x4f8223)throw new Error(_0x3b477f['YyoHF']);const _0x38d018=getApiBaseUrl(),_0x50a59e=await _0x3b477f['QjZQd'](fetch,_0x38d018+'/api/v1/mcp/features/'+_0x527ed3,{'method':'DELETE','headers':{'Authorization':_0x158f90(0xd1)+_0x4f8223}});if(!_0x50a59e['ok']){const _0x48c3e6=await _0x50a59e[_0x158f90(0xc2)]();throw new Error(_0x158f90(0xf1)+_0x48c3e6);}}export async function restoreFeature(_0x1c6c38){const _0x1e62fe=_0x369a,_0x2dbbf7={'GmSob':function(_0x4df20a){return _0x4df20a();},'jSZQX':_0x1e62fe(0xd6),'IdqFq':_0x1e62fe(0xf8)},_0x3c5a21=await _0x2dbbf7['GmSob'](getToken);if(!_0x3c5a21)throw new Error(_0x2dbbf7['jSZQX']);const _0x137239=getApiBaseUrl(),_0x54491a=await fetch(_0x137239+_0x1e62fe(0xcf)+_0x1c6c38+'/restore',{'method':_0x2dbbf7['IdqFq'],'headers':{'Authorization':'Bearer\x20'+_0x3c5a21}});if(!_0x54491a['ok']){const _0xe2f0a9=await _0x54491a[_0x1e62fe(0xc2)]();throw new Error(_0x1e62fe(0xcc)+_0xe2f0a9);}}
|
|
1
|
+
(function(_0x36bc3e,_0x601930){const _0x5dc0f4=_0x5cae,_0x447815=_0x36bc3e();while(!![]){try{const _0x47f8c7=parseInt(_0x5dc0f4(0xa9))/0x1*(-parseInt(_0x5dc0f4(0xa0))/0x2)+-parseInt(_0x5dc0f4(0x8e))/0x3+parseInt(_0x5dc0f4(0x86))/0x4+-parseInt(_0x5dc0f4(0x84))/0x5*(-parseInt(_0x5dc0f4(0x7e))/0x6)+parseInt(_0x5dc0f4(0x7f))/0x7+parseInt(_0x5dc0f4(0x72))/0x8*(parseInt(_0x5dc0f4(0xac))/0x9)+parseInt(_0x5dc0f4(0xb9))/0xa*(-parseInt(_0x5dc0f4(0x9d))/0xb);if(_0x47f8c7===_0x601930)break;else _0x447815['push'](_0x447815['shift']());}catch(_0x141d53){_0x447815['push'](_0x447815['shift']());}}}(_0x4e60,0xc24ae));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x18c3cb){const _0x4e2470=_0x5cae,_0x10522d={'AYPdh':_0x4e2470(0x82),'TAGdb':function(_0x217c1f){return _0x217c1f();},'DbksO':function(_0x3c647c,_0x476b0d,_0x507f18){return _0x3c647c(_0x476b0d,_0x507f18);},'irmwk':_0x4e2470(0x92)},_0x42edd2=await getToken();if(!_0x42edd2)throw new Error(_0x10522d['AYPdh']);const _0x3def5b=_0x10522d['TAGdb'](getApiBaseUrl),_0x4da9da=await _0x10522d[_0x4e2470(0xa4)](fetch,_0x3def5b+_0x4e2470(0xaa),{'method':_0x10522d['irmwk'],'headers':{'Authorization':'Bearer\x20'+_0x42edd2,'Content-Type':'application/json'},'body':JSON['stringify'](_0x18c3cb)});if(!_0x4da9da['ok']){if(_0x4da9da['status']===0x192){const _0x395a35=await _0x4da9da[_0x4e2470(0x96)](),_0xb4911b=_0x395a35[_0x4e2470(0x71)]||'https://dashboard.ranger.net/billing';throw new Error((_0x395a35['message']||'Feature\x20limit\x20exceeded')+_0x4e2470(0xa5)+_0xb4911b);}const _0xa6fbb=await _0x4da9da['text']();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0xa6fbb);}return _0x4da9da[_0x4e2470(0x96)]();}export async function listFeatures(_0x591054){const _0x2c597c=_0x5cae,_0x304de0={'Uxcsb':_0x2c597c(0x82),'rnweV':_0x2c597c(0x7c),'IyTkD':_0x2c597c(0x7b),'cbKka':'GET'},_0x4d442e=await getToken();if(!_0x4d442e)throw new Error(_0x304de0[_0x2c597c(0x95)]);const _0x1e578d=getApiBaseUrl(),_0x3e2d0f=new URLSearchParams();if(_0x591054?.[_0x2c597c(0x81)])_0x3e2d0f['set'](_0x2c597c(0x81),_0x591054['gitRepoUrl']);if(_0x591054?.['gitBranch'])_0x3e2d0f[_0x2c597c(0x99)](_0x304de0[_0x2c597c(0xb1)],_0x591054['gitBranch']);if(_0x591054?.['limit'])_0x3e2d0f[_0x2c597c(0x99)](_0x304de0[_0x2c597c(0x75)],_0x591054[_0x2c597c(0x7b)]['toString']());if(_0x591054?.[_0x2c597c(0xa8)])_0x3e2d0f['set']('offset',_0x591054['offset'][_0x2c597c(0xa7)]());if(_0x591054?.['includeDeleted'])_0x3e2d0f['set']('includeDeleted','true');const _0xa7b966=_0x1e578d+'/api/v1/mcp/features'+(_0x3e2d0f[_0x2c597c(0xa7)]()?'?'+_0x3e2d0f['toString']():''),_0x30a01a=await fetch(_0xa7b966,{'method':_0x304de0['cbKka'],'headers':{'Authorization':'Bearer\x20'+_0x4d442e}});if(!_0x30a01a['ok']){const _0x4a88cd=await _0x30a01a[_0x2c597c(0x89)]();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x4a88cd);}return _0x30a01a['json']();}export async function getFeature(_0x4a73ec){const _0x5ab0a6=_0x5cae,_0x5c4f6f={'rvTXE':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x110fd4=await getToken();if(!_0x110fd4)throw new Error(_0x5c4f6f['rvTXE']);const _0x4605a8=getApiBaseUrl(),_0x14c914=await fetch(_0x4605a8+_0x5ab0a6(0x91)+_0x4a73ec,{'method':'GET','headers':{'Authorization':_0x5ab0a6(0x77)+_0x110fd4}});if(!_0x14c914['ok']){const _0x38efc4=await _0x14c914[_0x5ab0a6(0x89)]();throw new Error(_0x5ab0a6(0xa2)+_0x38efc4);}return _0x14c914['json']();}export async function updateFeature(_0x100136,_0x53b097){const _0x39dacd=_0x5cae,_0x177b99={'FxPJG':_0x39dacd(0x82),'yVwtS':function(_0x3714fe,_0x713c61,_0x449cc5){return _0x3714fe(_0x713c61,_0x449cc5);}},_0x5e8cab=await getToken();if(!_0x5e8cab)throw new Error(_0x177b99[_0x39dacd(0x74)]);const _0xfbe398=getApiBaseUrl(),_0x19f6f6=await _0x177b99[_0x39dacd(0x6d)](fetch,_0xfbe398+_0x39dacd(0x91)+_0x100136,{'method':_0x39dacd(0x8a),'headers':{'Authorization':'Bearer\x20'+_0x5e8cab,'Content-Type':'application/json'},'body':JSON[_0x39dacd(0x98)](_0x53b097)});if(!_0x19f6f6['ok']){const _0x1532a1=await _0x19f6f6[_0x39dacd(0x89)]();throw new Error(_0x39dacd(0x76)+_0x1532a1);}return _0x19f6f6[_0x39dacd(0x96)]();}function _0x4e60(){const _0x451c88=['gAAIG','DbksO','\x0a\x0aUpgrade\x20your\x20plan:\x20','hQupy','toString','offset','167JRSkBQ','/api/v1/mcp/features','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','3897WmQwcE','nXbcG','GORkW','Failed\x20to\x20start\x20session:\x20','updateChecklistItem','rnweV','CKxAB','vwCzZ','sessionId','MPMtI','XgKSO','BUkSE','iNWnq','29439010TFPuzs','sNMzL','yVwtS','style','LgAax','/report/markdown','billingUrl','22912xVvuHB','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','FxPJG','IyTkD','Failed\x20to\x20update\x20feature\x20review:\x20','Bearer\x20','fQNOs','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','nriQx','limit','gitBranch','Failed\x20to\x20delete\x20feature\x20review:\x20','85818tGsgKY','4853604ncWffL','bPVLB','gitRepoUrl','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','/report','395vNPwGA','Failed\x20to\x20list\x20sessions:\x20','5811056CKcnFW','Failed\x20to\x20get\x20item\x20feedback:\x20','ilNqC','text','PATCH','jSqot','jHNuU','XzGdf','40317fjBSjR','JbCnN','hQvxz','/api/v1/mcp/features/','POST','Failed\x20to\x20update\x20scenario:\x20','bVEkQ','Uxcsb','json','XKOsJ','stringify','set','itemIds','YsQFK','Kweut','11DKNCFU','GET','length','9138JDLFpH','vWpsN','Failed\x20to\x20get\x20feature\x20review:\x20'];_0x4e60=function(){return _0x451c88;};return _0x4e60();}export async function createChecklistItem(_0x43865c,_0x5f1871,_0x555894){const _0x3eb9dd=_0x5cae,_0x10f682={'beGEw':function(_0x50936b,_0x5cabf4,_0x1c2443){return _0x50936b(_0x5cabf4,_0x1c2443);},'EQEoc':_0x3eb9dd(0x92),'vWpsN':'application/json'},_0x6334b9=await getToken();if(!_0x6334b9)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x19191f=getApiBaseUrl(),_0x55d853=await _0x10f682['beGEw'](fetch,_0x19191f+'/api/v1/mcp/features/'+_0x43865c+'/checklist',{'method':_0x10f682['EQEoc'],'headers':{'Authorization':_0x3eb9dd(0x77)+_0x6334b9,'Content-Type':_0x10f682[_0x3eb9dd(0xa1)]},'body':JSON[_0x3eb9dd(0x98)]({'description':_0x5f1871,'position':_0x555894})});if(!_0x55d853['ok']){const _0x1cc2fc=await _0x55d853['text']();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x1cc2fc);}return _0x55d853['json']();}export async function updateChecklistItem(_0x55c1af,_0x172610,_0x44066e){const _0x33adc6=_0x5cae,_0xb25588={'XzGdf':function(_0x4b27fb){return _0x4b27fb();},'GORkW':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','JbCnN':_0x33adc6(0x8a),'ilNqC':'application/json','mhBGt':function(_0x1d38a6,_0x5724b6,_0x4bd4a1){return _0x1d38a6(_0x5724b6,_0x4bd4a1);},'nXbcG':_0x33adc6(0xb0)};return _0xb25588['mhBGt'](withRetry,async()=>{const _0x12bfa9=_0x33adc6,_0x142fd3=await _0xb25588[_0x12bfa9(0x8d)](getToken);if(!_0x142fd3)throw new Error(_0xb25588[_0x12bfa9(0xae)]);const _0xf7ffe7=getApiBaseUrl(),_0x4c5dd6=await fetch(_0xf7ffe7+'/api/v1/mcp/features/'+_0x55c1af+'/checklist/'+_0x172610,{'method':_0xb25588[_0x12bfa9(0x8f)],'headers':{'Authorization':'Bearer\x20'+_0x142fd3,'Content-Type':_0xb25588[_0x12bfa9(0x88)]},'body':JSON['stringify'](_0x44066e)});if(!_0x4c5dd6['ok']){const _0x5ad255=await _0x4c5dd6['text']();throw new Error(_0x12bfa9(0x93)+_0x5ad255);}return _0x4c5dd6['json']();},{'label':_0xb25588[_0x33adc6(0xad)]});}export async function getFeatureReport(_0x5e466e){const _0x18a837=_0x5cae,_0x152e22={'NiEnj':_0x18a837(0x82),'mYxzZ':function(_0x2174c6,_0x40d755,_0x3df022){return _0x2174c6(_0x40d755,_0x3df022);},'bVEkQ':'GET'},_0x5b16d2=await getToken();if(!_0x5b16d2)throw new Error(_0x152e22['NiEnj']);const _0x3baaf5=getApiBaseUrl(),_0x542b2d=await _0x152e22['mYxzZ'](fetch,_0x3baaf5+'/api/v1/mcp/features/'+_0x5e466e+_0x18a837(0x83),{'method':_0x152e22[_0x18a837(0x94)],'headers':{'Authorization':_0x18a837(0x77)+_0x5b16d2}});if(!_0x542b2d['ok']){const _0x47e295=await _0x542b2d[_0x18a837(0x89)]();throw new Error(_0x18a837(0x79)+_0x47e295);}return _0x542b2d[_0x18a837(0x96)]();}export async function getFeatureReportMarkdown(_0xc51ea2,_0x51d65f){const _0x1976fc=_0x5cae,_0x591c14={'NoRTt':function(_0x3837c0,_0x2dc276){return _0x3837c0>_0x2dc276;},'nriQx':'itemIds','LIzbX':'sessionId','MYYue':function(_0xb7d38d,_0x1d8a2a){return _0xb7d38d&&_0x1d8a2a;},'YsQFK':function(_0x22cc6d,_0x5356a7,_0x4ec50a){return _0x22cc6d(_0x5356a7,_0x4ec50a);},'jHNuU':'GET'},_0x2a46c3=await getToken();if(!_0x2a46c3)throw new Error(_0x1976fc(0x82));const _0x44e954=getApiBaseUrl(),_0x2d7a23=new URLSearchParams(),_0x5144e1=_0x591c14['NoRTt'](_0x51d65f?.[_0x1976fc(0x9a)]?.[_0x1976fc(0x9f)]??0x0,0x0),_0x481d8f=Boolean(_0x51d65f?.['sessionId']);_0x5144e1&&_0x51d65f?.['itemIds']&&_0x2d7a23[_0x1976fc(0x99)](_0x591c14[_0x1976fc(0x7a)],_0x51d65f['itemIds']['join'](','));_0x481d8f&&_0x51d65f?.[_0x1976fc(0xb4)]&&_0x2d7a23['set'](_0x591c14['LIzbX'],_0x51d65f['sessionId']);_0x591c14['MYYue'](!_0x5144e1,!_0x481d8f)&&_0x51d65f?.[_0x1976fc(0x6e)]&&_0x2d7a23[_0x1976fc(0x99)](_0x1976fc(0x6e),_0x51d65f[_0x1976fc(0x6e)]);const _0x1438d4=_0x44e954+_0x1976fc(0x91)+_0xc51ea2+_0x1976fc(0x70),_0x474128=''+_0x1438d4+(_0x2d7a23[_0x1976fc(0xa7)]()?'?'+_0x2d7a23['toString']():''),_0x5d3c23=await _0x591c14[_0x1976fc(0x9b)](fetch,_0x474128,{'method':_0x591c14[_0x1976fc(0x8c)],'headers':{'Authorization':'Bearer\x20'+_0x2a46c3}});if(!_0x5d3c23['ok']){const _0xf97ed2=await _0x5d3c23[_0x1976fc(0x89)]();throw new Error(_0x1976fc(0xab)+_0xf97ed2);}return _0x5d3c23['text']();}export async function listFeatureSessions(_0x6421b0){const _0x1f3963=_0x5cae,_0x712537={'qSnph':function(_0x1945df){return _0x1945df();},'ztJsH':function(_0x139811,_0x34572e,_0x2484f){return _0x139811(_0x34572e,_0x2484f);},'MPMtI':'GET'},_0x19960a=await _0x712537['qSnph'](getToken);if(!_0x19960a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3a272b=getApiBaseUrl(),_0x185a16=await _0x712537['ztJsH'](fetch,_0x3a272b+_0x1f3963(0x91)+_0x6421b0+'/sessions',{'method':_0x712537[_0x1f3963(0xb5)],'headers':{'Authorization':'Bearer\x20'+_0x19960a}});if(!_0x185a16['ok']){const _0x590dd0=await _0x185a16[_0x1f3963(0x89)]();throw new Error(_0x1f3963(0x85)+_0x590dd0);}return _0x185a16[_0x1f3963(0x96)]();}export async function startSession(_0x12cb4b,_0x4f74c7){const _0x31536f=_0x5cae,_0x170bd9={'sNMzL':function(_0x2c2914){return _0x2c2914();},'gAAIG':_0x31536f(0x82),'XlWkQ':function(_0x3d9457){return _0x3d9457();}},_0x4250da=await _0x170bd9[_0x31536f(0xba)](getToken);if(!_0x4250da)throw new Error(_0x170bd9[_0x31536f(0xa3)]);const _0x28b115=_0x170bd9['XlWkQ'](getApiBaseUrl),_0x22d1cf=await fetch(_0x28b115+'/api/v1/mcp/features/'+_0x12cb4b+'/sessions/'+_0x4f74c7+'/start',{'method':_0x31536f(0x92),'headers':{'Authorization':_0x31536f(0x77)+_0x4250da}});if(!_0x22d1cf['ok']){const _0x3c8ce5=await _0x22d1cf[_0x31536f(0x89)]();throw new Error(_0x31536f(0xaf)+_0x3c8ce5);}return _0x22d1cf[_0x31536f(0x96)]();}export async function concludeSession(_0xee14a9,_0x2879a4){const _0x374b2e=_0x5cae,_0x533db8={'XgKSO':function(_0x2bf8dc){return _0x2bf8dc();},'hQupy':function(_0x195635,_0x4557ed,_0x41e9a9){return _0x195635(_0x4557ed,_0x41e9a9);},'fQNOs':'POST'},_0x53e8aa=await _0x533db8[_0x374b2e(0xb6)](getToken);if(!_0x53e8aa)throw new Error(_0x374b2e(0x82));const _0x4178c2=getApiBaseUrl(),_0x2d2f1c=await _0x533db8[_0x374b2e(0xa6)](fetch,_0x4178c2+'/api/v1/mcp/features/'+_0xee14a9+'/sessions/'+_0x2879a4+'/conclude',{'method':_0x533db8[_0x374b2e(0x78)],'headers':{'Authorization':'Bearer\x20'+_0x53e8aa}});if(!_0x2d2f1c['ok']){const _0x1dcb5b=await _0x2d2f1c['text']();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x1dcb5b);}return _0x2d2f1c['json']();}export async function getActionItems(_0x38a3e4){const _0x29e600=_0x5cae,_0x1d5d78={'iDNwc':function(_0x41ac9f){return _0x41ac9f();},'XKOsJ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ENVRv':_0x29e600(0x9e)},_0x9b09f=await _0x1d5d78['iDNwc'](getToken);if(!_0x9b09f)throw new Error(_0x1d5d78[_0x29e600(0x97)]);const _0x4a1452=_0x1d5d78['iDNwc'](getApiBaseUrl),_0x1b7c13=await fetch(_0x4a1452+_0x29e600(0x91)+_0x38a3e4+'/action-items',{'method':_0x1d5d78['ENVRv'],'headers':{'Authorization':_0x29e600(0x77)+_0x9b09f}});if(!_0x1b7c13['ok']){const _0x5bae90=await _0x1b7c13['text']();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x5bae90);}return _0x1b7c13[_0x29e600(0x96)]();}export async function getItemFeedback(_0x5d7223,_0x5803bb){const _0x14c4e5=_0x5cae,_0x48206d={'LgAax':function(_0x2724f0){return _0x2724f0();},'ZHEqs':_0x14c4e5(0x82),'Kweut':function(_0xd02787,_0xf91800,_0x277155){return _0xd02787(_0xf91800,_0x277155);},'CKxAB':'GET'},_0x3f5b65=await _0x48206d[_0x14c4e5(0x6f)](getToken);if(!_0x3f5b65)throw new Error(_0x48206d['ZHEqs']);const _0x1537a5=_0x48206d[_0x14c4e5(0x6f)](getApiBaseUrl),_0x1ed263=await _0x48206d[_0x14c4e5(0x9c)](fetch,_0x1537a5+'/api/v1/mcp/features/'+_0x5d7223+'/checklist-items/'+_0x5803bb+'/feedback',{'method':_0x48206d[_0x14c4e5(0xb2)],'headers':{'Authorization':'Bearer\x20'+_0x3f5b65}});if(!_0x1ed263['ok']){const _0x293c4c=await _0x1ed263[_0x14c4e5(0x89)]();throw new Error(_0x14c4e5(0x87)+_0x293c4c);}return _0x1ed263[_0x14c4e5(0x96)]();}export async function markCommentsAddressed(_0x5da9cc,_0x3dca0b,_0x503460){const _0x1d0157=_0x5cae,_0x46a967={'jSqot':function(_0x5158a4){return _0x5158a4();},'bPVLB':function(_0x3902ff,_0x52c3a1,_0x3207a9){return _0x3902ff(_0x52c3a1,_0x3207a9);}},_0x1539b2=await _0x46a967[_0x1d0157(0x8b)](getToken);if(!_0x1539b2)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2cdb9b=getApiBaseUrl(),_0x886d71=await _0x46a967[_0x1d0157(0x80)](fetch,_0x2cdb9b+_0x1d0157(0x91)+_0x5da9cc+'/comments/address',{'method':_0x1d0157(0x92),'headers':{'Authorization':'Bearer\x20'+_0x1539b2,'Content-Type':'application/json'},'body':JSON['stringify']({'checklistItemId':_0x3dca0b,'commentIds':_0x503460})});if(!_0x886d71['ok']){const _0x508264=await _0x886d71[_0x1d0157(0x89)]();throw new Error(_0x1d0157(0x73)+_0x508264);}}export async function softDeleteFeature(_0x167644){const _0x3d242f=_0x5cae,_0x4985a1={'ZLTpD':function(_0xe2a867){return _0xe2a867();},'hQvxz':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','BUkSE':function(_0x2fdf0c,_0xa5e992,_0x59cd75){return _0x2fdf0c(_0xa5e992,_0x59cd75);},'vwCzZ':'DELETE'},_0x19dae7=await _0x4985a1['ZLTpD'](getToken);if(!_0x19dae7)throw new Error(_0x4985a1[_0x3d242f(0x90)]);const _0x5de64a=getApiBaseUrl(),_0x5d7fcb=await _0x4985a1[_0x3d242f(0xb7)](fetch,_0x5de64a+_0x3d242f(0x91)+_0x167644,{'method':_0x4985a1[_0x3d242f(0xb3)],'headers':{'Authorization':'Bearer\x20'+_0x19dae7}});if(!_0x5d7fcb['ok']){const _0x3785b9=await _0x5d7fcb[_0x3d242f(0x89)]();throw new Error(_0x3d242f(0x7d)+_0x3785b9);}}function _0x5cae(_0x256846,_0x406343){_0x256846=_0x256846-0x6d;const _0x4e60c1=_0x4e60();let _0x5cae48=_0x4e60c1[_0x256846];return _0x5cae48;}export async function restoreFeature(_0xcd74d3){const _0x21da3a=_0x5cae,_0x3bcf2c={'zEykq':function(_0x3ef044){return _0x3ef044();},'iNWnq':_0x21da3a(0x82),'KWXCy':function(_0x397c23,_0x5ba2cc,_0x483f38){return _0x397c23(_0x5ba2cc,_0x483f38);},'VtDpB':'POST'},_0xb3edc1=await _0x3bcf2c['zEykq'](getToken);if(!_0xb3edc1)throw new Error(_0x3bcf2c[_0x21da3a(0xb8)]);const _0x17cede=getApiBaseUrl(),_0x446cab=await _0x3bcf2c['KWXCy'](fetch,_0x17cede+'/api/v1/mcp/features/'+_0xcd74d3+'/restore',{'method':_0x3bcf2c['VtDpB'],'headers':{'Authorization':'Bearer\x20'+_0xb3edc1}});if(!_0x446cab['ok']){const _0x3c74f7=await _0x446cab['text']();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x3c74f7);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5ee21e=_0x13a0;(function(_0x8827cd,_0x479b5d){const _0x37d908=_0x13a0,_0x5d874d=_0x8827cd();while(!![]){try{const _0x599640=-parseInt(_0x37d908(0x1ba))/0x1*(-parseInt(_0x37d908(0x1cc))/0x2)+-parseInt(_0x37d908(0x1bb))/0x3+parseInt(_0x37d908(0x1bc))/0x4*(parseInt(_0x37d908(0x1e5))/0x5)+-parseInt(_0x37d908(0x1f0))/0x6+parseInt(_0x37d908(0x1d1))/0x7+parseInt(_0x37d908(0x1c5))/0x8+-parseInt(_0x37d908(0x1d4))/0x9;if(_0x599640===_0x479b5d)break;else _0x5d874d['push'](_0x5d874d['shift']());}catch(_0x3deb37){_0x5d874d['push'](_0x5d874d['shift']());}}}(_0x1016,0xd8b11));import{readFileSync,writeFileSync}from'fs';const ID_SEGMENT=0x18538067,ID_INFO=0x1549a966,ID_TIMESTAMP_SCALE=0x2ad7b1,ID_DURATION=0x4489,ID_VOID=0xec,ID_CLUSTER=0x1f43b675,ID_TIMESTAMP=0xe7,ID_SIMPLE_BLOCK=0xa3;function readVint(_0x1a1f85,_0x571a72){const _0x1f8d0a=_0x13a0,_0x476390={'Xtpgh':function(_0xa38454,_0x478ae8){return _0xa38454>=_0x478ae8;},'zwvjQ':function(_0x212188,_0x2ac2ab){return _0x212188>_0x2ac2ab;},'VGeCJ':function(_0x3c8645,_0x1c08e8){return _0x3c8645&_0x1c08e8;},'IjEOb':function(_0x2c4451,_0x5ce26c){return _0x2c4451<_0x5ce26c;},'MmWin':function(_0x285390,_0xbeca6a){return _0x285390+_0xbeca6a;}};if(_0x476390[_0x1f8d0a(0x1be)](_0x571a72,_0x1a1f85['length']))return[0x0,0x0];const _0x34eefc=_0x1a1f85[_0x571a72];let _0x58b544=0x1,_0xc7b503=0x80;while(_0x58b544<=0x8&&!(_0x34eefc&_0xc7b503)){_0x58b544++,_0xc7b503>>=0x1;}if(_0x476390[_0x1f8d0a(0x1dc)](_0x571a72+_0x58b544,_0x1a1f85['length']))return[0x0,0x0];let _0x225ce9=_0x476390['VGeCJ'](_0x34eefc,_0xc7b503-0x1);for(let _0x5722f3=0x1;_0x476390[_0x1f8d0a(0x1b1)](_0x5722f3,_0x58b544);_0x5722f3++){_0x225ce9=_0x225ce9*0x100+_0x1a1f85[_0x476390[_0x1f8d0a(0x1da)](_0x571a72,_0x5722f3)];}return[_0x225ce9,_0x58b544];}function readId(_0x3a3002,_0x2d555a){const _0x3d92e2=_0x13a0,_0x4b7fd9={'nfarh':function(_0x54eed1,_0x3d387a){return _0x54eed1>=_0x3d387a;},'xKjZm':function(_0x5516ee,_0x31795d){return _0x5516ee>=_0x31795d;},'iDgvC':function(_0xf96c5d,_0x22e344){return _0xf96c5d>_0x22e344;},'wTout':function(_0xf2eb1a,_0x1e3bf4){return _0xf2eb1a<_0x1e3bf4;},'jCqQn':function(_0x44b84b,_0x2c8a14){return _0x44b84b*_0x2c8a14;}};if(_0x4b7fd9['nfarh'](_0x2d555a,_0x3a3002[_0x3d92e2(0x1ce)]))return[0x0,0x0];const _0x56fef7=_0x3a3002[_0x2d555a];let _0x51117b;if(_0x4b7fd9['xKjZm'](_0x56fef7,0x80))_0x51117b=0x1;else{if(_0x56fef7>=0x40)_0x51117b=0x2;else{if(_0x4b7fd9['xKjZm'](_0x56fef7,0x20))_0x51117b=0x3;else{if(_0x56fef7>=0x10)_0x51117b=0x4;else return[_0x56fef7,0x1];}}}if(_0x4b7fd9['iDgvC'](_0x2d555a+_0x51117b,_0x3a3002[_0x3d92e2(0x1ce)]))return[0x0,0x0];let _0x219904=0x0;for(let _0x3c3b29=0x0;_0x4b7fd9[_0x3d92e2(0x1d7)](_0x3c3b29,_0x51117b);_0x3c3b29++){_0x219904=_0x4b7fd9['jCqQn'](_0x219904,0x100)+_0x3a3002[_0x2d555a+_0x3c3b29];}return[_0x219904,_0x51117b];}function readUint(_0x2aa660,_0x2e89f0,_0x423ea6){const _0x327e26=_0x13a0,_0x31a082={'oaXaB':function(_0x295bf1,_0x37c10f){return _0x295bf1<_0x37c10f;},'ewQjd':function(_0x490cef,_0x4631bb){return _0x490cef*_0x4631bb;}};let _0x26d19f=0x0;for(let _0x29c10d=0x0;_0x31a082[_0x327e26(0x1f2)](_0x29c10d,_0x423ea6);_0x29c10d++){_0x26d19f=_0x31a082['ewQjd'](_0x26d19f,0x100)+_0x2aa660[_0x2e89f0+_0x29c10d];}return _0x26d19f;}function isUnknownSize(_0x30be05,_0x5d584e){const _0x4c5547=_0x13a0,_0x12c6e9={'fMjYI':function(_0x22ce64,_0x2d775c){return _0x22ce64===_0x2d775c;},'bYDHu':function(_0x5d6f69,_0x4d88b3){return _0x5d6f69*_0x4d88b3;}};return _0x12c6e9['fMjYI'](_0x30be05,Math['pow'](0x2,_0x12c6e9[_0x4c5547(0x1c6)](0x7,_0x5d584e))-0x1);}function _0x1016(){const _0x4bc220=['readInt16BE','FzcYa','hklzO','XwTmU','15IDKEIu','LqmTj','Znvkv','endsWith','bxpbT','error','JtNke','argv','Ytcwu','VPwDj','Rzmno','6912186AKsHWt','FpGwP','oaXaB','xTFNN','log','mnSjt','floor','mARth','mbAXY','IjEOb','JIbnR','dataSize','alloc','wlvmu','jrthm','JkQEu','gStpa','ABICp','105295NhFoYE','4502118zCJVIf','2309588DLavJy','zotRQ','Xtpgh','sizeLen','File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.','Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','concat','indexOf','vmWyp','11031120LpSCFx','bYDHu','idLen','uPiyS','FfNPx','Could\x20not\x20compute\x20duration','Could\x20not\x20find\x20Info\x20element','10cNMaJw','slice','length','uSFEy','ftNSc','567833WoGAuM','GftTA','sycqD','1605321iUCsOE','offset','LyrSG','wTout','kqfgF','from','MmWin','vpNIT','zwvjQ','exit','kmRNk','OmvbT','dataOffset'];_0x1016=function(){return _0x4bc220;};return _0x1016();}function writeId(_0x4ebb9b){const _0xf44294=_0x13a0,_0x2c971e={'FpGwP':function(_0x5000ad,_0x382e2a){return _0x5000ad<=_0x382e2a;},'OmvbT':function(_0x1f26ff,_0x2e5929){return _0x1f26ff&_0x2e5929;},'OVPWV':function(_0x2a2d61,_0x55c8e0){return _0x2a2d61>>_0x55c8e0;},'mbAXY':function(_0x43393e,_0x31b3d5){return _0x43393e&_0x31b3d5;},'CNzvw':function(_0x5b4997,_0x379329){return _0x5b4997&_0x379329;},'Znvkv':function(_0x9034fc,_0x2cf9be){return _0x9034fc>>_0x2cf9be;}};if(_0x2c971e[_0xf44294(0x1f1)](_0x4ebb9b,0xff))return Buffer['from']([_0x4ebb9b]);if(_0x2c971e[_0xf44294(0x1f1)](_0x4ebb9b,0xffff))return Buffer[_0xf44294(0x1d9)]([_0x2c971e[_0xf44294(0x1df)](_0x2c971e['OVPWV'](_0x4ebb9b,0x8),0xff),_0x2c971e[_0xf44294(0x1b0)](_0x4ebb9b,0xff)]);if(_0x4ebb9b<=0xffffff)return Buffer['from']([_0x2c971e['CNzvw'](_0x4ebb9b>>0x10,0xff),_0x4ebb9b>>0x8&0xff,_0x4ebb9b&0xff]);return Buffer['from']([_0x2c971e[_0xf44294(0x1e7)](_0x4ebb9b,0x18)&0xff,_0x2c971e[_0xf44294(0x1e7)](_0x4ebb9b,0x10)&0xff,_0x2c971e['OVPWV'](_0x4ebb9b,0x8)&0xff,_0x4ebb9b&0xff]);}function writeVint(_0x3c2602,_0xbd8c2a){const _0x1f52e6=_0x13a0,_0xb2d716={'pKPMR':function(_0x37db4d,_0x1c61de){return _0x37db4d<_0x1c61de;},'hFgDS':function(_0x8dafd1,_0x102300){return _0x8dafd1*_0x102300;},'mWHLh':function(_0x57168c,_0x48e532){return _0x57168c>=_0x48e532;},'jrthm':function(_0x51dd80,_0x20b738){return _0x51dd80&_0x20b738;},'FzcYa':function(_0x28117d,_0x1d0c77){return _0x28117d<<_0x1d0c77;},'AYOHM':function(_0x3f3fc6,_0x51da81){return _0x3f3fc6-_0x51da81;}};let _0x28083e=_0xbd8c2a||0x1;while(_0xb2d716['pKPMR'](Math['pow'](0x2,_0xb2d716['hFgDS'](0x7,_0x28083e))-0x2,_0x3c2602))_0x28083e++;const _0x5003f8=Buffer['alloc'](_0x28083e);for(let _0x4ff913=_0x28083e-0x1;_0xb2d716['mWHLh'](_0x4ff913,0x0);_0x4ff913--){_0x5003f8[_0x4ff913]=_0xb2d716[_0x1f52e6(0x1b6)](_0x3c2602,0xff),_0x3c2602=Math[_0x1f52e6(0x1f6)](_0x3c2602/0x100);}return _0x5003f8[0x0]|=_0xb2d716[_0x1f52e6(0x1e2)](0x1,_0xb2d716['AYOHM'](0x8,_0x28083e)),_0x5003f8;}function writeFloat64(_0x2ff8f5){const _0x191876=Buffer['alloc'](0x8);return _0x191876['writeDoubleBE'](_0x2ff8f5,0x0),_0x191876;}function writeVoid(_0x5db6ec){const _0xbb3938=_0x13a0,_0x271822={'zotRQ':function(_0x197221,_0x35cce8){return _0x197221<=_0x35cce8;},'xTFNN':function(_0x3eaf27,_0x41d4ef){return _0x3eaf27-_0x41d4ef;},'XcNPK':function(_0x175555,_0x4f85f3){return _0x175555>=_0x4f85f3;},'IMRWW':function(_0x34afd0,_0x4faf64){return _0x34afd0<=_0x4faf64;},'ledEI':function(_0x2d4927,_0x5181fe){return _0x2d4927*_0x5181fe;}};for(let _0x544a3b=0x1;_0x271822[_0xbb3938(0x1bd)](_0x544a3b,0x8);_0x544a3b++){const _0x53db48=_0x271822[_0xbb3938(0x1f3)](_0x5db6ec-0x1,_0x544a3b);if(_0x271822['XcNPK'](_0x53db48,0x0)&&_0x271822['IMRWW'](_0x53db48,Math['pow'](0x2,_0x271822['ledEI'](0x7,_0x544a3b))-0x2))return Buffer[_0xbb3938(0x1c2)]([Buffer['from']([ID_VOID]),writeVint(_0x53db48,_0x544a3b),Buffer[_0xbb3938(0x1b4)](_0x53db48)]);}return Buffer['alloc'](0x0);}function findElement(_0x2997be,_0x5d4480,_0x5c91c1,_0x56f2df){const _0x37dff7=_0x13a0,_0x3f95eb={'wuONB':function(_0xe90d5e,_0x3e9c3c){return _0xe90d5e<_0x3e9c3c;},'gStpa':function(_0x4a631a,_0x360cc4,_0x563c67){return _0x4a631a(_0x360cc4,_0x563c67);},'JIbnR':function(_0x3fa197,_0xdf9f8f){return _0x3fa197+_0xdf9f8f;},'ABICp':function(_0x210782,_0xa4a662){return _0x210782+_0xa4a662;}};let _0x109297=_0x5d4480;while(_0x3f95eb['wuONB'](_0x109297,_0x5c91c1)){const [_0x434d75,_0x310f68]=_0x3f95eb[_0x37dff7(0x1b8)](readId,_0x2997be,_0x109297),[_0xaafa7e,_0x379e6b]=readVint(_0x2997be,_0x109297+_0x310f68);if(_0x434d75===_0x56f2df)return{'offset':_0x109297,'idLen':_0x310f68,'sizeLen':_0x379e6b,'dataSize':_0xaafa7e,'dataOffset':_0x3f95eb[_0x37dff7(0x1b2)](_0x3f95eb[_0x37dff7(0x1b9)](_0x109297,_0x310f68),_0x379e6b)};if(_0x3f95eb[_0x37dff7(0x1b8)](isUnknownSize,_0xaafa7e,_0x379e6b))break;_0x109297+=_0x3f95eb['ABICp'](_0x310f68+_0x379e6b,_0xaafa7e);}return null;}function computeDurationMs(_0x3472ee,_0xaffaf){const _0x32f16a=_0x13a0,_0x3f3f0e={'JtNke':function(_0x2dbb3c,_0x300bce){return _0x2dbb3c<_0x300bce;},'JkQEu':function(_0x1fdd31,_0x11d35e,_0x44a081){return _0x1fdd31(_0x11d35e,_0x44a081);},'XwTmU':function(_0x5d05d5,_0x4a19b3){return _0x5d05d5!==_0x4a19b3;},'Ytcwu':function(_0x25cec5,_0x2c24d5){return _0x25cec5+_0x2c24d5;},'ZRniW':function(_0x343782,_0x20e3c9){return _0x343782-_0x20e3c9;},'Rzmno':function(_0x33e0c4,_0x182466,_0x5a21e5){return _0x33e0c4(_0x182466,_0x5a21e5);},'mARth':function(_0x22b59f,_0x4f57a7){return _0x22b59f===_0x4f57a7;},'vpNIT':function(_0x31f521,_0x259f75){return _0x31f521+_0x259f75;},'uPiyS':function(_0xe69125,_0x2db98f,_0x5ee4d2){return _0xe69125(_0x2db98f,_0x5ee4d2);},'wlvmu':function(_0x26a8a6,_0xe8bd24,_0xb5324,_0x3b4d9a){return _0x26a8a6(_0xe8bd24,_0xb5324,_0x3b4d9a);},'lRoIu':function(_0x2e1444,_0x4b0f5e){return _0x2e1444+_0x4b0f5e;},'vmWyp':function(_0x4e19e7,_0x2b81c7){return _0x4e19e7+_0x2b81c7;},'FttTe':function(_0x110b1a,_0x173a4c){return _0x110b1a/_0x173a4c;},'VPwDj':function(_0x3fc7d0,_0x11a956){return _0x3fc7d0*_0x11a956;},'kmRNk':function(_0xb2b6ba,_0x4ccd1c){return _0xb2b6ba+_0x4ccd1c;},'fDHCY':function(_0x477bfc,_0x3eda80){return _0x477bfc>_0x3eda80;},'txLrc':function(_0x1ed022,_0x373718){return _0x1ed022===_0x373718;},'LyrSG':function(_0x478b2e,_0x1afea8){return _0x478b2e+_0x1afea8;}};let _0x29083f=0x0;const _0x16e7f1=Buffer['from']([0x1f,0x43,0xb6,0x75]);let _0xafeb3d=_0x3472ee[_0x32f16a(0x1c3)](_0x16e7f1);if(_0xafeb3d===-0x1)return 0x0;while(_0x3f3f0e[_0x32f16a(0x1eb)](_0xafeb3d,_0x3472ee[_0x32f16a(0x1ce)])){const [_0x4afb6e,_0x1c56c8]=_0x3f3f0e[_0x32f16a(0x1b7)](readId,_0x3472ee,_0xafeb3d);if(_0x3f3f0e[_0x32f16a(0x1e4)](_0x4afb6e,ID_CLUSTER))break;const [_0x40f3e8,_0x3f0d48]=readVint(_0x3472ee,_0xafeb3d+_0x1c56c8),_0x100cca=_0x3f3f0e[_0x32f16a(0x1ed)](_0x3f3f0e['Ytcwu'](_0xafeb3d,_0x1c56c8),_0x3f0d48),_0x5e9fdb=isUnknownSize(_0x40f3e8,_0x3f0d48);let _0x17d78b;if(_0x5e9fdb){let _0x127eaa=_0x100cca;while(_0x127eaa<_0x3f3f0e['ZRniW'](_0x3472ee[_0x32f16a(0x1ce)],0x4)){const [_0x2c0850,_0x3d492e]=_0x3f3f0e[_0x32f16a(0x1ef)](readId,_0x3472ee,_0x127eaa);if(_0x3f3f0e[_0x32f16a(0x1af)](_0x2c0850,ID_CLUSTER)){_0x17d78b=_0x127eaa;break;}const [_0x65245e,_0x2cd4f1]=_0x3f3f0e['Rzmno'](readVint,_0x3472ee,_0x127eaa+_0x3d492e);if(isUnknownSize(_0x65245e,_0x2cd4f1)){_0x17d78b=_0x3472ee[_0x32f16a(0x1ce)];break;}_0x127eaa+=_0x3f3f0e[_0x32f16a(0x1ed)](_0x3f3f0e['Ytcwu'](_0x3d492e,_0x2cd4f1),_0x65245e);}_0x17d78b??=_0x3472ee[_0x32f16a(0x1ce)];}else _0x17d78b=_0x3f3f0e[_0x32f16a(0x1db)](_0x100cca,_0x40f3e8);let _0x52a363=0x0,_0x251586=_0x100cca;while(_0x251586<_0x17d78b){const [_0x7f436e,_0x3ab420]=readId(_0x3472ee,_0x251586),[_0xfe4afc,_0x589b9b]=_0x3f3f0e['uPiyS'](readVint,_0x3472ee,_0x251586+_0x3ab420);if(_0x7f436e===ID_TIMESTAMP)_0x52a363=_0x3f3f0e[_0x32f16a(0x1b5)](readUint,_0x3472ee,_0x3f3f0e['lRoIu'](_0x251586,_0x3ab420)+_0x589b9b,_0xfe4afc);else{if(_0x7f436e===ID_SIMPLE_BLOCK&&_0xfe4afc>=0x4){const _0x32d9ca=_0x3f3f0e[_0x32f16a(0x1c4)](_0x251586+_0x3ab420,_0x589b9b),[,_0x4314ba]=_0x3f3f0e[_0x32f16a(0x1c8)](readVint,_0x3472ee,_0x32d9ca),_0x301fa8=_0x3472ee[_0x32f16a(0x1e1)](_0x3f3f0e[_0x32f16a(0x1c4)](_0x32d9ca,_0x4314ba)),_0x227fbd=_0x3f3f0e['FttTe'](_0x3f3f0e[_0x32f16a(0x1ee)](_0x3f3f0e[_0x32f16a(0x1de)](_0x52a363,_0x301fa8),_0xaffaf),0xf4240);_0x3f3f0e['fDHCY'](_0x227fbd,_0x29083f)&&(_0x29083f=_0x227fbd);}else{if(_0x3f3f0e['txLrc'](_0x7f436e,ID_CLUSTER))break;}}if(_0x3f3f0e[_0x32f16a(0x1b7)](isUnknownSize,_0xfe4afc,_0x589b9b))break;_0x251586+=_0x3f3f0e[_0x32f16a(0x1d6)](_0x3f3f0e[_0x32f16a(0x1d6)](_0x3ab420,_0x589b9b),_0xfe4afc);}_0xafeb3d=_0x17d78b;}return _0x29083f;}function _0x13a0(_0x125a35,_0x4922e2){_0x125a35=_0x125a35-0x1af;const _0x10169a=_0x1016();let _0x13a055=_0x10169a[_0x125a35];return _0x13a055;}export function fixWebmDuration(_0x228d6c,_0x30cc39){const _0x4289ae=_0x13a0,_0x4db317={'FfNPx':function(_0x525715,_0x45d9cf){return _0x525715(_0x45d9cf);},'ftNSc':function(_0x40b507,_0x38e4e3,_0x5622d0){return _0x40b507(_0x38e4e3,_0x5622d0);},'ZHklY':function(_0x5e7d17,_0x17920a){return _0x5e7d17+_0x17920a;},'VSKyJ':_0x4289ae(0x1c1),'bxpbT':function(_0x26d1df,_0x4c848e){return _0x26d1df+_0x4c848e;},'mnSjt':function(_0x2f6ebb,_0x285233){return _0x2f6ebb===_0x285233;},'LqmTj':function(_0xe4100e,_0x3457f7){return _0xe4100e<=_0x3457f7;},'hklzO':_0x4289ae(0x1ca),'OSyLG':function(_0x271d7a,_0x34c25d){return _0x271d7a<_0x34c25d;},'OkxWs':function(_0x386a5d,_0x5184fa){return _0x386a5d+_0x5184fa;},'kqfgF':function(_0x981cfe,_0x1da603){return _0x981cfe-_0x1da603;},'GftTA':function(_0x18ed54,_0x4b9a66,_0x71f92,_0x4685cc,_0x56f8d7,_0x5dddb4,_0x416772){return _0x18ed54(_0x4b9a66,_0x71f92,_0x4685cc,_0x56f8d7,_0x5dddb4,_0x416772);},'sycqD':function(_0x4aebfb,_0x35e958){return _0x4aebfb+_0x35e958;},'LHkAt':function(_0x1b87c1,_0xfb6ac4){return _0x1b87c1+_0xfb6ac4;}},_0x1a97d2=_0x4db317[_0x4289ae(0x1c9)](readFileSync,_0x228d6c);let _0x5e8832=0x0;const [_0x2cf411,_0x42878]=readId(_0x1a97d2,_0x5e8832),[_0x2c11da,_0x85635d]=_0x4db317[_0x4289ae(0x1d0)](readVint,_0x1a97d2,_0x5e8832+_0x42878);_0x5e8832+=_0x4db317['ZHklY'](_0x42878,_0x85635d)+_0x2c11da;const [_0x567d10,_0x354599]=readId(_0x1a97d2,_0x5e8832);if(_0x567d10!==ID_SEGMENT)return console[_0x4289ae(0x1ea)](_0x4db317['VSKyJ']),![];const [,_0x23f9d9]=_0x4db317['ftNSc'](readVint,_0x1a97d2,_0x4db317['ZHklY'](_0x5e8832,_0x354599)),_0x5b2889=_0x4db317[_0x4289ae(0x1e9)](_0x5e8832+_0x354599,_0x23f9d9);let _0xa59bd1=_0x5b2889;const _0x36341f=Math['min'](_0x1a97d2[_0x4289ae(0x1ce)],_0x5b2889+0x2710);let _0xa4f848=null,_0x1313d0=null;while(_0xa59bd1<_0x36341f){const [_0xf38b14,_0x324ea5]=_0x4db317[_0x4289ae(0x1d0)](readId,_0x1a97d2,_0xa59bd1),[_0x58f138,_0x2deea0]=readVint(_0x1a97d2,_0x4db317['bxpbT'](_0xa59bd1,_0x324ea5));_0x4db317['mnSjt'](_0xf38b14,ID_VOID)&&!_0xa4f848&&(_0xa4f848={'offset':_0xa59bd1,'idLen':_0x324ea5,'sizeLen':_0x2deea0,'dataSize':_0x58f138,'dataOffset':_0x4db317['bxpbT'](_0xa59bd1,_0x324ea5)+_0x2deea0});if(_0xf38b14===ID_INFO){_0x1313d0={'offset':_0xa59bd1,'idLen':_0x324ea5,'sizeLen':_0x2deea0,'dataSize':_0x58f138,'dataOffset':_0xa59bd1+_0x324ea5+_0x2deea0};break;}if(_0x4db317[_0x4289ae(0x1f5)](_0xf38b14,ID_CLUSTER))break;if(_0x4db317['ftNSc'](isUnknownSize,_0x58f138,_0x2deea0))break;_0xa59bd1+=_0x4db317['bxpbT'](_0x324ea5,_0x2deea0)+_0x58f138;}if(!_0x1313d0)return console[_0x4289ae(0x1ea)](_0x4289ae(0x1cb)),![];const _0x30ca46=findElement(_0x1a97d2,_0x1313d0['dataOffset'],_0x1313d0['dataOffset']+_0x1313d0['dataSize'],ID_DURATION);if(_0x30ca46)return![];const _0x4ea898=findElement(_0x1a97d2,_0x1313d0['dataOffset'],_0x1313d0['dataOffset']+_0x1313d0[_0x4289ae(0x1b3)],ID_TIMESTAMP_SCALE);let _0x1f5704=0xf4240;_0x4ea898&&(_0x1f5704=readUint(_0x1a97d2,_0x4ea898[_0x4289ae(0x1e0)],_0x4ea898[_0x4289ae(0x1b3)]));const _0x48acbd=_0x4db317[_0x4289ae(0x1d0)](computeDurationMs,_0x1a97d2,_0x1f5704);if(_0x4db317[_0x4289ae(0x1e6)](_0x48acbd,0x0))return console[_0x4289ae(0x1ea)](_0x4db317[_0x4289ae(0x1e3)]),![];const _0x5b6180=_0x48acbd*0xf4240/_0x1f5704,_0x2f1191=Buffer[_0x4289ae(0x1c2)]([_0x4db317[_0x4289ae(0x1c9)](writeId,ID_DURATION),_0x4db317[_0x4289ae(0x1c9)](writeVint,0x8),_0x4db317['FfNPx'](writeFloat64,_0x5b6180)]),_0x4c6b10=_0x2f1191[_0x4289ae(0x1ce)];if(!_0xa4f848||_0x4db317['OSyLG'](_0xa4f848['offset'],_0x1313d0[_0x4289ae(0x1d5)])){if(_0xa4f848){const _0xb438c=_0x4db317['OkxWs'](_0xa4f848[_0x4289ae(0x1c7)],_0xa4f848[_0x4289ae(0x1bf)])+_0xa4f848['dataSize'],_0x127424=_0x4db317[_0x4289ae(0x1d8)](_0xb438c,_0x4c6b10);if(_0x127424<0x2)return _0x4db317[_0x4289ae(0x1d2)](rewriteFile,_0x1a97d2,_0x1313d0,_0x2f1191,_0x1f5704,_0x48acbd,_0x30cc39);const _0x4dd48d=_0x4db317[_0x4289ae(0x1d3)](_0x1313d0['dataSize'],_0x4c6b10),_0x550d88=Buffer[_0x4289ae(0x1c2)]([writeId(ID_INFO),writeVint(_0x4dd48d,_0x1313d0[_0x4289ae(0x1bf)])]),_0x5258d0=_0x1a97d2['slice'](_0x1313d0[_0x4289ae(0x1e0)],_0x4db317['LHkAt'](_0x1313d0[_0x4289ae(0x1e0)],_0x1313d0['dataSize'])),_0x2980c0=writeVoid(_0x127424),_0x4777ba=_0x1a97d2[_0x4289ae(0x1cd)](0x0,_0xa4f848[_0x4289ae(0x1d5)]),_0x394fb7=_0x1a97d2['slice'](_0x1313d0['dataOffset']+_0x1313d0[_0x4289ae(0x1b3)]);return _0x4db317[_0x4289ae(0x1d0)](writeFileSync,_0x30cc39,Buffer['concat']([_0x4777ba,_0x2980c0,_0x550d88,_0x5258d0,_0x2f1191,_0x394fb7])),!![];}}return rewriteFile(_0x1a97d2,_0x1313d0,_0x2f1191,_0x1f5704,_0x48acbd,_0x30cc39);}function rewriteFile(_0x1e9310,_0x18fea5,_0x38a0bb,_0x320ee4,_0x283abd,_0x4d8705){const _0x558308=_0x13a0,_0x2b512f={'osQHo':function(_0x18f0db,_0x1bb976){return _0x18f0db+_0x1bb976;},'LasPk':function(_0x57b050,_0x32e1ef){return _0x57b050(_0x32e1ef);},'uSFEy':function(_0x36dd3c,_0x15f520){return _0x36dd3c+_0x15f520;}},_0x32cdec=_0x2b512f['osQHo'](_0x18fea5['dataSize'],_0x38a0bb[_0x558308(0x1ce)]),_0x4f8d1f=Buffer['concat']([writeId(ID_INFO),_0x2b512f['LasPk'](writeVint,_0x32cdec)]),_0x3acbac=_0x18fea5[_0x558308(0x1c7)]+_0x18fea5[_0x558308(0x1bf)],_0x64e35b=_0x1e9310['slice'](0x0,_0x18fea5['offset']),_0x2c7767=_0x1e9310[_0x558308(0x1cd)](_0x18fea5['dataOffset'],_0x2b512f[_0x558308(0x1cf)](_0x18fea5[_0x558308(0x1e0)],_0x18fea5['dataSize'])),_0x5653d5=_0x1e9310['slice'](_0x2b512f['uSFEy'](_0x18fea5[_0x558308(0x1d5)],_0x3acbac)+_0x18fea5['dataSize']);return writeFileSync(_0x4d8705,Buffer[_0x558308(0x1c2)]([_0x64e35b,_0x4f8d1f,_0x2c7767,_0x38a0bb,_0x5653d5])),!![];}if(process[_0x5ee21e(0x1ec)][0x1]?.['endsWith']('fixWebmDuration.ts')||process[_0x5ee21e(0x1ec)][0x1]?.[_0x5ee21e(0x1e8)]('fixWebmDuration.js')){const input=process[_0x5ee21e(0x1ec)][0x2],output=process[_0x5ee21e(0x1ec)][0x3];(!input||!output)&&(console['error']('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process[_0x5ee21e(0x1dd)](0x1));const fixed=fixWebmDuration(input,output);fixed?console['log']('Fixed:\x20'+output):console[_0x5ee21e(0x1f4)](_0x5ee21e(0x1c0));}
|
|
1
|
+
const _0x20ca6a=_0x5345;(function(_0x5b519b,_0x4440f5){const _0x2ca36c=_0x5345,_0x48cfa4=_0x5b519b();while(!![]){try{const _0x37ce4a=-parseInt(_0x2ca36c(0x203))/0x1+parseInt(_0x2ca36c(0x1fb))/0x2+parseInt(_0x2ca36c(0x1e7))/0x3*(parseInt(_0x2ca36c(0x1fd))/0x4)+parseInt(_0x2ca36c(0x21d))/0x5+parseInt(_0x2ca36c(0x1f5))/0x6*(parseInt(_0x2ca36c(0x1f9))/0x7)+parseInt(_0x2ca36c(0x210))/0x8+-parseInt(_0x2ca36c(0x201))/0x9*(parseInt(_0x2ca36c(0x1e4))/0xa);if(_0x37ce4a===_0x4440f5)break;else _0x48cfa4['push'](_0x48cfa4['shift']());}catch(_0x10235c){_0x48cfa4['push'](_0x48cfa4['shift']());}}}(_0x17b8,0xabbe6));import{readFileSync,writeFileSync}from'fs';const ID_SEGMENT=0x18538067,ID_INFO=0x1549a966,ID_TIMESTAMP_SCALE=0x2ad7b1,ID_DURATION=0x4489,ID_VOID=0xec,ID_CLUSTER=0x1f43b675,ID_TIMESTAMP=0xe7,ID_SIMPLE_BLOCK=0xa3;function readVint(_0x198e50,_0x5a34f4){const _0x27998c=_0x5345,_0x21259a={'eYNdX':function(_0x34ac51,_0xaee2f1){return _0x34ac51>=_0xaee2f1;},'JUTyl':function(_0x5bb643,_0x2a00ff){return _0x5bb643&_0x2a00ff;},'jUGTr':function(_0x20f552,_0x21befd){return _0x20f552>_0x21befd;},'wXolD':function(_0x4c79f3,_0x3c1be0){return _0x4c79f3+_0x3c1be0;},'nYazP':function(_0x4cd406,_0x102457){return _0x4cd406-_0x102457;},'sjfJQ':function(_0x2c7e6f,_0x1fc7ad){return _0x2c7e6f*_0x1fc7ad;}};if(_0x21259a[_0x27998c(0x225)](_0x5a34f4,_0x198e50['length']))return[0x0,0x0];const _0x4c9dbc=_0x198e50[_0x5a34f4];let _0x5437e9=0x1,_0x2d3570=0x80;while(_0x5437e9<=0x8&&!_0x21259a['JUTyl'](_0x4c9dbc,_0x2d3570)){_0x5437e9++,_0x2d3570>>=0x1;}if(_0x21259a[_0x27998c(0x1fa)](_0x21259a['wXolD'](_0x5a34f4,_0x5437e9),_0x198e50['length']))return[0x0,0x0];let _0x2fbaa0=_0x4c9dbc&_0x21259a['nYazP'](_0x2d3570,0x1);for(let _0x5d0d9d=0x1;_0x5d0d9d<_0x5437e9;_0x5d0d9d++){_0x2fbaa0=_0x21259a[_0x27998c(0x214)](_0x2fbaa0,0x100)+_0x198e50[_0x21259a[_0x27998c(0x1ed)](_0x5a34f4,_0x5d0d9d)];}return[_0x2fbaa0,_0x5437e9];}function readId(_0x513421,_0xdfb70c){const _0x1a904c={'bWGDr':function(_0x50a311,_0x2d255e){return _0x50a311+_0x2d255e;}};if(_0xdfb70c>=_0x513421['length'])return[0x0,0x0];const _0x4d0ef6=_0x513421[_0xdfb70c];let _0x5370c9;if(_0x4d0ef6>=0x80)_0x5370c9=0x1;else{if(_0x4d0ef6>=0x40)_0x5370c9=0x2;else{if(_0x4d0ef6>=0x20)_0x5370c9=0x3;else{if(_0x4d0ef6>=0x10)_0x5370c9=0x4;else return[_0x4d0ef6,0x1];}}}if(_0x1a904c['bWGDr'](_0xdfb70c,_0x5370c9)>_0x513421['length'])return[0x0,0x0];let _0x3a6b45=0x0;for(let _0x5e7e2f=0x0;_0x5e7e2f<_0x5370c9;_0x5e7e2f++){_0x3a6b45=_0x3a6b45*0x100+_0x513421[_0xdfb70c+_0x5e7e2f];}return[_0x3a6b45,_0x5370c9];}function readUint(_0x454f90,_0x674684,_0x4bfeff){const _0x176f47=_0x5345,_0x3ec867={'OkeyE':function(_0x474ec6,_0x54f569){return _0x474ec6+_0x54f569;}};let _0x32e74e=0x0;for(let _0x374d08=0x0;_0x374d08<_0x4bfeff;_0x374d08++){_0x32e74e=_0x32e74e*0x100+_0x454f90[_0x3ec867[_0x176f47(0x211)](_0x674684,_0x374d08)];}return _0x32e74e;}function isUnknownSize(_0x4585de,_0xaf2d51){const _0x3c27c1=_0x5345,_0x48a379={'ISaet':function(_0x2da96c,_0x36cbed){return _0x2da96c*_0x36cbed;}};return _0x4585de===Math['pow'](0x2,_0x48a379[_0x3c27c1(0x1ec)](0x7,_0xaf2d51))-0x1;}function writeId(_0x36197d){const _0x5b8f0e=_0x5345,_0x41e2f9={'XecSW':function(_0x5842f1,_0x496025){return _0x5842f1<=_0x496025;},'lcVGO':function(_0x302338,_0x4cf463){return _0x302338>>_0x4cf463;},'SIbSf':function(_0x4daf19,_0x49ceab){return _0x4daf19<=_0x49ceab;},'DmDPH':function(_0x2054e6,_0x454e2f){return _0x2054e6&_0x454e2f;},'OYNwt':function(_0x2371e0,_0x55bc14){return _0x2371e0&_0x55bc14;},'xuXDt':function(_0x135e36,_0x55a90a){return _0x135e36&_0x55a90a;},'qFjzh':function(_0x13b78d,_0x19041e){return _0x13b78d>>_0x19041e;}};if(_0x41e2f9[_0x5b8f0e(0x208)](_0x36197d,0xff))return Buffer[_0x5b8f0e(0x20f)]([_0x36197d]);if(_0x41e2f9[_0x5b8f0e(0x208)](_0x36197d,0xffff))return Buffer['from']([_0x41e2f9['lcVGO'](_0x36197d,0x8)&0xff,_0x36197d&0xff]);if(_0x41e2f9[_0x5b8f0e(0x1ef)](_0x36197d,0xffffff))return Buffer['from']([_0x41e2f9['DmDPH'](_0x36197d>>0x10,0xff),_0x41e2f9[_0x5b8f0e(0x1eb)](_0x36197d>>0x8,0xff),_0x36197d&0xff]);return Buffer[_0x5b8f0e(0x20f)]([_0x41e2f9['lcVGO'](_0x36197d,0x18)&0xff,_0x41e2f9['DmDPH'](_0x36197d>>0x10,0xff),_0x41e2f9[_0x5b8f0e(0x1f6)](_0x41e2f9['qFjzh'](_0x36197d,0x8),0xff),_0x36197d&0xff]);}function writeVint(_0x1e9297,_0x46a9e1){const _0x3369de=_0x5345,_0x2dd1c5={'KGjWg':function(_0x5ec1c8,_0x47e052){return _0x5ec1c8<_0x47e052;},'vvbmP':function(_0x3abc57,_0x3c24a0){return _0x3abc57-_0x3c24a0;},'AwyLG':function(_0x509c32,_0xd74207){return _0x509c32*_0xd74207;},'KiyFw':function(_0xa1ad46,_0x26bde1){return _0xa1ad46&_0x26bde1;},'ufTRa':function(_0x1375cc,_0x4093ae){return _0x1375cc/_0x4093ae;},'UEjgH':function(_0x237e95,_0x5ef906){return _0x237e95<<_0x5ef906;}};let _0x3959e4=_0x46a9e1||0x1;while(_0x2dd1c5['KGjWg'](_0x2dd1c5[_0x3369de(0x205)](Math['pow'](0x2,_0x2dd1c5['AwyLG'](0x7,_0x3959e4)),0x2),_0x1e9297))_0x3959e4++;const _0x28f00e=Buffer[_0x3369de(0x1ea)](_0x3959e4);for(let _0x537529=_0x3959e4-0x1;_0x537529>=0x0;_0x537529--){_0x28f00e[_0x537529]=_0x2dd1c5['KiyFw'](_0x1e9297,0xff),_0x1e9297=Math['floor'](_0x2dd1c5['ufTRa'](_0x1e9297,0x100));}return _0x28f00e[0x0]|=_0x2dd1c5[_0x3369de(0x216)](0x1,0x8-_0x3959e4),_0x28f00e;}function _0x17b8(){const _0x24875a=['tLYVn','isbhK','length','from','7327896qKYLbA','OkeyE','Could\x20not\x20find\x20Info\x20element','eUUMP','sjfJQ','sQlKt','UEjgH','ZJDly','lBZPf','GzryQ','readInt16BE','exit','SzsOa','68555bmVVFl','idLen','PoGwL','sizeLen','SxcCu','argv','tbPaF','Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','eYNdX','19350TEZBOF','fixWebmDuration.js','ZWVMa','5703RumUcx','Could\x20not\x20compute\x20duration','dataOffset','alloc','OYNwt','ISaet','wXolD','BVfrR','SIbSf','dataSize','kFhZg','endsWith','log','giUqz','987942uAJPIJ','xuXDt','Fixed:\x20','min','56DmhFlo','jUGTr','2017798CuvVnX','hveCy','1296ntmIeI','slice','FDFGW','YQouY','13887OcxutO','jCaeJ','182610eoIYAP','offset','vvbmP','ydyRX','error','XecSW','concat','iCZQW','TsTdz'];_0x17b8=function(){return _0x24875a;};return _0x17b8();}function writeFloat64(_0x579292){const _0x25cbeb=_0x5345,_0x3d0739=Buffer[_0x25cbeb(0x1ea)](0x8);return _0x3d0739['writeDoubleBE'](_0x579292,0x0),_0x3d0739;}function writeVoid(_0x77cb74){const _0x5dff27=_0x5345,_0x21c166={'lKpta':function(_0x47b6b7,_0x5882dc){return _0x47b6b7<=_0x5882dc;},'nxDmR':function(_0x4d97c6,_0x184492){return _0x4d97c6>=_0x184492;},'tLYVn':function(_0x41af7c,_0x2abf39){return _0x41af7c<=_0x2abf39;}};for(let _0x41e130=0x1;_0x21c166['lKpta'](_0x41e130,0x8);_0x41e130++){const _0x55e257=_0x77cb74-0x1-_0x41e130;if(_0x21c166['nxDmR'](_0x55e257,0x0)&&_0x21c166[_0x5dff27(0x20c)](_0x55e257,Math['pow'](0x2,0x7*_0x41e130)-0x2))return Buffer[_0x5dff27(0x209)]([Buffer['from']([ID_VOID]),writeVint(_0x55e257,_0x41e130),Buffer[_0x5dff27(0x1ea)](_0x55e257)]);}return Buffer['alloc'](0x0);}function findElement(_0x906dc9,_0x17a928,_0x32486c,_0x2e669a){const _0x574b4c=_0x5345,_0x2563c5={'ydyRX':function(_0x4c2a09,_0x1bb706){return _0x4c2a09+_0x1bb706;},'tbPaF':function(_0x360e80,_0x52c3f4){return _0x360e80===_0x52c3f4;}};let _0x2dc3b1=_0x17a928;while(_0x2dc3b1<_0x32486c){const [_0x5dd4ef,_0x347b85]=readId(_0x906dc9,_0x2dc3b1),[_0x4e0ae2,_0x431421]=readVint(_0x906dc9,_0x2563c5[_0x574b4c(0x206)](_0x2dc3b1,_0x347b85));if(_0x2563c5[_0x574b4c(0x223)](_0x5dd4ef,_0x2e669a))return{'offset':_0x2dc3b1,'idLen':_0x347b85,'sizeLen':_0x431421,'dataSize':_0x4e0ae2,'dataOffset':_0x2563c5[_0x574b4c(0x206)](_0x2dc3b1+_0x347b85,_0x431421)};if(isUnknownSize(_0x4e0ae2,_0x431421))break;_0x2dc3b1+=_0x2563c5['ydyRX'](_0x347b85,_0x431421)+_0x4e0ae2;}return null;}function computeDurationMs(_0x4d5265,_0x275ed7){const _0x485c3d=_0x5345,_0x1bde88={'iLmQU':function(_0x238b7f,_0x1dac26,_0x1020df){return _0x238b7f(_0x1dac26,_0x1020df);},'XqRIl':function(_0x367324,_0x142a46){return _0x367324!==_0x142a46;},'hiHNb':function(_0x432a72,_0x557062){return _0x432a72+_0x557062;},'ZJDly':function(_0x4446cd,_0x183498){return _0x4446cd+_0x183498;},'BVfrR':function(_0x2ec71e,_0x4f4627){return _0x2ec71e-_0x4f4627;},'eUUMP':function(_0x4bc161,_0x562e30,_0x1f5b3c){return _0x4bc161(_0x562e30,_0x1f5b3c);},'FvVjN':function(_0x17ae93,_0x75f000,_0x22a395){return _0x17ae93(_0x75f000,_0x22a395);},'HvXgK':function(_0x66c34d,_0x409fcc){return _0x66c34d+_0x409fcc;},'WGFIg':function(_0x255e54,_0x2b8c21,_0x153ff1){return _0x255e54(_0x2b8c21,_0x153ff1);},'SxcCu':function(_0x1f35a0,_0x127f5c){return _0x1f35a0+_0x127f5c;},'PoGwL':function(_0x58aa46,_0x35d290){return _0x58aa46===_0x35d290;},'YQouY':function(_0x5d3d3b,_0x2fd53b){return _0x5d3d3b+_0x2fd53b;},'rPzaJ':function(_0x3062a9,_0x12ea21){return _0x3062a9>=_0x12ea21;},'hveCy':function(_0x6fdc3c,_0x236e72){return _0x6fdc3c+_0x236e72;}};let _0x1ddccf=0x0;const _0x31eb8e=Buffer['from']([0x1f,0x43,0xb6,0x75]);let _0x5e63f5=_0x4d5265['indexOf'](_0x31eb8e);if(_0x5e63f5===-0x1)return 0x0;while(_0x5e63f5<_0x4d5265['length']){const [_0x58d99e,_0x23dc91]=_0x1bde88['iLmQU'](readId,_0x4d5265,_0x5e63f5);if(_0x1bde88['XqRIl'](_0x58d99e,ID_CLUSTER))break;const [_0x20d498,_0x55b8a9]=readVint(_0x4d5265,_0x1bde88['hiHNb'](_0x5e63f5,_0x23dc91)),_0x430947=_0x1bde88['ZJDly'](_0x5e63f5+_0x23dc91,_0x55b8a9),_0xe4dbe3=isUnknownSize(_0x20d498,_0x55b8a9);let _0x132914;if(_0xe4dbe3){let _0x5c62f0=_0x430947;while(_0x5c62f0<_0x1bde88[_0x485c3d(0x1ee)](_0x4d5265['length'],0x4)){const [_0x449471,_0x4c7611]=_0x1bde88['eUUMP'](readId,_0x4d5265,_0x5c62f0);if(_0x449471===ID_CLUSTER){_0x132914=_0x5c62f0;break;}const [_0x58a8b5,_0x140857]=_0x1bde88['FvVjN'](readVint,_0x4d5265,_0x1bde88['HvXgK'](_0x5c62f0,_0x4c7611));if(isUnknownSize(_0x58a8b5,_0x140857)){_0x132914=_0x4d5265['length'];break;}_0x5c62f0+=_0x4c7611+_0x140857+_0x58a8b5;}_0x132914??=_0x4d5265['length'];}else _0x132914=_0x430947+_0x20d498;let _0x5db741=0x0,_0x26cf14=_0x430947;while(_0x26cf14<_0x132914){const [_0x21b216,_0x1bcd8e]=_0x1bde88['WGFIg'](readId,_0x4d5265,_0x26cf14),[_0x51bce6,_0x3a7aa6]=_0x1bde88[_0x485c3d(0x213)](readVint,_0x4d5265,_0x1bde88[_0x485c3d(0x221)](_0x26cf14,_0x1bcd8e));if(_0x1bde88[_0x485c3d(0x21f)](_0x21b216,ID_TIMESTAMP))_0x5db741=readUint(_0x4d5265,_0x1bde88[_0x485c3d(0x200)](_0x26cf14,_0x1bcd8e)+_0x3a7aa6,_0x51bce6);else{if(_0x21b216===ID_SIMPLE_BLOCK&&_0x1bde88['rPzaJ'](_0x51bce6,0x4)){const _0x4fc92e=_0x1bde88[_0x485c3d(0x217)](_0x26cf14+_0x1bcd8e,_0x3a7aa6),[,_0x39903b]=_0x1bde88['eUUMP'](readVint,_0x4d5265,_0x4fc92e),_0x3d413a=_0x4d5265[_0x485c3d(0x21a)](_0x4fc92e+_0x39903b),_0x465053=(_0x5db741+_0x3d413a)*_0x275ed7/0xf4240;_0x465053>_0x1ddccf&&(_0x1ddccf=_0x465053);}else{if(_0x21b216===ID_CLUSTER)break;}}if(isUnknownSize(_0x51bce6,_0x3a7aa6))break;_0x26cf14+=_0x1bde88['HvXgK'](_0x1bde88[_0x485c3d(0x1fc)](_0x1bcd8e,_0x3a7aa6),_0x51bce6);}_0x5e63f5=_0x132914;}return _0x1ddccf;}export function fixWebmDuration(_0x26d661,_0x362d08){const _0xc7ef72=_0x5345,_0x481149={'kFhZg':function(_0x215a86,_0x5761a5,_0x4c92b7){return _0x215a86(_0x5761a5,_0x4c92b7);},'TsTdz':function(_0x466d24,_0x5e8757){return _0x466d24+_0x5e8757;},'CCqkg':function(_0x28a1c0,_0x34af5b){return _0x28a1c0!==_0x34af5b;},'PZHEk':_0xc7ef72(0x224),'lBZPf':function(_0x5d0ea9,_0x16d2d1){return _0x5d0ea9+_0x16d2d1;},'mcnXa':function(_0x4ebf4d,_0x1ee226){return _0x4ebf4d+_0x1ee226;},'xOaQz':function(_0x18d8b8,_0x22d119){return _0x18d8b8+_0x22d119;},'XotTr':function(_0x332325,_0x4661ac,_0x11aaa5){return _0x332325(_0x4661ac,_0x11aaa5);},'giUqz':function(_0x13c644,_0x36005b,_0x28e0ff,_0x1378ad,_0x3ae7ef){return _0x13c644(_0x36005b,_0x28e0ff,_0x1378ad,_0x3ae7ef);},'GzryQ':function(_0x217022,_0xf6c07b){return _0x217022+_0xf6c07b;},'isbhK':function(_0x5746ff,_0x14eabc,_0x496ea7,_0x542bc8){return _0x5746ff(_0x14eabc,_0x496ea7,_0x542bc8);},'SzsOa':function(_0x1c3183,_0x13741f){return _0x1c3183<=_0x13741f;},'hJlBl':function(_0x1fe363,_0x125274){return _0x1fe363*_0x125274;},'sQlKt':function(_0x28f3c2,_0x351a91){return _0x28f3c2(_0x351a91);},'iCZQW':function(_0x2357f3,_0x419cee){return _0x2357f3(_0x419cee);},'dJZlE':function(_0x14be07,_0x18e6c9){return _0x14be07<_0x18e6c9;},'PLwPS':function(_0x4a8df7,_0x152280){return _0x4a8df7(_0x152280);}},_0x227c6c=readFileSync(_0x26d661);let _0x1f2f59=0x0;const [_0x376df8,_0x354f65]=readId(_0x227c6c,_0x1f2f59),[_0x5c03f7,_0x2ce9ca]=_0x481149['kFhZg'](readVint,_0x227c6c,_0x1f2f59+_0x354f65);_0x1f2f59+=_0x481149[_0xc7ef72(0x20b)](_0x354f65+_0x2ce9ca,_0x5c03f7);const [_0x5e2190,_0x566e31]=_0x481149[_0xc7ef72(0x1f1)](readId,_0x227c6c,_0x1f2f59);if(_0x481149['CCqkg'](_0x5e2190,ID_SEGMENT))return console[_0xc7ef72(0x207)](_0x481149['PZHEk']),![];const [,_0x2f43b8]=readVint(_0x227c6c,_0x1f2f59+_0x566e31),_0x5c3e62=_0x1f2f59+_0x566e31+_0x2f43b8;let _0x3e4115=_0x5c3e62;const _0x308fdf=Math[_0xc7ef72(0x1f8)](_0x227c6c['length'],_0x481149['lBZPf'](_0x5c3e62,0x2710));let _0x3e7023=null,_0x5b0d44=null;while(_0x3e4115<_0x308fdf){const [_0x251be0,_0x438081]=readId(_0x227c6c,_0x3e4115),[_0x3ba82c,_0x1a3343]=readVint(_0x227c6c,_0x481149['TsTdz'](_0x3e4115,_0x438081));_0x251be0===ID_VOID&&!_0x3e7023&&(_0x3e7023={'offset':_0x3e4115,'idLen':_0x438081,'sizeLen':_0x1a3343,'dataSize':_0x3ba82c,'dataOffset':_0x481149[_0xc7ef72(0x218)](_0x481149['TsTdz'](_0x3e4115,_0x438081),_0x1a3343)});if(_0x251be0===ID_INFO){_0x5b0d44={'offset':_0x3e4115,'idLen':_0x438081,'sizeLen':_0x1a3343,'dataSize':_0x3ba82c,'dataOffset':_0x481149['mcnXa'](_0x481149['xOaQz'](_0x3e4115,_0x438081),_0x1a3343)};break;}if(_0x251be0===ID_CLUSTER)break;if(_0x481149['XotTr'](isUnknownSize,_0x3ba82c,_0x1a3343))break;_0x3e4115+=_0x438081+_0x1a3343+_0x3ba82c;}if(!_0x5b0d44)return console['error'](_0xc7ef72(0x212)),![];const _0x93d982=_0x481149[_0xc7ef72(0x1f4)](findElement,_0x227c6c,_0x5b0d44['dataOffset'],_0x5b0d44[_0xc7ef72(0x1e9)]+_0x5b0d44[_0xc7ef72(0x1f0)],ID_DURATION);if(_0x93d982)return![];const _0x2d7d36=findElement(_0x227c6c,_0x5b0d44['dataOffset'],_0x481149['GzryQ'](_0x5b0d44[_0xc7ef72(0x1e9)],_0x5b0d44['dataSize']),ID_TIMESTAMP_SCALE);let _0x47fc19=0xf4240;_0x2d7d36&&(_0x47fc19=_0x481149[_0xc7ef72(0x20d)](readUint,_0x227c6c,_0x2d7d36[_0xc7ef72(0x1e9)],_0x2d7d36[_0xc7ef72(0x1f0)]));const _0x2a199d=computeDurationMs(_0x227c6c,_0x47fc19);if(_0x481149[_0xc7ef72(0x21c)](_0x2a199d,0x0))return console['error'](_0xc7ef72(0x1e8)),![];const _0x2cc6e9=_0x481149['hJlBl'](_0x2a199d,0xf4240)/_0x47fc19,_0x2c53ac=Buffer[_0xc7ef72(0x209)]([_0x481149[_0xc7ef72(0x215)](writeId,ID_DURATION),_0x481149[_0xc7ef72(0x20a)](writeVint,0x8),writeFloat64(_0x2cc6e9)]),_0x2e7478=_0x2c53ac[_0xc7ef72(0x20e)];if(!_0x3e7023||_0x3e7023[_0xc7ef72(0x204)]<_0x5b0d44[_0xc7ef72(0x204)]){if(_0x3e7023){const _0x2ef277=_0x481149['TsTdz'](_0x3e7023[_0xc7ef72(0x21e)],_0x3e7023[_0xc7ef72(0x220)])+_0x3e7023['dataSize'],_0x577b5b=_0x2ef277-_0x2e7478;if(_0x481149['dJZlE'](_0x577b5b,0x2))return rewriteFile(_0x227c6c,_0x5b0d44,_0x2c53ac,_0x47fc19,_0x2a199d,_0x362d08);const _0x16e746=_0x481149['lBZPf'](_0x5b0d44['dataSize'],_0x2e7478),_0x256e87=Buffer[_0xc7ef72(0x209)]([writeId(ID_INFO),writeVint(_0x16e746,_0x5b0d44[_0xc7ef72(0x220)])]),_0x55ff94=_0x227c6c[_0xc7ef72(0x1fe)](_0x5b0d44[_0xc7ef72(0x1e9)],_0x481149[_0xc7ef72(0x219)](_0x5b0d44[_0xc7ef72(0x1e9)],_0x5b0d44[_0xc7ef72(0x1f0)])),_0x21166f=_0x481149['PLwPS'](writeVoid,_0x577b5b),_0x13e769=_0x227c6c[_0xc7ef72(0x1fe)](0x0,_0x3e7023[_0xc7ef72(0x204)]),_0xeb2af0=_0x227c6c['slice'](_0x5b0d44[_0xc7ef72(0x1e9)]+_0x5b0d44['dataSize']);return _0x481149['XotTr'](writeFileSync,_0x362d08,Buffer['concat']([_0x13e769,_0x21166f,_0x256e87,_0x55ff94,_0x2c53ac,_0xeb2af0])),!![];}}return rewriteFile(_0x227c6c,_0x5b0d44,_0x2c53ac,_0x47fc19,_0x2a199d,_0x362d08);}function rewriteFile(_0x1490a0,_0x6a3f6f,_0x565199,_0x4bdac0,_0x14c7b0,_0x379829){const _0x3a39b6=_0x5345,_0x7c062e={'jCaeJ':function(_0x5e0b83,_0x429b39){return _0x5e0b83+_0x429b39;},'FDFGW':function(_0x219ff3,_0x362e29){return _0x219ff3(_0x362e29);},'ZWVMa':function(_0x29ba24,_0x534373){return _0x29ba24+_0x534373;}},_0x285692=_0x7c062e[_0x3a39b6(0x202)](_0x6a3f6f[_0x3a39b6(0x1f0)],_0x565199[_0x3a39b6(0x20e)]),_0x218ca6=Buffer['concat']([writeId(ID_INFO),_0x7c062e[_0x3a39b6(0x1ff)](writeVint,_0x285692)]),_0x5775cc=_0x6a3f6f[_0x3a39b6(0x21e)]+_0x6a3f6f['sizeLen'],_0x2126b4=_0x1490a0[_0x3a39b6(0x1fe)](0x0,_0x6a3f6f[_0x3a39b6(0x204)]),_0x204701=_0x1490a0['slice'](_0x6a3f6f['dataOffset'],_0x6a3f6f['dataOffset']+_0x6a3f6f[_0x3a39b6(0x1f0)]),_0x48f586=_0x1490a0[_0x3a39b6(0x1fe)](_0x7c062e[_0x3a39b6(0x1e6)](_0x6a3f6f['offset']+_0x5775cc,_0x6a3f6f[_0x3a39b6(0x1f0)]));return writeFileSync(_0x379829,Buffer[_0x3a39b6(0x209)]([_0x2126b4,_0x218ca6,_0x204701,_0x565199,_0x48f586])),!![];}function _0x5345(_0x32cbc6,_0x16df14){_0x32cbc6=_0x32cbc6-0x1e4;const _0x17b84d=_0x17b8();let _0x534573=_0x17b84d[_0x32cbc6];return _0x534573;}if(process[_0x20ca6a(0x222)][0x1]?.['endsWith']('fixWebmDuration.ts')||process[_0x20ca6a(0x222)][0x1]?.[_0x20ca6a(0x1f2)](_0x20ca6a(0x1e5))){const input=process[_0x20ca6a(0x222)][0x2],output=process[_0x20ca6a(0x222)][0x3];(!input||!output)&&(console['error']('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process[_0x20ca6a(0x21b)](0x1));const fixed=fixWebmDuration(input,output);fixed?console[_0x20ca6a(0x1f3)](_0x20ca6a(0x1f7)+output):console[_0x20ca6a(0x1f3)]('File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4a933d,_0x4c47a2){const _0x56f94f=_0x57b0,_0x544160=_0x4a933d();while(!![]){try{const _0x50ff00=parseInt(_0x56f94f(0x1b8))/0x1*(-parseInt(_0x56f94f(0x1ba))/0x2)+-parseInt(_0x56f94f(0x1bb))/0x3+parseInt(_0x56f94f(0x1bf))/0x4*(-parseInt(_0x56f94f(0x1be))/0x5)+-parseInt(_0x56f94f(0x1c3))/0x6*(-parseInt(_0x56f94f(0x1b7))/0x7)+parseInt(_0x56f94f(0x1c5))/0x8*(-parseInt(_0x56f94f(0x1c0))/0x9)+-parseInt(_0x56f94f(0x1b9))/0xa+parseInt(_0x56f94f(0x1c1))/0xb;if(_0x50ff00===_0x4c47a2)break;else _0x544160['push'](_0x544160['shift']());}catch(_0x1ad827){_0x544160['push'](_0x544160['shift']());}}}(_0x3ab9,0x2e303));function _0x57b0(_0xa0310,_0x3c8586){_0xa0310=_0xa0310-0x1b7;const _0x3ab9fb=_0x3ab9();let _0x57b0fe=_0x3ab9fb[_0xa0310];return _0x57b0fe;}function _0x3ab9(){const _0x5907ff=['1158rUMMMo','HyYzp','24HmCdtB','12467zZxpHD','33504Pilmah','3718130bRTqgv','8aMwQtV','654435gkEMYl','cwd','ls-files','10VJJZdX','578864Tlpbxj','952857UJSCrv','12941269MPeveI','--error-unmatch'];_0x3ab9=function(){return _0x5907ff;};return _0x3ab9();}import{execFile as _0x293b88}from'child_process';import{promisify}from'util';const execFile=promisify(_0x293b88);export async function isPathGitTracked(_0x14843a){const _0x95e63a=_0x57b0,_0x3b0f35={'OQZep':function(_0x3d416c,_0x2f5217,_0x5911cb,_0x42ebc4){return _0x3d416c(_0x2f5217,_0x5911cb,_0x42ebc4);},'GmcKZ':'git','HyYzp':_0x95e63a(0x1bd)};try{return await _0x3b0f35['OQZep'](execFile,_0x3b0f35['GmcKZ'],[_0x3b0f35[_0x95e63a(0x1c4)],_0x95e63a(0x1c2),_0x14843a],{'cwd':process[_0x95e63a(0x1bc)]()}),!![];}catch{return![];}}
|