@ranger-testing/ranger-cli 3.0.0 → 3.0.1-alpha.d9f4572-27
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/deleteProfile.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/legacyWarning.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/novaActCli.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/commands/verifyFeatureNovaCli.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x461d(){const _0x29e42b=['env','\x22,\x20attempting\x20login...','SAuyO','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','WJwoj','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','username','clientIp','API\x20request\x20','\x22.\x0a','force','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','CgWTR','TDcFc','xHjFU','cookies','effectiveBaseUrl','/api/v1/profiles/','sessionState','newContext','YMGwc','error','toISOString','lNRUd','657320kQcvzJ','PXKUN','string','\x20\x20No\x20live\x20session\x20for\x20\x22','FXVlg','newPage','settings','yVFmP','isArray','statusText','setupHeaders','pzjPY','xpZKQ','1486572XuijEX','PUT','not_configured','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','JFlaJ','auth_config','kiiSw','domains','defaultEnvironmentKey','\x20\x20Login\x20successful.\x20Session\x20cached.','join','SvTQq','message','test_output','vTBYj','veSTa','IPAzb','5104045pYcgnk','DELETE','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','environment_key','/session','UjbuO','LAbIw','status','storageStatePath','stringify','Cloud\x20profile\x20\x22','goto','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','headers','cli:manual-login','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','detail','2431899ibnqFo','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','ORbdR','some','code','\x20\x20Server-side\x20login\x20error:\x20','wazfo','Browser\x20login\x20timed\x20out\x20after\x20','application/json','RHAoK','STLSi','name','sessionCheckPath','profiles','RANGER_TEST_USERNAME','log','\x20failed\x20(','utf-8','PhKnU','77YWRUcr','gArYt','\x22\x20failed\x20validation\x20—\x20refreshing...','organizationId','UOZNT','userAgent','XZgOI','invalidateOn','json','\x22,\x20cached\x20locally','JBFtO','launch','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','push','baseUrl','UrDUg','success','gUWxN','YgvaA','aWsxV','origin','WEaRe','WTzjg','1638ahUWNH','8161821oQogow','length','password','RANGER_TEST_PASSWORD','kPNYn','):\x20','GcUBa','1416azAfDK','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','mTTzX','2938672wykqXz','close'];_0x461d=function(){return _0x29e42b;};return _0x461d();}const _0x2bc529=_0xf910;function _0xf910(_0x4c071b,_0x37b87a){_0x4c071b=_0x4c071b-0x1dd;const _0x461d13=_0x461d();let _0xf91049=_0x461d13[_0x4c071b];return _0xf91049;}(function(_0x4cc419,_0x2484f5){const _0x35579d=_0xf910,_0x1e0f5e=_0x4cc419();while(!![]){try{const _0x499c4c=-parseInt(_0x35579d(0x20d))/0x1*(-parseInt(_0x35579d(0x215))/0x2)+parseInt(_0x35579d(0x1e3))/0x3+-parseInt(_0x35579d(0x218))/0x4+parseInt(_0x35579d(0x250))/0x5+parseInt(_0x35579d(0x23f))/0x6+parseInt(_0x35579d(0x1f6))/0x7*(-parseInt(_0x35579d(0x232))/0x8)+-parseInt(_0x35579d(0x20e))/0x9;if(_0x499c4c===_0x2484f5)break;else _0x1e0f5e['push'](_0x1e0f5e['shift']());}catch(_0x1eb3fa){_0x1e0f5e['push'](_0x1e0f5e['shift']());}}}(_0x461d,0xa9534));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x2edc44 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;async function requireToken(){const _0x324815={'TSzad':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x817e9e=await getToken();if(!_0x817e9e)throw new Error(_0x324815['TSzad']);return _0x817e9e;}async function apiRequest(_0x4eef30,_0x2fe906={}){const _0x550541=_0xf910,_0x3603a2={'CPotW':function(_0x150f5f,_0x118394,_0xa9f890){return _0x150f5f(_0x118394,_0xa9f890);},'MDBtI':function(_0x532962,_0x49dc66){return _0x532962===_0x49dc66;},'FXVlg':_0x550541(0x234)},_0x42bff7=await requireToken(),_0x1e877b=getApiBaseUrl(),_0x187212=await _0x3603a2['CPotW'](fetch,''+_0x1e877b+_0x4eef30,{..._0x2fe906,'headers':{'Authorization':'Bearer\x20'+_0x42bff7,'Content-Type':_0x550541(0x1eb),..._0x2fe906[_0x550541(0x1df)]??{}}});if(!_0x187212['ok']){let _0x57bfcc='',_0x16b3a7;try{const _0x5143ee=await _0x187212['json']();_0x57bfcc=(_0x3603a2['MDBtI'](typeof _0x5143ee[_0x550541(0x22f)],_0x3603a2[_0x550541(0x236)])?_0x5143ee['error']:undefined)??JSON['stringify'](_0x5143ee);if(typeof _0x5143ee['code']===_0x550541(0x234))_0x16b3a7=_0x5143ee['code'];}catch{_0x57bfcc=_0x187212[_0x550541(0x23b)];}throw new ApiError(_0x550541(0x222)+_0x4eef30+_0x550541(0x1f3)+_0x187212[_0x550541(0x257)]+_0x550541(0x213)+_0x57bfcc,_0x187212[_0x550541(0x257)],_0x57bfcc,_0x16b3a7);}if(_0x3603a2['MDBtI'](_0x187212[_0x550541(0x257)],0xcc))return undefined;return _0x187212[_0x550541(0x1fe)]();}export class ApiError extends Error{[_0x2bc529(0x257)];[_0x2bc529(0x1e2)];[_0x2bc529(0x1e7)];constructor(_0x5607e2,_0x3df058,_0x45430d,_0x43fbf1){const _0x1c1cd9=_0x2bc529;super(_0x5607e2),this[_0x1c1cd9(0x257)]=_0x3df058,this[_0x1c1cd9(0x1e2)]=_0x45430d,this[_0x1c1cd9(0x1e7)]=_0x43fbf1,this[_0x1c1cd9(0x1ee)]='ApiError';}}export async function fetchCloudProfile(_0x3d9b12){const _0x5812fa=_0x2bc529,_0x1fc7c6={'STLSi':function(_0x3f6969,_0x300fab){return _0x3f6969(_0x300fab);},'UjbuO':function(_0x84bbbf,_0x4c766b){return _0x84bbbf(_0x4c766b);}};try{return await _0x1fc7c6[_0x5812fa(0x1ed)](apiRequest,_0x5812fa(0x22b)+_0x1fc7c6[_0x5812fa(0x255)](encodeURIComponent,_0x3d9b12));}catch(_0x54b38f){if(_0x54b38f instanceof ApiError&&_0x54b38f[_0x5812fa(0x257)]===0x194)return null;throw _0x54b38f;}}export async function listCloudProfiles(){const _0x2bb991=_0x2bc529,_0x39c15f=await apiRequest('/api/v1/profiles');return _0x39c15f[_0x2bb991(0x1f0)];}export async function deleteCloudProfile(_0x146c29){const _0x26a1c0=_0x2bc529,_0xb8ca8c={'TLBoD':function(_0x2e5700,_0x721a92){return _0x2e5700(_0x721a92);},'mFZaL':function(_0x524b39,_0x1f4794){return _0x524b39 instanceof _0x1f4794;}};try{await apiRequest(_0x26a1c0(0x22b)+_0xb8ca8c['TLBoD'](encodeURIComponent,_0x146c29),{'method':_0x26a1c0(0x251)});}catch(_0x24b60a){if(_0xb8ca8c['mFZaL'](_0x24b60a,ApiError)&&_0x24b60a['status']===0x194)throw new Error(_0x26a1c0(0x25a)+_0x146c29+'\x22\x20not\x20found.');throw _0x24b60a;}}export async function createCloudProfile(_0x307dcf,_0x3f99da,_0x38083e={}){const _0x525d45=_0x2bc529,_0x941a59={'MAJuJ':function(_0x3596da,_0x5b72ea,_0x2499ce){return _0x3596da(_0x5b72ea,_0x2499ce);},'dHQXk':'/api/v1/profiles','kYVUI':'POST'},_0x311ed4={'name':_0x307dcf};if(_0x3f99da)_0x311ed4[_0x525d45(0x253)]=_0x3f99da;_0x38083e['settings']&&Object['keys'](_0x38083e['settings'])[_0x525d45(0x20f)]>0x0&&(_0x311ed4[_0x525d45(0x238)]=_0x38083e[_0x525d45(0x238)]);if(_0x38083e['username'])_0x311ed4['username']=_0x38083e[_0x525d45(0x220)];if(_0x38083e[_0x525d45(0x210)])_0x311ed4['password']=_0x38083e['password'];return await _0x941a59['MAJuJ'](apiRequest,_0x941a59['dHQXk'],{'method':_0x941a59['kYVUI'],'body':JSON['stringify'](_0x311ed4)});}export async function uploadCloudProfileSession(_0x2030c8,_0x7b31d8){const _0x2485b2=_0x2bc529,_0x2a5c3f={'xHjFU':function(_0x52e929,_0x3d792d,_0x46c87f){return _0x52e929(_0x3d792d,_0x46c87f);}};return await _0x2a5c3f[_0x2485b2(0x228)](apiRequest,_0x2485b2(0x22b)+encodeURIComponent(_0x2030c8)+_0x2485b2(0x254),{'method':'POST','body':JSON[_0x2485b2(0x259)]({'session_state':_0x7b31d8})});}export async function saveCloudProfileCredentials(_0x3b6fca,_0x58d542,_0x516637){const _0x5e5c81=_0x2bc529,_0x7bd087={'LAbIw':function(_0x235e50,_0x5c7dfc,_0x2379b1){return _0x235e50(_0x5c7dfc,_0x2379b1);},'wazfo':'PUT'};await _0x7bd087[_0x5e5c81(0x256)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x3b6fca),{'method':_0x7bd087[_0x5e5c81(0x1e9)],'body':JSON[_0x5e5c81(0x259)]({'username':_0x58d542,'password':_0x516637})});}export async function fetchAuthConfig(){const _0x53dff0=_0x2bc529,_0x175317={'lNRUd':'/api/v1/profiles/auth-config'};try{const _0x138a14=await apiRequest(_0x175317[_0x53dff0(0x231)]);return _0x138a14[_0x53dff0(0x244)];}catch(_0x4a4fbf){return _0x4a4fbf instanceof ApiError&&_0x4a4fbf[_0x53dff0(0x257)]!==0x194&&console['error'](_0x53dff0(0x21f)+_0x4a4fbf[_0x53dff0(0x24b)]),null;}}export function pickAdHocEnvKey(_0x350e3d){const _0x50dfc4=_0x2bc529,_0x32a4e0={'oNcHZ':function(_0x11ca56,_0x4f6819){return _0x11ca56===_0x4f6819;}};if(!_0x350e3d)return null;if(_0x350e3d[_0x50dfc4(0x247)])return _0x350e3d[_0x50dfc4(0x247)];const _0x3f0934=Object['keys'](_0x350e3d['environments']??{});if(_0x32a4e0['oNcHZ'](_0x3f0934['length'],0x1))return _0x3f0934[0x0];if(_0x32a4e0['oNcHZ'](_0x3f0934['length'],0x0))return null;throw new Error(_0x50dfc4(0x202)+_0x3f0934['join'](',\x20')+').\x20'+'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.');}export async function resolveAdHocProfile(_0x59ba7e=process[_0x2bc529(0x21a)]){const _0x1e1dd9=_0x2bc529,_0x231537={'cnzwL':function(_0x35fb74){return _0x35fb74();},'cRXtH':function(_0x72e9db,_0x12bc15){return _0x72e9db(_0x12bc15);},'zufrr':function(_0x559a39,_0x36d0e4,_0x180175,_0x4ca2c8){return _0x559a39(_0x36d0e4,_0x180175,_0x4ca2c8);},'YgvaA':function(_0x57e82e,_0x23aa8a){return _0x57e82e??_0x23aa8a;}},_0x4df4f6=_0x59ba7e['RANGER_TEST_USERNAME'];if(!_0x4df4f6)return null;const _0x34371a=await fetchCloudProfile(_0x4df4f6);if(_0x34371a)return{'name':_0x34371a['name'],'profile':_0x34371a};const _0x5782f7=await _0x231537['cnzwL'](fetchAuthConfig),_0x11ed09=_0x231537['cRXtH'](pickAdHocEnvKey,_0x5782f7),_0x11374e=_0x59ba7e[_0x1e1dd9(0x211)],_0x3508f3=await _0x231537['zufrr'](createCloudProfile,_0x4df4f6,_0x231537[_0x1e1dd9(0x208)](_0x11ed09,undefined),{'username':_0x4df4f6,'password':_0x11374e});return console[_0x1e1dd9(0x1f2)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x3508f3['name']+'\x22\x20for\x20'+_0x4df4f6),{'name':_0x3508f3[_0x1e1dd9(0x1ee)],'profile':_0x3508f3};}export async function writeSessionToLocalCache(_0x4dcf74,_0x1e2797,_0x21da83,_0xd36fd0,_0x2beb1b,_0x182a05,_0x31fa04){const _0x39efbb=_0x2bc529,_0x5bfd59={'kiiSw':function(_0x415629,_0x495458){return _0x415629(_0x495458);},'WJwoj':function(_0xf4a3d0,_0x2c38a1,_0x55beb7){return _0xf4a3d0(_0x2c38a1,_0x55beb7);},'mTTzX':function(_0x304598){return _0x304598();},'RHAoK':function(_0x4cfa7a,_0x145436){return _0x4cfa7a>_0x145436;},'TDcFc':function(_0x37078f,_0x391d47,_0x4c5b55){return _0x37078f(_0x391d47,_0x4c5b55);},'WTzjg':function(_0x415ba0,_0x231b6f,_0x76a263){return _0x415ba0(_0x231b6f,_0x76a263);},'grLBN':function(_0x135a3b,_0x3f82e5){return _0x135a3b(_0x3f82e5);}},_0x7d6be0=_0x5bfd59[_0x39efbb(0x245)](sessionCacheHash,{'orgId':_0x1e2797,'profileName':_0x4dcf74,'effectiveBaseUrl':_0x21da83,'setupHeaders':_0xd36fd0,'invalidateOn':_0x31fa04?.[_0x39efbb(0x1fd)],'userAgent':_0x31fa04?.[_0x39efbb(0x1fb)],'clientIp':_0x31fa04?.['clientIp']}),_0x515468=getSessionCachePath(_0x7d6be0,_0x4dcf74),_0xdb66f2=_0x5bfd59[_0x39efbb(0x21e)](join,_0x5bfd59[_0x39efbb(0x217)](getRangerHomeDir),'auth');!existsSync(_0xdb66f2)&&await mkdir(_0xdb66f2,{'recursive':!![]});const _0x350c1d={..._0x2beb1b};_0x182a05&&_0x5bfd59[_0x39efbb(0x1ec)](_0x182a05[_0x39efbb(0x20f)],0x0)&&Array[_0x39efbb(0x23a)](_0x350c1d['cookies'])&&(_0x350c1d[_0x39efbb(0x229)]=_0x5bfd59[_0x39efbb(0x227)](duplicateCookiesForDomains,_0x350c1d['cookies'],_0x182a05));const _0xf9bd6e={'cached_at':new Date()[_0x39efbb(0x230)](),'session_state':_0x350c1d};await _0x5bfd59['WTzjg'](writeFile,_0x515468,JSON['stringify'](_0xf9bd6e,null,0x2));const _0x46ad8c=_0x5bfd59['grLBN'](getStorageStatePath,_0x515468);return await _0x5bfd59[_0x39efbb(0x20c)](writeFile,_0x46ad8c,JSON['stringify'](_0x350c1d,null,0x2)),_0x46ad8c;}export async function checkLocalCache(_0x40d1c4,_0x9a106b,_0x25c4a6,_0x3fc3a6,_0x7c2df4){const _0x2f90ee=_0x2bc529,_0x3f8e4e={'yzReZ':function(_0x9e364,_0x19ba5f,_0x5d39b5){return _0x9e364(_0x19ba5f,_0x5d39b5);},'fdGJZ':function(_0x43bb51,_0x48210b){return _0x43bb51(_0x48210b);},'wNlfZ':function(_0x2f7a4e,_0x112301,_0x1ebd34){return _0x2f7a4e(_0x112301,_0x1ebd34);}},_0x1789e6=sessionCacheHash({'orgId':_0x9a106b,'profileName':_0x40d1c4,'effectiveBaseUrl':_0x25c4a6,'setupHeaders':_0x3fc3a6,'invalidateOn':_0x7c2df4?.[_0x2f90ee(0x1fd)],'userAgent':_0x7c2df4?.[_0x2f90ee(0x1fb)],'clientIp':_0x7c2df4?.[_0x2f90ee(0x221)]}),_0x1a74fa=_0x3f8e4e['yzReZ'](getSessionCachePath,_0x1789e6,_0x40d1c4),_0x1efec1=_0x3f8e4e['fdGJZ'](getStorageStatePath,_0x1a74fa);if(!existsSync(_0x1a74fa)||!existsSync(_0x1efec1))return null;try{const _0xae4c60=await _0x3f8e4e['wNlfZ'](readFile,_0x1a74fa,_0x2f90ee(0x1f4));return JSON['parse'](_0xae4c60),{'storageStatePath':_0x1efec1};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x563c28,_0x9253c3){const _0x38400d=_0x2bc529,_0x3270b1={'ptVBG':function(_0x3044c3,_0x226dca){return _0x3044c3+_0x226dca;}};if(!_0x9253c3||!_0x9253c3[_0x38400d(0x246)]?.[_0x38400d(0x20f)])return;let _0x2b4802;try{_0x2b4802=new URL(_0x563c28);}catch{return;}const _0x18aa88=[];for(const _0x556223 of _0x9253c3[_0x38400d(0x246)]){try{_0x18aa88[_0x38400d(0x203)]({'raw':_0x556223,'url':new URL(_0x556223)});}catch{}}if(_0x18aa88[_0x38400d(0x20f)]===0x0)return;if(_0x18aa88[_0x38400d(0x1e6)](_0x29ffff=>_0x29ffff['url']['origin']===_0x2b4802[_0x38400d(0x20a)]))return;const _0x544baf=_0x18aa88['map'](_0x1a38fb=>'\x22'+_0x1a38fb['raw']+'\x22')[_0x38400d(0x249)](',\x20');console['log'](_0x3270b1['ptVBG'](_0x3270b1['ptVBG']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x544baf+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x563c28+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20'),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0x2ff294,_0x73723d){const _0x3643d6=_0x2bc529,_0x5be189={'xpZKQ':function(_0x528077,_0x1fa991){return _0x528077===_0x1fa991;},'yVFmP':function(_0x4ad596,_0x9fc8d4){return _0x4ad596===_0x9fc8d4;}},_0x23c04e=process['env'][_0x3643d6(0x1f1)],_0x339ff8=process[_0x3643d6(0x21a)][_0x3643d6(0x211)],_0x2d30a8={};if(_0x23c04e)_0x2d30a8['username']=_0x23c04e;if(_0x339ff8)_0x2d30a8['password']=_0x339ff8;if(_0x73723d?.[_0x3643d6(0x224)])_0x2d30a8[_0x3643d6(0x224)]=!![];try{return await apiRequest(_0x3643d6(0x22b)+encodeURIComponent(_0x2ff294)+'/login',{'method':'POST','body':JSON['stringify'](_0x2d30a8)});}catch(_0x1df9ea){if(_0x1df9ea instanceof ApiError&&_0x5be189[_0x3643d6(0x23e)](_0x1df9ea['status'],0x190)&&_0x5be189[_0x3643d6(0x239)](_0x1df9ea[_0x3643d6(0x1e7)],_0x3643d6(0x241)))return{'status':'not_configured','error':_0x1df9ea[_0x3643d6(0x1e2)]};throw _0x1df9ea;}}export async function manualBrowserLogin(_0xe12a9,_0x37a3d1){const _0x473d9f=_0x2bc529,_0x3bed5d={'XZgOI':function(_0x3f8ad5,_0x28a058){return _0x3f8ad5/_0x28a058;},'PXKUN':function(_0x42db46){return _0x42db46();},'YMGwc':function(_0x195858,_0x59c77f){return _0x195858(_0x59c77f);},'vunOa':function(_0x1274ae){return _0x1274ae();},'lFMwU':_0x473d9f(0x219),'DGEfL':function(_0x3c901f,_0x202910){return _0x3c901f+_0x202910;},'rfmdR':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','GcUBa':'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','HqFdC':function(_0x240728,_0x4524a6){return _0x240728&&_0x4524a6;},'JFlaJ':function(_0x3d92b5,_0x23bb9a,_0x3be806){return _0x3d92b5(_0x23bb9a,_0x3be806);},'YqmtF':function(_0x5b10e9,_0x4bdcac){return _0x5b10e9(_0x4bdcac);},'fYiYE':'POST','JBFtO':_0x473d9f(0x1e0)};if(!isInteractive())throw new Error(_0x3bed5d['DGEfL'](_0x473d9f(0x242)+_0xe12a9[_0x473d9f(0x1ee)]+_0x473d9f(0x223),_0x3bed5d['rfmdR'])+_0x3bed5d[_0x473d9f(0x214)]);const _0x1d2d46=_0x37a3d1&&_0x37a3d1['domains'][_0x473d9f(0x20f)]>0x0?_0x37a3d1[_0x473d9f(0x246)][0x0]:'about:blank';console[_0x473d9f(0x1f2)]('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log']('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x3a3a43=>setTimeout(_0x3a3a43,0x7d0));const _0x4f2d79=await chromium[_0x473d9f(0x201)]({'headless':![]});let _0x27cd5a=null;try{const _0x381665={'ignoreHTTPSErrors':!![]};_0x37a3d1?.[_0x473d9f(0x23c)]&&(_0x381665['extraHTTPHeaders']=_0x37a3d1['setupHeaders']);const _0x104896=await _0x4f2d79[_0x473d9f(0x22d)](_0x381665);await _0x3bed5d[_0x473d9f(0x22e)](addProfileSetupBanner,_0x104896);const _0x3f22c4=await _0x104896[_0x473d9f(0x237)]();await _0x3f22c4[_0x473d9f(0x1dd)](_0x1d2d46);let _0x60c656=![];await new Promise(_0x2f4670=>{const _0x59cdde={'CgWTR':function(_0x33dae2,_0x23c545){const _0x39c54a=_0xf910;return _0x3bed5d[_0x39c54a(0x22e)](_0x33dae2,_0x23c545);},'uRrxJ':function(_0x15a982){return _0x3bed5d['vunOa'](_0x15a982);}},_0x5e93d4=setTimeout(()=>{const _0x4bd3ea=_0xf910;_0x60c656=!![],console[_0x4bd3ea(0x22f)](_0x4bd3ea(0x1ea)+_0x3bed5d[_0x4bd3ea(0x1fc)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x4bd3ea(0x1e4)),_0x3bed5d[_0x4bd3ea(0x233)](_0x2f4670);},MANUAL_LOGIN_TIMEOUT_MS);_0x3f22c4['on'](_0x3bed5d['lFMwU'],async()=>{const _0x480841=_0xf910;_0x59cdde[_0x480841(0x226)](clearTimeout,_0x5e93d4);try{const _0x4df9af=await _0x104896['storageState']();_0x27cd5a=_0x4df9af;}catch{}_0x59cdde['uRrxJ'](_0x2f4670);});});if(_0x3bed5d['HqFdC'](_0x60c656,!_0x27cd5a))throw new Error('Browser\x20login\x20timed\x20out\x20before\x20completion.');}finally{await _0x4f2d79[_0x473d9f(0x219)]()['catch'](()=>{});}if(!_0x27cd5a)throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');return await _0x3bed5d[_0x473d9f(0x243)](apiRequest,'/api/v1/profiles/'+_0x3bed5d['YqmtF'](encodeURIComponent,_0xe12a9[_0x473d9f(0x1ee)])+'/session',{'method':_0x3bed5d['fYiYE'],'body':JSON[_0x473d9f(0x259)]({'session_state':_0x27cd5a,'updated_by':_0x3bed5d[_0x473d9f(0x200)]})}),{'sessionState':_0x27cd5a};}export async function promptSaveCredentials(_0x9aa37c){const _0x34be45=_0x2bc529,_0xc5e48c={'veSTa':function(_0x240deb,_0x4247b8){return _0x240deb||_0x4247b8;},'gUWxN':function(_0x41ce9f){return _0x41ce9f();},'pNAeR':_0x34be45(0x1e1),'gArYt':_0x34be45(0x240),'hwgcF':_0x34be45(0x252)},_0x5d52d3=process['env']['RANGER_TEST_USERNAME'],_0x366857=process[_0x34be45(0x21a)]['RANGER_TEST_PASSWORD'];if(_0xc5e48c[_0x34be45(0x24e)](!_0x5d52d3,!_0x366857))return;if(!_0xc5e48c[_0x34be45(0x207)](isInteractive))return;const {save:_0x436f4a}=await _0x2edc44['prompt']([{'type':'confirm','name':'save','message':_0xc5e48c['pNAeR'],'default':![]}]);if(!_0x436f4a)return;await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x9aa37c),{'method':_0xc5e48c[_0x34be45(0x1f7)],'body':JSON[_0x34be45(0x259)]({'username':_0x5d52d3,'password':_0x366857})}),console['log'](_0xc5e48c['hwgcF']);}export async function resolveCloudProfileSession(_0xdecb94,_0x5eb88c={}){const _0x26dcdc=_0x2bc529,_0x3d6a2a={'SAuyO':function(_0x525636,_0x46b5c1,_0x18ebd9){return _0x525636(_0x46b5c1,_0x18ebd9);},'vTBYj':function(_0x17d71b,_0x7d541f){return _0x17d71b>_0x7d541f;},'IPAzb':function(_0x45a7d4,_0x5825ed,_0x45daf1,_0x3fb82e,_0x2fb2a7,_0x520cbb){return _0x45a7d4(_0x5825ed,_0x45daf1,_0x3fb82e,_0x2fb2a7,_0x520cbb);},'KLaWV':function(_0x446569,_0x7864cb,_0x585dde,_0x10be23,_0x381b46){return _0x446569(_0x7864cb,_0x585dde,_0x10be23,_0x381b46);},'kPNYn':function(_0x4b37c7,_0x3a99c1){return _0x4b37c7(_0x3a99c1);},'SvTQq':function(_0x17198c,_0x53d42b){return _0x17198c||_0x53d42b;},'WEaRe':function(_0x45405f,_0x5663ae){return _0x45405f(_0x5663ae);},'cRWbY':_0x26dcdc(0x241),'UrDUg':_0x26dcdc(0x225),'aWsxV':_0x26dcdc(0x206),'pzjPY':_0x26dcdc(0x248),'wBMBu':function(_0x579e19,_0x4ff2ad,_0x394408,_0x537928,_0xea36ca,_0x1818e4,_0x293a7a,_0x3cc5a3){return _0x579e19(_0x4ff2ad,_0x394408,_0x537928,_0xea36ca,_0x1818e4,_0x293a7a,_0x3cc5a3);},'PhKnU':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','ORbdR':_0x26dcdc(0x216),'UOZNT':function(_0x252d2b,_0xa99d2b){return _0x252d2b instanceof _0xa99d2b;}},_0x1b4f4a=_0xdecb94['settings']??{},_0x2a85a6=await fetchAuthConfig(),_0x2c3f5b=_0x2a85a6?_0x3d6a2a[_0x26dcdc(0x21c)](resolveAuthEnvironmentLocally,_0x2a85a6,_0xdecb94['environmentKey']):null,_0x10c1ea=_0x2c3f5b?.['domains'],_0xab711e=_0x1b4f4a[_0x26dcdc(0x23c)],_0x4555b2=_0xab711e??_0x2c3f5b?.['setupHeaders'],_0x1d5369=_0x5eb88c[_0x26dcdc(0x22a)]??_0x1b4f4a[_0x26dcdc(0x204)]??(_0x10c1ea&&_0x3d6a2a[_0x26dcdc(0x24d)](_0x10c1ea[_0x26dcdc(0x20f)],0x0)?_0x10c1ea[0x0]:''),_0x264e2d={'invalidateOn':_0x2c3f5b?.[_0x26dcdc(0x1fd)],'userAgent':_0x2c3f5b?.['browserOptions']?.[_0x26dcdc(0x1fb)]??_0x1b4f4a[_0x26dcdc(0x1fb)]},_0x3794f8=await _0x3d6a2a[_0x26dcdc(0x24f)](checkLocalCache,_0xdecb94['name'],_0xdecb94[_0x26dcdc(0x1f9)],_0x1d5369,_0x4555b2,_0x264e2d);if(_0x3794f8){if(_0x1d5369){const _0xc2ef34=await _0x3d6a2a['KLaWV'](isCachedSessionLive,_0x3794f8[_0x26dcdc(0x258)],_0x1d5369,{'sessionCheckPath':_0x2c3f5b?.['sessionCheckPath'],'setupHeaders':_0x4555b2},{'launchBrowser':launchRealBrowser});if(_0xc2ef34)return console['log']('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0xdecb94['name']+'\x22'),{'authPath':_0x3794f8['storageStatePath'],'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0xdecb94['name']+_0x26dcdc(0x1f8)),emitSessionValidationHint(_0x1d5369,_0x2c3f5b);}else return{'authPath':_0x3794f8['storageStatePath'],'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};}if(_0xdecb94['sessionState']){const _0x39f0c6=await writeSessionToLocalCache(_0xdecb94[_0x26dcdc(0x1ee)],_0xdecb94[_0x26dcdc(0x1f9)],_0x1d5369,_0x4555b2,_0xdecb94[_0x26dcdc(0x22c)],_0x10c1ea,_0x264e2d);if(_0x1d5369){const _0x3dd579=await isCachedSessionLive(_0x39f0c6,_0x1d5369,{'sessionCheckPath':_0x2c3f5b?.[_0x26dcdc(0x1ef)],'setupHeaders':_0x4555b2},{'launchBrowser':launchRealBrowser});if(_0x3dd579)return console[_0x26dcdc(0x1f2)](_0x26dcdc(0x21d)+_0xdecb94[_0x26dcdc(0x1ee)]+_0x26dcdc(0x1ff)),{'authPath':_0x39f0c6,'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};console[_0x26dcdc(0x1f2)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0xdecb94['name']+_0x26dcdc(0x1de)),emitSessionValidationHint(_0x1d5369,_0x2c3f5b);}else return{'authPath':_0x39f0c6,'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};}console['log'](_0x26dcdc(0x235)+_0xdecb94[_0x26dcdc(0x1ee)]+_0x26dcdc(0x21b));const _0x267187=Boolean(process['env']['RANGER_TEST_USERNAME'])&&Boolean(process[_0x26dcdc(0x21a)]['RANGER_TEST_PASSWORD']),_0x55ff29=_0x3d6a2a[_0x26dcdc(0x212)](Boolean,_0xdecb94[_0x26dcdc(0x220)]);if(_0x3d6a2a[_0x26dcdc(0x24a)](_0x267187,_0x55ff29))try{const _0x264638=await _0x3d6a2a['WEaRe'](serverSideLogin,_0xdecb94['name']);if(_0x264638['status']===_0x3d6a2a['cRWbY'])console[_0x26dcdc(0x1f2)](_0x3d6a2a[_0x26dcdc(0x205)]);else{if(_0x264638['status']===_0x3d6a2a[_0x26dcdc(0x209)]&&_0x264638['session_state']){console['log'](_0x3d6a2a[_0x26dcdc(0x23d)]);const _0x4f75c0=await _0x3d6a2a['wBMBu'](writeSessionToLocalCache,_0xdecb94['name'],_0xdecb94['organizationId'],_0x1d5369,_0x4555b2,_0x264638['session_state'],_0x10c1ea,_0x264e2d);return _0x267187&&!_0x55ff29&&await promptSaveCredentials(_0xdecb94[_0x26dcdc(0x1ee)]),{'authPath':_0x4f75c0,'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};}else _0x264638[_0x26dcdc(0x24c)]&&(console['log'](_0x3d6a2a[_0x26dcdc(0x1f5)]),console[_0x26dcdc(0x1f2)](_0x264638['test_output'])),console['log'](_0x3d6a2a[_0x26dcdc(0x1e5)]);}}catch(_0x4fc574){console[_0x26dcdc(0x1f2)](_0x26dcdc(0x1e8)+(_0x3d6a2a[_0x26dcdc(0x1fa)](_0x4fc574,Error)?_0x4fc574[_0x26dcdc(0x24b)]:_0x3d6a2a[_0x26dcdc(0x20b)](String,_0x4fc574))),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const {sessionState:_0x361285}=await manualBrowserLogin(_0xdecb94,_0x2c3f5b),_0x35b719=await writeSessionToLocalCache(_0xdecb94['name'],_0xdecb94[_0x26dcdc(0x1f9)],_0x1d5369,_0x4555b2,_0x361285,_0x10c1ea,_0x264e2d);return{'authPath':_0x35b719,'settings':_0x1b4f4a,'resolvedEnv':_0x2c3f5b};}
|
|
1
|
+
const _0x296b05=_0x25a0;(function(_0x55a570,_0x1605e8){const _0x362b1d=_0x25a0,_0x57d756=_0x55a570();while(!![]){try{const _0x4e61c3=parseInt(_0x362b1d(0x23a))/0x1+parseInt(_0x362b1d(0x239))/0x2+parseInt(_0x362b1d(0x243))/0x3*(-parseInt(_0x362b1d(0x20c))/0x4)+-parseInt(_0x362b1d(0x242))/0x5*(parseInt(_0x362b1d(0x263))/0x6)+-parseInt(_0x362b1d(0x1f8))/0x7+parseInt(_0x362b1d(0x225))/0x8+parseInt(_0x362b1d(0x25f))/0x9;if(_0x4e61c3===_0x1605e8)break;else _0x57d756['push'](_0x57d756['shift']());}catch(_0x4ac9f3){_0x57d756['push'](_0x57d756['shift']());}}}(_0x5ebf,0x33a22));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x598102 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;async function requireToken(){const _0x499a12=_0x25a0,_0x4bc52f={'IWbDy':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x5e9948=await getToken();if(!_0x5e9948)throw new Error(_0x4bc52f[_0x499a12(0x24d)]);return _0x5e9948;}async function apiRequest(_0x366fbf,_0xbfa0e9={}){const _0x52c11b=_0x25a0,_0x2b823c={'DOnpC':function(_0x56f964){return _0x56f964();},'wtHkk':function(_0x627530){return _0x627530();},'YnjhQ':_0x52c11b(0x272),'CSuAZ':function(_0x39e6bd,_0x51c7d2){return _0x39e6bd===_0x51c7d2;},'cZggC':'string'},_0x2391bf=await _0x2b823c[_0x52c11b(0x269)](requireToken),_0x20dc7e=_0x2b823c[_0x52c11b(0x262)](getApiBaseUrl),_0x4d7d2b=await fetch(''+_0x20dc7e+_0x366fbf,{..._0xbfa0e9,'headers':{'Authorization':'Bearer\x20'+_0x2391bf,'Content-Type':_0x2b823c[_0x52c11b(0x25e)],..._0xbfa0e9[_0x52c11b(0x266)]??{}}});if(!_0x4d7d2b['ok']){let _0x4a33eb='',_0x568208;try{const _0x3e6b38=await _0x4d7d2b[_0x52c11b(0x271)]();_0x4a33eb=(_0x2b823c[_0x52c11b(0x26a)](typeof _0x3e6b38[_0x52c11b(0x25d)],_0x2b823c['cZggC'])?_0x3e6b38[_0x52c11b(0x25d)]:undefined)??JSON['stringify'](_0x3e6b38);if(typeof _0x3e6b38['code']===_0x2b823c['cZggC'])_0x568208=_0x3e6b38[_0x52c11b(0x233)];}catch{_0x4a33eb=_0x4d7d2b['statusText'];}throw new ApiError(_0x52c11b(0x26f)+_0x366fbf+'\x20failed\x20('+_0x4d7d2b[_0x52c11b(0x201)]+_0x52c11b(0x251)+_0x4a33eb,_0x4d7d2b['status'],_0x4a33eb,_0x568208);}if(_0x4d7d2b['status']===0xcc)return undefined;return _0x4d7d2b['json']();}export class ApiError extends Error{[_0x296b05(0x201)];[_0x296b05(0x1fa)];['code'];constructor(_0x50432e,_0x4f26ae,_0x2737e4,_0x431140){const _0x1d0742=_0x296b05,_0x3f2a55='0|1|4|3|2'['split']('|');let _0x4c031e=0x0;while(!![]){switch(_0x3f2a55[_0x4c031e++]){case'0':super(_0x50432e);continue;case'1':this[_0x1d0742(0x201)]=_0x4f26ae;continue;case'2':this[_0x1d0742(0x22a)]=_0x1d0742(0x21b);continue;case'3':this['code']=_0x431140;continue;case'4':this[_0x1d0742(0x1fa)]=_0x2737e4;continue;}break;}}}export async function fetchCloudProfile(_0x2556dd){const _0x16460f=_0x296b05,_0x4cedee={'DchdO':function(_0x6c0dc5,_0x5a97d1){return _0x6c0dc5(_0x5a97d1);},'lMoQA':function(_0x589841,_0x8bbdad){return _0x589841(_0x8bbdad);},'ajrtr':function(_0x4f26c9,_0x4869ce){return _0x4f26c9===_0x4869ce;}};try{return await _0x4cedee[_0x16460f(0x226)](apiRequest,'/api/v1/profiles/'+_0x4cedee[_0x16460f(0x1ff)](encodeURIComponent,_0x2556dd));}catch(_0x2d3033){if(_0x2d3033 instanceof ApiError&&_0x4cedee[_0x16460f(0x229)](_0x2d3033['status'],0x194))return null;throw _0x2d3033;}}export async function listCloudProfiles(){const _0x446b18=_0x296b05,_0x21849b=await apiRequest('/api/v1/profiles');return _0x21849b[_0x446b18(0x270)];}export async function deleteCloudProfile(_0x549f52){const _0xf97702=_0x296b05,_0x4cd80e={'ofYGN':function(_0x6fab1,_0x4c2d7f,_0x324874){return _0x6fab1(_0x4c2d7f,_0x324874);},'yzfEL':_0xf97702(0x24f),'gNNEc':function(_0x442806,_0xa102ad){return _0x442806 instanceof _0xa102ad;},'xZqDF':function(_0x149b3f,_0x5b336e){return _0x149b3f===_0x5b336e;}};try{await _0x4cd80e[_0xf97702(0x211)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x549f52),{'method':_0x4cd80e[_0xf97702(0x255)]});}catch(_0xf587b3){if(_0x4cd80e[_0xf97702(0x231)](_0xf587b3,ApiError)&&_0x4cd80e['xZqDF'](_0xf587b3['status'],0x194))throw new Error('Cloud\x20profile\x20\x22'+_0x549f52+'\x22\x20not\x20found.');throw _0xf587b3;}}export async function createCloudProfile(_0x140300,_0x7e6861,_0x5258c8={}){const _0x39f291=_0x296b05,_0x167819={'SmKiR':'POST'},_0x2d566f={'name':_0x140300};if(_0x7e6861)_0x2d566f['environment_key']=_0x7e6861;_0x5258c8['settings']&&Object[_0x39f291(0x23d)](_0x5258c8['settings'])[_0x39f291(0x213)]>0x0&&(_0x2d566f[_0x39f291(0x24b)]=_0x5258c8['settings']);if(_0x5258c8[_0x39f291(0x1fe)])_0x2d566f['username']=_0x5258c8[_0x39f291(0x1fe)];if(_0x5258c8['password'])_0x2d566f['password']=_0x5258c8[_0x39f291(0x1f4)];return await apiRequest(_0x39f291(0x25a),{'method':_0x167819['SmKiR'],'body':JSON['stringify'](_0x2d566f)});}export async function uploadCloudProfileSession(_0x4dd71e,_0x20d335){const _0x5a22da=_0x296b05,_0x3b21c3={'kSnTB':function(_0x37cadd,_0x2abf1a,_0x362d56){return _0x37cadd(_0x2abf1a,_0x362d56);},'fPfTI':function(_0x1a6d67,_0x4e7974){return _0x1a6d67(_0x4e7974);}};return await _0x3b21c3['kSnTB'](apiRequest,'/api/v1/profiles/'+_0x3b21c3['fPfTI'](encodeURIComponent,_0x4dd71e)+'/session',{'method':_0x5a22da(0x249),'body':JSON['stringify']({'session_state':_0x20d335})});}export async function saveCloudProfileCredentials(_0x2c9131,_0x1661ba,_0x4df10e){const _0x57f19a=_0x296b05,_0x1f6af7={'IVXNV':function(_0xea06e6,_0x2ef087){return _0xea06e6(_0x2ef087);}};await apiRequest('/api/v1/profiles/'+_0x1f6af7[_0x57f19a(0x214)](encodeURIComponent,_0x2c9131),{'method':'PUT','body':JSON[_0x57f19a(0x1fd)]({'username':_0x1661ba,'password':_0x4df10e})});}export async function fetchAuthConfig(){const _0x22dcea=_0x296b05,_0x45c140={'oHmPH':function(_0x2934c1,_0x239c0b){return _0x2934c1(_0x239c0b);},'FIIjq':function(_0x5e13e9,_0x5f373c){return _0x5e13e9 instanceof _0x5f373c;}};try{const _0x10b644=await _0x45c140[_0x22dcea(0x219)](apiRequest,'/api/v1/profiles/auth-config');return _0x10b644['auth_config'];}catch(_0x10527c){return _0x45c140['FIIjq'](_0x10527c,ApiError)&&_0x10527c['status']!==0x194&&console[_0x22dcea(0x25d)]('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x10527c['message']),null;}}export function pickAdHocEnvKey(_0x4e3577){const _0x8c915d=_0x296b05;if(!_0x4e3577)return null;if(_0x4e3577[_0x8c915d(0x238)])return _0x4e3577[_0x8c915d(0x238)];const _0xe882c5=Object['keys'](_0x4e3577[_0x8c915d(0x217)]??{});if(_0xe882c5[_0x8c915d(0x213)]===0x1)return _0xe882c5[0x0];if(_0xe882c5['length']===0x0)return null;throw new Error('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0xe882c5[_0x8c915d(0x20a)](',\x20')+').\x20'+'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.');}export async function resolveAdHocProfile(_0xc12fd2=process['env']){const _0x1db1a7=_0x296b05,_0x561d6f={'bOdua':function(_0x186b4c,_0x117ea0,_0xd3f5b,_0x21c37){return _0x186b4c(_0x117ea0,_0xd3f5b,_0x21c37);}},_0x4b779c=_0xc12fd2['RANGER_TEST_USERNAME'];if(!_0x4b779c)return null;const _0x22e817=await fetchCloudProfile(_0x4b779c);if(_0x22e817)return{'name':_0x22e817['name'],'profile':_0x22e817};const _0x5d8ca0=await fetchAuthConfig(),_0xef8047=pickAdHocEnvKey(_0x5d8ca0),_0x1572fb=_0xc12fd2[_0x1db1a7(0x264)],_0x1e1e08=await _0x561d6f['bOdua'](createCloudProfile,_0x4b779c,_0xef8047??undefined,{'username':_0x4b779c,'password':_0x1572fb});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x1e1e08['name']+_0x1db1a7(0x205)+_0x4b779c),{'name':_0x1e1e08[_0x1db1a7(0x22a)],'profile':_0x1e1e08};}export async function writeSessionToLocalCache(_0x38b475,_0x220c4b,_0x211138,_0x48b6ca,_0x2084b4,_0x1e517f,_0x44c0a8){const _0x24d6d7=_0x296b05,_0x3f8223={'yAIHW':function(_0x497b4d,_0xdfe5b1,_0x31384f){return _0x497b4d(_0xdfe5b1,_0x31384f);},'TqVpU':function(_0x30a389){return _0x30a389();},'HrOTi':'auth'},_0x467786=sessionCacheHash({'orgId':_0x220c4b,'profileName':_0x38b475,'effectiveBaseUrl':_0x211138,'setupHeaders':_0x48b6ca,'invalidateOn':_0x44c0a8?.['invalidateOn'],'userAgent':_0x44c0a8?.[_0x24d6d7(0x25b)],'clientIp':_0x44c0a8?.[_0x24d6d7(0x268)]}),_0x4fd329=_0x3f8223[_0x24d6d7(0x259)](getSessionCachePath,_0x467786,_0x38b475),_0x39f56d=join(_0x3f8223[_0x24d6d7(0x236)](getRangerHomeDir),_0x3f8223['HrOTi']);!existsSync(_0x39f56d)&&await mkdir(_0x39f56d,{'recursive':!![]});const _0x2e523c={..._0x2084b4};_0x1e517f&&_0x1e517f[_0x24d6d7(0x213)]>0x0&&Array['isArray'](_0x2e523c['cookies'])&&(_0x2e523c['cookies']=_0x3f8223['yAIHW'](duplicateCookiesForDomains,_0x2e523c['cookies'],_0x1e517f));const _0x30e264={'cached_at':new Date()['toISOString'](),'session_state':_0x2e523c};await _0x3f8223['yAIHW'](writeFile,_0x4fd329,JSON['stringify'](_0x30e264,null,0x2));const _0x23a3fa=getStorageStatePath(_0x4fd329);return await _0x3f8223[_0x24d6d7(0x259)](writeFile,_0x23a3fa,JSON['stringify'](_0x2e523c,null,0x2)),_0x23a3fa;}export async function checkLocalCache(_0x3140ea,_0x1520e7,_0x1cc6d1,_0x578273,_0x56d562){const _0xed151d=_0x296b05,_0x56b26c={'mMgeu':function(_0x170584,_0x52506a){return _0x170584(_0x52506a);},'GPCEM':function(_0x21a98e,_0x2bfb86){return _0x21a98e(_0x2bfb86);},'qTBqq':_0xed151d(0x235)},_0x4bba74=_0x56b26c[_0xed151d(0x21e)](sessionCacheHash,{'orgId':_0x1520e7,'profileName':_0x3140ea,'effectiveBaseUrl':_0x1cc6d1,'setupHeaders':_0x578273,'invalidateOn':_0x56d562?.[_0xed151d(0x260)],'userAgent':_0x56d562?.[_0xed151d(0x25b)],'clientIp':_0x56d562?.['clientIp']}),_0x3b3883=getSessionCachePath(_0x4bba74,_0x3140ea),_0x680357=getStorageStatePath(_0x3b3883);if(!_0x56b26c[_0xed151d(0x246)](existsSync,_0x3b3883)||!existsSync(_0x680357))return null;try{const _0x2d08de=await readFile(_0x3b3883,_0x56b26c['qTBqq']);return JSON['parse'](_0x2d08de),{'storageStatePath':_0x680357};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x113c69,_0x565e78){const _0x1f98d7=_0x296b05,_0x1092f9={'kVKHB':function(_0x49dcda,_0x29d6f9){return _0x49dcda===_0x29d6f9;},'pyOyw':function(_0x19baea,_0x2dddc0){return _0x19baea+_0x2dddc0;},'qHnyy':function(_0x498ae7,_0x26ecf2){return _0x498ae7+_0x26ecf2;}};if(!_0x565e78||!_0x565e78['domains']?.[_0x1f98d7(0x213)])return;let _0x562929;try{_0x562929=new URL(_0x113c69);}catch{return;}const _0x46054c=[];for(const _0x57506b of _0x565e78[_0x1f98d7(0x21d)]){try{_0x46054c[_0x1f98d7(0x23c)]({'raw':_0x57506b,'url':new URL(_0x57506b)});}catch{}}if(_0x1092f9[_0x1f98d7(0x234)](_0x46054c['length'],0x0))return;if(_0x46054c['some'](_0x2507da=>_0x2507da[_0x1f98d7(0x26c)]['origin']===_0x562929['origin']))return;const _0x992358=_0x46054c['map'](_0x5e3966=>'\x22'+_0x5e3966[_0x1f98d7(0x21c)]+'\x22')[_0x1f98d7(0x20a)](',\x20');console['log'](_0x1092f9[_0x1f98d7(0x218)](_0x1092f9['qHnyy']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x992358+';\x20',_0x1f98d7(0x253)+_0x113c69+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20'),_0x1f98d7(0x206)));}export async function serverSideLogin(_0xa23899,_0x5abb03){const _0x5c45bd=_0x296b05,_0x191d5f={'jBUSY':function(_0x3509ea,_0x102dd6,_0x4ade86){return _0x3509ea(_0x102dd6,_0x4ade86);},'BWjsR':function(_0x30008c,_0x4e02cb){return _0x30008c(_0x4e02cb);},'ZBHdU':function(_0x4f8378,_0x1c0537){return _0x4f8378===_0x1c0537;},'bRhQi':'not_configured'},_0x5e2633=process[_0x5c45bd(0x224)]['RANGER_TEST_USERNAME'],_0x43f205=process[_0x5c45bd(0x224)]['RANGER_TEST_PASSWORD'],_0x2ce100={};if(_0x5e2633)_0x2ce100[_0x5c45bd(0x1fe)]=_0x5e2633;if(_0x43f205)_0x2ce100['password']=_0x43f205;if(_0x5abb03?.[_0x5c45bd(0x212)])_0x2ce100['force']=!![];try{return await _0x191d5f[_0x5c45bd(0x1f6)](apiRequest,_0x5c45bd(0x245)+_0x191d5f['BWjsR'](encodeURIComponent,_0xa23899)+'/login',{'method':'POST','body':JSON['stringify'](_0x2ce100)});}catch(_0x238a8e){if(_0x238a8e instanceof ApiError&&_0x191d5f[_0x5c45bd(0x257)](_0x238a8e[_0x5c45bd(0x201)],0x190)&&_0x191d5f[_0x5c45bd(0x257)](_0x238a8e['code'],_0x5c45bd(0x23f)))return{'status':_0x191d5f[_0x5c45bd(0x21f)],'error':_0x238a8e[_0x5c45bd(0x1fa)]};throw _0x238a8e;}}export async function manualBrowserLogin(_0x4ab5d4,_0x577f58){const _0x44501f=_0x296b05,_0x37f543={'gEyth':function(_0x571d1c,_0x61b388){return _0x571d1c/_0x61b388;},'iUEtD':function(_0x560054,_0x33cbfc,_0x26be67){return _0x560054(_0x33cbfc,_0x26be67);},'OHEMr':function(_0x27bba0,_0x55ce07){return _0x27bba0+_0x55ce07;},'zmRti':_0x44501f(0x237),'HOcYm':'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','kKCPx':function(_0x2843fd,_0x3e6a7d){return _0x2843fd>_0x3e6a7d;},'aavsu':_0x44501f(0x228),'mEMnp':'POST'};if(!isInteractive())throw new Error(_0x37f543[_0x44501f(0x250)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x4ab5d4[_0x44501f(0x22a)]+_0x44501f(0x256)+_0x37f543[_0x44501f(0x215)],_0x37f543[_0x44501f(0x240)]));const _0x5c97e0=_0x577f58&&_0x37f543[_0x44501f(0x204)](_0x577f58[_0x44501f(0x21d)]['length'],0x0)?_0x577f58['domains'][0x0]:'about:blank';console['log']('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console[_0x44501f(0x21a)]('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x1b208d=>setTimeout(_0x1b208d,0x7d0));const _0x585e89=await chromium[_0x44501f(0x20f)]({'headless':![]});let _0x5cac6e=null;try{const _0x98a1e4={'ignoreHTTPSErrors':!![]};_0x577f58?.['setupHeaders']&&(_0x98a1e4[_0x44501f(0x24a)]=_0x577f58[_0x44501f(0x20e)]);const _0x913ee0=await _0x585e89[_0x44501f(0x1f9)](_0x98a1e4);await addProfileSetupBanner(_0x913ee0);const _0x2bae51=await _0x913ee0[_0x44501f(0x1fc)]();await _0x2bae51[_0x44501f(0x22e)](_0x5c97e0);let _0x1ca089=![];await new Promise(_0x3c82d5=>{const _0x1f0223=_0x44501f,_0x39bc81={'LoilW':function(_0x443bc1,_0x530f46){const _0x14c98d=_0x25a0;return _0x37f543[_0x14c98d(0x247)](_0x443bc1,_0x530f46);}},_0x43821c=_0x37f543[_0x1f0223(0x220)](setTimeout,()=>{const _0x263e78=_0x1f0223;_0x1ca089=!![],console['error'](_0x263e78(0x232)+_0x39bc81[_0x263e78(0x25c)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x263e78(0x261)),_0x3c82d5();},MANUAL_LOGIN_TIMEOUT_MS);_0x2bae51['on']('close',async()=>{const _0x2bb2c2=_0x1f0223;clearTimeout(_0x43821c);try{const _0xfaa80e=await _0x913ee0[_0x2bb2c2(0x248)]();_0x5cac6e=_0xfaa80e;}catch{}_0x3c82d5();});});if(_0x1ca089&&!_0x5cac6e)throw new Error(_0x37f543[_0x44501f(0x223)]);}finally{await _0x585e89[_0x44501f(0x22b)]()[_0x44501f(0x207)](()=>{});}if(!_0x5cac6e)throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');return await _0x37f543['iUEtD'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x4ab5d4[_0x44501f(0x22a)])+_0x44501f(0x20b),{'method':_0x37f543['mEMnp'],'body':JSON[_0x44501f(0x1fd)]({'session_state':_0x5cac6e,'updated_by':_0x44501f(0x26b)})}),{'sessionState':_0x5cac6e};}function _0x25a0(_0x4fd24c,_0x41e1f4){_0x4fd24c=_0x4fd24c-0x1f4;const _0x5ebf63=_0x5ebf();let _0x25a06f=_0x5ebf63[_0x4fd24c];return _0x25a06f;}export async function promptSaveCredentials(_0x5b736d){const _0x3147bd=_0x296b05,_0x224e62={'jjltQ':function(_0x317b0c,_0x520470){return _0x317b0c||_0x520470;},'bWKEY':function(_0xf981){return _0xf981();},'ymPgb':'confirm','EjHIE':_0x3147bd(0x1f7),'AOapt':'PUT'},_0x1d4e9c=process['env'][_0x3147bd(0x203)],_0x3f11b4=process['env'][_0x3147bd(0x264)];if(_0x224e62[_0x3147bd(0x208)](!_0x1d4e9c,!_0x3f11b4))return;if(!_0x224e62['bWKEY'](isInteractive))return;const {save:_0x4fe3a3}=await _0x598102[_0x3147bd(0x222)]([{'type':_0x224e62['ymPgb'],'name':_0x224e62[_0x3147bd(0x221)],'message':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','default':![]}]);if(!_0x4fe3a3)return;await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x5b736d),{'method':_0x224e62['AOapt'],'body':JSON['stringify']({'username':_0x1d4e9c,'password':_0x3f11b4})}),console[_0x3147bd(0x21a)](_0x3147bd(0x267));}export async function resolveCloudProfileSession(_0x83a701,_0x12d465={}){const _0x254393=_0x296b05,_0x49ac12={'OpTwl':function(_0x377733,_0x4a563e,_0x594477){return _0x377733(_0x4a563e,_0x594477);},'zTSbR':function(_0x1ef57b,_0x368a54){return _0x1ef57b>_0x368a54;},'wSuaF':function(_0x57d84a,_0xbb5eb8,_0x2da5f0,_0x3034d2,_0x503215,_0x42f88b){return _0x57d84a(_0xbb5eb8,_0x2da5f0,_0x3034d2,_0x503215,_0x42f88b);},'RMvOd':function(_0x36d94,_0x106f90,_0x3d8ec4,_0x3408dd,_0x46c4de){return _0x36d94(_0x106f90,_0x3d8ec4,_0x3408dd,_0x46c4de);},'cPKPF':function(_0x273f66,_0x538619,_0x3d24cd){return _0x273f66(_0x538619,_0x3d24cd);},'CrOTG':function(_0x1231e6,_0x140c8f){return _0x1231e6(_0x140c8f);},'dmJte':function(_0x53a7a3,_0x11aa2d){return _0x53a7a3===_0x11aa2d;},'tPTrj':_0x254393(0x23f),'MBqVm':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','AVKJv':'success','VAHYD':'\x20\x20Login\x20successful.\x20Session\x20cached.','sStSF':function(_0x493232,_0xde476e){return _0x493232&&_0xde476e;},'PWDbF':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','kzKiD':_0x254393(0x23b),'pHuRc':function(_0x306ddc,_0x35dbd5){return _0x306ddc instanceof _0x35dbd5;},'IriGV':function(_0x10557a,_0x3240be){return _0x10557a(_0x3240be);},'lrFOe':function(_0x4d4985,_0xaf2751,_0x51bd08,_0x14a7b8,_0x23c1d5,_0x4e6924,_0x1032cf,_0x1aa357){return _0x4d4985(_0xaf2751,_0x51bd08,_0x14a7b8,_0x23c1d5,_0x4e6924,_0x1032cf,_0x1aa357);}},_0x5ac8c2=_0x83a701['settings']??{},_0xd7eb55=await fetchAuthConfig(),_0x4417de=_0xd7eb55?_0x49ac12['OpTwl'](resolveAuthEnvironmentLocally,_0xd7eb55,_0x83a701['environmentKey']):null,_0x1d39c4=_0x4417de?.[_0x254393(0x21d)],_0x330c77=_0x5ac8c2['setupHeaders'],_0x50abcb=_0x330c77??_0x4417de?.['setupHeaders'],_0x20494c=_0x12d465['effectiveBaseUrl']??_0x5ac8c2['baseUrl']??(_0x1d39c4&&_0x49ac12[_0x254393(0x26d)](_0x1d39c4['length'],0x0)?_0x1d39c4[0x0]:''),_0x2011b4={'invalidateOn':_0x4417de?.[_0x254393(0x260)],'userAgent':_0x4417de?.[_0x254393(0x22d)]?.[_0x254393(0x25b)]??_0x5ac8c2['userAgent']},_0x1f9ec0=await _0x49ac12[_0x254393(0x227)](checkLocalCache,_0x83a701['name'],_0x83a701['organizationId'],_0x20494c,_0x50abcb,_0x2011b4);if(_0x1f9ec0){if(_0x20494c){const _0x5bfa13=await _0x49ac12[_0x254393(0x23e)](isCachedSessionLive,_0x1f9ec0[_0x254393(0x26e)],_0x20494c,{'sessionCheckPath':_0x4417de?.[_0x254393(0x1fb)],'setupHeaders':_0x50abcb},{'launchBrowser':launchRealBrowser});if(_0x5bfa13)return console['log'](_0x254393(0x24e)+_0x83a701[_0x254393(0x22a)]+'\x22'),{'authPath':_0x1f9ec0['storageStatePath'],'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x83a701['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x49ac12['cPKPF'](emitSessionValidationHint,_0x20494c,_0x4417de);}else return{'authPath':_0x1f9ec0[_0x254393(0x26e)],'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};}if(_0x83a701[_0x254393(0x200)]){const _0x3eba4f=await writeSessionToLocalCache(_0x83a701['name'],_0x83a701[_0x254393(0x230)],_0x20494c,_0x50abcb,_0x83a701['sessionState'],_0x1d39c4,_0x2011b4);if(_0x20494c){const _0xc33ce=await isCachedSessionLive(_0x3eba4f,_0x20494c,{'sessionCheckPath':_0x4417de?.['sessionCheckPath'],'setupHeaders':_0x50abcb},{'launchBrowser':launchRealBrowser});if(_0xc33ce)return console[_0x254393(0x21a)]('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x83a701[_0x254393(0x22a)]+'\x22,\x20cached\x20locally'),{'authPath':_0x3eba4f,'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};console[_0x254393(0x21a)](_0x254393(0x22f)+_0x83a701[_0x254393(0x22a)]+_0x254393(0x209)),emitSessionValidationHint(_0x20494c,_0x4417de);}else return{'authPath':_0x3eba4f,'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};}console['log'](_0x254393(0x241)+_0x83a701[_0x254393(0x22a)]+'\x22,\x20attempting\x20login...');const _0x3d2f4e=_0x49ac12[_0x254393(0x258)](Boolean,process[_0x254393(0x224)]['RANGER_TEST_USERNAME'])&&_0x49ac12[_0x254393(0x258)](Boolean,process[_0x254393(0x224)]['RANGER_TEST_PASSWORD']),_0x513ff2=Boolean(_0x83a701['username']);if(_0x3d2f4e||_0x513ff2)try{const _0x4dc6f7=await serverSideLogin(_0x83a701[_0x254393(0x22a)]);if(_0x49ac12[_0x254393(0x244)](_0x4dc6f7['status'],_0x49ac12['tPTrj']))console[_0x254393(0x21a)](_0x49ac12[_0x254393(0x24c)]);else{if(_0x4dc6f7[_0x254393(0x201)]===_0x49ac12['AVKJv']&&_0x4dc6f7[_0x254393(0x216)]){console[_0x254393(0x21a)](_0x49ac12[_0x254393(0x22c)]);const _0x1c3a8d=await writeSessionToLocalCache(_0x83a701[_0x254393(0x22a)],_0x83a701[_0x254393(0x230)],_0x20494c,_0x50abcb,_0x4dc6f7[_0x254393(0x216)],_0x1d39c4,_0x2011b4);return _0x49ac12[_0x254393(0x265)](_0x3d2f4e,!_0x513ff2)&&await promptSaveCredentials(_0x83a701[_0x254393(0x22a)]),{'authPath':_0x1c3a8d,'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};}else _0x4dc6f7['test_output']&&(console['log'](_0x49ac12[_0x254393(0x202)]),console[_0x254393(0x21a)](_0x4dc6f7['test_output'])),console['log'](_0x49ac12['kzKiD']);}}catch(_0x105a3f){console['log'](_0x254393(0x252)+(_0x49ac12['pHuRc'](_0x105a3f,Error)?_0x105a3f[_0x254393(0x254)]:_0x49ac12[_0x254393(0x1f5)](String,_0x105a3f))),console['log'](_0x254393(0x23b));}const {sessionState:_0x2c7ff3}=await _0x49ac12[_0x254393(0x210)](manualBrowserLogin,_0x83a701,_0x4417de),_0x4b67e5=await _0x49ac12[_0x254393(0x20d)](writeSessionToLocalCache,_0x83a701['name'],_0x83a701[_0x254393(0x230)],_0x20494c,_0x50abcb,_0x2c7ff3,_0x1d39c4,_0x2011b4);return{'authPath':_0x4b67e5,'settings':_0x5ac8c2,'resolvedEnv':_0x4417de};}function _0x5ebf(){const _0x596596=['userAgent','LoilW','error','YnjhQ','5725728jYzMnX','invalidateOn','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','wtHkk','192FvvcDK','RANGER_TEST_PASSWORD','sStSF','headers','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','clientIp','DOnpC','CSuAZ','cli:manual-login','url','zTSbR','storageStatePath','API\x20request\x20','profiles','json','application/json','password','IriGV','jBUSY','save','2785202HpsDSG','newContext','detail','sessionCheckPath','newPage','stringify','username','lMoQA','sessionState','status','PWDbF','RANGER_TEST_USERNAME','kKCPx','\x22\x20for\x20','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','catch','jjltQ','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','join','/session','44qIFJkZ','lrFOe','setupHeaders','launch','cPKPF','ofYGN','force','length','IVXNV','zmRti','session_state','environments','pyOyw','oHmPH','log','ApiError','raw','domains','mMgeu','bRhQi','iUEtD','EjHIE','prompt','aavsu','env','1171464NZEqRT','DchdO','wSuaF','Browser\x20login\x20timed\x20out\x20before\x20completion.','ajrtr','name','close','VAHYD','browserOptions','goto','\x20\x20Cloud\x20session\x20for\x20\x22','organizationId','gNNEc','Browser\x20login\x20timed\x20out\x20after\x20','code','kVKHB','utf-8','TqVpU','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','defaultEnvironmentKey','544974ADgJYs','64647YaNVLX','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','push','keys','RMvOd','not_configured','HOcYm','\x20\x20No\x20live\x20session\x20for\x20\x22','31765bRGuLo','83751lUBimD','dmJte','/api/v1/profiles/','GPCEM','gEyth','storageState','POST','extraHTTPHeaders','settings','MBqVm','IWbDy','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','DELETE','OHEMr','):\x20','\x20\x20Server-side\x20login\x20error:\x20','you\x27re\x20now\x20at\x20\x22','message','yzfEL','\x22.\x0a','ZBHdU','CrOTG','yAIHW','/api/v1/profiles'];_0x5ebf=function(){return _0x596596;};return _0x5ebf();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x5a4be9=_0x4815;(function(_0x59f442,_0x5f1282){const _0x1a46f4=_0x4815,_0x3948ac=_0x59f442();while(!![]){try{const _0x22bcb9=parseInt(_0x1a46f4(0x1ea))/0x1*(parseInt(_0x1a46f4(0x1ed))/0x2)+-parseInt(_0x1a46f4(0x1f9))/0x3*(parseInt(_0x1a46f4(0x204))/0x4)+-parseInt(_0x1a46f4(0x207))/0x5*(parseInt(_0x1a46f4(0x1f3))/0x6)+-parseInt(_0x1a46f4(0x1f2))/0x7*(parseInt(_0x1a46f4(0x1f1))/0x8)+parseInt(_0x1a46f4(0x201))/0x9*(-parseInt(_0x1a46f4(0x205))/0xa)+-parseInt(_0x1a46f4(0x1e8))/0xb+parseInt(_0x1a46f4(0x1e4))/0xc;if(_0x22bcb9===_0x5f1282)break;else _0x3948ac['push'](_0x3948ac['shift']());}catch(_0x3a7fd1){_0x3948ac['push'](_0x3948ac['shift']());}}}(_0x5bbd,0x369e5));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x2d5fe4=process[_0x5a4be9(0x1e7)],_0x262575={'stdin':process[_0x5a4be9(0x1f4)],'stdout':process[_0x5a4be9(0x1e5)]}){const _0x3908af=_0x5a4be9;if(_0x2d5fe4['CI'])return![];return Boolean(_0x262575[_0x3908af(0x1f4)][_0x3908af(0x208)])&&Boolean(_0x262575[_0x3908af(0x1e5)]['isTTY']);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x48dfd7){const _0x48cd4f=_0x5a4be9,_0x2d31f5={'yUNRy':'baseUrl','MwLsB':_0x48cd4f(0x1fb),'VnJjm':function(_0x3402c7,_0x46c5e8){return _0x3402c7!==_0x46c5e8;},'rdfjo':function(_0x2d5393,_0x231d01){return _0x2d5393!==_0x231d01;},'RAuxy':function(_0x58f9b9,_0x180ef3){return _0x58f9b9(_0x180ef3);},'EJXPe':_0x48cd4f(0x203)},_0x92ed24=new Set(_0x48dfd7['invalidateOn']??DEFAULT_INVALIDATE_ON),_0x4d3e85={'orgId':_0x48dfd7['orgId'],'profileName':_0x48dfd7['profileName']};return _0x92ed24['has'](_0x2d31f5['yUNRy'])&&(_0x4d3e85['effectiveBaseUrl']=_0x48dfd7[_0x48cd4f(0x1fa)]),_0x92ed24[_0x48cd4f(0x202)](_0x48cd4f(0x1e6))&&(_0x4d3e85[_0x48cd4f(0x1e6)]=_0x48dfd7['setupHeaders']?sortObjectKeys(_0x48dfd7[_0x48cd4f(0x1e6)]):_0x48dfd7['setupHeaders']),_0x92ed24['has'](_0x2d31f5[_0x48cd4f(0x206)])&&(_0x4d3e85['port']=extractPort(_0x48dfd7['effectiveBaseUrl'])),_0x92ed24['has'](_0x48cd4f(0x1fe))&&_0x2d31f5[_0x48cd4f(0x1e9)](_0x48dfd7['userAgent'],undefined)&&(_0x4d3e85[_0x48cd4f(0x1fe)]=_0x48dfd7['userAgent']),_0x92ed24['has'](_0x48cd4f(0x1db))&&_0x2d31f5['rdfjo'](_0x48dfd7[_0x48cd4f(0x1db)],undefined)&&(_0x4d3e85['clientIp']=_0x48dfd7['clientIp']),_0x2d31f5['RAuxy'](createHash,_0x2d31f5[_0x48cd4f(0x1f0)])[_0x48cd4f(0x1ec)](JSON[_0x48cd4f(0x1fc)](_0x4d3e85))[_0x48cd4f(0x1e2)]('hex')[_0x48cd4f(0x1f8)](0x0,0xc);}function extractPort(_0x138b0a){try{return new URL(_0x138b0a)['port'];}catch{return'';}}function _0x4815(_0x242e0c,_0x1b3e9d){_0x242e0c=_0x242e0c-0x1db;const _0x5bbdcc=_0x5bbd();let _0x481563=_0x5bbdcc[_0x242e0c];return _0x481563;}function sortObjectKeys(_0x37e045){const _0x35d815=_0x5a4be9,_0x5810e0={};for(const _0x4a32aa of Object['keys'](_0x37e045)[_0x35d815(0x1fd)]()){_0x5810e0[_0x4a32aa]=_0x37e045[_0x4a32aa];}return _0x5810e0;}export function getSessionCachePath(_0x1f56bd,_0x4f791b){const _0x3bbefb=_0x5a4be9,_0x489ffe={'LBBNq':function(_0x2b2f27,_0x1c52ba,_0x587a1f,_0x350213){return _0x2b2f27(_0x1c52ba,_0x587a1f,_0x350213);}};return _0x489ffe['LBBNq'](join,getRangerHomeDir(),_0x3bbefb(0x1dc),_0x1f56bd+'-'+_0x4f791b+'.json');}export function getStorageStatePath(_0x3dfca1){const _0x77fcb=_0x5a4be9,_0x96bb84={'lZcnx':'.storageState.json'};return _0x3dfca1[_0x77fcb(0x209)](/\.json$/,_0x96bb84['lZcnx']);}export function needsTunnel(_0x18cd64){const _0x28342d=_0x5a4be9,_0x275e0a={'pNbTG':'localhost','AnbJn':'localhost.'};let _0x3db507;try{_0x3db507=new URL(_0x18cd64)['hostname'];}catch{return![];}if(_0x3db507===_0x275e0a[_0x28342d(0x1e1)]||_0x3db507===_0x28342d(0x1ee))return!![];if(_0x3db507['endsWith']('.localhost'))return!![];if(_0x3db507[_0x28342d(0x1ff)](_0x275e0a[_0x28342d(0x1ef)]))return!![];return![];}export function hostnameOf(_0x5ebd01){return new URL(_0x5ebd01)['hostname'];}export function duplicateCookiesForDomains(_0x1ccea2,_0x146ef1){const _0x4ac27e=_0x5a4be9,_0x30cdd3=[..._0x1ccea2],_0x314be8=new Set(_0x1ccea2['map'](_0x29e53c=>_0x29e53c[_0x4ac27e(0x1de)]));for(const _0x5d57e8 of _0x146ef1){let _0x219109;try{_0x219109=hostnameOf(_0x5d57e8);}catch{continue;}if(!_0x219109)continue;const _0x15588b=_0x219109['startsWith']('.')?_0x219109:'.'+_0x219109;if(_0x314be8[_0x4ac27e(0x202)](_0x219109)||_0x314be8[_0x4ac27e(0x202)](_0x15588b))continue;for(const _0x2f0f6a of _0x1ccea2){_0x30cdd3['push']({..._0x2f0f6a,'domain':_0x15588b});}_0x314be8['add'](_0x15588b);}return _0x30cdd3;}function _0x5bbd(){const _0x52450e=['sort','userAgent','includes','newPage','153pnQvtd','has','sha256','16TfQykd','14270aQryUp','MwLsB','5sqneRb','isTTY','replace','clientIp','auth','url','domain','keys','defaultEnvironmentKey','pNbTG','digest','newContext','12535992aBjAwO','stdout','setupHeaders','env','3394919dbhTnv','VnJjm','1eWGErV','domcontentloaded','update','656634KRJAxB','127.0.0.1','AnbJn','EJXPe','1336oRyqfW','7749avGMSb','1564446RZFmLi','stdin','test','toString','FMjcq','slice','278076LAeEeX','effectiveBaseUrl','port','stringify'];_0x5bbd=function(){return _0x52450e;};return _0x5bbd();}export function resolveAuthEnvironmentLocally(_0x2c64c6,_0x402499){const _0x328cdc=_0x5a4be9,_0x5bc623={'WlyGP':function(_0x4becba,_0x20ce60){return _0x4becba===_0x20ce60;}},_0x512336=_0x2c64c6['environments'];if(_0x402499){const _0x3f2279=_0x512336[_0x402499];if(!_0x3f2279)return null;return{'key':_0x402499,..._0x3f2279};}if(_0x2c64c6['defaultEnvironmentKey']){const _0x3cced1=_0x512336[_0x2c64c6[_0x328cdc(0x1e0)]];if(!_0x3cced1)return null;return{'key':_0x2c64c6[_0x328cdc(0x1e0)],..._0x3cced1};}const _0x2c1da=Object[_0x328cdc(0x1df)](_0x512336);if(_0x5bc623['WlyGP'](_0x2c1da['length'],0x1)){const _0x2f9bc6=_0x2c1da[0x0];return{'key':_0x2f9bc6,..._0x512336[_0x2f9bc6]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x552a8e,_0x32d096){const _0x4748e0=_0x5a4be9;try{if(_0x32d096)return new URL(_0x32d096,_0x552a8e)[_0x4748e0(0x1f6)]();return new URL(_0x552a8e)['toString']();}catch{return null;}}export function looksLikeLoginUrl(_0x293d63){const _0x22e0cc=_0x5a4be9;try{const _0x5c9056=new URL(_0x293d63);return LOGIN_URL_PATTERN[_0x22e0cc(0x1f5)](_0x5c9056['pathname']);}catch{return LOGIN_URL_PATTERN[_0x22e0cc(0x1f5)](_0x293d63);}}export async function isCachedSessionLive(_0x1334a3,_0x8ebadf,_0x4de1c1={},_0x3e9aa0={}){const _0x3ffd25=_0x5a4be9,_0x506f27={'HQnFk':function(_0x3f36fa,_0x230396){return _0x3f36fa===_0x230396;},'FMjcq':function(_0x3de06e,_0x47baa3){return _0x3de06e===_0x47baa3;},'TzNkM':function(_0x18d430,_0x54f610){return _0x18d430(_0x54f610);}},_0x54169e=buildSessionCheckUrl(_0x8ebadf,_0x4de1c1['sessionCheckPath']);if(!_0x54169e)return!![];if(!_0x3e9aa0['launchBrowser'])return!![];let _0x53c9cb=null;try{_0x53c9cb=await _0x3e9aa0['launchBrowser']();const _0x226f82=await _0x53c9cb[_0x3ffd25(0x1e3)]({'storageState':_0x1334a3,'ignoreHTTPSErrors':!![],..._0x4de1c1['setupHeaders']?{'extraHTTPHeaders':_0x4de1c1[_0x3ffd25(0x1e6)]}:{}}),_0x29f4df=await _0x226f82[_0x3ffd25(0x200)](),_0x5e8011=await _0x29f4df['goto'](_0x54169e,{'waitUntil':_0x3ffd25(0x1eb),'timeout':0x3a98}),_0x135dba=_0x5e8011?.['status']();if(_0x506f27['HQnFk'](_0x135dba,0x191)||_0x506f27[_0x3ffd25(0x1f7)](_0x135dba,0x193))return![];const _0x3b0ef6=_0x29f4df[_0x3ffd25(0x1dd)]();if(_0x506f27['TzNkM'](looksLikeLoginUrl,_0x3b0ef6))return![];return!![];}catch{return![];}finally{if(_0x53c9cb)await _0x53c9cb['close']()['catch'](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const _0x3e767d=_0x595b;(function(_0x5633e2,_0x39364b){const _0x1e6b20=_0x595b,_0x12d83c=_0x5633e2();while(!![]){try{const _0x36d4af=-parseInt(_0x1e6b20(0x164))/0x1*(parseInt(_0x1e6b20(0x162))/0x2)+parseInt(_0x1e6b20(0x16f))/0x3+-parseInt(_0x1e6b20(0x165))/0x4*(-parseInt(_0x1e6b20(0x172))/0x5)+parseInt(_0x1e6b20(0x177))/0x6*(-parseInt(_0x1e6b20(0x169))/0x7)+-parseInt(_0x1e6b20(0x170))/0x8*(parseInt(_0x1e6b20(0x173))/0x9)+-parseInt(_0x1e6b20(0x161))/0xa*(-parseInt(_0x1e6b20(0x16d))/0xb)+parseInt(_0x1e6b20(0x16e))/0xc;if(_0x36d4af===_0x39364b)break;else _0x12d83c['push'](_0x12d83c['shift']());}catch(_0x2d02bf){_0x12d83c['push'](_0x12d83c['shift']());}}}(_0x5b8e,0x543d7));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT=_0x3e767d(0x163),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0x595b(_0x55cbce,_0x2e4c80){_0x55cbce=_0x55cbce-0x161;const _0x5b8e79=_0x5b8e();let _0x595bf7=_0x5b8e79[_0x55cbce];return _0x595bf7;}function _0x5b8e(){const _0x31c366=['160223AmJXcg','eyZXB','VzEjp','final','2391477SEoNeo','11555880ZIVTEy','388014BwGhlR','112sCvfLG','update','24085KLbiAN','217881nQncJi','subarray','DNmcz','setAuthTag','132GpqDTH','30tMRLAS','425938vArcrz','ranger-auth-encryption','3MzlAXD','68AiKbUP','concat','ePFnv','utf8'];_0x5b8e=function(){return _0x31c366;};return _0x5b8e();}export function deriveKey(_0x3d40c2){return pbkdf2Sync(_0x3d40c2,SALT,0x186a0,KEY_LENGTH,'sha256');}export function encrypt(_0x40cdaa,_0x266d76){const _0x3d5732=_0x3e767d,_0x38caf1={'UwnUp':function(_0x4789f9,_0x2ceefe){return _0x4789f9(_0x2ceefe);},'eyZXB':'utf8'},_0x3a7b6a=deriveKey(_0x266d76),_0x3bf0c9=_0x38caf1['UwnUp'](randomBytes,IV_LENGTH),_0x3e3873=createCipheriv(ALGORITHM,_0x3a7b6a,_0x3bf0c9),_0x42dc33=Buffer[_0x3d5732(0x166)]([_0x3e3873[_0x3d5732(0x171)](_0x40cdaa,_0x38caf1[_0x3d5732(0x16a)]),_0x3e3873[_0x3d5732(0x16c)]()]),_0x318e14=_0x3e3873['getAuthTag']();return Buffer['concat']([_0x3bf0c9,_0x318e14,_0x42dc33]);}export function decrypt(_0x5050aa,_0xa352b9){const _0xdbab87=_0x3e767d,_0x31b6e5={'DNmcz':function(_0x541ea6,_0x703a71){return _0x541ea6+_0x703a71;},'ePFnv':function(_0x4da29e,_0x14456d,_0x830254,_0x5a8864){return _0x4da29e(_0x14456d,_0x830254,_0x5a8864);},'VzEjp':_0xdbab87(0x168)},_0x4c8ddf=deriveKey(_0xa352b9),_0x4b1d8f=_0x5050aa['subarray'](0x0,IV_LENGTH),_0x36e803=_0x5050aa['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x28a93a=_0x5050aa[_0xdbab87(0x174)](_0x31b6e5[_0xdbab87(0x175)](IV_LENGTH,TAG_LENGTH)),_0x4c2a15=_0x31b6e5[_0xdbab87(0x167)](createDecipheriv,ALGORITHM,_0x4c8ddf,_0x4b1d8f);return _0x4c2a15[_0xdbab87(0x176)](_0x36e803),_0x4c2a15['update'](_0x28a93a)+_0x4c2a15[_0xdbab87(0x16c)](_0x31b6e5[_0xdbab87(0x16b)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x3c6b(_0x572d23,_0x3f66a5){_0x572d23=_0x572d23-0xf4;const _0x4a5c43=_0x4a5c();let _0x3c6bcb=_0x4a5c43[_0x572d23];return _0x3c6bcb;}const _0x5a3718=_0x3c6b;(function(_0x272496,_0x3505b6){const _0x2920ef=_0x3c6b,_0x380773=_0x272496();while(!![]){try{const _0x4c9ffb=-parseInt(_0x2920ef(0x100))/0x1*(parseInt(_0x2920ef(0xfc))/0x2)+-parseInt(_0x2920ef(0xfe))/0x3+parseInt(_0x2920ef(0x107))/0x4+-parseInt(_0x2920ef(0x128))/0x5*(-parseInt(_0x2920ef(0x11e))/0x6)+-parseInt(_0x2920ef(0x126))/0x7+parseInt(_0x2920ef(0x10e))/0x8+parseInt(_0x2920ef(0x11a))/0x9;if(_0x4c9ffb===_0x3505b6)break;else _0x380773['push'](_0x380773['shift']());}catch(_0x539818){_0x380773['push'](_0x380773['shift']());}}}(_0x4a5c,0x46bec));import{getToken}from'./keychain.js';function _0x4a5c(){const _0x4709aa=['FENUY','24iCWTUy','unknown_argument','bfGQJ','indexOf','unknown_command','pzexv','unknown','DvRRq','2283778PeXXCT','env','156880BFjNKN','length','toLowerCase','includes','[REDACTED]','--secret','--key','startsWith','some','2chvDrc','--auth','1101264pHuesd','Missing\x20required\x20argument','465106eVUsWQ','/api/v1/mcp/desire-path-logs','error','push','invalid_option_value','mwxsY','sDcbG','1743352gOYcor','isTTY','--cookie','test','MZryu','hwBzv','syntax_error','1465904vnJZSS','Not\x20enough\x20non-option\x20arguments','--token','dBuAt','slice','Bearer\x20','POST','FabBx','=[REDACTED]','--header','has','Unknown\x20command','6332760dfeJIB','missing_option','missing_required_argument'];_0x4a5c=function(){return _0x4709aa;};return _0x4a5c();}import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x5a3718(0x110),'-t',_0x5a3718(0xf8),'--api-key','--apikey',_0x5a3718(0xf9),'--password','--pass',_0x5a3718(0xfd),'--authorization',_0x5a3718(0x117),_0x5a3718(0x109),'--credentials']),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x5d9747){const _0x2c7362=_0x5a3718;return TOKEN_PATTERNS[_0x2c7362(0xfb)](_0x2b2715=>_0x2b2715[_0x2c7362(0x10a)](_0x5d9747));}export function sanitizeArgs(_0xe01a67){const _0x147009=_0x5a3718,_0x1da276={'hwBzv':function(_0x23e8aa,_0x3ab44b){return _0x23e8aa<_0x3ab44b;},'FabBx':function(_0x7acb00,_0x86209d){return _0x7acb00!==_0x86209d;},'DSaBU':function(_0x318d55,_0x4bff9d){return _0x318d55(_0x4bff9d);},'mwxsY':'[REDACTED]'},_0x49bac7=[];let _0x54a944=![];for(let _0x56cdf3=0x0;_0x1da276[_0x147009(0x10c)](_0x56cdf3,_0xe01a67[_0x147009(0xf4)]);_0x56cdf3++){const _0x455672=_0xe01a67[_0x56cdf3];if(_0x54a944){_0x49bac7['push'](_0x147009(0xf7)),_0x54a944=![];continue;}if(_0x455672['startsWith']('--')||_0x455672[_0x147009(0xfa)]('-')){const _0x5242a9=_0x455672[_0x147009(0x121)]('=');if(_0x1da276[_0x147009(0x115)](_0x5242a9,-0x1)){const _0x195cbd=_0x455672[_0x147009(0x112)](0x0,_0x5242a9)[_0x147009(0xf5)]();if(SENSITIVE_FLAGS['has'](_0x195cbd)){_0x49bac7['push'](_0x455672['slice'](0x0,_0x5242a9)+_0x147009(0x116));continue;}}else{const _0x3efa34=_0x455672['toLowerCase']();SENSITIVE_FLAGS[_0x147009(0x118)](_0x3efa34)&&(_0x54a944=!![]);}_0x49bac7[_0x147009(0x103)](_0x455672);}else _0x1da276['DSaBU'](looksLikeToken,_0x455672)?_0x49bac7[_0x147009(0x103)](_0x1da276[_0x147009(0x105)]):_0x49bac7[_0x147009(0x103)](_0x455672);}return _0x49bac7['join']('\x20');}export async function logDesirePath(_0x19d260){const _0x5c0860=_0x5a3718,_0x580153={'LFvIJ':function(_0x2b898e){return _0x2b898e();},'FENUY':'application/json','bfGQJ':function(_0x149c6f,_0x4e469b,_0x4a2560){return _0x149c6f(_0x4e469b,_0x4a2560);},'MZryu':_0x5c0860(0x114)};try{const _0x4ee102=await getToken()['catch'](()=>null),_0x3cb485=getApiBaseUrl(),_0x441dd4=_0x580153['LFvIJ'](getCurrentVersion),_0x54cb77=_0x4ee102?'has_token':'no_token',_0x41e9fd={..._0x19d260['metadata'],'authStatus':_0x54cb77,'isTty':process['stdout'][_0x5c0860(0x108)]??![]},_0x3bc422={'Content-Type':_0x580153[_0x5c0860(0x11d)]};_0x4ee102&&(_0x3bc422['Authorization']=_0x5c0860(0x113)+_0x4ee102);const _0x56f412={'rawCommand':_0x19d260['rawCommand'],'errorMessage':_0x19d260['errorMessage'],'errorType':_0x19d260['errorType'],'featureId':_0x19d260['featureId'],'sessionId':_0x19d260['sessionId'],'metadata':_0x41e9fd,'cliVersion':_0x441dd4};process[_0x5c0860(0x127)]['DEBUG']&&(console['error']('[desire-path]\x20Sending\x20log\x20to\x20'+_0x3cb485+_0x5c0860(0x101)),console['error']('[desire-path]\x20Payload:\x20'+JSON['stringify'](_0x56f412,null,0x2))),await _0x580153[_0x5c0860(0x120)](fetch,_0x3cb485+'/api/v1/mcp/desire-path-logs',{'method':_0x580153[_0x5c0860(0x10b)],'headers':_0x3bc422,'body':JSON['stringify'](_0x56f412)});}catch(_0x4fe29e){process[_0x5c0860(0x127)]['DEBUG']&&console[_0x5c0860(0x102)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x4fe29e);}}export function getErrorType(_0x2f57e2,_0x225003){const _0x5c02f7=_0x5a3718,_0x4fa6ac={'sDcbG':_0x5c02f7(0x10f),'jomkQ':_0x5c02f7(0x11c),'pzexv':'Invalid\x20values','DvRRq':_0x5c02f7(0x104),'vQvJW':'Unknown\x20argument','dBuAt':_0x5c02f7(0x11f),'fKQFP':_0x5c02f7(0x124),'GlXwi':_0x5c02f7(0x119),'EnJze':_0x5c02f7(0x122),'BKEZJ':'runtime_error','EsiGE':_0x5c02f7(0xff)},_0x1867ee='6|4|5|3|0|1|7|2'['split']('|');let _0x1a091d=0x0;while(!![]){switch(_0x1867ee[_0x1a091d++]){case'0':if(_0x2f57e2['includes'](_0x4fa6ac[_0x5c02f7(0x106)]))return _0x4fa6ac['jomkQ'];continue;case'1':if(_0x2f57e2[_0x5c02f7(0xf6)](_0x4fa6ac[_0x5c02f7(0x123)]))return _0x4fa6ac[_0x5c02f7(0x125)];continue;case'2':return _0x5c02f7(0x10d);case'3':if(_0x2f57e2[_0x5c02f7(0xf6)](_0x4fa6ac['vQvJW']))return _0x4fa6ac[_0x5c02f7(0x111)];continue;case'4':if(!_0x2f57e2)return _0x4fa6ac['fKQFP'];continue;case'5':if(_0x2f57e2[_0x5c02f7(0xf6)](_0x4fa6ac['GlXwi']))return _0x4fa6ac['EnJze'];continue;case'6':if(_0x225003)return _0x4fa6ac['BKEZJ'];continue;case'7':if(_0x2f57e2['includes'](_0x4fa6ac['EsiGE']))return _0x5c02f7(0x11b);continue;}break;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x9b31c1,_0xf80811){const _0x25347e=_0x3931,_0x5cd6cf=_0x9b31c1();while(!![]){try{const _0x9f75bd=parseInt(_0x25347e(0xc9))/0x1+-parseInt(_0x25347e(0xc4))/0x2*(parseInt(_0x25347e(0x7e))/0x3)+parseInt(_0x25347e(0xc6))/0x4*(-parseInt(_0x25347e(0xcb))/0x5)+parseInt(_0x25347e(0xc3))/0x6+parseInt(_0x25347e(0xa8))/0x7*(-parseInt(_0x25347e(0x9e))/0x8)+-parseInt(_0x25347e(0xa3))/0x9+parseInt(_0x25347e(0x82))/0xa;if(_0x9f75bd===_0xf80811)break;else _0x5cd6cf['push'](_0x5cd6cf['shift']());}catch(_0x3ce29e){_0x5cd6cf['push'](_0x5cd6cf['shift']());}}}(_0x2831,0x3ea3a));import{spawn}from'child_process';import _0x2bbbe0 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x41ac61){const _0x2031b3=_0x3931,_0xaad07b={'OUWFr':'application/x-www-form-urlencoded'},_0x572795=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':'POST','headers':{'Content-Type':_0xaad07b['OUWFr']},'body':new URLSearchParams({'client_id':_0x41ac61})});if(!_0x572795['ok']){const _0x58e2f3=await _0x572795['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x572795[_0x2031b3(0x95)]+'\x20'+_0x58e2f3);}return _0x572795[_0x2031b3(0x8b)]();}export async function pollForTokens(_0x17d09d,_0xe4e6dd,_0x291943,_0x50f69b){const _0x5dd33c=_0x3931,_0x3d76dd={'adnVo':_0x5dd33c(0xb3),'SzwEy':_0x5dd33c(0x7c),'odvIn':'authorization_pending','RNIZI':_0x5dd33c(0xbd),'rTybS':_0x5dd33c(0xc0)},_0x9a089c=Date[_0x5dd33c(0x8e)]()+_0x50f69b*0x3e8;let _0x272791=_0x291943*0x3e8;while(Date[_0x5dd33c(0x8e)]()<_0x9a089c){await sleep(_0x272791);const _0x433218=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x3d76dd['adnVo']},'body':new URLSearchParams({'client_id':_0x17d09d,'device_code':_0xe4e6dd,'grant_type':_0x3d76dd[_0x5dd33c(0x92)]})});if(_0x433218['ok'])return _0x433218[_0x5dd33c(0x8b)]();const _0xd7d6e3=await _0x433218['json']();if(_0xd7d6e3['error']===_0x3d76dd['odvIn'])continue;if(_0xd7d6e3[_0x5dd33c(0xa0)]===_0x3d76dd['RNIZI']){_0x272791+=0x3e8;continue;}throw new Error(_0xd7d6e3['error_description']||_0xd7d6e3[_0x5dd33c(0xa0)]||_0x3d76dd['rTybS']);}throw new Error('Device\x20authorization\x20timed\x20out');}async function fetchUserProfile(_0x1a85c6){const _0x11c91f=_0x3931,_0x2c4174=getApiBaseUrl();try{const _0x2c9e9b=await fetch(_0x2c4174+_0x11c91f(0xa7),{'method':_0x11c91f(0xb8),'headers':{'workos-token':_0x1a85c6}});if(_0x2c9e9b['ok'])return _0x2c9e9b['json']();}catch{}return null;}function buildKeyName(_0x44166d,_0x502586){const _0x3baf6a=_0x3931,_0x2bf1d5={'moNAM':function(_0x44bd6b,_0x635073){return _0x44bd6b+_0x635073;}},_0x35ad94=_0x502586['filter'](_0x250ffe=>_0x250ffe[_0x3baf6a(0xc7)]===_0x44166d||_0x250ffe[_0x3baf6a(0xc7)]['startsWith'](_0x44166d+'\x20('));if(_0x35ad94[_0x3baf6a(0x7d)]===0x0)return _0x44166d;return _0x44166d+'\x20('+_0x2bf1d5[_0x3baf6a(0xb5)](_0x35ad94[_0x3baf6a(0x7d)],0x1)+')';}export async function provisionApiKey(_0x54c6ce){const _0x21a45c=_0x3931,_0x20a8f4={'XCEZi':_0x21a45c(0x80),'UyBrn':function(_0x5d2dae,_0x31155c,_0x2da61d){return _0x5d2dae(_0x31155c,_0x2da61d);},'PySEb':_0x21a45c(0x9f)},_0x5b1975=getApiBaseUrl(),_0x150995={'Content-Type':_0x20a8f4[_0x21a45c(0xb4)],'workos-token':_0x54c6ce},_0x45af12=await fetchUserProfile(_0x54c6ce),_0x359ba6=_0x45af12?.['firstName']||_0x45af12?.['email']?.[_0x21a45c(0xa1)]('@')[0x0],_0x25c2a2=_0x359ba6?_0x359ba6+'\x27s\x20CLI\x20Key':'CLI\x20Key';let _0x195f0e=[];try{const _0x5ee7be=await fetch(_0x5b1975+'/api-keys',{'method':_0x21a45c(0xb8),'headers':_0x150995});if(_0x5ee7be['ok']){const _0x5b962e=await _0x5ee7be[_0x21a45c(0x8b)]();_0x195f0e=_0x5b962e['apiKeys'];}}catch{}const _0x58b730=_0x20a8f4['UyBrn'](buildKeyName,_0x25c2a2,_0x195f0e),_0x33fb20=await fetch(_0x5b1975+'/api-keys',{'method':_0x20a8f4[_0x21a45c(0x8d)],'headers':_0x150995,'body':JSON[_0x21a45c(0xc1)]({'name':_0x58b730,'scope':_0x21a45c(0x9a)})});if(!_0x33fb20['ok']){const _0x414c5b=await _0x33fb20['text']();throw new Error(_0x21a45c(0xca)+_0x33fb20['status']+'\x20'+_0x414c5b);}const _0x317e1c=await _0x33fb20['json']();return _0x317e1c[_0x21a45c(0xb7)][_0x21a45c(0x9c)];}function _0x2831(){const _0x2cdd89=['workosClientId','xdg-open','vOvgK','SzwEy','YVcaF','oMiPr','status','organizationId','ReIIp','prompt','dJebS','mcp:write','QgAxh','token','duhwm','8wfhYtV','POST','error','split','yVIFy','238140UVqare','oJdFC','device_code','write','/organization/me','296765CVPafm','log','user_code','toString','ignore','base64url','/cli-auth/token','Invalid\x20JWT\x20format','refresh_token','VPRDf','/organization/my-memberships','application/x-www-form-urlencoded','XCEZi','moNAM','PqlyJ','apiKey','GET','YnibS','text','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','from','slow_down','hiDBN','AAWTJ','Authentication\x20failed','stringify','utf-8','2071188XDWZxx','16tluYdj','Setting\x20up\x20your\x20organization...','4jcXZit','name','stdout','125675tyrqtZ','Failed\x20to\x20provision\x20API\x20key:\x20','1103710yTqlEE','win32','urn:ietf:params:oauth:grant-type:device_code','length','69663UzIzIN','Failed\x20to\x20provision\x20CLI\x20token:\x20','application/json','parse','2610620wOyYzL','verification_uri_complete','YAyqU','Failed\x20to\x20fetch\x20memberships:\x20','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','access_token','ONaaB','ScQzw','map','json','start','PySEb','now'];_0x2831=function(){return _0x2cdd89;};return _0x2831();}export function openBrowser(_0x3bc3e9){const _0x272a94=_0x3931,_0x5c11a3={'FcvyG':_0x272a94(0x7b),'YVcaF':function(_0x499349,_0x543a87,_0x56c094,_0x1c9ce5){return _0x499349(_0x543a87,_0x56c094,_0x1c9ce5);},'QgAxh':'cmd','yktFc':_0x272a94(0x8c),'VPRDf':'ignore'};try{if(process['platform']===_0x5c11a3['FcvyG']){const _0x4bf020=_0x5c11a3[_0x272a94(0x93)](spawn,_0x5c11a3[_0x272a94(0x9b)],['/c',_0x5c11a3['yktFc'],'',_0x3bc3e9],{'detached':!![],'stdio':_0x272a94(0xac),'windowsHide':!![]});_0x4bf020['unref']();return;}const _0x3eb5ae=process['platform']==='darwin'?'open':_0x272a94(0x90),_0x5ba12e=spawn(_0x3eb5ae,[_0x3bc3e9],{'detached':!![],'stdio':_0x5c11a3[_0x272a94(0xb1)]});_0x5ba12e['unref']();}catch{}}function decodeJwtPayload(_0x296cc8){const _0x19fc43=_0x3931,_0x6b3b22={'mxxxo':function(_0x4cba06,_0x1b5be5){return _0x4cba06!==_0x1b5be5;},'hiDBN':_0x19fc43(0xaf),'PqlyJ':_0x19fc43(0xc2)},_0x34f1be=_0x296cc8[_0x19fc43(0xa1)]('.');if(_0x6b3b22['mxxxo'](_0x34f1be['length'],0x3))throw new Error(_0x6b3b22[_0x19fc43(0xbe)]);const _0x511200=Buffer[_0x19fc43(0xbc)](_0x34f1be[0x1],_0x19fc43(0xad))[_0x19fc43(0xab)](_0x6b3b22[_0x19fc43(0xb6)]);return JSON[_0x19fc43(0x81)](_0x511200);}async function selfServeSignup(_0x27d354){const _0xbbf852=_0x3931,_0x213945={'zuQcj':'application/json'},_0xc2c4e8=getApiBaseUrl(),_0xe38ad4=await fetch(_0xc2c4e8+'/organization/self-serve-signup',{'method':_0xbbf852(0x9f),'headers':{'Content-Type':_0x213945['zuQcj'],'workos-token':_0x27d354}});if(!_0xe38ad4['ok']){const _0x2d50f5=await _0xe38ad4['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0xe38ad4['status']+'\x20'+_0x2d50f5);}return _0xe38ad4['json']();}async function fetchMyMemberships(_0x32eec7){const _0x5ec327=_0x3931,_0x499794={'QOjJB':function(_0x22d6d4){return _0x22d6d4();},'ScQzw':_0x5ec327(0xb8)},_0x3af277=_0x499794['QOjJB'](getApiBaseUrl),_0x179a0d=await fetch(_0x3af277+_0x5ec327(0xb2),{'method':_0x499794[_0x5ec327(0x89)],'headers':{'workos-token':_0x32eec7}});if(!_0x179a0d['ok']){const _0x575145=await _0x179a0d[_0x5ec327(0xba)]();throw new Error(_0x5ec327(0x85)+_0x179a0d['status']+'\x20'+_0x575145);}const _0x54f44a=await _0x179a0d[_0x5ec327(0x8b)]();return _0x54f44a['memberships'];}async function refreshTokenWithOrg(_0x234c96,_0x2473ed,_0x10ea8d){const _0x53ab84=_0x3931,_0x57e3b9={'dJebS':_0x53ab84(0xb3),'YAyqU':_0x53ab84(0xb0)},_0xda2126=await fetch(WORKOS_TOKEN_URL,{'method':_0x53ab84(0x9f),'headers':{'Content-Type':_0x57e3b9[_0x53ab84(0x99)]},'body':new URLSearchParams({'client_id':_0x234c96,'grant_type':_0x57e3b9[_0x53ab84(0x84)],'refresh_token':_0x2473ed,'organization_id':_0x10ea8d})});if(!_0xda2126['ok']){const _0x2810c1=await _0xda2126['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0xda2126['status']+'\x20'+_0x2810c1);}return _0xda2126[_0x53ab84(0x8b)]();}async function provisionCliToken(_0x2e6a89){const _0x55cc13=_0x3931,_0x58ec81={'ONaaB':function(_0x6df52c){return _0x6df52c();},'vyFzs':function(_0x5f2177,_0x2121e1,_0x3bb443){return _0x5f2177(_0x2121e1,_0x3bb443);}},_0x111f5b=_0x58ec81[_0x55cc13(0x88)](getApiBaseUrl),_0x3c814f=await _0x58ec81['vyFzs'](fetch,_0x111f5b+_0x55cc13(0xae),{'method':_0x55cc13(0x9f),'headers':{'Content-Type':'application/json','workos-token':_0x2e6a89}});if(!_0x3c814f['ok']){const _0x1e1030=await _0x3c814f['text']();throw new Error(_0x55cc13(0x7f)+_0x3c814f['status']+'\x20'+_0x1e1030);}return _0x3c814f['json']();}function _0x3931(_0x390fdf,_0x43543d){_0x390fdf=_0x390fdf-0x7b;const _0x2831de=_0x2831();let _0x39319e=_0x2831de[_0x390fdf];return _0x39319e;}export async function runDeviceAuthFlow(){const _0x3b758a=_0x3931,_0x2f0df4={'akzlz':function(_0x115e16){return _0x115e16();},'oMiPr':function(_0x5a8e9d,_0xb983c5){return _0x5a8e9d(_0xb983c5);},'AAWTJ':function(_0x2df227,_0xeabe15){return _0x2df227(_0xeabe15);},'duhwm':'Waiting\x20for\x20authentication...','gtsJf':function(_0xc29c14,_0x1d87f5,_0x480982,_0x1c4bd6,_0x15984d){return _0xc29c14(_0x1d87f5,_0x480982,_0x1c4bd6,_0x15984d);},'LFeIa':function(_0x2287a7,_0x27efac){return _0x2287a7(_0x27efac);},'yVIFy':function(_0x2506db,_0x36c3b4){return _0x2506db===_0x36c3b4;},'ReIIp':function(_0x19e239,_0x1c0b50){return _0x19e239===_0x1c0b50;},'fkdOs':function(_0xc3dc2,_0x203661){return _0xc3dc2+_0x203661;},'YnibS':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','vYLTg':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','CQGBU':'list','SfGxe':'selected','oJdFC':'Select\x20an\x20organization:','Eaume':function(_0x552024,_0x1f5e37,_0x1b0913,_0x4461f1){return _0x552024(_0x1f5e37,_0x1b0913,_0x4461f1);},'vOvgK':function(_0x171e31,_0x3345e9){return _0x171e31(_0x3345e9);},'SBzgt':function(_0x1aeb30,_0x4995ba){return _0x1aeb30(_0x4995ba);}},_0x307db8=_0x2f0df4['akzlz'](getCurrentEnvironment),_0x22bb50=ENVIRONMENT_CONFIGS[_0x307db8][_0x3b758a(0x8f)],_0x3f3a25=await _0x2f0df4[_0x3b758a(0x94)](requestDeviceCode,_0x22bb50);console[_0x3b758a(0xa9)]('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x3b758a(0xa9)](_0x3b758a(0xbb)),_0x2f0df4['AAWTJ'](openBrowser,_0x3f3a25[_0x3b758a(0x83)]),console[_0x3b758a(0xa9)](_0x3b758a(0x86)+_0x3f3a25[_0x3b758a(0x83)]),console['log']('Code:\x20'+_0x3f3a25[_0x3b758a(0xaa)]+'\x0a'),process[_0x3b758a(0xc8)][_0x3b758a(0xa6)](_0x2f0df4[_0x3b758a(0x9d)]);let _0x17801b=await _0x2f0df4['gtsJf'](pollForTokens,_0x22bb50,_0x3f3a25[_0x3b758a(0xa5)],_0x3f3a25['interval'],_0x3f3a25['expires_in']);console[_0x3b758a(0xa9)]('\x20✓');const _0x5c0cad=_0x2f0df4[_0x3b758a(0xbf)](decodeJwtPayload,_0x17801b[_0x3b758a(0x87)]);if(!_0x5c0cad['org_id']){const _0x5c6429=await _0x2f0df4['LFeIa'](fetchMyMemberships,_0x17801b['access_token']);let _0x41c845;if(_0x2f0df4[_0x3b758a(0xa2)](_0x5c6429['length'],0x0)){process['stdout'][_0x3b758a(0xa6)](_0x3b758a(0xc5));const _0x4d3c37=await selfServeSignup(_0x17801b['access_token']);_0x41c845=_0x4d3c37['organizationId'],console[_0x3b758a(0xa9)]('\x20✓');}else{if(_0x2f0df4[_0x3b758a(0x97)](_0x5c6429['length'],0x1))_0x41c845=_0x5c6429[0x0][_0x3b758a(0x96)],console['log']('Using\x20organization:\x20'+_0x5c6429[0x0][_0x3b758a(0xc7)]);else{const _0x56d496=process['stdin']['isTTY']&&process['stdout']['isTTY'];if(!_0x56d496)throw new Error(_0x2f0df4['fkdOs'](_0x2f0df4[_0x3b758a(0xb9)],_0x2f0df4['vYLTg']));const {selected:_0x463e30}=await _0x2bbbe0[_0x3b758a(0x98)]([{'type':_0x2f0df4['CQGBU'],'name':_0x2f0df4['SfGxe'],'message':_0x2f0df4[_0x3b758a(0xa4)],'choices':_0x5c6429[_0x3b758a(0x8a)](_0x4a5535=>({'name':_0x4a5535[_0x3b758a(0xc7)],'value':_0x4a5535['organizationId']}))}]);_0x41c845=_0x463e30;}}_0x17801b=await _0x2f0df4['Eaume'](refreshTokenWithOrg,_0x22bb50,_0x17801b[_0x3b758a(0xb0)],_0x41c845);}process[_0x3b758a(0xc8)][_0x3b758a(0xa6)]('Provisioning\x20CLI\x20token...');const _0x116beb=await provisionCliToken(_0x17801b[_0x3b758a(0x87)]);return console[_0x3b758a(0xa9)]('\x20✓'),await _0x2f0df4[_0x3b758a(0x91)](storeToken,_0x116beb['token']),_0x17801b[_0x3b758a(0xb0)]&&await _0x2f0df4['SBzgt'](storeRefreshToken,_0x17801b['refresh_token']),_0x116beb['token'];}function sleep(_0x5c31d5){return new Promise(_0x29d68f=>setTimeout(_0x29d68f,_0x5c31d5));}
|
|
1
|
+
const _0x3881a7=_0x1778;(function(_0x305205,_0x80ab5b){const _0x5b3fc4=_0x1778,_0x13ec55=_0x305205();while(!![]){try{const _0x46534b=-parseInt(_0x5b3fc4(0xe5))/0x1*(parseInt(_0x5b3fc4(0xee))/0x2)+parseInt(_0x5b3fc4(0xbf))/0x3*(parseInt(_0x5b3fc4(0xe1))/0x4)+-parseInt(_0x5b3fc4(0xbe))/0x5*(-parseInt(_0x5b3fc4(0xc9))/0x6)+-parseInt(_0x5b3fc4(0xd8))/0x7+-parseInt(_0x5b3fc4(0xcc))/0x8*(-parseInt(_0x5b3fc4(0xe3))/0x9)+parseInt(_0x5b3fc4(0xe9))/0xa+parseInt(_0x5b3fc4(0xf7))/0xb*(-parseInt(_0x5b3fc4(0xf2))/0xc);if(_0x46534b===_0x80ab5b)break;else _0x13ec55['push'](_0x13ec55['shift']());}catch(_0x574405){_0x13ec55['push'](_0x13ec55['shift']());}}}(_0x29e0,0x7be82));import{spawn}from'child_process';import _0x52b840 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x3881a7(0xf9);export async function requestDeviceCode(_0x1fb895){const _0x4fd852=_0x3881a7,_0x1ee71e=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':'POST','headers':{'Content-Type':_0x4fd852(0xb6)},'body':new URLSearchParams({'client_id':_0x1fb895})});if(!_0x1ee71e['ok']){const _0x270dfc=await _0x1ee71e['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x1ee71e[_0x4fd852(0xe7)]+'\x20'+_0x270dfc);}return _0x1ee71e['json']();}export async function pollForTokens(_0x4d8974,_0x1fac1c,_0x427174,_0x317704){const _0x1e6abd=_0x3881a7,_0x3723f0={'rEMRH':function(_0x53eb6a,_0x26d86d){return _0x53eb6a+_0x26d86d;},'DddpL':'urn:ietf:params:oauth:grant-type:device_code','rpNhu':_0x1e6abd(0xde),'ElGEW':function(_0x494646,_0x3da738){return _0x494646===_0x3da738;},'xthFr':'slow_down','RUEzI':_0x1e6abd(0xea),'BCbFZ':_0x1e6abd(0xaf)},_0x2c0dbd=_0x3723f0['rEMRH'](Date[_0x1e6abd(0xae)](),_0x317704*0x3e8);let _0x142fed=_0x427174*0x3e8;while(Date[_0x1e6abd(0xae)]()<_0x2c0dbd){await sleep(_0x142fed);const _0xa4ee6d=await fetch(WORKOS_TOKEN_URL,{'method':_0x1e6abd(0xb5),'headers':{'Content-Type':_0x1e6abd(0xb6)},'body':new URLSearchParams({'client_id':_0x4d8974,'device_code':_0x1fac1c,'grant_type':_0x3723f0['DddpL']})});if(_0xa4ee6d['ok'])return _0xa4ee6d[_0x1e6abd(0xba)]();const _0x46c5a5=await _0xa4ee6d[_0x1e6abd(0xba)]();if(_0x46c5a5[_0x1e6abd(0xbc)]===_0x3723f0[_0x1e6abd(0xda)])continue;if(_0x3723f0[_0x1e6abd(0xf6)](_0x46c5a5['error'],_0x3723f0['xthFr'])){_0x142fed+=0x3e8;continue;}throw new Error(_0x46c5a5[_0x1e6abd(0xdf)]||_0x46c5a5['error']||_0x3723f0[_0x1e6abd(0xc3)]);}throw new Error(_0x3723f0[_0x1e6abd(0xbd)]);}async function fetchUserProfile(_0x828e74){const _0x3b0c74=_0x3881a7,_0x108152={'vunft':function(_0x1e49eb,_0x231f10,_0x217f73){return _0x1e49eb(_0x231f10,_0x217f73);},'AgYfB':_0x3b0c74(0xd5)},_0x38ce46=getApiBaseUrl();try{const _0xa68b7=await _0x108152['vunft'](fetch,_0x38ce46+'/organization/me',{'method':_0x108152[_0x3b0c74(0xf4)],'headers':{'workos-token':_0x828e74}});if(_0xa68b7['ok'])return _0xa68b7[_0x3b0c74(0xba)]();}catch{}return null;}function buildKeyName(_0x5071c1,_0x48d84f){const _0x51478b=_0x3881a7,_0x5d35cc=_0x48d84f[_0x51478b(0xcd)](_0x42dd7f=>_0x42dd7f[_0x51478b(0xf3)]===_0x5071c1||_0x42dd7f['name'][_0x51478b(0xb0)](_0x5071c1+'\x20('));if(_0x5d35cc[_0x51478b(0xfa)]===0x0)return _0x5071c1;return _0x5071c1+'\x20('+(_0x5d35cc['length']+0x1)+')';}export async function provisionApiKey(_0xed3e53){const _0x3e98ef=_0x3881a7,_0x56764d={'dzigK':_0x3e98ef(0xe6),'VIPxV':function(_0x9ce346,_0x523de2){return _0x9ce346(_0x523de2);},'BXrHU':function(_0x5359c3,_0x1221b3,_0x53224){return _0x5359c3(_0x1221b3,_0x53224);},'GJtya':_0x3e98ef(0xca)},_0x4f2932=getApiBaseUrl(),_0x46c8d3={'Content-Type':_0x56764d[_0x3e98ef(0xfb)],'workos-token':_0xed3e53},_0x3720da=await _0x56764d['VIPxV'](fetchUserProfile,_0xed3e53),_0x186154=_0x3720da?.['firstName']||_0x3720da?.[_0x3e98ef(0xd7)]?.['split']('@')[0x0],_0x2f6a27=_0x186154?_0x186154+'\x27s\x20CLI\x20Key':_0x3e98ef(0xb2);let _0x1c3d74=[];try{const _0x546cc7=await _0x56764d['BXrHU'](fetch,_0x4f2932+'/api-keys',{'method':'GET','headers':_0x46c8d3});if(_0x546cc7['ok']){const _0x357491=await _0x546cc7[_0x3e98ef(0xba)]();_0x1c3d74=_0x357491['apiKeys'];}}catch{}const _0x52e47e=buildKeyName(_0x2f6a27,_0x1c3d74),_0x4c08dc=await fetch(_0x4f2932+_0x3e98ef(0xd1),{'method':'POST','headers':_0x46c8d3,'body':JSON[_0x3e98ef(0xe2)]({'name':_0x52e47e,'scope':_0x56764d[_0x3e98ef(0xf8)]})});if(!_0x4c08dc['ok']){const _0x1ac65b=await _0x4c08dc[_0x3e98ef(0xd0)]();throw new Error(_0x3e98ef(0xc1)+_0x4c08dc[_0x3e98ef(0xe7)]+'\x20'+_0x1ac65b);}const _0x1bc9e7=await _0x4c08dc[_0x3e98ef(0xba)]();return _0x1bc9e7['apiKey'][_0x3e98ef(0xc8)];}export function openBrowser(_0x229770){const _0x4a753a=_0x3881a7,_0x55a549={'HbFED':function(_0x5f6c6e,_0x45498d){return _0x5f6c6e===_0x45498d;},'ODHsD':_0x4a753a(0xed),'QsbGs':function(_0x4b0fd1,_0x5c0809,_0x196152,_0x1f823d){return _0x4b0fd1(_0x5c0809,_0x196152,_0x1f823d);},'tgATg':'ignore'};try{if(_0x55a549[_0x4a753a(0xf0)](process['platform'],_0x4a753a(0xdb))){const _0x18841e=spawn('cmd',['/c',_0x4a753a(0xd4),'',_0x229770],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x18841e['unref']();return;}const _0xe9bb5b=process['platform']==='darwin'?_0x55a549['ODHsD']:_0x4a753a(0xcb),_0x3de18c=_0x55a549['QsbGs'](spawn,_0xe9bb5b,[_0x229770],{'detached':!![],'stdio':_0x55a549[_0x4a753a(0xe4)]});_0x3de18c['unref']();}catch{}}function _0x1778(_0x95d83e,_0x1afe64){_0x95d83e=_0x95d83e-0xae;const _0x29e097=_0x29e0();let _0x177896=_0x29e097[_0x95d83e];return _0x177896;}function decodeJwtPayload(_0x256286){const _0x1cc30d=_0x3881a7,_0x23a780={'WeovI':_0x1cc30d(0xb3),'IZOJY':_0x1cc30d(0xf5)},_0x4ea615=_0x256286[_0x1cc30d(0xce)]('.');if(_0x4ea615[_0x1cc30d(0xfa)]!==0x3)throw new Error(_0x1cc30d(0xef));const _0x5544ad=Buffer['from'](_0x4ea615[0x1],_0x23a780['WeovI'])['toString'](_0x23a780[_0x1cc30d(0xd2)]);return JSON['parse'](_0x5544ad);}function _0x29e0(){const _0x51c62d=['stdout','open','160462VzvJNE','Invalid\x20JWT\x20format','HbFED','jVxHZ','144quWvIg','name','AgYfB','utf-8','ElGEW','156222PZdLHg','GJtya','https://api.workos.com/user_management/authenticate','length','dzigK','Failed\x20to\x20fetch\x20memberships:\x20','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','now','Device\x20authorization\x20timed\x20out','startsWith','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','CLI\x20Key','base64url','Code:\x20','POST','application/x-www-form-urlencoded','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','map','access_token','json','RPHoQ','error','BCbFZ','123405ujGEPD','333267xEOBYz','rlEaa','Failed\x20to\x20provision\x20API\x20key:\x20','ZdQjs','RUEzI','expires_in','workosClientId','memberships','user_code','token','216vszgNp','mcp:write','xdg-open','5271584pXrnly','filter','split','isTTY','text','/api-keys','IZOJY','Failed\x20to\x20create\x20organization:\x20','start','GET','refresh_token','email','2163707PoFFJn','organizationId','rpNhu','win32','write','log','authorization_pending','error_description','/organization/my-memberships','4NKPJzH','stringify','9iZcVVI','tgATg','12ToFdzn','application/json','status','IIPJo','2912660MzqKrE','Authentication\x20failed','kGyvd'];_0x29e0=function(){return _0x51c62d;};return _0x29e0();}async function selfServeSignup(_0xbbd0b6){const _0x2e72ac=_0x3881a7,_0xaa4e6e=getApiBaseUrl(),_0x41d20a=await fetch(_0xaa4e6e+'/organization/self-serve-signup',{'method':_0x2e72ac(0xb5),'headers':{'Content-Type':_0x2e72ac(0xe6),'workos-token':_0xbbd0b6}});if(!_0x41d20a['ok']){const _0x5a4b0f=await _0x41d20a['text']();throw new Error(_0x2e72ac(0xd3)+_0x41d20a[_0x2e72ac(0xe7)]+'\x20'+_0x5a4b0f);}return _0x41d20a['json']();}async function fetchMyMemberships(_0x9f0f5d){const _0x2ae864=_0x3881a7,_0x1bdc58={'CYQXx':function(_0x158aff){return _0x158aff();},'IIPJo':_0x2ae864(0xd5)},_0x4910ff=_0x1bdc58['CYQXx'](getApiBaseUrl),_0x301507=await fetch(_0x4910ff+_0x2ae864(0xe0),{'method':_0x1bdc58[_0x2ae864(0xe8)],'headers':{'workos-token':_0x9f0f5d}});if(!_0x301507['ok']){const _0x5665e4=await _0x301507[_0x2ae864(0xd0)]();throw new Error(_0x2ae864(0xfc)+_0x301507['status']+'\x20'+_0x5665e4);}const _0x5f1087=await _0x301507['json']();return _0x5f1087[_0x2ae864(0xc6)];}async function refreshTokenWithOrg(_0x35339c,_0x5888d3,_0x1714eb){const _0x28937c=_0x3881a7,_0x3f59a7={'tFMgM':function(_0x174acd,_0x334d66,_0x546dc8){return _0x174acd(_0x334d66,_0x546dc8);},'uPzXH':_0x28937c(0xb6)},_0x53280a=await _0x3f59a7['tFMgM'](fetch,WORKOS_TOKEN_URL,{'method':_0x28937c(0xb5),'headers':{'Content-Type':_0x3f59a7['uPzXH']},'body':new URLSearchParams({'client_id':_0x35339c,'grant_type':_0x28937c(0xd6),'refresh_token':_0x5888d3,'organization_id':_0x1714eb})});if(!_0x53280a['ok']){const _0x5c78a7=await _0x53280a[_0x28937c(0xd0)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x53280a['status']+'\x20'+_0x5c78a7);}return _0x53280a[_0x28937c(0xba)]();}async function provisionCliToken(_0x358a3a){const _0x1592f8=_0x3881a7,_0x1437e7={'AmByq':'POST'},_0x245b1c=getApiBaseUrl(),_0x57cbdb=await fetch(_0x245b1c+'/cli-auth/token',{'method':_0x1437e7['AmByq'],'headers':{'Content-Type':_0x1592f8(0xe6),'workos-token':_0x358a3a}});if(!_0x57cbdb['ok']){const _0x554456=await _0x57cbdb['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x57cbdb['status']+'\x20'+_0x554456);}return _0x57cbdb[_0x1592f8(0xba)]();}export async function runDeviceAuthFlow(){const _0x1b3b00=_0x3881a7,_0x11d3db={'kGyvd':_0x1b3b00(0xb7),'JlUlk':function(_0x24b3c3,_0x5a0688,_0x3402d0,_0x8ee318,_0x1ef6ba){return _0x24b3c3(_0x5a0688,_0x3402d0,_0x8ee318,_0x1ef6ba);},'ZdQjs':function(_0x5d2f81,_0xc3cfaa){return _0x5d2f81(_0xc3cfaa);},'bzWEV':function(_0x4de08b,_0x51d78d){return _0x4de08b+_0x51d78d;},'SGPbR':_0x1b3b00(0xfd),'jVxHZ':'list','rlEaa':'selected','DVaQE':function(_0x14fc46,_0x353e89,_0x5829d,_0x47106b){return _0x14fc46(_0x353e89,_0x5829d,_0x47106b);},'RPHoQ':function(_0x1b92a0,_0x12b8ac){return _0x1b92a0(_0x12b8ac);}},_0x951211=getCurrentEnvironment(),_0x12d4ff=ENVIRONMENT_CONFIGS[_0x951211][_0x1b3b00(0xc5)],_0x19197d=await requestDeviceCode(_0x12d4ff);console['log'](_0x1b3b00(0xb1)),console[_0x1b3b00(0xdd)](_0x11d3db[_0x1b3b00(0xeb)]),openBrowser(_0x19197d['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x19197d['verification_uri_complete']),console['log'](_0x1b3b00(0xb4)+_0x19197d[_0x1b3b00(0xc7)]+'\x0a'),process['stdout']['write']('Waiting\x20for\x20authentication...');let _0x1056ab=await _0x11d3db['JlUlk'](pollForTokens,_0x12d4ff,_0x19197d['device_code'],_0x19197d['interval'],_0x19197d[_0x1b3b00(0xc4)]);console[_0x1b3b00(0xdd)]('\x20✓');const _0x114e5f=decodeJwtPayload(_0x1056ab[_0x1b3b00(0xb9)]);if(!_0x114e5f['org_id']){const _0x418839=await fetchMyMemberships(_0x1056ab['access_token']);let _0x4571a4;if(_0x418839['length']===0x0){process[_0x1b3b00(0xec)][_0x1b3b00(0xdc)]('Setting\x20up\x20your\x20organization...');const _0x1afac2=await _0x11d3db[_0x1b3b00(0xc2)](selfServeSignup,_0x1056ab['access_token']);_0x4571a4=_0x1afac2[_0x1b3b00(0xd9)],console['log']('\x20✓');}else{if(_0x418839['length']===0x1)_0x4571a4=_0x418839[0x0]['organizationId'],console['log']('Using\x20organization:\x20'+_0x418839[0x0]['name']);else{const _0x4735f0=process['stdin'][_0x1b3b00(0xcf)]&&process['stdout']['isTTY'];if(!_0x4735f0)throw new Error(_0x11d3db['bzWEV'](_0x11d3db['SGPbR'],'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.'));const {selected:_0x263edf}=await _0x52b840['prompt']([{'type':_0x11d3db[_0x1b3b00(0xf1)],'name':_0x11d3db[_0x1b3b00(0xc0)],'message':'Select\x20an\x20organization:','choices':_0x418839[_0x1b3b00(0xb8)](_0x23564c=>({'name':_0x23564c[_0x1b3b00(0xf3)],'value':_0x23564c[_0x1b3b00(0xd9)]}))}]);_0x4571a4=_0x263edf;}}_0x1056ab=await _0x11d3db['DVaQE'](refreshTokenWithOrg,_0x12d4ff,_0x1056ab['refresh_token'],_0x4571a4);}process[_0x1b3b00(0xec)][_0x1b3b00(0xdc)]('Provisioning\x20CLI\x20token...');const _0x3dade0=await _0x11d3db[_0x1b3b00(0xbb)](provisionCliToken,_0x1056ab[_0x1b3b00(0xb9)]);return console['log']('\x20✓'),await storeToken(_0x3dade0['token']),_0x1056ab[_0x1b3b00(0xd6)]&&await storeRefreshToken(_0x1056ab[_0x1b3b00(0xd6)]),_0x3dade0['token'];}function sleep(_0x5e2baf){return new Promise(_0x279c30=>setTimeout(_0x279c30,_0x5e2baf));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x38f77e=_0x1184;(function(_0x87bb23,_0xd91c93){const _0x1ff649=_0x1184,_0x2ab716=_0x87bb23();while(!![]){try{const _0x51112f=-parseInt(_0x1ff649(0x1d7))/0x1+parseInt(_0x1ff649(0x1d5))/0x2+parseInt(_0x1ff649(0x1cc))/0x3*(parseInt(_0x1ff649(0x1d1))/0x4)+parseInt(_0x1ff649(0x1bf))/0x5+parseInt(_0x1ff649(0x1d8))/0x6+parseInt(_0x1ff649(0x1c1))/0x7*(parseInt(_0x1ff649(0x1c4))/0x8)+-parseInt(_0x1ff649(0x1be))/0x9;if(_0x51112f===_0xd91c93)break;else _0x2ab716['push'](_0x2ab716['shift']());}catch(_0x4257c0){_0x2ab716['push'](_0x2ab716['shift']());}}}(_0x57f0,0xe0c08));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x38f77e(0x1cb),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':_0x38f77e(0x1d4),'aiProxyUrl':'https://ai-proxy-301751771437.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x38f77e(0x1ca),'mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT=_0x38f77e(0x1bd);export function isValidEnvironment(_0x59a1c7){const _0x5f47bd=_0x38f77e,_0x5da57e={'Zprkt':function(_0x26a2cf,_0x5ca4db){return _0x26a2cf===_0x5ca4db;},'xekxo':function(_0x1c1cac,_0xfa262){return _0x1c1cac===_0xfa262;},'EQCVV':'staging','iMfvW':function(_0x4cb3a0,_0x4f6cdc){return _0x4cb3a0===_0x4f6cdc;},'DgkNn':'local'};return _0x5da57e['Zprkt'](_0x59a1c7,'prod')||_0x5da57e['xekxo'](_0x59a1c7,_0x5da57e[_0x5f47bd(0x1c0)])||_0x5da57e[_0x5f47bd(0x1c5)](_0x59a1c7,_0x5da57e['DgkNn']);}export function getCurrentEnvironment(){const _0x3a71ab=_0x38f77e,_0x4edd6d={'GJflh':function(_0x4ce03d,_0x43aa6e){return _0x4ce03d(_0x43aa6e);}},_0x61068e=process[_0x3a71ab(0x1bc)][_0x3a71ab(0x1d3)];if(_0x61068e&&_0x4edd6d[_0x3a71ab(0x1c2)](isValidEnvironment,_0x61068e))return _0x61068e;return DEFAULT_ENVIRONMENT;}function _0x57f0(){const _0x3f8011=['364tdnxyp','GJflh','RANGER_DISABLE_MCP','101256HixpON','iMfvW','osjdv','RANGER_USE_NOVA_ACT','nova-act-cli','RANGER_TRANSPORT','http://localhost:8090','client_01J9CBYM7M5ZETCF7G6614DXR2','1806BFbjji','RANGER_MCP_AUTH_URL','mcp','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli.','true','2636oUUgYw','apiBaseUrl','RANGER_CLI_ENV','client_01J9CBYM2DKWV9HM17D95Z540K','819048Tftkto','mcpAuthUrl','1186374psjxTE','3804372WDfTJw','env','prod','902970ANCiMY','544100XyShvL','EQCVV'];_0x57f0=function(){return _0x3f8011;};return _0x57f0();}export function getApiBaseUrl(){const _0x2cb57a=_0x38f77e,_0x4b1506={'ePpCg':function(_0x33c468){return _0x33c468();}};return ENVIRONMENT_CONFIGS[_0x4b1506['ePpCg'](getCurrentEnvironment)][_0x2cb57a(0x1d2)];}function _0x1184(_0x306670,_0x2c9ac5){_0x306670=_0x306670-0x1bc;const _0x57f0c1=_0x57f0();let _0x118471=_0x57f0c1[_0x306670];return _0x118471;}export function getAiProxyUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0xf968f2=_0x38f77e;return process[_0xf968f2(0x1bc)][_0xf968f2(0x1cd)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0xf968f2(0x1d6)];}export function isByokEnabled(){const _0x2252ae=_0x38f77e,_0x5906fb={'osjdv':_0x2252ae(0x1d0)};return process[_0x2252ae(0x1bc)]['RANGER_BYOK']===_0x5906fb[_0x2252ae(0x1c6)];}function isVerificationTransport(_0x917dcf){const _0x15da1f=_0x38f77e,_0x25d83b={'bAhuY':'mcp','IcucP':function(_0x152a4b,_0x1fd6e7){return _0x152a4b===_0x1fd6e7;},'qptry':function(_0x3f126b,_0x3f9066){return _0x3f126b===_0x3f9066;}};return _0x917dcf===_0x25d83b['bAhuY']||_0x25d83b['IcucP'](_0x917dcf,'playwright-cli')||_0x25d83b['qptry'](_0x917dcf,_0x15da1f(0x1c8));}const LEGACY_TRANSPORT_ENV_VARS=[_0x38f77e(0x1c7),_0x38f77e(0x1c3)];export function getVerificationTransport(){const _0x3bdbe1=_0x38f77e,_0x1c9f7d=process[_0x3bdbe1(0x1bc)][_0x3bdbe1(0x1c9)]?.['trim']();if(_0x1c9f7d){if(isVerificationTransport(_0x1c9f7d))return _0x1c9f7d;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x1c9f7d+_0x3bdbe1(0x1cf));}const _0x3addaa=LEGACY_TRANSPORT_ENV_VARS['find'](_0x10825c=>process['env'][_0x10825c]);if(_0x3addaa)throw new Error(_0x3addaa+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20or\x20RANGER_TRANSPORT=nova-act-cli.');return _0x3bdbe1(0x1ce);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xb2b246,_0x58c01d){const _0xb7f1de=_0x42f3,_0x4d6c5f=_0xb2b246();while(!![]){try{const _0x3576c2=parseInt(_0xb7f1de(0x140))/0x1+parseInt(_0xb7f1de(0x143))/0x2*(parseInt(_0xb7f1de(0x157))/0x3)+parseInt(_0xb7f1de(0x135))/0x4*(parseInt(_0xb7f1de(0x154))/0x5)+-parseInt(_0xb7f1de(0x14d))/0x6+-parseInt(_0xb7f1de(0x14c))/0x7+parseInt(_0xb7f1de(0x15e))/0x8+-parseInt(_0xb7f1de(0x134))/0x9;if(_0x3576c2===_0x58c01d)break;else _0x4d6c5f['push'](_0x4d6c5f['shift']());}catch(_0x4a1092){_0x4d6c5f['push'](_0x4d6c5f['shift']());}}}(_0x22e8,0xe2329));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x42f3(_0x17db48,_0x3bfa0b){_0x17db48=_0x17db48-0x133;const _0x22e852=_0x22e8();let _0x42f3a0=_0x22e852[_0x17db48];return _0x42f3a0;}import{withRetry}from'./retry.js';export async function createFeature(_0x53944b){const _0x26c1f8=_0x42f3,_0x4bc92e={'LQQaK':function(_0x298c35){return _0x298c35();},'JbnYc':_0x26c1f8(0x14b),'lACPL':_0x26c1f8(0x172)},_0x187ebe=await _0x4bc92e['LQQaK'](getToken);if(!_0x187ebe)throw new Error(_0x26c1f8(0x16d));const _0x285200=_0x4bc92e[_0x26c1f8(0x166)](getApiBaseUrl),_0x4ac37b=await fetch(_0x285200+_0x26c1f8(0x15c),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x187ebe,'Content-Type':'application/json'},'body':JSON[_0x26c1f8(0x13e)](_0x53944b)});if(!_0x4ac37b['ok']){if(_0x4ac37b[_0x26c1f8(0x173)]===0x192){const _0x47a3d1=await _0x4ac37b[_0x26c1f8(0x13a)](),_0xa816a8=_0x47a3d1[_0x26c1f8(0x14e)]||_0x4bc92e['JbnYc'];throw new Error((_0x47a3d1[_0x26c1f8(0x145)]||_0x4bc92e['lACPL'])+_0x26c1f8(0x163)+_0xa816a8);}const _0x25f06e=await _0x4ac37b[_0x26c1f8(0x153)]();throw new Error(_0x26c1f8(0x158)+_0x25f06e);}return _0x4ac37b[_0x26c1f8(0x13a)]();}export async function listFeatures(_0x4ae37f){const _0xb04675=_0x42f3,_0x491e8e={'AGctk':function(_0x1b3503){return _0x1b3503();},'vZJli':_0xb04675(0x16d),'PzzAo':'limit','RxRYy':'offset','JszOF':'includeDeleted','QWnIZ':_0xb04675(0x17e)},_0x49a486=await _0x491e8e['AGctk'](getToken);if(!_0x49a486)throw new Error(_0x491e8e['vZJli']);const _0x180044=getApiBaseUrl(),_0xd000c1=new URLSearchParams();if(_0x4ae37f?.['gitRepoUrl'])_0xd000c1[_0xb04675(0x180)](_0xb04675(0x160),_0x4ae37f['gitRepoUrl']);if(_0x4ae37f?.[_0xb04675(0x16b)])_0xd000c1[_0xb04675(0x180)](_0xb04675(0x16b),_0x4ae37f[_0xb04675(0x16b)]);if(_0x4ae37f?.[_0xb04675(0x176)])_0xd000c1['set'](_0x491e8e[_0xb04675(0x136)],_0x4ae37f[_0xb04675(0x176)][_0xb04675(0x181)]());if(_0x4ae37f?.[_0xb04675(0x16a)])_0xd000c1['set'](_0x491e8e['RxRYy'],_0x4ae37f['offset'][_0xb04675(0x181)]());if(_0x4ae37f?.[_0xb04675(0x17f)])_0xd000c1['set'](_0x491e8e['JszOF'],_0xb04675(0x138));const _0x4b840e=_0x180044+_0xb04675(0x15c)+(_0xd000c1['toString']()?'?'+_0xd000c1[_0xb04675(0x181)]():''),_0x5847dd=await fetch(_0x4b840e,{'method':_0x491e8e[_0xb04675(0x15b)],'headers':{'Authorization':_0xb04675(0x13c)+_0x49a486}});if(!_0x5847dd['ok']){const _0x599f95=await _0x5847dd[_0xb04675(0x153)]();throw new Error(_0xb04675(0x17b)+_0x599f95);}return _0x5847dd[_0xb04675(0x13a)]();}function _0x22e8(){const _0xb4cc48=['Failed\x20to\x20start\x20session:\x20','gzaEE','LQQaK','Failed\x20to\x20update\x20scenario:\x20','application/json','/checklist/','offset','gitBranch','gpzhK','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','/sessions/','Failed\x20to\x20get\x20item\x20feedback:\x20','/action-items','lZMDv','Feature\x20limit\x20exceeded','status','ncuTJ','MpHox','limit','/checklist','quCEN','SELLz','sessionId','Failed\x20to\x20list\x20feature\x20reviews:\x20','itemIds','join','GET','includeDeleted','set','toString','uGqoZ','style','7256079EIcWMC','4mjJRQf','PzzAo','gynYd','true','/report/markdown','json','DgJrl','Bearer\x20','/conclude','stringify','Failed\x20to\x20create\x20scenario:\x20','802323JvcZVC','/api/v1/mcp/features/','DELETE','2341384qkcRjm','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','message','TwEyP','Failed\x20to\x20get\x20action\x20items:\x20','rhTJn','aaNYy','POST','https://dashboard.ranger.net/billing','5781027xpvrGZ','7177158hXPjVK','billingUrl','JySgH','rmXhP','xAesE','AUQwj','text','2748310WCgTyQ','AvdlY','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','3xcjWUs','Failed\x20to\x20create\x20feature\x20review:\x20','NDUMx','wVPtY','QWnIZ','/api/v1/mcp/features','QKfdW','9856904OKhZSS','fxbxl','gitRepoUrl','Failed\x20to\x20delete\x20feature\x20review:\x20','VGCuP','\x0a\x0aUpgrade\x20your\x20plan:\x20'];_0x22e8=function(){return _0xb4cc48;};return _0x22e8();}export async function getFeature(_0x14e3a6){const _0x189293=_0x42f3,_0x3b560a={'VGCuP':function(_0x5cd035){return _0x5cd035();},'AbWXH':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','rmXhP':function(_0x141e9d){return _0x141e9d();},'WWDxs':function(_0x3b43c3,_0x31f169,_0x38be2e){return _0x3b43c3(_0x31f169,_0x38be2e);},'QKfdW':_0x189293(0x17e)},_0x1aee73=await _0x3b560a[_0x189293(0x162)](getToken);if(!_0x1aee73)throw new Error(_0x3b560a['AbWXH']);const _0x2f2c7b=_0x3b560a[_0x189293(0x150)](getApiBaseUrl),_0x25b1eb=await _0x3b560a['WWDxs'](fetch,_0x2f2c7b+'/api/v1/mcp/features/'+_0x14e3a6,{'method':_0x3b560a[_0x189293(0x15d)],'headers':{'Authorization':'Bearer\x20'+_0x1aee73}});if(!_0x25b1eb['ok']){const _0x5dc283=await _0x25b1eb[_0x189293(0x153)]();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x5dc283);}return _0x25b1eb[_0x189293(0x13a)]();}export async function updateFeature(_0x21a04c,_0x38409f){const _0x1fe993=_0x42f3,_0x583d2d={'DgJrl':function(_0x2e68ed){return _0x2e68ed();},'EYaWc':function(_0x15edf6,_0x4be230,_0x1f82a1){return _0x15edf6(_0x4be230,_0x1f82a1);}},_0x219d3c=await _0x583d2d[_0x1fe993(0x13b)](getToken);if(!_0x219d3c)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2fe94c=_0x583d2d['DgJrl'](getApiBaseUrl),_0x1dd95c=await _0x583d2d['EYaWc'](fetch,_0x2fe94c+_0x1fe993(0x141)+_0x21a04c,{'method':'PATCH','headers':{'Authorization':_0x1fe993(0x13c)+_0x219d3c,'Content-Type':'application/json'},'body':JSON['stringify'](_0x38409f)});if(!_0x1dd95c['ok']){const _0x3424df=await _0x1dd95c['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x3424df);}return _0x1dd95c[_0x1fe993(0x13a)]();}export async function createChecklistItem(_0x1a9bc9,_0x53650e,_0x4d8162){const _0x457d0a=_0x42f3,_0x1e474e={'uGqoZ':_0x457d0a(0x16d),'aaNYy':function(_0x33dca9){return _0x33dca9();},'kHpCG':'application/json'},_0x5bef29=await getToken();if(!_0x5bef29)throw new Error(_0x1e474e[_0x457d0a(0x182)]);const _0xc2bb25=_0x1e474e[_0x457d0a(0x149)](getApiBaseUrl),_0x32dc33=await fetch(_0xc2bb25+_0x457d0a(0x141)+_0x1a9bc9+_0x457d0a(0x177),{'method':'POST','headers':{'Authorization':_0x457d0a(0x13c)+_0x5bef29,'Content-Type':_0x1e474e['kHpCG']},'body':JSON[_0x457d0a(0x13e)]({'description':_0x53650e,'position':_0x4d8162})});if(!_0x32dc33['ok']){const _0x49d50c=await _0x32dc33['text']();throw new Error(_0x457d0a(0x13f)+_0x49d50c);}return _0x32dc33[_0x457d0a(0x13a)]();}export async function updateChecklistItem(_0x90bcad,_0x491b9f,_0x4f5266){const _0x39c1e7=_0x42f3,_0x532c5b={'LOXMK':function(_0x5252b6){return _0x5252b6();},'UTBbN':_0x39c1e7(0x16d),'SELLz':'PATCH','lZMDv':_0x39c1e7(0x168),'vjlIT':'updateChecklistItem'};return withRetry(async()=>{const _0x22df1c=_0x39c1e7,_0x50f9c4=await _0x532c5b['LOXMK'](getToken);if(!_0x50f9c4)throw new Error(_0x532c5b['UTBbN']);const _0x1530be=getApiBaseUrl(),_0x2c236d=await fetch(_0x1530be+'/api/v1/mcp/features/'+_0x90bcad+_0x22df1c(0x169)+_0x491b9f,{'method':_0x532c5b[_0x22df1c(0x179)],'headers':{'Authorization':_0x22df1c(0x13c)+_0x50f9c4,'Content-Type':_0x532c5b[_0x22df1c(0x171)]},'body':JSON[_0x22df1c(0x13e)](_0x4f5266)});if(!_0x2c236d['ok']){const _0x3606a2=await _0x2c236d['text']();throw new Error(_0x22df1c(0x167)+_0x3606a2);}return _0x2c236d['json']();},{'label':_0x532c5b['vjlIT']});}export async function getFeatureReport(_0xdc50d6){const _0x4d9b91=_0x42f3,_0x1c0684={'XcUhb':_0x4d9b91(0x17e)},_0x50cac1=await getToken();if(!_0x50cac1)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x18aa04=getApiBaseUrl(),_0x4cebfb=await fetch(_0x18aa04+_0x4d9b91(0x141)+_0xdc50d6+'/report',{'method':_0x1c0684['XcUhb'],'headers':{'Authorization':_0x4d9b91(0x13c)+_0x50cac1}});if(!_0x4cebfb['ok']){const _0x201293=await _0x4cebfb['text']();throw new Error(_0x4d9b91(0x156)+_0x201293);}return _0x4cebfb['json']();}export async function getFeatureReportMarkdown(_0x370864,_0xa21a){const _0x194b8f=_0x42f3,_0x108bfb={'AvdlY':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','NDUMx':function(_0x3b9bae){return _0x3b9bae();},'wVPtY':_0x194b8f(0x17c),'VXNeh':'sessionId','TwEyP':function(_0x2a3824,_0x4d8c76){return _0x2a3824&&_0x4d8c76;},'TPunL':_0x194b8f(0x17e)},_0x13c48d=await getToken();if(!_0x13c48d)throw new Error(_0x108bfb[_0x194b8f(0x155)]);const _0x5654a7=_0x108bfb[_0x194b8f(0x159)](getApiBaseUrl),_0x17462f=new URLSearchParams(),_0xf10c9f=(_0xa21a?.[_0x194b8f(0x17c)]?.['length']??0x0)>0x0,_0x3d2d43=Boolean(_0xa21a?.[_0x194b8f(0x17a)]);_0xf10c9f&&_0xa21a?.['itemIds']&&_0x17462f['set'](_0x108bfb[_0x194b8f(0x15a)],_0xa21a[_0x194b8f(0x17c)][_0x194b8f(0x17d)](','));_0x3d2d43&&_0xa21a?.['sessionId']&&_0x17462f[_0x194b8f(0x180)](_0x108bfb['VXNeh'],_0xa21a[_0x194b8f(0x17a)]);_0x108bfb[_0x194b8f(0x146)](!_0xf10c9f,!_0x3d2d43)&&_0xa21a?.[_0x194b8f(0x133)]&&_0x17462f['set']('style',_0xa21a[_0x194b8f(0x133)]);const _0x31c65e=_0x5654a7+'/api/v1/mcp/features/'+_0x370864+_0x194b8f(0x139),_0x5b5c8b=''+_0x31c65e+(_0x17462f[_0x194b8f(0x181)]()?'?'+_0x17462f['toString']():''),_0x3c83d0=await fetch(_0x5b5c8b,{'method':_0x108bfb['TPunL'],'headers':{'Authorization':_0x194b8f(0x13c)+_0x13c48d}});if(!_0x3c83d0['ok']){const _0x2d9c43=await _0x3c83d0['text']();throw new Error(_0x194b8f(0x144)+_0x2d9c43);}return _0x3c83d0['text']();}export async function listFeatureSessions(_0x45267e){const _0x556560=_0x42f3,_0x4f34a2={'AxqzE':function(_0x77179a){return _0x77179a();},'NGqLQ':_0x556560(0x16d)},_0x33edfc=await _0x4f34a2['AxqzE'](getToken);if(!_0x33edfc)throw new Error(_0x4f34a2['NGqLQ']);const _0x11724e=getApiBaseUrl(),_0x52bc13=await fetch(_0x11724e+'/api/v1/mcp/features/'+_0x45267e+'/sessions',{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x33edfc}});if(!_0x52bc13['ok']){const _0x3ad2de=await _0x52bc13['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x3ad2de);}return _0x52bc13['json']();}export async function startSession(_0x2594bc,_0x1a807c){const _0x5bcc77=_0x42f3,_0x2ace68={'sfGIz':_0x5bcc77(0x16d),'KKQxe':_0x5bcc77(0x14a)},_0x3168ef=await getToken();if(!_0x3168ef)throw new Error(_0x2ace68['sfGIz']);const _0x5516ff=getApiBaseUrl(),_0x4ff6b7=await fetch(_0x5516ff+_0x5bcc77(0x141)+_0x2594bc+'/sessions/'+_0x1a807c+'/start',{'method':_0x2ace68['KKQxe'],'headers':{'Authorization':'Bearer\x20'+_0x3168ef}});if(!_0x4ff6b7['ok']){const _0x477890=await _0x4ff6b7['text']();throw new Error(_0x5bcc77(0x164)+_0x477890);}return _0x4ff6b7['json']();}export async function concludeSession(_0x4eef90,_0x308832){const _0x14ae25=_0x42f3,_0x104c98={'ncuTJ':function(_0x3170e0){return _0x3170e0();}},_0x4cd95b=await _0x104c98[_0x14ae25(0x174)](getToken);if(!_0x4cd95b)throw new Error(_0x14ae25(0x16d));const _0x168ef1=getApiBaseUrl(),_0x1c38cf=await fetch(_0x168ef1+_0x14ae25(0x141)+_0x4eef90+_0x14ae25(0x16e)+_0x308832+_0x14ae25(0x13d),{'method':_0x14ae25(0x14a),'headers':{'Authorization':_0x14ae25(0x13c)+_0x4cd95b}});if(!_0x1c38cf['ok']){const _0x592d3f=await _0x1c38cf[_0x14ae25(0x153)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x592d3f);}return _0x1c38cf[_0x14ae25(0x13a)]();}export async function getActionItems(_0x4230ce){const _0x5dfa88=_0x42f3,_0x70a29c={'JySgH':function(_0x52837c){return _0x52837c();},'fxbxl':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','bzTie':function(_0x43a78d,_0xbc1f1a,_0x4ea1ba){return _0x43a78d(_0xbc1f1a,_0x4ea1ba);}},_0x365014=await _0x70a29c[_0x5dfa88(0x14f)](getToken);if(!_0x365014)throw new Error(_0x70a29c[_0x5dfa88(0x15f)]);const _0x365d17=_0x70a29c['JySgH'](getApiBaseUrl),_0x47437f=await _0x70a29c['bzTie'](fetch,_0x365d17+_0x5dfa88(0x141)+_0x4230ce+_0x5dfa88(0x170),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x365014}});if(!_0x47437f['ok']){const _0x434198=await _0x47437f[_0x5dfa88(0x153)]();throw new Error(_0x5dfa88(0x147)+_0x434198);}return _0x47437f['json']();}export async function getItemFeedback(_0x23b5db,_0x9fc221){const _0xa289ec=_0x42f3,_0x459cb9={'RCmFL':_0xa289ec(0x16d),'SoVqL':'GET'},_0x3956f0=await getToken();if(!_0x3956f0)throw new Error(_0x459cb9['RCmFL']);const _0x4aef82=getApiBaseUrl(),_0x58eafb=await fetch(_0x4aef82+'/api/v1/mcp/features/'+_0x23b5db+'/checklist-items/'+_0x9fc221+'/feedback',{'method':_0x459cb9['SoVqL'],'headers':{'Authorization':'Bearer\x20'+_0x3956f0}});if(!_0x58eafb['ok']){const _0x62d66=await _0x58eafb['text']();throw new Error(_0xa289ec(0x16f)+_0x62d66);}return _0x58eafb['json']();}export async function markCommentsAddressed(_0x5a536f,_0x43d212,_0x1db4d5){const _0x2ec776=_0x42f3,_0x3c3e2e={'gynYd':function(_0x41e55b){return _0x41e55b();},'rhTJn':function(_0x15a913,_0x3b5914,_0x288686){return _0x15a913(_0x3b5914,_0x288686);},'xAesE':_0x2ec776(0x14a),'jdlsF':_0x2ec776(0x168)},_0x58b9cc=await getToken();if(!_0x58b9cc)throw new Error(_0x2ec776(0x16d));const _0x550a7e=_0x3c3e2e[_0x2ec776(0x137)](getApiBaseUrl),_0x2bc797=await _0x3c3e2e[_0x2ec776(0x148)](fetch,_0x550a7e+'/api/v1/mcp/features/'+_0x5a536f+'/comments/address',{'method':_0x3c3e2e[_0x2ec776(0x151)],'headers':{'Authorization':_0x2ec776(0x13c)+_0x58b9cc,'Content-Type':_0x3c3e2e['jdlsF']},'body':JSON[_0x2ec776(0x13e)]({'checklistItemId':_0x43d212,'commentIds':_0x1db4d5})});if(!_0x2bc797['ok']){const _0x4eb725=await _0x2bc797['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x4eb725);}}export async function softDeleteFeature(_0x5a310e){const _0x55675b=_0x42f3,_0x9c540f={'MpHox':function(_0x2bdd1b){return _0x2bdd1b();},'gpzhK':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','NIhVJ':function(_0x452551){return _0x452551();},'AUQwj':function(_0x3bb6f3,_0x51924b,_0x2d442b){return _0x3bb6f3(_0x51924b,_0x2d442b);},'quCEN':_0x55675b(0x142)},_0x3cc7dd=await _0x9c540f[_0x55675b(0x175)](getToken);if(!_0x3cc7dd)throw new Error(_0x9c540f[_0x55675b(0x16c)]);const _0x5a3669=_0x9c540f['NIhVJ'](getApiBaseUrl),_0x5c2112=await _0x9c540f[_0x55675b(0x152)](fetch,_0x5a3669+_0x55675b(0x141)+_0x5a310e,{'method':_0x9c540f[_0x55675b(0x178)],'headers':{'Authorization':'Bearer\x20'+_0x3cc7dd}});if(!_0x5c2112['ok']){const _0x4fe027=await _0x5c2112[_0x55675b(0x153)]();throw new Error(_0x55675b(0x161)+_0x4fe027);}}export async function restoreFeature(_0x106194){const _0x4a62ff=_0x42f3,_0x1bc7a2={'MrTlY':_0x4a62ff(0x16d),'gzaEE':function(_0x4f60cf,_0x28c001,_0x33f0ba){return _0x4f60cf(_0x28c001,_0x33f0ba);},'KZDvl':'POST'},_0x1743f1=await getToken();if(!_0x1743f1)throw new Error(_0x1bc7a2['MrTlY']);const _0x1a8c49=getApiBaseUrl(),_0x4de372=await _0x1bc7a2[_0x4a62ff(0x165)](fetch,_0x1a8c49+'/api/v1/mcp/features/'+_0x106194+'/restore',{'method':_0x1bc7a2['KZDvl'],'headers':{'Authorization':'Bearer\x20'+_0x1743f1}});if(!_0x4de372['ok']){const _0xe651d2=await _0x4de372['text']();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0xe651d2);}}
|
|
1
|
+
(function(_0x5ea1d1,_0x21fa5f){const _0x5d8a04=_0x5d99,_0x47c900=_0x5ea1d1();while(!![]){try{const _0x482ba0=parseInt(_0x5d8a04(0x18f))/0x1*(-parseInt(_0x5d8a04(0x189))/0x2)+-parseInt(_0x5d8a04(0x1b7))/0x3*(parseInt(_0x5d8a04(0x1c2))/0x4)+parseInt(_0x5d8a04(0x1bc))/0x5+parseInt(_0x5d8a04(0x1c8))/0x6*(parseInt(_0x5d8a04(0x1c4))/0x7)+parseInt(_0x5d8a04(0x186))/0x8+-parseInt(_0x5d8a04(0x1a4))/0x9*(-parseInt(_0x5d8a04(0x1c0))/0xa)+parseInt(_0x5d8a04(0x1b1))/0xb*(-parseInt(_0x5d8a04(0x1c7))/0xc);if(_0x482ba0===_0x21fa5f)break;else _0x47c900['push'](_0x47c900['shift']());}catch(_0x35716a){_0x47c900['push'](_0x47c900['shift']());}}}(_0x1dca,0xbd8aa));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x26f33c){const _0x597caa=_0x5d99,_0x14cce6={'MUEqU':function(_0x43cacf){return _0x43cacf();},'aeMMb':_0x597caa(0x18b),'vruDQ':function(_0x549a80,_0x469e52){return _0x549a80===_0x469e52;},'oBiVO':'https://dashboard.ranger.net/billing'},_0x59d8a5=await getToken();if(!_0x59d8a5)throw new Error(_0x597caa(0x1ab));const _0x4d1467=_0x14cce6['MUEqU'](getApiBaseUrl),_0x38b330=await fetch(_0x4d1467+'/api/v1/mcp/features',{'method':_0x14cce6['aeMMb'],'headers':{'Authorization':'Bearer\x20'+_0x59d8a5,'Content-Type':_0x597caa(0x1aa)},'body':JSON[_0x597caa(0x1ca)](_0x26f33c)});if(!_0x38b330['ok']){if(_0x14cce6['vruDQ'](_0x38b330['status'],0x192)){const _0x4927a8=await _0x38b330[_0x597caa(0x1af)](),_0xf4c06f=_0x4927a8[_0x597caa(0x1cb)]||_0x14cce6['oBiVO'];throw new Error((_0x4927a8[_0x597caa(0x1ba)]||_0x597caa(0x197))+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0xf4c06f);}const _0x25ddd2=await _0x38b330[_0x597caa(0x1a8)]();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0x25ddd2);}return _0x38b330[_0x597caa(0x1af)]();}export async function listFeatures(_0x45be07){const _0x4cc1bb=_0x5d99,_0x2c97a2={'aaxKA':function(_0x49f235){return _0x49f235();},'bIsLq':function(_0x540894){return _0x540894();},'JEZEE':_0x4cc1bb(0x1b8),'UtkYX':'true','aLWty':'GET'},_0x54339c=await _0x2c97a2['aaxKA'](getToken);if(!_0x54339c)throw new Error(_0x4cc1bb(0x1ab));const _0x3fb455=_0x2c97a2[_0x4cc1bb(0x1b4)](getApiBaseUrl),_0x3c9140=new URLSearchParams();if(_0x45be07?.[_0x4cc1bb(0x1a9)])_0x3c9140[_0x4cc1bb(0x1a6)](_0x4cc1bb(0x1a9),_0x45be07[_0x4cc1bb(0x1a9)]);if(_0x45be07?.[_0x4cc1bb(0x1b3)])_0x3c9140[_0x4cc1bb(0x1a6)]('gitBranch',_0x45be07['gitBranch']);if(_0x45be07?.['limit'])_0x3c9140['set']('limit',_0x45be07[_0x4cc1bb(0x1b0)]['toString']());if(_0x45be07?.['offset'])_0x3c9140[_0x4cc1bb(0x1a6)](_0x4cc1bb(0x1ae),_0x45be07['offset']['toString']());if(_0x45be07?.[_0x4cc1bb(0x1b8)])_0x3c9140[_0x4cc1bb(0x1a6)](_0x2c97a2['JEZEE'],_0x2c97a2['UtkYX']);const _0x470bb4=_0x3fb455+'/api/v1/mcp/features'+(_0x3c9140['toString']()?'?'+_0x3c9140[_0x4cc1bb(0x1cc)]():''),_0x3e228f=await fetch(_0x470bb4,{'method':_0x2c97a2['aLWty'],'headers':{'Authorization':_0x4cc1bb(0x194)+_0x54339c}});if(!_0x3e228f['ok']){const _0x1b0875=await _0x3e228f['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x1b0875);}return _0x3e228f[_0x4cc1bb(0x1af)]();}export async function getFeature(_0x27cf5b){const _0x5031c9=_0x5d99,_0x393d66={'PWwMC':function(_0xba102){return _0xba102();},'BKwqA':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','GhGQk':function(_0xef88b0,_0x251456,_0x289a1d){return _0xef88b0(_0x251456,_0x289a1d);}},_0x524ecf=await _0x393d66[_0x5031c9(0x19f)](getToken);if(!_0x524ecf)throw new Error(_0x393d66['BKwqA']);const _0x56a8ec=getApiBaseUrl(),_0x1b8472=await _0x393d66['GhGQk'](fetch,_0x56a8ec+'/api/v1/mcp/features/'+_0x27cf5b,{'method':_0x5031c9(0x1bb),'headers':{'Authorization':_0x5031c9(0x194)+_0x524ecf}});if(!_0x1b8472['ok']){const _0x22294b=await _0x1b8472['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x22294b);}return _0x1b8472['json']();}export async function updateFeature(_0x5db0ee,_0x5ad36d){const _0x4c17ca=_0x5d99,_0xe1cfa5={'GdZtK':function(_0xa12add){return _0xa12add();},'FBBMb':function(_0x230e83,_0x1b431a,_0x54aa02){return _0x230e83(_0x1b431a,_0x54aa02);},'uzOxB':_0x4c17ca(0x1aa)},_0x3f6040=await _0xe1cfa5[_0x4c17ca(0x18c)](getToken);if(!_0x3f6040)throw new Error(_0x4c17ca(0x1ab));const _0x352bc9=getApiBaseUrl(),_0x1b4f34=await _0xe1cfa5[_0x4c17ca(0x18e)](fetch,_0x352bc9+'/api/v1/mcp/features/'+_0x5db0ee,{'method':_0x4c17ca(0x196),'headers':{'Authorization':'Bearer\x20'+_0x3f6040,'Content-Type':_0xe1cfa5[_0x4c17ca(0x188)]},'body':JSON['stringify'](_0x5ad36d)});if(!_0x1b4f34['ok']){const _0x410c0b=await _0x1b4f34['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x410c0b);}return _0x1b4f34[_0x4c17ca(0x1af)]();}function _0x1dca(){const _0x3f440e=['4135188rsGnlu','6XRCCCy','length','stringify','billingUrl','toString','xLHlm','QvYiS','5018488Dqkwdf','Failed\x20to\x20restore\x20feature\x20review:\x20','uzOxB','79654YovTfo','vjMBA','POST','GdZtK','rdPha','FBBMb','14rHtFAi','Tuagv','/checklist/','NLNPf','sessionId','Bearer\x20','/conclude','PATCH','Feature\x20limit\x20exceeded','/start','/sessions/','DzLLQ','JAKZB','style','Failed\x20to\x20get\x20item\x20feedback:\x20','Failed\x20to\x20start\x20session:\x20','PWwMC','CAMkW','xCPyN','/api/v1/mcp/features/','updateChecklistItem','110277HzcLPk','/report/markdown','set','/sessions','text','gitRepoUrl','application/json','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','itemIds','/comments/address','offset','json','limit','33CHXQOs','/report','gitBranch','bIsLq','EShae','DELETE','78102MnlPzH','includeDeleted','Failed\x20to\x20delete\x20feature\x20review:\x20','message','GET','7215670vvnyTc','/checklist','HsXhs','/restore','350vHFziJ','Fdkcy','176IvqusQ','Failed\x20to\x20list\x20sessions:\x20','7097531Okzztf','vWPgn','Failed\x20to\x20conclude\x20session:\x20'];_0x1dca=function(){return _0x3f440e;};return _0x1dca();}export async function createChecklistItem(_0x1bca62,_0x195325,_0x520581){const _0x1a629c=_0x5d99,_0x217906={'weCqI':function(_0x6aef5b){return _0x6aef5b();},'zsrhk':_0x1a629c(0x1ab),'NLNPf':_0x1a629c(0x18b)},_0x581fc2=await _0x217906['weCqI'](getToken);if(!_0x581fc2)throw new Error(_0x217906['zsrhk']);const _0x2c55b2=getApiBaseUrl(),_0x40d153=await fetch(_0x2c55b2+_0x1a629c(0x1a2)+_0x1bca62+_0x1a629c(0x1bd),{'method':_0x217906[_0x1a629c(0x192)],'headers':{'Authorization':_0x1a629c(0x194)+_0x581fc2,'Content-Type':_0x1a629c(0x1aa)},'body':JSON[_0x1a629c(0x1ca)]({'description':_0x195325,'position':_0x520581})});if(!_0x40d153['ok']){const _0xe8e83a=await _0x40d153['text']();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0xe8e83a);}return _0x40d153[_0x1a629c(0x1af)]();}export async function updateChecklistItem(_0x211c26,_0x5e06c6,_0x21ec14){const _0x39eb44=_0x5d99,_0x13cbea={'rdPha':function(_0xe66690){return _0xe66690();},'vWPgn':function(_0x12b0d8,_0x2730c8,_0xac903f){return _0x12b0d8(_0x2730c8,_0xac903f);},'CsiUz':'PATCH','YCLiB':_0x39eb44(0x1aa)};return withRetry(async()=>{const _0x16230b=_0x39eb44,_0x353721=await _0x13cbea[_0x16230b(0x18d)](getToken);if(!_0x353721)throw new Error(_0x16230b(0x1ab));const _0x341060=getApiBaseUrl(),_0x4d9827=await _0x13cbea[_0x16230b(0x1c5)](fetch,_0x341060+_0x16230b(0x1a2)+_0x211c26+_0x16230b(0x191)+_0x5e06c6,{'method':_0x13cbea['CsiUz'],'headers':{'Authorization':_0x16230b(0x194)+_0x353721,'Content-Type':_0x13cbea['YCLiB']},'body':JSON[_0x16230b(0x1ca)](_0x21ec14)});if(!_0x4d9827['ok']){const _0x98d507=await _0x4d9827[_0x16230b(0x1a8)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x98d507);}return _0x4d9827[_0x16230b(0x1af)]();},{'label':_0x39eb44(0x1a3)});}export async function getFeatureReport(_0x58a098){const _0xdc3ab2=_0x5d99,_0x138e03={'ebHMe':function(_0x4d1c54){return _0x4d1c54();},'xLHlm':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x180de3=await _0x138e03['ebHMe'](getToken);if(!_0x180de3)throw new Error(_0x138e03[_0xdc3ab2(0x1cd)]);const _0x33b5c8=getApiBaseUrl(),_0x315f7c=await fetch(_0x33b5c8+_0xdc3ab2(0x1a2)+_0x58a098+_0xdc3ab2(0x1b2),{'method':'GET','headers':{'Authorization':_0xdc3ab2(0x194)+_0x180de3}});if(!_0x315f7c['ok']){const _0x36182a=await _0x315f7c[_0xdc3ab2(0x1a8)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x36182a);}return _0x315f7c[_0xdc3ab2(0x1af)]();}export async function getFeatureReportMarkdown(_0x451540,_0x11412c){const _0x15584a=_0x5d99,_0x1e0535={'JAKZB':_0x15584a(0x1ac),'vjMBA':'sessionId','pRWCw':_0x15584a(0x19c),'EShae':function(_0x56df10,_0xd1676d,_0x54f42a){return _0x56df10(_0xd1676d,_0x54f42a);},'iwISM':_0x15584a(0x1bb)},_0x262fc6=await getToken();if(!_0x262fc6)throw new Error(_0x15584a(0x1ab));const _0x58c9f3=getApiBaseUrl(),_0x43f0e9=new URLSearchParams(),_0x481df5=(_0x11412c?.[_0x15584a(0x1ac)]?.[_0x15584a(0x1c9)]??0x0)>0x0,_0x2733cc=Boolean(_0x11412c?.[_0x15584a(0x193)]);_0x481df5&&_0x11412c?.[_0x15584a(0x1ac)]&&_0x43f0e9['set'](_0x1e0535[_0x15584a(0x19b)],_0x11412c['itemIds']['join'](','));_0x2733cc&&_0x11412c?.[_0x15584a(0x193)]&&_0x43f0e9['set'](_0x1e0535[_0x15584a(0x18a)],_0x11412c['sessionId']);!_0x481df5&&!_0x2733cc&&_0x11412c?.['style']&&_0x43f0e9['set'](_0x1e0535['pRWCw'],_0x11412c['style']);const _0x4e525c=_0x58c9f3+'/api/v1/mcp/features/'+_0x451540+_0x15584a(0x1a5),_0x2511bd=''+_0x4e525c+(_0x43f0e9['toString']()?'?'+_0x43f0e9['toString']():''),_0x111ec0=await _0x1e0535[_0x15584a(0x1b5)](fetch,_0x2511bd,{'method':_0x1e0535['iwISM'],'headers':{'Authorization':_0x15584a(0x194)+_0x262fc6}});if(!_0x111ec0['ok']){const _0x2ab1a5=await _0x111ec0['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x2ab1a5);}return _0x111ec0[_0x15584a(0x1a8)]();}export async function listFeatureSessions(_0x1abb72){const _0x2a2c0f=_0x5d99,_0x3b41b9={'PxYzO':function(_0x5ab921){return _0x5ab921();},'CAMkW':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','vQoNb':function(_0x3e0a4f){return _0x3e0a4f();}},_0xf635ef=await _0x3b41b9['PxYzO'](getToken);if(!_0xf635ef)throw new Error(_0x3b41b9[_0x2a2c0f(0x1a0)]);const _0x597b17=_0x3b41b9['vQoNb'](getApiBaseUrl),_0xcc0bb1=await fetch(_0x597b17+_0x2a2c0f(0x1a2)+_0x1abb72+_0x2a2c0f(0x1a7),{'method':_0x2a2c0f(0x1bb),'headers':{'Authorization':'Bearer\x20'+_0xf635ef}});if(!_0xcc0bb1['ok']){const _0x994184=await _0xcc0bb1[_0x2a2c0f(0x1a8)]();throw new Error(_0x2a2c0f(0x1c3)+_0x994184);}return _0xcc0bb1['json']();}function _0x5d99(_0x407522,_0x204d14){_0x407522=_0x407522-0x185;const _0x1dcafe=_0x1dca();let _0x5d9987=_0x1dcafe[_0x407522];return _0x5d9987;}export async function startSession(_0x586933,_0x306439){const _0x9139f7=_0x5d99,_0x3bf318={'QvYiS':function(_0x595ef2){return _0x595ef2();},'gPtLQ':'POST'},_0x292c54=await getToken();if(!_0x292c54)throw new Error(_0x9139f7(0x1ab));const _0x4189c4=_0x3bf318[_0x9139f7(0x185)](getApiBaseUrl),_0x4078bf=await fetch(_0x4189c4+_0x9139f7(0x1a2)+_0x586933+_0x9139f7(0x199)+_0x306439+_0x9139f7(0x198),{'method':_0x3bf318['gPtLQ'],'headers':{'Authorization':'Bearer\x20'+_0x292c54}});if(!_0x4078bf['ok']){const _0x4d0d04=await _0x4078bf['text']();throw new Error(_0x9139f7(0x19e)+_0x4d0d04);}return _0x4078bf[_0x9139f7(0x1af)]();}export async function concludeSession(_0x3693bf,_0x1a56e7){const _0x54b3a8=_0x5d99,_0x4b8d51={'NpYFt':function(_0x1cba37){return _0x1cba37();},'HsXhs':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x405dd0=await _0x4b8d51['NpYFt'](getToken);if(!_0x405dd0)throw new Error(_0x4b8d51[_0x54b3a8(0x1be)]);const _0x1ea410=getApiBaseUrl(),_0x3ab56d=await fetch(_0x1ea410+'/api/v1/mcp/features/'+_0x3693bf+'/sessions/'+_0x1a56e7+_0x54b3a8(0x195),{'method':_0x54b3a8(0x18b),'headers':{'Authorization':_0x54b3a8(0x194)+_0x405dd0}});if(!_0x3ab56d['ok']){const _0x5493c0=await _0x3ab56d['text']();throw new Error(_0x54b3a8(0x1c6)+_0x5493c0);}return _0x3ab56d[_0x54b3a8(0x1af)]();}export async function getActionItems(_0x13ab0d){const _0x57d2d7=_0x5d99,_0x37c0d9=await getToken();if(!_0x37c0d9)throw new Error(_0x57d2d7(0x1ab));const _0x35e0cf=getApiBaseUrl(),_0x474c5b=await fetch(_0x35e0cf+_0x57d2d7(0x1a2)+_0x13ab0d+'/action-items',{'method':_0x57d2d7(0x1bb),'headers':{'Authorization':_0x57d2d7(0x194)+_0x37c0d9}});if(!_0x474c5b['ok']){const _0x250a3b=await _0x474c5b[_0x57d2d7(0x1a8)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x250a3b);}return _0x474c5b[_0x57d2d7(0x1af)]();}export async function getItemFeedback(_0x323611,_0x5b0e25){const _0x3c2123=_0x5d99,_0x38543b={'oboTY':function(_0x3e7279){return _0x3e7279();},'WosSS':_0x3c2123(0x1ab),'DzLLQ':function(_0x5b36f8){return _0x5b36f8();},'LzCSo':function(_0x2c7813,_0x18760c,_0xe29aa8){return _0x2c7813(_0x18760c,_0xe29aa8);},'dHxyY':'GET'},_0x2dc7d0=await _0x38543b['oboTY'](getToken);if(!_0x2dc7d0)throw new Error(_0x38543b['WosSS']);const _0x20e8d1=_0x38543b[_0x3c2123(0x19a)](getApiBaseUrl),_0xd0e693=await _0x38543b['LzCSo'](fetch,_0x20e8d1+'/api/v1/mcp/features/'+_0x323611+'/checklist-items/'+_0x5b0e25+'/feedback',{'method':_0x38543b['dHxyY'],'headers':{'Authorization':_0x3c2123(0x194)+_0x2dc7d0}});if(!_0xd0e693['ok']){const _0x4787c9=await _0xd0e693[_0x3c2123(0x1a8)]();throw new Error(_0x3c2123(0x19d)+_0x4787c9);}return _0xd0e693[_0x3c2123(0x1af)]();}export async function markCommentsAddressed(_0x1fe847,_0x34fc1e,_0x892cf9){const _0x2c4174=_0x5d99,_0x5e431c={'xCPyN':function(_0x59c7fa){return _0x59c7fa();},'Tuagv':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','Fdkcy':_0x2c4174(0x1aa)},_0x4ab8ba=await _0x5e431c[_0x2c4174(0x1a1)](getToken);if(!_0x4ab8ba)throw new Error(_0x5e431c[_0x2c4174(0x190)]);const _0xe1e1b6=getApiBaseUrl(),_0x1bc18c=await fetch(_0xe1e1b6+'/api/v1/mcp/features/'+_0x1fe847+_0x2c4174(0x1ad),{'method':_0x2c4174(0x18b),'headers':{'Authorization':_0x2c4174(0x194)+_0x4ab8ba,'Content-Type':_0x5e431c[_0x2c4174(0x1c1)]},'body':JSON[_0x2c4174(0x1ca)]({'checklistItemId':_0x34fc1e,'commentIds':_0x892cf9})});if(!_0x1bc18c['ok']){const _0x882617=await _0x1bc18c['text']();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x882617);}}export async function softDeleteFeature(_0x38757a){const _0x130304=_0x5d99,_0x5593af={'ugxIT':_0x130304(0x1ab),'yWYTg':function(_0x1c3d53){return _0x1c3d53();}},_0x6b7e18=await getToken();if(!_0x6b7e18)throw new Error(_0x5593af['ugxIT']);const _0x42bc2e=_0x5593af['yWYTg'](getApiBaseUrl),_0x499db0=await fetch(_0x42bc2e+_0x130304(0x1a2)+_0x38757a,{'method':_0x130304(0x1b6),'headers':{'Authorization':_0x130304(0x194)+_0x6b7e18}});if(!_0x499db0['ok']){const _0x46fbbc=await _0x499db0['text']();throw new Error(_0x130304(0x1b9)+_0x46fbbc);}}export async function restoreFeature(_0x2c6a94){const _0x548cf9=_0x5d99,_0x1da9db={'JKMDI':function(_0x458ed0,_0x2447d4,_0xc4b8c9){return _0x458ed0(_0x2447d4,_0xc4b8c9);}},_0x527957=await getToken();if(!_0x527957)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x24e200=getApiBaseUrl(),_0x518c17=await _0x1da9db['JKMDI'](fetch,_0x24e200+_0x548cf9(0x1a2)+_0x2c6a94+_0x548cf9(0x1bf),{'method':'POST','headers':{'Authorization':_0x548cf9(0x194)+_0x527957}});if(!_0x518c17['ok']){const _0x26c52a=await _0x518c17[_0x548cf9(0x1a8)]();throw new Error(_0x548cf9(0x187)+_0x26c52a);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x1cdc42=_0x4b33;(function(_0x19bcec,_0x5b1dff){const _0x3d7a90=_0x4b33,_0x4a85cb=_0x19bcec();while(!![]){try{const _0x5792a9=parseInt(_0x3d7a90(0xe5))/0x1*(parseInt(_0x3d7a90(0xe6))/0x2)+parseInt(_0x3d7a90(0x112))/0x3*(-parseInt(_0x3d7a90(0x118))/0x4)+parseInt(_0x3d7a90(0xf1))/0x5+parseInt(_0x3d7a90(0x105))/0x6*(parseInt(_0x3d7a90(0x107))/0x7)+-parseInt(_0x3d7a90(0x102))/0x8+parseInt(_0x3d7a90(0xe9))/0x9+parseInt(_0x3d7a90(0x109))/0xa*(-parseInt(_0x3d7a90(0x114))/0xb);if(_0x5792a9===_0x5b1dff)break;else _0x4a85cb['push'](_0x4a85cb['shift']());}catch(_0x2365bc){_0x4a85cb['push'](_0x4a85cb['shift']());}}}(_0x4179,0x4cc0c));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(_0x18a3d7,_0x1bcfb2){const _0x2ba225=_0x4b33,_0x1086af={'Szqib':function(_0xf26ba1,_0x367468){return _0xf26ba1<=_0x367468;},'tSssB':function(_0x225149,_0x28450b){return _0x225149+_0x28450b;},'RqezJ':function(_0x5314f3,_0x33651e){return _0x5314f3-_0x33651e;},'uFBbO':function(_0x40307e,_0x447223){return _0x40307e+_0x447223;},'xIvsF':function(_0x554d3b,_0x1340e7){return _0x554d3b*_0x1340e7;},'sTjsn':function(_0x5b70c0,_0x5aa9a4){return _0x5b70c0+_0x5aa9a4;}};if(_0x1bcfb2>=_0x18a3d7['length'])return[0x0,0x0];const _0x576139=_0x18a3d7[_0x1bcfb2];let _0x5b7827=0x1,_0xacb061=0x80;while(_0x1086af['Szqib'](_0x5b7827,0x8)&&!(_0x576139&_0xacb061)){_0x5b7827++,_0xacb061>>=0x1;}if(_0x1086af['tSssB'](_0x1bcfb2,_0x5b7827)>_0x18a3d7[_0x2ba225(0xf6)])return[0x0,0x0];let _0x26c273=_0x576139&_0x1086af['RqezJ'](_0xacb061,0x1);for(let _0x5a7a38=0x1;_0x5a7a38<_0x5b7827;_0x5a7a38++){_0x26c273=_0x1086af[_0x2ba225(0x117)](_0x1086af[_0x2ba225(0xe7)](_0x26c273,0x100),_0x18a3d7[_0x1086af[_0x2ba225(0x10e)](_0x1bcfb2,_0x5a7a38)]);}return[_0x26c273,_0x5b7827];}function readId(_0xa144eb,_0x43ecec){const _0x6d213b=_0x4b33,_0x5cd782={'UUdLa':function(_0x3d9a60,_0x2a8ab1){return _0x3d9a60>=_0x2a8ab1;},'JWonN':function(_0x25f0af,_0x409df7){return _0x25f0af>=_0x409df7;},'OIkDi':function(_0x4dd80c,_0x1d1d3a){return _0x4dd80c<_0x1d1d3a;},'xIGIY':function(_0x3cfbd6,_0x276219){return _0x3cfbd6+_0x276219;}};if(_0x5cd782[_0x6d213b(0xf7)](_0x43ecec,_0xa144eb['length']))return[0x0,0x0];const _0x35b4ad=_0xa144eb[_0x43ecec];let _0x5b4a6e;if(_0x35b4ad>=0x80)_0x5b4a6e=0x1;else{if(_0x5cd782[_0x6d213b(0x11a)](_0x35b4ad,0x40))_0x5b4a6e=0x2;else{if(_0x5cd782['JWonN'](_0x35b4ad,0x20))_0x5b4a6e=0x3;else{if(_0x5cd782['UUdLa'](_0x35b4ad,0x10))_0x5b4a6e=0x4;else return[_0x35b4ad,0x1];}}}if(_0x43ecec+_0x5b4a6e>_0xa144eb['length'])return[0x0,0x0];let _0x1e5d2c=0x0;for(let _0x25910c=0x0;_0x5cd782['OIkDi'](_0x25910c,_0x5b4a6e);_0x25910c++){_0x1e5d2c=_0x1e5d2c*0x100+_0xa144eb[_0x5cd782['xIGIY'](_0x43ecec,_0x25910c)];}return[_0x1e5d2c,_0x5b4a6e];}function readUint(_0xb6cb56,_0x507786,_0x33ff8a){const _0xf98a24=_0x4b33,_0x255e82={'lGqQq':function(_0xe3998f,_0x257a66){return _0xe3998f<_0x257a66;}};let _0x54352e=0x0;for(let _0x39404d=0x0;_0x255e82[_0xf98a24(0xea)](_0x39404d,_0x33ff8a);_0x39404d++){_0x54352e=_0x54352e*0x100+_0xb6cb56[_0x507786+_0x39404d];}return _0x54352e;}function isUnknownSize(_0x5e0586,_0x16964e){const _0x303813=_0x4b33;return _0x5e0586===Math[_0x303813(0xfe)](0x2,0x7*_0x16964e)-0x1;}function writeId(_0x245d04){const _0x1f30ac=_0x4b33,_0x5c7745={'COdGZ':function(_0x322955,_0x1f17b5){return _0x322955>>_0x1f17b5;},'CgXEc':function(_0x443566,_0x3d8c5f){return _0x443566<=_0x3d8c5f;},'ztcxG':function(_0x38b462,_0x5aeb27){return _0x38b462>>_0x5aeb27;},'GZMHG':function(_0x3586be,_0xaa938){return _0x3586be&_0xaa938;},'oZcqA':function(_0x576a94,_0x141383){return _0x576a94>>_0x141383;},'XcGKV':function(_0x62b808,_0x3e4156){return _0x62b808>>_0x3e4156;}};if(_0x245d04<=0xff)return Buffer['from']([_0x245d04]);if(_0x245d04<=0xffff)return Buffer[_0x1f30ac(0x10a)]([_0x5c7745['COdGZ'](_0x245d04,0x8)&0xff,_0x245d04&0xff]);if(_0x5c7745['CgXEc'](_0x245d04,0xffffff))return Buffer['from']([_0x5c7745[_0x1f30ac(0xf4)](_0x245d04,0x10)&0xff,_0x5c7745[_0x1f30ac(0xf4)](_0x245d04,0x8)&0xff,_0x245d04&0xff]);return Buffer['from']([_0x5c7745['ztcxG'](_0x245d04,0x18)&0xff,_0x5c7745['GZMHG'](_0x5c7745[_0x1f30ac(0xe3)](_0x245d04,0x10),0xff),_0x5c7745[_0x1f30ac(0xe8)](_0x5c7745[_0x1f30ac(0x11b)](_0x245d04,0x8),0xff),_0x245d04&0xff]);}function writeVint(_0x20845f,_0x547cf0){const _0x51622e=_0x4b33,_0xcc33f8={'JnKWY':function(_0x546685,_0x49592d){return _0x546685||_0x49592d;},'uJXgN':function(_0x3e4bf4,_0x38676f){return _0x3e4bf4-_0x38676f;},'szoud':function(_0x146741,_0x53c743){return _0x146741>=_0x53c743;},'MaAsQ':function(_0x2a8770,_0x35625f){return _0x2a8770&_0x35625f;},'eDNDL':function(_0x402368,_0x3d99e1){return _0x402368/_0x3d99e1;}};let _0x1ff301=_0xcc33f8['JnKWY'](_0x547cf0,0x1);while(Math[_0x51622e(0xfe)](0x2,0x7*_0x1ff301)-0x2<_0x20845f)_0x1ff301++;const _0x3a92ea=Buffer['alloc'](_0x1ff301);for(let _0x24b74e=_0xcc33f8[_0x51622e(0x110)](_0x1ff301,0x1);_0xcc33f8[_0x51622e(0x11d)](_0x24b74e,0x0);_0x24b74e--){_0x3a92ea[_0x24b74e]=_0xcc33f8['MaAsQ'](_0x20845f,0xff),_0x20845f=Math[_0x51622e(0x116)](_0xcc33f8[_0x51622e(0x113)](_0x20845f,0x100));}return _0x3a92ea[0x0]|=0x1<<_0xcc33f8['uJXgN'](0x8,_0x1ff301),_0x3a92ea;}function writeFloat64(_0xfdc3a9){const _0x3c615b=Buffer['alloc'](0x8);return _0x3c615b['writeDoubleBE'](_0xfdc3a9,0x0),_0x3c615b;}function writeVoid(_0x3f0c9b){const _0x1551fc=_0x4b33,_0x4517e1={'aYhUY':function(_0x437c61,_0xcbfdf3){return _0x437c61<=_0xcbfdf3;},'FhzRu':function(_0x5c3bf4,_0x9ca000){return _0x5c3bf4<=_0x9ca000;},'Fhmie':function(_0x5d4e28,_0x8fd7fd,_0x3f3319){return _0x5d4e28(_0x8fd7fd,_0x3f3319);}};for(let _0x8e1f9=0x1;_0x4517e1['aYhUY'](_0x8e1f9,0x8);_0x8e1f9++){const _0x2921cb=_0x3f0c9b-0x1-_0x8e1f9;if(_0x2921cb>=0x0&&_0x4517e1['FhzRu'](_0x2921cb,Math[_0x1551fc(0xfe)](0x2,0x7*_0x8e1f9)-0x2))return Buffer[_0x1551fc(0x10c)]([Buffer['from']([ID_VOID]),_0x4517e1['Fhmie'](writeVint,_0x2921cb,_0x8e1f9),Buffer[_0x1551fc(0xfd)](_0x2921cb)]);}return Buffer[_0x1551fc(0xfd)](0x0);}function findElement(_0x49efc1,_0x1cffac,_0x1d1729,_0x3dca28){const _0x203bf3={'UZSdK':function(_0x2728df,_0x38afb1,_0x5f00ed){return _0x2728df(_0x38afb1,_0x5f00ed);},'vaCvN':function(_0x74f48e,_0x51a89a,_0x5e3fdd){return _0x74f48e(_0x51a89a,_0x5e3fdd);},'lTBOV':function(_0x21a5ed,_0x1401e9){return _0x21a5ed+_0x1401e9;},'pHETx':function(_0x4c94d3,_0x409bf5){return _0x4c94d3+_0x409bf5;}};let _0x211553=_0x1cffac;while(_0x211553<_0x1d1729){const [_0x2c604b,_0x2c056d]=_0x203bf3['UZSdK'](readId,_0x49efc1,_0x211553),[_0x5880ce,_0x198b0a]=_0x203bf3['vaCvN'](readVint,_0x49efc1,_0x203bf3['lTBOV'](_0x211553,_0x2c056d));if(_0x2c604b===_0x3dca28)return{'offset':_0x211553,'idLen':_0x2c056d,'sizeLen':_0x198b0a,'dataSize':_0x5880ce,'dataOffset':_0x203bf3['pHETx'](_0x211553+_0x2c056d,_0x198b0a)};if(isUnknownSize(_0x5880ce,_0x198b0a))break;_0x211553+=_0x203bf3['lTBOV'](_0x2c056d+_0x198b0a,_0x5880ce);}return null;}function _0x4179(){const _0x59b5d6=['3398994tIlEhV','lGqQq','AHwVk','KAQpO','Could\x20not\x20compute\x20duration','fbLJl','rHuQd','LNjBl','1588305hFYFRz','indexOf','fKwUB','COdGZ','hstpv','length','UUdLa','idLen','log','argv','error','endsWith','alloc','pow','maRkF','tcYNl','slice','1783464YLNeiG','qauau','offset','941658RdmUib','ETSBm','14tSRlms','qTmxJ','10vVmLiZ','from','mNIqp','concat','Fixed:\x20','sTjsn','eLUGo','uJXgN','dataOffset','3HdKELE','eDNDL','3971495AadHHB','dataSize','floor','uFBbO','1136092ctJHhD','TurNv','JWonN','XcGKV','csPJA','szoud','IdFyY','XOGkS','aAmND','AqPrj','JaHCH','readInt16BE','Could\x20not\x20find\x20Info\x20element','FHwja','oZcqA','fixWebmDuration.js','137SphWUk','2528iiGFMP','xIvsF','GZMHG'];_0x4179=function(){return _0x59b5d6;};return _0x4179();}function computeDurationMs(_0x1bddd1,_0x22a106){const _0x47f705=_0x4b33,_0x13ffd0={'fbLJl':function(_0x2841cc,_0x51d70f){return _0x2841cc===_0x51d70f;},'tcYNl':function(_0x5f3b45,_0xedecb6){return _0x5f3b45<_0xedecb6;},'PWbSA':function(_0x3bb4ba,_0x2931d2){return _0x3bb4ba!==_0x2931d2;},'XOGkS':function(_0x5e40a9,_0x1e6f38){return _0x5e40a9+_0x1e6f38;},'csPJA':function(_0x4a86da,_0x7bbc80){return _0x4a86da+_0x7bbc80;},'FvUGT':function(_0x4ba77a,_0x555181){return _0x4ba77a-_0x555181;},'KAQpO':function(_0x346d2b,_0x15f0fe,_0xc8818){return _0x346d2b(_0x15f0fe,_0xc8818);},'rHuQd':function(_0x4c2df5,_0x2cec44){return _0x4c2df5===_0x2cec44;},'TurNv':function(_0x954dac,_0x302aef,_0x44c1da,_0x2ff58f){return _0x954dac(_0x302aef,_0x44c1da,_0x2ff58f);},'UpbPf':function(_0x1552c2,_0x7664fc){return _0x1552c2>=_0x7664fc;},'sUxBe':function(_0x5b7052,_0x43d63c){return _0x5b7052/_0x43d63c;},'oZnmh':function(_0x313cbd,_0x2b580b){return _0x313cbd>_0x2b580b;},'tAZwb':function(_0x1db8da,_0x3fe0f2){return _0x1db8da+_0x3fe0f2;}};let _0x213c2c=0x0;const _0x29180e=Buffer[_0x47f705(0x10a)]([0x1f,0x43,0xb6,0x75]);let _0x3d14c3=_0x1bddd1[_0x47f705(0xf2)](_0x29180e);if(_0x13ffd0[_0x47f705(0xee)](_0x3d14c3,-0x1))return 0x0;while(_0x13ffd0['tcYNl'](_0x3d14c3,_0x1bddd1[_0x47f705(0xf6)])){const [_0x5d3cdd,_0x36aab8]=readId(_0x1bddd1,_0x3d14c3);if(_0x13ffd0['PWbSA'](_0x5d3cdd,ID_CLUSTER))break;const [_0x25f930,_0x43d98e]=readVint(_0x1bddd1,_0x3d14c3+_0x36aab8),_0x5b3b36=_0x13ffd0['XOGkS'](_0x13ffd0['csPJA'](_0x3d14c3,_0x36aab8),_0x43d98e),_0xb07150=isUnknownSize(_0x25f930,_0x43d98e);let _0x1e54ec;if(_0xb07150){let _0x1b337c=_0x5b3b36;while(_0x13ffd0[_0x47f705(0x100)](_0x1b337c,_0x13ffd0['FvUGT'](_0x1bddd1['length'],0x4))){const [_0x1b6c42,_0x20bd96]=readId(_0x1bddd1,_0x1b337c);if(_0x1b6c42===ID_CLUSTER){_0x1e54ec=_0x1b337c;break;}const [_0xf79efd,_0x2cfab9]=_0x13ffd0[_0x47f705(0xec)](readVint,_0x1bddd1,_0x1b337c+_0x20bd96);if(isUnknownSize(_0xf79efd,_0x2cfab9)){_0x1e54ec=_0x1bddd1['length'];break;}_0x1b337c+=_0x20bd96+_0x2cfab9+_0xf79efd;}_0x1e54ec??=_0x1bddd1['length'];}else _0x1e54ec=_0x5b3b36+_0x25f930;let _0x126f25=0x0,_0x4cb08a=_0x5b3b36;while(_0x4cb08a<_0x1e54ec){const [_0x16fa03,_0x4a6209]=_0x13ffd0['KAQpO'](readId,_0x1bddd1,_0x4cb08a),[_0xefbed1,_0x3fa6e1]=readVint(_0x1bddd1,_0x4cb08a+_0x4a6209);if(_0x13ffd0[_0x47f705(0xef)](_0x16fa03,ID_TIMESTAMP))_0x126f25=_0x13ffd0[_0x47f705(0x119)](readUint,_0x1bddd1,_0x13ffd0[_0x47f705(0x11f)](_0x4cb08a,_0x4a6209)+_0x3fa6e1,_0xefbed1);else{if(_0x16fa03===ID_SIMPLE_BLOCK&&_0x13ffd0['UpbPf'](_0xefbed1,0x4)){const _0x384fb5=_0x13ffd0[_0x47f705(0x11c)](_0x4cb08a,_0x4a6209)+_0x3fa6e1,[,_0x2ac2ef]=_0x13ffd0['KAQpO'](readVint,_0x1bddd1,_0x384fb5),_0x517f6a=_0x1bddd1[_0x47f705(0xe0)](_0x384fb5+_0x2ac2ef),_0x538e0e=_0x13ffd0['sUxBe']((_0x126f25+_0x517f6a)*_0x22a106,0xf4240);_0x13ffd0['oZnmh'](_0x538e0e,_0x213c2c)&&(_0x213c2c=_0x538e0e);}else{if(_0x16fa03===ID_CLUSTER)break;}}if(_0x13ffd0['KAQpO'](isUnknownSize,_0xefbed1,_0x3fa6e1))break;_0x4cb08a+=_0x13ffd0[_0x47f705(0x11c)](_0x13ffd0['tAZwb'](_0x4a6209,_0x3fa6e1),_0xefbed1);}_0x3d14c3=_0x1e54ec;}return _0x213c2c;}export function fixWebmDuration(_0x5e9107,_0x2d9430){const _0x52fc6a=_0x4b33,_0x4e308a={'maRkF':function(_0x41f361,_0x106aff){return _0x41f361(_0x106aff);},'LNjBl':function(_0x4c89c5,_0x482df4,_0xc4bc51){return _0x4c89c5(_0x482df4,_0xc4bc51);},'JaHCH':function(_0x2323f8,_0x4b0f03,_0x1c223a){return _0x2323f8(_0x4b0f03,_0x1c223a);},'IdFyY':function(_0x46a3c8,_0x2f2c51){return _0x46a3c8+_0x2f2c51;},'aAmND':function(_0x32824f,_0x102d8a){return _0x32824f!==_0x102d8a;},'AqPrj':'Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','qauau':function(_0x34ec49,_0x5a1584){return _0x34ec49+_0x5a1584;},'mNIqp':function(_0x264d9f,_0x40463a){return _0x264d9f===_0x40463a;},'Hfvwf':_0x52fc6a(0xe1),'ETSBm':function(_0x520a22,_0x11a0ea,_0x1f6aee,_0x5cc66e){return _0x520a22(_0x11a0ea,_0x1f6aee,_0x5cc66e);},'KgWAP':function(_0x3e3e33,_0x11f560){return _0x3e3e33<=_0x11f560;},'bAjMr':_0x52fc6a(0xed),'FHwja':function(_0x3c96a5,_0x40d683){return _0x3c96a5/_0x40d683;},'sNRQn':function(_0x4fc5e3,_0x36a562){return _0x4fc5e3*_0x36a562;},'fKwUB':function(_0x5ba7cc,_0x4d53ca){return _0x5ba7cc(_0x4d53ca);},'hstpv':function(_0x38b38a,_0x1e3a03){return _0x38b38a+_0x1e3a03;},'GpeGE':function(_0x4b5f3c,_0x20e7de){return _0x4b5f3c-_0x20e7de;},'AHwVk':function(_0x24f575,_0x3c3833,_0x4e6440,_0x2dac27,_0x3a46f4,_0x53938d,_0x67d9f4){return _0x24f575(_0x3c3833,_0x4e6440,_0x2dac27,_0x3a46f4,_0x53938d,_0x67d9f4);},'FJUGp':function(_0x4064da,_0x158358,_0x11c0f7){return _0x4064da(_0x158358,_0x11c0f7);}},_0x212d90=_0x4e308a[_0x52fc6a(0xff)](readFileSync,_0x5e9107);let _0x4c3fc4=0x0;const [_0x3d0825,_0x1f7a8c]=_0x4e308a['LNjBl'](readId,_0x212d90,_0x4c3fc4),[_0x2cf56c,_0x587304]=_0x4e308a[_0x52fc6a(0xdf)](readVint,_0x212d90,_0x4c3fc4+_0x1f7a8c);_0x4c3fc4+=_0x4e308a[_0x52fc6a(0x11e)](_0x1f7a8c+_0x587304,_0x2cf56c);const [_0x121a9c,_0x18de4e]=readId(_0x212d90,_0x4c3fc4);if(_0x4e308a[_0x52fc6a(0x120)](_0x121a9c,ID_SEGMENT))return console[_0x52fc6a(0xfb)](_0x4e308a[_0x52fc6a(0xde)]),![];const [,_0x245e2d]=readVint(_0x212d90,_0x4c3fc4+_0x18de4e),_0x969563=_0x4e308a['IdFyY'](_0x4e308a[_0x52fc6a(0x11e)](_0x4c3fc4,_0x18de4e),_0x245e2d);let _0x4878c8=_0x969563;const _0x163579=Math['min'](_0x212d90['length'],_0x969563+0x2710);let _0x2dcee5=null,_0x49d98c=null;while(_0x4878c8<_0x163579){const [_0x3d1001,_0x11e494]=readId(_0x212d90,_0x4878c8),[_0x9f2404,_0xb9ab75]=_0x4e308a[_0x52fc6a(0xdf)](readVint,_0x212d90,_0x4e308a['qauau'](_0x4878c8,_0x11e494));_0x3d1001===ID_VOID&&!_0x2dcee5&&(_0x2dcee5={'offset':_0x4878c8,'idLen':_0x11e494,'sizeLen':_0xb9ab75,'dataSize':_0x9f2404,'dataOffset':_0x4e308a[_0x52fc6a(0x103)](_0x4878c8,_0x11e494)+_0xb9ab75});if(_0x4e308a[_0x52fc6a(0x10b)](_0x3d1001,ID_INFO)){_0x49d98c={'offset':_0x4878c8,'idLen':_0x11e494,'sizeLen':_0xb9ab75,'dataSize':_0x9f2404,'dataOffset':_0x4878c8+_0x11e494+_0xb9ab75};break;}if(_0x3d1001===ID_CLUSTER)break;if(isUnknownSize(_0x9f2404,_0xb9ab75))break;_0x4878c8+=_0x4e308a[_0x52fc6a(0x103)](_0x11e494,_0xb9ab75)+_0x9f2404;}if(!_0x49d98c)return console['error'](_0x4e308a['Hfvwf']),![];const _0x42f791=findElement(_0x212d90,_0x49d98c[_0x52fc6a(0x111)],_0x4e308a['qauau'](_0x49d98c['dataOffset'],_0x49d98c[_0x52fc6a(0x115)]),ID_DURATION);if(_0x42f791)return![];const _0x2c1e67=findElement(_0x212d90,_0x49d98c['dataOffset'],_0x49d98c[_0x52fc6a(0x111)]+_0x49d98c[_0x52fc6a(0x115)],ID_TIMESTAMP_SCALE);let _0x355175=0xf4240;_0x2c1e67&&(_0x355175=_0x4e308a[_0x52fc6a(0x106)](readUint,_0x212d90,_0x2c1e67['dataOffset'],_0x2c1e67['dataSize']));const _0x35e647=_0x4e308a[_0x52fc6a(0xf0)](computeDurationMs,_0x212d90,_0x355175);if(_0x4e308a['KgWAP'](_0x35e647,0x0))return console['error'](_0x4e308a['bAjMr']),![];const _0x39edb7=_0x4e308a[_0x52fc6a(0xe2)](_0x4e308a['sNRQn'](_0x35e647,0xf4240),_0x355175),_0x6b4471=Buffer[_0x52fc6a(0x10c)]([writeId(ID_DURATION),writeVint(0x8),_0x4e308a[_0x52fc6a(0xf3)](writeFloat64,_0x39edb7)]),_0x591c51=_0x6b4471['length'];if(!_0x2dcee5||_0x2dcee5['offset']<_0x49d98c[_0x52fc6a(0x104)]){if(_0x2dcee5){const _0x2b2272=_0x4e308a['IdFyY'](_0x4e308a[_0x52fc6a(0xf5)](_0x2dcee5['idLen'],_0x2dcee5['sizeLen']),_0x2dcee5['dataSize']),_0x38ecde=_0x4e308a['GpeGE'](_0x2b2272,_0x591c51);if(_0x38ecde<0x2)return _0x4e308a['AHwVk'](rewriteFile,_0x212d90,_0x49d98c,_0x6b4471,_0x355175,_0x35e647,_0x2d9430);const _0x380573=_0x49d98c['dataSize']+_0x591c51,_0x1015bc=Buffer[_0x52fc6a(0x10c)]([_0x4e308a[_0x52fc6a(0xf3)](writeId,ID_INFO),_0x4e308a['FJUGp'](writeVint,_0x380573,_0x49d98c['sizeLen'])]),_0x509c38=_0x212d90['slice'](_0x49d98c[_0x52fc6a(0x111)],_0x49d98c[_0x52fc6a(0x111)]+_0x49d98c[_0x52fc6a(0x115)]),_0x27828a=writeVoid(_0x38ecde),_0xb8a23=_0x212d90['slice'](0x0,_0x2dcee5[_0x52fc6a(0x104)]),_0x7349ee=_0x212d90[_0x52fc6a(0x101)](_0x49d98c[_0x52fc6a(0x111)]+_0x49d98c[_0x52fc6a(0x115)]);return _0x4e308a['FJUGp'](writeFileSync,_0x2d9430,Buffer['concat']([_0xb8a23,_0x27828a,_0x1015bc,_0x509c38,_0x6b4471,_0x7349ee])),!![];}}return _0x4e308a[_0x52fc6a(0xeb)](rewriteFile,_0x212d90,_0x49d98c,_0x6b4471,_0x355175,_0x35e647,_0x2d9430);}function rewriteFile(_0x55114c,_0x9014c7,_0x3c8c39,_0x3b5bed,_0x19ea67,_0x2fbc22){const _0x4ac3e3=_0x4b33,_0x57f4a2={'eLUGo':function(_0x1c15c1,_0xadd868){return _0x1c15c1+_0xadd868;},'VQNpe':function(_0x22a1fb,_0x303109){return _0x22a1fb+_0x303109;},'qTmxJ':function(_0x2e2af2,_0x314ed2,_0x341db5){return _0x2e2af2(_0x314ed2,_0x341db5);}},_0x56b11b=_0x9014c7['dataSize']+_0x3c8c39[_0x4ac3e3(0xf6)],_0x560631=Buffer[_0x4ac3e3(0x10c)]([writeId(ID_INFO),writeVint(_0x56b11b)]),_0x511eb0=_0x57f4a2[_0x4ac3e3(0x10f)](_0x9014c7[_0x4ac3e3(0xf8)],_0x9014c7['sizeLen']),_0x275fa5=_0x55114c[_0x4ac3e3(0x101)](0x0,_0x9014c7[_0x4ac3e3(0x104)]),_0x52c1f2=_0x55114c[_0x4ac3e3(0x101)](_0x9014c7[_0x4ac3e3(0x111)],_0x57f4a2['VQNpe'](_0x9014c7[_0x4ac3e3(0x111)],_0x9014c7[_0x4ac3e3(0x115)])),_0x302fac=_0x55114c['slice'](_0x57f4a2['VQNpe'](_0x9014c7['offset']+_0x511eb0,_0x9014c7[_0x4ac3e3(0x115)]));return _0x57f4a2[_0x4ac3e3(0x108)](writeFileSync,_0x2fbc22,Buffer['concat']([_0x275fa5,_0x560631,_0x52c1f2,_0x3c8c39,_0x302fac])),!![];}function _0x4b33(_0x350299,_0x21a174){_0x350299=_0x350299-0xde;const _0x417919=_0x4179();let _0x4b3363=_0x417919[_0x350299];return _0x4b3363;}if(process[_0x1cdc42(0xfa)][0x1]?.[_0x1cdc42(0xfc)]('fixWebmDuration.ts')||process['argv'][0x1]?.['endsWith'](_0x1cdc42(0xe4))){const input=process[_0x1cdc42(0xfa)][0x2],output=process[_0x1cdc42(0xfa)][0x3];(!input||!output)&&(console['error']('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process['exit'](0x1));const fixed=fixWebmDuration(input,output);fixed?console[_0x1cdc42(0xf9)](_0x1cdc42(0x10d)+output):console[_0x1cdc42(0xf9)]('File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.');}
|
|
1
|
+
function _0x51ab(){const _0x48caa6=['dataSize','2976phmFvW','jZQoi','from','SeSbf','XPenz','KHady','MtIRK','10568383QpDGKq','DvzhQ','8351752sSJvmh','euTsy','floor','fwMrU','lyhdh','55IgNuLL','cCyJk','GZaVG','error','9CdRVnD','yRARI','zbLZQ','offset','tjtlf','slice','zFQMr','vqIpv','foUrS','FSfIa','HKtBS','dZdBu','xUsPW','UOGTx','rDTAn','length','concat','918003MHkjAW','ltutB','endsWith','File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.','YidWB','Could\x20not\x20find\x20Info\x20element','alloc','RyfFR','pow','argv','nCQoL','9690iZlUCY','keQyI','fixWebmDuration.js','WXnrU','VtnFI','writeDoubleBE','3288210ZYCoeI','tfGZU','sizeLen','108OUHBXo','126123XUGoqY','Tnrbn','readInt16BE','veEmV','yjKUi','dataOffset','jHmTz','GCDDU','Inlsf','78050cqoldK','tVRzH'];_0x51ab=function(){return _0x48caa6;};return _0x51ab();}const _0x583f8c=_0x1e5f;(function(_0x17d24c,_0xcf3efe){const _0x4223c4=_0x1e5f,_0x3634e9=_0x17d24c();while(!![]){try{const _0x56515c=parseInt(_0x4223c4(0x1ca))/0x1+-parseInt(_0x4223c4(0x1db))/0x2+parseInt(_0x4223c4(0x1df))/0x3*(parseInt(_0x4223c4(0x1de))/0x4)+-parseInt(_0x4223c4(0x1d5))/0x5*(-parseInt(_0x4223c4(0x1a7))/0x6)+-parseInt(_0x4223c4(0x1ae))/0x7+-parseInt(_0x4223c4(0x1b0))/0x8*(-parseInt(_0x4223c4(0x1b9))/0x9)+parseInt(_0x4223c4(0x1a4))/0xa*(-parseInt(_0x4223c4(0x1b5))/0xb);if(_0x56515c===_0xcf3efe)break;else _0x3634e9['push'](_0x3634e9['shift']());}catch(_0x5788b9){_0x3634e9['push'](_0x3634e9['shift']());}}}(_0x51ab,0xd3494));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(_0x26e5d2,_0x45e795){const _0x51136e=_0x1e5f,_0x415093={'wpTSc':function(_0x308533,_0x18587c){return _0x308533>=_0x18587c;},'KZJEZ':function(_0x503ad4,_0x1e55a7){return _0x503ad4&_0x1e55a7;},'SeSbf':function(_0x52b612,_0x1ece40){return _0x52b612<_0x1ece40;},'LfzLB':function(_0x942fab,_0x391755){return _0x942fab*_0x391755;}};if(_0x415093['wpTSc'](_0x45e795,_0x26e5d2['length']))return[0x0,0x0];const _0x448635=_0x26e5d2[_0x45e795];let _0x51da00=0x1,_0x33c774=0x80;while(_0x51da00<=0x8&&!(_0x448635&_0x33c774)){_0x51da00++,_0x33c774>>=0x1;}if(_0x45e795+_0x51da00>_0x26e5d2['length'])return[0x0,0x0];let _0xe4cf6b=_0x415093['KZJEZ'](_0x448635,_0x33c774-0x1);for(let _0x1748b6=0x1;_0x415093[_0x51136e(0x1aa)](_0x1748b6,_0x51da00);_0x1748b6++){_0xe4cf6b=_0x415093['LfzLB'](_0xe4cf6b,0x100)+_0x26e5d2[_0x45e795+_0x1748b6];}return[_0xe4cf6b,_0x51da00];}function readId(_0x415c52,_0x54b722){const _0x31a0b8=_0x1e5f,_0x16e7d1={'sMhuD':function(_0xd9056c,_0x80a6bf){return _0xd9056c>_0x80a6bf;},'fwMrU':function(_0x52d929,_0x49e147){return _0x52d929+_0x49e147;},'RyfFR':function(_0x228bd5,_0x3581ad){return _0x228bd5*_0x3581ad;},'XPenz':function(_0x3914b,_0x351616){return _0x3914b+_0x351616;}};if(_0x54b722>=_0x415c52['length'])return[0x0,0x0];const _0x9dd9d4=_0x415c52[_0x54b722];let _0x125c62;if(_0x9dd9d4>=0x80)_0x125c62=0x1;else{if(_0x9dd9d4>=0x40)_0x125c62=0x2;else{if(_0x9dd9d4>=0x20)_0x125c62=0x3;else{if(_0x9dd9d4>=0x10)_0x125c62=0x4;else return[_0x9dd9d4,0x1];}}}if(_0x16e7d1['sMhuD'](_0x16e7d1[_0x31a0b8(0x1b3)](_0x54b722,_0x125c62),_0x415c52['length']))return[0x0,0x0];let _0x2a7293=0x0;for(let _0x22f694=0x0;_0x22f694<_0x125c62;_0x22f694++){_0x2a7293=_0x16e7d1[_0x31a0b8(0x1d1)](_0x2a7293,0x100)+_0x415c52[_0x16e7d1[_0x31a0b8(0x1ab)](_0x54b722,_0x22f694)];}return[_0x2a7293,_0x125c62];}function readUint(_0x2dc24a,_0x2b80b5,_0x200e3c){const _0x45197f={'ZlNWI':function(_0x1efb48,_0x48fe9e){return _0x1efb48<_0x48fe9e;},'BJNPa':function(_0x27f2ee,_0x1842d2){return _0x27f2ee+_0x1842d2;}};let _0x1c0761=0x0;for(let _0x27080d=0x0;_0x45197f['ZlNWI'](_0x27080d,_0x200e3c);_0x27080d++){_0x1c0761=_0x45197f['BJNPa'](_0x1c0761*0x100,_0x2dc24a[_0x45197f['BJNPa'](_0x2b80b5,_0x27080d)]);}return _0x1c0761;}function isUnknownSize(_0x25e4a6,_0x39306f){const _0x1f5f31=_0x1e5f,_0x2c104b={'jZQoi':function(_0x5ea1b1,_0xc6c025){return _0x5ea1b1===_0xc6c025;}};return _0x2c104b[_0x1f5f31(0x1a8)](_0x25e4a6,Math[_0x1f5f31(0x1d2)](0x2,0x7*_0x39306f)-0x1);}function writeId(_0x228079){const _0xdfed1a=_0x1e5f,_0x360004={'GZaVG':function(_0x129f6f,_0x2ee5f5){return _0x129f6f<=_0x2ee5f5;},'xKbqa':function(_0x198d47,_0x3bd4bc){return _0x198d47<=_0x3bd4bc;},'xUsPW':function(_0x32b37d,_0x279cf5){return _0x32b37d&_0x279cf5;},'euTsy':function(_0x39260b,_0x2de125){return _0x39260b>>_0x2de125;},'tfGZU':function(_0x479cfe,_0x2dc385){return _0x479cfe>>_0x2dc385;},'eBNJz':function(_0x12aa38,_0x3542fe){return _0x12aa38&_0x3542fe;}};if(_0x360004[_0xdfed1a(0x1b7)](_0x228079,0xff))return Buffer[_0xdfed1a(0x1a9)]([_0x228079]);if(_0x360004['xKbqa'](_0x228079,0xffff))return Buffer[_0xdfed1a(0x1a9)]([_0x228079>>0x8&0xff,_0x360004[_0xdfed1a(0x1c5)](_0x228079,0xff)]);if(_0x228079<=0xffffff)return Buffer['from']([_0x360004[_0xdfed1a(0x1c5)](_0x360004[_0xdfed1a(0x1b1)](_0x228079,0x10),0xff),_0x360004[_0xdfed1a(0x1c5)](_0x360004[_0xdfed1a(0x1dc)](_0x228079,0x8),0xff),_0x360004[_0xdfed1a(0x1c5)](_0x228079,0xff)]);return Buffer[_0xdfed1a(0x1a9)]([_0x360004['xUsPW'](_0x228079>>0x18,0xff),_0x228079>>0x10&0xff,_0x360004['tfGZU'](_0x228079,0x8)&0xff,_0x360004['eBNJz'](_0x228079,0xff)]);}function writeVint(_0x4bd7a1,_0x269ef2){const _0xc1253b=_0x1e5f,_0x54cb43={'FRMPY':function(_0x51dec8,_0x31ded9){return _0x51dec8||_0x31ded9;},'cCyJk':function(_0x3d4b84,_0x3e54dd){return _0x3d4b84<_0x3e54dd;},'Inlsf':function(_0x145b27,_0x857b67){return _0x145b27-_0x857b67;},'HKtBS':function(_0x4ce679,_0x1cc09b){return _0x4ce679*_0x1cc09b;},'QEFzF':function(_0x4b9474,_0xb43bbc){return _0x4b9474&_0xb43bbc;}};let _0x2e87ef=_0x54cb43['FRMPY'](_0x269ef2,0x1);while(_0x54cb43[_0xc1253b(0x1b6)](_0x54cb43[_0xc1253b(0x1a3)](Math['pow'](0x2,_0x54cb43[_0xc1253b(0x1c3)](0x7,_0x2e87ef)),0x2),_0x4bd7a1))_0x2e87ef++;const _0x37adbb=Buffer['alloc'](_0x2e87ef);for(let _0x21bff2=_0x2e87ef-0x1;_0x21bff2>=0x0;_0x21bff2--){_0x37adbb[_0x21bff2]=_0x54cb43['QEFzF'](_0x4bd7a1,0xff),_0x4bd7a1=Math[_0xc1253b(0x1b2)](_0x4bd7a1/0x100);}return _0x37adbb[0x0]|=0x1<<0x8-_0x2e87ef,_0x37adbb;}function writeFloat64(_0x57d7a1){const _0x27d57a=_0x1e5f,_0x5afd7e=Buffer[_0x27d57a(0x1d0)](0x8);return _0x5afd7e[_0x27d57a(0x1da)](_0x57d7a1,0x0),_0x5afd7e;}function writeVoid(_0x1a3a6b){const _0x527ee0=_0x1e5f,_0x480a37={'vqIpv':function(_0x933382,_0x55e13f){return _0x933382<=_0x55e13f;},'tjtlf':function(_0x1eaf4a,_0x1c9866){return _0x1eaf4a-_0x1c9866;}};for(let _0x22e7a1=0x1;_0x480a37[_0x527ee0(0x1c0)](_0x22e7a1,0x8);_0x22e7a1++){const _0x3ed523=_0x1a3a6b-0x1-_0x22e7a1;if(_0x3ed523>=0x0&&_0x3ed523<=_0x480a37[_0x527ee0(0x1bd)](Math[_0x527ee0(0x1d2)](0x2,0x7*_0x22e7a1),0x2))return Buffer['concat']([Buffer['from']([ID_VOID]),writeVint(_0x3ed523,_0x22e7a1),Buffer['alloc'](_0x3ed523)]);}return Buffer[_0x527ee0(0x1d0)](0x0);}function findElement(_0x4bf26c,_0x548dc8,_0xd99596,_0x1841d4){const _0x2ea7f1=_0x1e5f,_0x2b5fe4={'keQyI':function(_0x1aa78a,_0x2cd216){return _0x1aa78a<_0x2cd216;},'dZdBu':function(_0x5f23c6,_0x538f21){return _0x5f23c6+_0x538f21;},'nCQoL':function(_0x2002c1,_0x3c9bbd){return _0x2002c1+_0x3c9bbd;}};let _0x251141=_0x548dc8;while(_0x2b5fe4[_0x2ea7f1(0x1d6)](_0x251141,_0xd99596)){const [_0x5d2167,_0x48249d]=readId(_0x4bf26c,_0x251141),[_0x3213f7,_0x49423e]=readVint(_0x4bf26c,_0x2b5fe4[_0x2ea7f1(0x1c4)](_0x251141,_0x48249d));if(_0x5d2167===_0x1841d4)return{'offset':_0x251141,'idLen':_0x48249d,'sizeLen':_0x49423e,'dataSize':_0x3213f7,'dataOffset':_0x251141+_0x48249d+_0x49423e};if(isUnknownSize(_0x3213f7,_0x49423e))break;_0x251141+=_0x2b5fe4[_0x2ea7f1(0x1d4)](_0x48249d,_0x49423e)+_0x3213f7;}return null;}function computeDurationMs(_0xe5cc9c,_0x482f3c){const _0x2c0063=_0x1e5f,_0x52138a={'MtIRK':function(_0x5b7227,_0x583f55){return _0x5b7227===_0x583f55;},'tlDaq':function(_0x12a124,_0x5d06ae,_0x38d207){return _0x12a124(_0x5d06ae,_0x38d207);},'jHmTz':function(_0x5ec46a,_0xf19bfc){return _0x5ec46a+_0xf19bfc;},'BqKCG':function(_0x517c4c,_0x2c69c1){return _0x517c4c+_0x2c69c1;},'Tnrbn':function(_0x3c21ba,_0x5e0e3c,_0x132544){return _0x3c21ba(_0x5e0e3c,_0x132544);},'zFQMr':function(_0x2d841f,_0x5b9b03){return _0x2d841f<_0x5b9b03;},'tVRzH':function(_0x413984,_0x11c62f,_0x47c92c){return _0x413984(_0x11c62f,_0x47c92c);},'VtnFI':function(_0x305325,_0x2e1f12,_0xbda2c2){return _0x305325(_0x2e1f12,_0xbda2c2);},'yjKUi':function(_0x49f723,_0x37ca49){return _0x49f723===_0x37ca49;},'yRARI':function(_0x3be543,_0x4d5267){return _0x3be543+_0x4d5267;},'YSMdH':function(_0x3b5b6c,_0x148474,_0x559817){return _0x3b5b6c(_0x148474,_0x559817);},'WXnrU':function(_0x3bb7f3,_0x20bb9f){return _0x3bb7f3*_0x20bb9f;},'chfDf':function(_0xceccc3,_0x121303){return _0xceccc3>_0x121303;},'foUrS':function(_0x2cdfbe,_0x40a933){return _0x2cdfbe===_0x40a933;}};let _0x1717d2=0x0;const _0x1fecb6=Buffer[_0x2c0063(0x1a9)]([0x1f,0x43,0xb6,0x75]);let _0x2629ee=_0xe5cc9c['indexOf'](_0x1fecb6);if(_0x52138a[_0x2c0063(0x1ad)](_0x2629ee,-0x1))return 0x0;while(_0x2629ee<_0xe5cc9c[_0x2c0063(0x1c8)]){const [_0x13ade6,_0x2b608f]=readId(_0xe5cc9c,_0x2629ee);if(_0x13ade6!==ID_CLUSTER)break;const [_0x43383b,_0x5ef234]=_0x52138a['tlDaq'](readVint,_0xe5cc9c,_0x52138a['jHmTz'](_0x2629ee,_0x2b608f)),_0x5c915a=_0x52138a[_0x2c0063(0x1a1)](_0x52138a['BqKCG'](_0x2629ee,_0x2b608f),_0x5ef234),_0x127c39=_0x52138a[_0x2c0063(0x1e0)](isUnknownSize,_0x43383b,_0x5ef234);let _0x546af3;if(_0x127c39){let _0x39cd4d=_0x5c915a;while(_0x52138a[_0x2c0063(0x1bf)](_0x39cd4d,_0xe5cc9c[_0x2c0063(0x1c8)]-0x4)){const [_0x308459,_0xf1aa0a]=readId(_0xe5cc9c,_0x39cd4d);if(_0x308459===ID_CLUSTER){_0x546af3=_0x39cd4d;break;}const [_0x234491,_0x5d5c07]=readVint(_0xe5cc9c,_0x39cd4d+_0xf1aa0a);if(_0x52138a['tVRzH'](isUnknownSize,_0x234491,_0x5d5c07)){_0x546af3=_0xe5cc9c['length'];break;}_0x39cd4d+=_0xf1aa0a+_0x5d5c07+_0x234491;}_0x546af3??=_0xe5cc9c[_0x2c0063(0x1c8)];}else _0x546af3=_0x5c915a+_0x43383b;let _0x569166=0x0,_0x3e28ab=_0x5c915a;while(_0x3e28ab<_0x546af3){const [_0x21e9a7,_0x551a9d]=_0x52138a[_0x2c0063(0x1d9)](readId,_0xe5cc9c,_0x3e28ab),[_0x130fb4,_0x4fbfd0]=readVint(_0xe5cc9c,_0x3e28ab+_0x551a9d);if(_0x52138a['yjKUi'](_0x21e9a7,ID_TIMESTAMP))_0x569166=readUint(_0xe5cc9c,_0x3e28ab+_0x551a9d+_0x4fbfd0,_0x130fb4);else{if(_0x52138a[_0x2c0063(0x19f)](_0x21e9a7,ID_SIMPLE_BLOCK)&&_0x130fb4>=0x4){const _0x1c5435=_0x52138a[_0x2c0063(0x1ba)](_0x3e28ab+_0x551a9d,_0x4fbfd0),[,_0x548786]=_0x52138a['YSMdH'](readVint,_0xe5cc9c,_0x1c5435),_0x22b6a3=_0xe5cc9c[_0x2c0063(0x1e1)](_0x1c5435+_0x548786),_0xc76e=_0x52138a[_0x2c0063(0x1d8)](_0x569166+_0x22b6a3,_0x482f3c)/0xf4240;_0x52138a['chfDf'](_0xc76e,_0x1717d2)&&(_0x1717d2=_0xc76e);}else{if(_0x52138a[_0x2c0063(0x1c1)](_0x21e9a7,ID_CLUSTER))break;}}if(_0x52138a[_0x2c0063(0x1a5)](isUnknownSize,_0x130fb4,_0x4fbfd0))break;_0x3e28ab+=_0x52138a['jHmTz'](_0x551a9d+_0x4fbfd0,_0x130fb4);}_0x2629ee=_0x546af3;}return _0x1717d2;}export function fixWebmDuration(_0x4d8001,_0x20e6d4){const _0x24e611=_0x1e5f,_0x351301={'iPRJy':function(_0x340905,_0x1f129a){return _0x340905!==_0x1f129a;},'XaRaG':'Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','zbLZQ':function(_0x2009a1,_0x28a4a8,_0x32f0ff){return _0x2009a1(_0x28a4a8,_0x32f0ff);},'lyhdh':function(_0x4a22bd,_0x1d27e0){return _0x4a22bd+_0x1d27e0;},'KHady':function(_0x3fd75a,_0x5be6e1){return _0x3fd75a===_0x5be6e1;},'veEmV':function(_0x1f4af8,_0x473d39){return _0x1f4af8+_0x473d39;},'DvzhQ':function(_0x1e3dd2,_0x15c457){return _0x1e3dd2+_0x15c457;},'YidWB':function(_0x5a8b25,_0x31db9f,_0x26167d){return _0x5a8b25(_0x31db9f,_0x26167d);},'ltutB':function(_0x7c8b0,_0x8b9453){return _0x7c8b0+_0x8b9453;},'GCDDU':function(_0x165fd2,_0x4926a7){return _0x165fd2+_0x4926a7;},'tATCV':function(_0x5b8bc9,_0x4ca098){return _0x5b8bc9+_0x4ca098;},'FSfIa':function(_0x3597dd,_0x126d4b,_0x4a4f55){return _0x3597dd(_0x126d4b,_0x4a4f55);},'zebVs':function(_0x5cb422,_0x345c72){return _0x5cb422/_0x345c72;},'UOGTx':function(_0x3bd470,_0x528f82){return _0x3bd470(_0x528f82);},'utKZD':function(_0x19463d,_0x93f94f){return _0x19463d-_0x93f94f;},'fdyup':function(_0x1d709b,_0x248a63){return _0x1d709b<_0x248a63;},'EOXLR':function(_0x517c7d,_0x4443cb){return _0x517c7d(_0x4443cb);},'BBFlM':function(_0x5510d1,_0x14b0e2,_0x4c713d){return _0x5510d1(_0x14b0e2,_0x4c713d);},'rDTAn':function(_0x5dbcbb,_0x5c422a){return _0x5dbcbb(_0x5c422a);},'sHuaM':function(_0x3bc96d,_0x1627a8,_0x38ec8d,_0x4af013,_0x5b552d,_0x291feb,_0x1c413b){return _0x3bc96d(_0x1627a8,_0x38ec8d,_0x4af013,_0x5b552d,_0x291feb,_0x1c413b);}},_0x4f8d34=readFileSync(_0x4d8001);let _0x2670a2=0x0;const [_0x476d5b,_0x35fafa]=readId(_0x4f8d34,_0x2670a2),[_0x227265,_0x59f2b1]=readVint(_0x4f8d34,_0x2670a2+_0x35fafa);_0x2670a2+=_0x35fafa+_0x59f2b1+_0x227265;const [_0x2987ff,_0x4ed357]=readId(_0x4f8d34,_0x2670a2);if(_0x351301['iPRJy'](_0x2987ff,ID_SEGMENT))return console['error'](_0x351301['XaRaG']),![];const [,_0x3bccf6]=_0x351301[_0x24e611(0x1bb)](readVint,_0x4f8d34,_0x351301[_0x24e611(0x1b4)](_0x2670a2,_0x4ed357)),_0xabc5a4=_0x2670a2+_0x4ed357+_0x3bccf6;let _0x302a53=_0xabc5a4;const _0x124e19=Math['min'](_0x4f8d34[_0x24e611(0x1c8)],_0xabc5a4+0x2710);let _0x4e2a7b=null,_0x11688f=null;while(_0x302a53<_0x124e19){const [_0x11cb7a,_0x73d8e0]=readId(_0x4f8d34,_0x302a53),[_0x4d5ec6,_0x44d844]=_0x351301[_0x24e611(0x1bb)](readVint,_0x4f8d34,_0x302a53+_0x73d8e0);_0x351301['KHady'](_0x11cb7a,ID_VOID)&&!_0x4e2a7b&&(_0x4e2a7b={'offset':_0x302a53,'idLen':_0x73d8e0,'sizeLen':_0x44d844,'dataSize':_0x4d5ec6,'dataOffset':_0x351301[_0x24e611(0x1e2)](_0x302a53+_0x73d8e0,_0x44d844)});if(_0x351301[_0x24e611(0x1ac)](_0x11cb7a,ID_INFO)){_0x11688f={'offset':_0x302a53,'idLen':_0x73d8e0,'sizeLen':_0x44d844,'dataSize':_0x4d5ec6,'dataOffset':_0x351301[_0x24e611(0x1af)](_0x302a53+_0x73d8e0,_0x44d844)};break;}if(_0x351301[_0x24e611(0x1ac)](_0x11cb7a,ID_CLUSTER))break;if(_0x351301[_0x24e611(0x1ce)](isUnknownSize,_0x4d5ec6,_0x44d844))break;_0x302a53+=_0x351301[_0x24e611(0x1b4)](_0x351301['ltutB'](_0x73d8e0,_0x44d844),_0x4d5ec6);}if(!_0x11688f)return console[_0x24e611(0x1b8)](_0x24e611(0x1cf)),![];const _0x2b3d73=findElement(_0x4f8d34,_0x11688f[_0x24e611(0x1a0)],_0x351301[_0x24e611(0x1a2)](_0x11688f['dataOffset'],_0x11688f['dataSize']),ID_DURATION);if(_0x2b3d73)return![];const _0x68508b=findElement(_0x4f8d34,_0x11688f[_0x24e611(0x1a0)],_0x351301['tATCV'](_0x11688f[_0x24e611(0x1a0)],_0x11688f['dataSize']),ID_TIMESTAMP_SCALE);let _0x2cd8f3=0xf4240;_0x68508b&&(_0x2cd8f3=readUint(_0x4f8d34,_0x68508b['dataOffset'],_0x68508b[_0x24e611(0x1a6)]));const _0x45345a=_0x351301[_0x24e611(0x1c2)](computeDurationMs,_0x4f8d34,_0x2cd8f3);if(_0x45345a<=0x0)return console[_0x24e611(0x1b8)]('Could\x20not\x20compute\x20duration'),![];const _0x105e73=_0x351301['zebVs'](_0x45345a*0xf4240,_0x2cd8f3),_0x538a1a=Buffer[_0x24e611(0x1c9)]([_0x351301['UOGTx'](writeId,ID_DURATION),_0x351301[_0x24e611(0x1c6)](writeVint,0x8),_0x351301[_0x24e611(0x1c6)](writeFloat64,_0x105e73)]),_0x2e6f10=_0x538a1a['length'];if(!_0x4e2a7b||_0x4e2a7b[_0x24e611(0x1bc)]<_0x11688f['offset']){if(_0x4e2a7b){const _0xbfbfc2=_0x4e2a7b['idLen']+_0x4e2a7b['sizeLen']+_0x4e2a7b['dataSize'],_0x9249fb=_0x351301['utKZD'](_0xbfbfc2,_0x2e6f10);if(_0x351301['fdyup'](_0x9249fb,0x2))return rewriteFile(_0x4f8d34,_0x11688f,_0x538a1a,_0x2cd8f3,_0x45345a,_0x20e6d4);const _0x4e8051=_0x351301[_0x24e611(0x1cb)](_0x11688f[_0x24e611(0x1a6)],_0x2e6f10),_0x2bab8c=Buffer[_0x24e611(0x1c9)]([_0x351301['EOXLR'](writeId,ID_INFO),_0x351301['BBFlM'](writeVint,_0x4e8051,_0x11688f['sizeLen'])]),_0x1e2f17=_0x4f8d34[_0x24e611(0x1be)](_0x11688f['dataOffset'],_0x11688f['dataOffset']+_0x11688f[_0x24e611(0x1a6)]),_0x22a624=_0x351301[_0x24e611(0x1c7)](writeVoid,_0x9249fb),_0x526e1c=_0x4f8d34[_0x24e611(0x1be)](0x0,_0x4e2a7b[_0x24e611(0x1bc)]),_0x254107=_0x4f8d34[_0x24e611(0x1be)](_0x351301['ltutB'](_0x11688f['dataOffset'],_0x11688f['dataSize']));return writeFileSync(_0x20e6d4,Buffer['concat']([_0x526e1c,_0x22a624,_0x2bab8c,_0x1e2f17,_0x538a1a,_0x254107])),!![];}}return _0x351301['sHuaM'](rewriteFile,_0x4f8d34,_0x11688f,_0x538a1a,_0x2cd8f3,_0x45345a,_0x20e6d4);}function rewriteFile(_0x53f3a7,_0x3eab7d,_0x17ba0c,_0x412f8e,_0x368005,_0x303b99){const _0x30e08d=_0x1e5f,_0x1aa72e={'sCsmN':function(_0x67aa14,_0x37c649){return _0x67aa14+_0x37c649;},'JPlen':function(_0x10912c,_0x54cf57){return _0x10912c+_0x54cf57;}},_0x27bf5c=_0x1aa72e['sCsmN'](_0x3eab7d[_0x30e08d(0x1a6)],_0x17ba0c[_0x30e08d(0x1c8)]),_0x59ec60=Buffer[_0x30e08d(0x1c9)]([writeId(ID_INFO),writeVint(_0x27bf5c)]),_0x1b6cc6=_0x3eab7d['idLen']+_0x3eab7d[_0x30e08d(0x1dd)],_0x353708=_0x53f3a7[_0x30e08d(0x1be)](0x0,_0x3eab7d[_0x30e08d(0x1bc)]),_0x3f3359=_0x53f3a7[_0x30e08d(0x1be)](_0x3eab7d['dataOffset'],_0x1aa72e['sCsmN'](_0x3eab7d['dataOffset'],_0x3eab7d['dataSize'])),_0x8e766b=_0x53f3a7[_0x30e08d(0x1be)](_0x1aa72e['JPlen'](_0x3eab7d[_0x30e08d(0x1bc)],_0x1b6cc6)+_0x3eab7d[_0x30e08d(0x1a6)]);return writeFileSync(_0x303b99,Buffer['concat']([_0x353708,_0x59ec60,_0x3f3359,_0x17ba0c,_0x8e766b])),!![];}function _0x1e5f(_0x3e687d,_0x443d4b){_0x3e687d=_0x3e687d-0x19f;const _0x51ab49=_0x51ab();let _0x1e5f6a=_0x51ab49[_0x3e687d];return _0x1e5f6a;}if(process['argv'][0x1]?.[_0x583f8c(0x1cc)]('fixWebmDuration.ts')||process[_0x583f8c(0x1d3)][0x1]?.['endsWith'](_0x583f8c(0x1d7))){const input=process['argv'][0x2],output=process['argv'][0x3];(!input||!output)&&(console['error']('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process['exit'](0x1));const fixed=fixWebmDuration(input,output);fixed?console['log']('Fixed:\x20'+output):console['log'](_0x583f8c(0x1cd));}
|