@flosum/cli 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +1 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a0_0x216d83=a0_0x3826;(function(_0x524d71,_0x458f6c){const _0x2d72c6=a0_0x3826,_0x539e1f=_0x524d71();while(!![]){try{const _0x37dd41=-parseInt(_0x2d72c6(0x317))/0x1*(-parseInt(_0x2d72c6(0x2fb))/0x2)+-parseInt(_0x2d72c6(0x2c0))/0x3+parseInt(_0x2d72c6(0x2fc))/0x4+parseInt(_0x2d72c6(0x285))/0x5+-parseInt(_0x2d72c6(0x31b))/0x6*(-parseInt(_0x2d72c6(0x20e))/0x7)+-parseInt(_0x2d72c6(0x1ef))/0x8*(parseInt(_0x2d72c6(0x27b))/0x9)+parseInt(_0x2d72c6(0x2a5))/0xa;if(_0x37dd41===_0x458f6c)break;else _0x539e1f['push'](_0x539e1f['shift']());}catch(_0x121916){_0x539e1f['push'](_0x539e1f['shift']());}}}(a0_0x5404,0x7fc16));const a0_0x3c45d3=(function(){let _0x4bb14c=!![];return function(_0x97cfa9,_0x3a62e7){const _0x473194=_0x4bb14c?function(){const _0x522076=a0_0x3826;if(_0x3a62e7){const _0x282f3d=_0x3a62e7[_0x522076(0x336)](_0x97cfa9,arguments);return _0x3a62e7=null,_0x282f3d;}}:function(){};return _0x4bb14c=![],_0x473194;};}()),a0_0x25e96e=a0_0x3c45d3(this,function(){const _0x35bd58=a0_0x3826;return a0_0x25e96e['toString']()[_0x35bd58(0x270)](_0x35bd58(0x1da))[_0x35bd58(0x249)]()[_0x35bd58(0x28a)](a0_0x25e96e)[_0x35bd58(0x270)](_0x35bd58(0x1da));});a0_0x25e96e();'use strict';var node_path=require(a0_0x216d83(0x2cb)),commander=require(a0_0x216d83(0x288)),promises=require('node:fs/promises'),node_os=require(a0_0x216d83(0x29e)),axios=require('axios'),salesforce=require('@flosum/salesforce'),node_crypto=require('node:crypto'),readline=require(a0_0x216d83(0x207)),debug=require(a0_0x216d83(0x292)),table=require(a0_0x216d83(0x242)),path=require(a0_0x216d83(0x1f6)),version=a0_0x216d83(0x320),config={'version':version};const ROOT_NAME=a0_0x216d83(0x23f),DEFAULT_ALIAS_NAME='default';class FileUtils{static async[a0_0x216d83(0x20f)](_0x230ca7){const _0x4e1f2d=a0_0x216d83,_0x49324f=await promises[_0x4e1f2d(0x334)](_0x230ca7,{'withFileTypes':!![]}),_0x4d0651=[];for(const _0x3a27da of _0x49324f){const _0x47f267=node_path['join'](_0x230ca7,_0x3a27da['name']);if(_0x3a27da[_0x4e1f2d(0x2be)]()){const _0x40d98e=await FileUtils[_0x4e1f2d(0x20f)](_0x47f267);_0x4d0651['push'](_0x40d98e);continue;}_0x4d0651[_0x4e1f2d(0x212)](_0x47f267);}return _0x4d0651[_0x4e1f2d(0x220)]();}static async[a0_0x216d83(0x2d1)](_0x50dfc0,_0x50cdb5=!![]){const _0x4a286d=a0_0x216d83,_0x34350c=await promises[_0x4a286d(0x334)](_0x50dfc0,{'withFileTypes':!![]});let _0xb76d28=!![];for(const _0x1d1576 of _0x34350c){const _0x2efdb4=node_path[_0x4a286d(0x1e5)](_0x50dfc0,_0x1d1576[_0x4a286d(0x24f)]);if(_0x1d1576[_0x4a286d(0x2be)]()){const _0x33d52d=await FileUtils[_0x4a286d(0x2d1)](_0x2efdb4);!_0x33d52d&&(_0xb76d28=![]);}else _0xb76d28=![];}return _0x50cdb5&&_0xb76d28&&await promises[_0x4a286d(0x302)](_0x50dfc0),_0xb76d28;}static async[a0_0x216d83(0x24c)](_0x3bdc99){const _0x220188=a0_0x216d83;return promises['stat'](_0x3bdc99)[_0x220188(0x311)](async _0x413fd3=>{const _0x5b8339=_0x220188;return await promises[_0x5b8339(0x25a)](_0x3bdc99,promises['constants']['R_OK']|promises['constants'][_0x5b8339(0x2f6)]),_0x413fd3[_0x5b8339(0x2be)]();})[_0x220188(0x2ac)](()=>![]);}static async[a0_0x216d83(0x266)](_0xcc45ba){const _0x5ef9e9=a0_0x216d83;return promises[_0x5ef9e9(0x21e)](_0xcc45ba)['then'](async _0x4abde0=>{const _0x3fafdf=_0x5ef9e9;return await promises[_0x3fafdf(0x25a)](_0xcc45ba,promises['constants']['R_OK']|promises[_0x3fafdf(0x280)][_0x3fafdf(0x2f6)]),_0x4abde0['isFile']();})['catch'](()=>![]);}}const SYSTEM_FOLDER$1='.'+ROOT_NAME,CREDENTIALS_FILE_NAME=a0_0x216d83(0x1d6);class CredentialsManager{static async[a0_0x216d83(0x29c)](_0x207449){const _0x31efc4=a0_0x216d83,_0xf6f3bd=node_path[_0x31efc4(0x1e5)](node_os[_0x31efc4(0x1e1)](),SYSTEM_FOLDER$1);await promises[_0x31efc4(0x33b)](_0xf6f3bd,{'recursive':!![]});const _0x15bce7=node_path['join'](_0xf6f3bd,CREDENTIALS_FILE_NAME),_0x2b7dd7=await CredentialsManager[_0x31efc4(0x2ca)](_0x15bce7),_0xba5c7a=_0x2b7dd7[_0x31efc4(0x1d1)](({alias:_0x431be5})=>_0x431be5===_0x207449[_0x31efc4(0x27e)]);!_0xba5c7a?_0x2b7dd7[_0x31efc4(0x212)](_0x207449):(_0xba5c7a[_0x31efc4(0x1db)]=_0x207449['accessToken'],_0xba5c7a[_0x31efc4(0x294)]=_0x207449[_0x31efc4(0x294)],_0xba5c7a[_0x31efc4(0x1f0)]=_0x207449[_0x31efc4(0x1f0)]),await promises[_0x31efc4(0x313)](_0x15bce7,Buffer[_0x31efc4(0x267)](JSON[_0x31efc4(0x21f)](_0x2b7dd7)));}static async['get']({alias:_0x96ff83}){const _0x4afc10=a0_0x216d83,_0x13f7e6=node_path[_0x4afc10(0x1e5)](node_os[_0x4afc10(0x1e1)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0xa2134f=await CredentialsManager[_0x4afc10(0x2ca)](_0x13f7e6),_0x18a4d6=_0xa2134f['find'](_0x232e1a=>_0x232e1a['alias']===_0x96ff83);if(!_0x18a4d6)throw new Error(_0x4afc10(0x22b)+_0x96ff83+'\x22\x20not\x20found');return _0x18a4d6;}static async['list'](){const _0x21cb33=a0_0x216d83,_0x1a9057=node_path[_0x21cb33(0x1e5)](node_os[_0x21cb33(0x1e1)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x16cd47=await CredentialsManager[_0x21cb33(0x2ca)](_0x1a9057);return _0x16cd47;}static async['getAllCredentials'](_0x53e634){const _0x5f404c=a0_0x216d83,_0x57028c=await FileUtils['isFileExists'](_0x53e634);if(_0x57028c){const _0x5b3a57=await promises[_0x5f404c(0x297)](_0x53e634);return JSON[_0x5f404c(0x304)](_0x5b3a57[_0x5f404c(0x249)]());}return[];}static async[a0_0x216d83(0x1cf)]({alias:_0x4ca4f4}){const _0x2ed15b=a0_0x216d83,_0x2f6605=node_path[_0x2ed15b(0x1e5)](node_os[_0x2ed15b(0x1e1)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x27bb69=await CredentialsManager[_0x2ed15b(0x2ca)](_0x2f6605),_0x4e4bed=_0x27bb69[_0x2ed15b(0x2df)](_0x42ca94=>_0x42ca94[_0x2ed15b(0x27e)]===_0x4ca4f4);if(_0x4e4bed<0x0)throw new Error(_0x2ed15b(0x22b)+_0x4ca4f4+_0x2ed15b(0x2f2));_0x27bb69['splice'](_0x4e4bed,0x1),await promises[_0x2ed15b(0x313)](_0x2f6605,Buffer[_0x2ed15b(0x267)](JSON[_0x2ed15b(0x21f)](_0x27bb69)));}}var ManagementType=(_0x3e0a74=>{const _0x30f2e5=a0_0x216d83;return _0x3e0a74[_0x30f2e5(0x27c)]='Salesforce',_0x3e0a74[_0x30f2e5(0x319)]='Vlocity',_0x3e0a74;})(ManagementType||{});class CommitAction{[a0_0x216d83(0x1db)];[a0_0x216d83(0x1f0)];['message'];[a0_0x216d83(0x343)];[a0_0x216d83(0x2b4)];[a0_0x216d83(0x2f5)];[a0_0x216d83(0x283)]=new Date();constructor(_0x4bdfb5){const _0x4b9288=a0_0x216d83;this[_0x4b9288(0x1db)]=_0x4bdfb5[_0x4b9288(0x1db)],this[_0x4b9288(0x1f0)]=_0x4bdfb5[_0x4b9288(0x1f0)],this[_0x4b9288(0x300)]=_0x4bdfb5['message'],this[_0x4b9288(0x343)]=_0x4bdfb5[_0x4b9288(0x343)],this[_0x4b9288(0x2b4)]=_0x4bdfb5[_0x4b9288(0x2b4)],this[_0x4b9288(0x2f5)]=_0x4bdfb5[_0x4b9288(0x2f5)];}async['execute'](){const _0x24e55d=a0_0x216d83;try{const _0x171715=await Promise[_0x24e55d(0x2c4)](this[_0x24e55d(0x2b4)][_0x24e55d(0x1d8)](async _0x1996b5=>await this[_0x24e55d(0x281)](_0x1996b5))),{data:_0x28a0ec}=await axios['post'](_0x24e55d(0x228)+this[_0x24e55d(0x343)]+_0x24e55d(0x2e9),{'message':this[_0x24e55d(0x300)],'components':_0x171715},{'headers':{'authorization':''+this[_0x24e55d(0x1db)]},'baseURL':this[_0x24e55d(0x1f0)]});return _0x28a0ec;}catch(_0x5a5652){if(axios[_0x24e55d(0x2d2)](_0x5a5652))throw Error(_0x5a5652[_0x24e55d(0x227)]?.[_0x24e55d(0x307)][_0x24e55d(0x300)]||_0x5a5652['response']?.[_0x24e55d(0x28c)]||_0x5a5652[_0x24e55d(0x300)],{'cause':_0x5a5652});throw _0x5a5652;}}async[a0_0x216d83(0x281)](_0x4501c5){const _0x318124=a0_0x216d83,_0x29afe6=[];for(const {path:_0x45a269,localPath:_0xb9fcd0}of _0x4501c5[_0x318124(0x1c1)]){_0x29afe6[_0x318124(0x212)](promises[_0x318124(0x297)](_0xb9fcd0)[_0x318124(0x311)](_0x3a19b2=>({'path':_0x45a269,'content':_0x3a19b2[_0x318124(0x249)]('base64')})));}const _0x76bc10=await Promise[_0x318124(0x2c4)](_0x29afe6);return{'name':_0x4501c5['name'],'label':_0x4501c5[_0x318124(0x2ed)],'type':_0x4501c5[_0x318124(0x30f)],'sourceName':'CLI','sourceType':_0x318124(0x1ec),'externalUpdatedAt':this[_0x318124(0x283)],'externalUpdatedBy':this[_0x318124(0x2f5)],'files':_0x76bc10,'managementType':ManagementType[_0x318124(0x27c)]};}}class CreateBranchAction{[a0_0x216d83(0x1db)];['devopsUrl'];constructor(_0x2020e0){const _0x542ef8=a0_0x216d83;this[_0x542ef8(0x1db)]=_0x2020e0[_0x542ef8(0x1db)],this[_0x542ef8(0x1f0)]=_0x2020e0[_0x542ef8(0x1f0)];}async[a0_0x216d83(0x31a)](_0xe7982c){const _0x128f96=a0_0x216d83;try{const {data:_0x40e1e2}=await axios[_0x128f96(0x209)](_0x128f96(0x330),{..._0xe7982c},{'headers':{'authorization':''+this[_0x128f96(0x1db)]},'baseURL':this['devopsUrl']});return _0x40e1e2;}catch(_0x343b21){if(axios['isAxiosError'](_0x343b21))throw Error(_0x343b21[_0x128f96(0x227)]?.[_0x128f96(0x307)][_0x128f96(0x300)]||_0x343b21['response']?.['statusText']||_0x343b21['message'],{'cause':_0x343b21});throw _0x343b21;}}}class GetBranchAction{[a0_0x216d83(0x1db)];['devopsUrl'];constructor(_0xea5c18){const _0x4cf4a9=a0_0x216d83;this[_0x4cf4a9(0x1db)]=_0xea5c18[_0x4cf4a9(0x1db)],this['devopsUrl']=_0xea5c18[_0x4cf4a9(0x1f0)];}async[a0_0x216d83(0x31a)](_0x3fa371){const _0x262080=a0_0x216d83;try{const {data:_0x5ef3aa}=await axios[_0x262080(0x2e5)](_0x262080(0x228)+_0x3fa371[_0x262080(0x343)],{'headers':{'authorization':''+this[_0x262080(0x1db)]},'baseURL':this[_0x262080(0x1f0)]});return _0x5ef3aa;}catch(_0x28b8ba){if(axios[_0x262080(0x2d2)](_0x28b8ba))throw Error(_0x28b8ba[_0x262080(0x227)]?.['data'][_0x262080(0x300)]||_0x28b8ba[_0x262080(0x227)]?.[_0x262080(0x28c)]||_0x28b8ba['message'],{'cause':_0x28b8ba});throw _0x28b8ba;}}}class GetDefaultBranchAction{[a0_0x216d83(0x1f0)];[a0_0x216d83(0x1db)];constructor(_0x529c22){const _0x5aadf9=a0_0x216d83;this[_0x5aadf9(0x1f0)]=_0x529c22[_0x5aadf9(0x1f0)],this['accessToken']=_0x529c22['accessToken'];}async[a0_0x216d83(0x31a)](){const _0x319b29=a0_0x216d83;try{const {data:_0x303b67}=await axios[_0x319b29(0x2e5)]('fit/branches/default',{'headers':{'authorization':''+this['accessToken']},'baseURL':this[_0x319b29(0x1f0)]});return _0x303b67;}catch(_0x284c80){if(axios[_0x319b29(0x2d2)](_0x284c80))throw Error(_0x284c80[_0x319b29(0x227)]?.[_0x319b29(0x307)][_0x319b29(0x300)]||_0x284c80[_0x319b29(0x227)]?.[_0x319b29(0x28c)]||_0x284c80[_0x319b29(0x300)],{'cause':_0x284c80});throw _0x284c80;}}}class GetMeAction{[a0_0x216d83(0x1db)];[a0_0x216d83(0x1f0)];constructor(_0x38f881){const _0xe2868a=a0_0x216d83;this['accessToken']=_0x38f881[_0xe2868a(0x1db)],this[_0xe2868a(0x1f0)]=_0x38f881[_0xe2868a(0x1f0)];}async[a0_0x216d83(0x31a)](){const _0x30ffac=a0_0x216d83;try{const {data:_0x412ce6}=await axios[_0x30ffac(0x2e5)](_0x30ffac(0x284),{'headers':{'authorization':''+this[_0x30ffac(0x1db)]},'baseURL':this[_0x30ffac(0x1f0)]});return _0x412ce6;}catch(_0x536fe5){if(axios[_0x30ffac(0x2d2)](_0x536fe5))throw Error(_0x536fe5[_0x30ffac(0x227)]?.[_0x30ffac(0x307)]['message']||_0x536fe5[_0x30ffac(0x227)]?.[_0x30ffac(0x28c)]||_0x536fe5[_0x30ffac(0x300)],{'cause':_0x536fe5});throw _0x536fe5;}}}class ListBranchesAction{[a0_0x216d83(0x1f0)];['accessToken'];[a0_0x216d83(0x270)];constructor(_0x4254b7){const _0x3ad4ff=a0_0x216d83;this[_0x3ad4ff(0x1f0)]=_0x4254b7['devopsUrl'],this[_0x3ad4ff(0x1db)]=_0x4254b7[_0x3ad4ff(0x1db)],this[_0x3ad4ff(0x270)]=_0x4254b7[_0x3ad4ff(0x270)];}async[a0_0x216d83(0x31a)](){const _0x1a2ad0=a0_0x216d83;try{const _0x219b0c=[];let _0x59041d=0x0,_0x4fcd61=0x0;do{const {data:_0x1b60d2}=await axios[_0x1a2ad0(0x2e5)](_0x1a2ad0(0x330),{'headers':{'authorization':''+this[_0x1a2ad0(0x1db)]},'params':{'search':this['search'],'offset':_0x59041d,'limit':0x64},'baseURL':this[_0x1a2ad0(0x1f0)]});_0x219b0c[_0x1a2ad0(0x212)](..._0x1b60d2[_0x1a2ad0(0x1d7)]),_0x59041d+=_0x1b60d2[_0x1a2ad0(0x1d7)]['length'],_0x4fcd61=_0x1b60d2[_0x1a2ad0(0x206)];}while(_0x59041d<_0x4fcd61);return _0x219b0c;}catch(_0x45f13d){if(axios['isAxiosError'](_0x45f13d))throw Error(_0x45f13d[_0x1a2ad0(0x227)]?.[_0x1a2ad0(0x307)][_0x1a2ad0(0x300)]||_0x45f13d[_0x1a2ad0(0x227)]?.[_0x1a2ad0(0x28c)]||_0x45f13d[_0x1a2ad0(0x300)],{'cause':_0x45f13d});throw _0x45f13d;}}}class ListComponentsAction{['devopsUrl'];[a0_0x216d83(0x1db)];['branchId'];['commitId'];[a0_0x216d83(0x2e7)];constructor(_0x14ea87){const _0x10406e=a0_0x216d83;this[_0x10406e(0x1f0)]=_0x14ea87[_0x10406e(0x1f0)],this[_0x10406e(0x1db)]=_0x14ea87[_0x10406e(0x1db)],this['branchId']=_0x14ea87[_0x10406e(0x343)],this['commitId']=_0x14ea87['commitId'],_0x14ea87[_0x10406e(0x2b4)]&&(this[_0x10406e(0x2e7)]=new Set(_0x14ea87[_0x10406e(0x2b4)]['map'](({name:_0x1fcc97,type:_0x26146a})=>_0x26146a+'_'+_0x1fcc97)));}async*[a0_0x216d83(0x31a)](){const _0x1aa1c3=a0_0x216d83;try{let _0x492b56=0x0,_0x5f1ad0=0x0;do{const {data:_0x3e15f0}=await axios[_0x1aa1c3(0x2e5)](_0x1aa1c3(0x228)+this['branchId']+'/commits/'+this[_0x1aa1c3(0x219)]+'/components',{'headers':{'authorization':''+this[_0x1aa1c3(0x1db)]},'params':{'offset':_0x492b56,'limit':0x64,'managementType':ManagementType[_0x1aa1c3(0x27c)]},'baseURL':this[_0x1aa1c3(0x1f0)]});_0x492b56+=_0x3e15f0[_0x1aa1c3(0x1d7)][_0x1aa1c3(0x200)],_0x5f1ad0=_0x3e15f0[_0x1aa1c3(0x232)];let _0x5dfbcb=_0x3e15f0[_0x1aa1c3(0x1d7)];this[_0x1aa1c3(0x2e7)]&&(_0x5dfbcb=_0x3e15f0[_0x1aa1c3(0x1d7)]['filter'](({name:_0x25da66,type:_0x86d777})=>this['indexes']?.[_0x1aa1c3(0x210)](_0x86d777+'_'+_0x25da66))),yield*_0x5dfbcb;}while(_0x492b56<_0x5f1ad0);}catch(_0x5073e4){if(axios['isAxiosError'](_0x5073e4))throw Error(_0x5073e4[_0x1aa1c3(0x227)]?.[_0x1aa1c3(0x307)][_0x1aa1c3(0x300)]||_0x5073e4[_0x1aa1c3(0x227)]?.[_0x1aa1c3(0x28c)]||_0x5073e4[_0x1aa1c3(0x300)],{'cause':_0x5073e4});throw _0x5073e4;}}}class RetrieveComponentAction{['devopsUrl'];[a0_0x216d83(0x1db)];constructor(_0x4a391e){const _0x129cdf=a0_0x216d83;this[_0x129cdf(0x1f0)]=_0x4a391e[_0x129cdf(0x1f0)],this['accessToken']=_0x4a391e[_0x129cdf(0x1db)];}async[a0_0x216d83(0x31a)](_0x3370c3){const _0x242880=a0_0x216d83;try{const {data:{id:_0x279b10,name:_0x5c9754,type:_0x571ec6,fHash:_0x37b7ed,files:_0x105206}}=await axios[_0x242880(0x2e5)](_0x242880(0x1df)+_0x3370c3,{'headers':{'authorization':''+this[_0x242880(0x1db)]},'baseURL':this['devopsUrl']}),_0x4ecb5b=_0x105206[_0x242880(0x1d8)](_0x5126db=>({'path':_0x5126db[_0x242880(0x1f6)],'content':Buffer[_0x242880(0x267)](_0x5126db['content'],'base64')['toString'](_0x242880(0x2a4))}));return{'id':_0x279b10,'name':_0x5c9754,'type':_0x571ec6,'fHash':_0x37b7ed,'files':_0x4ecb5b};}catch(_0x2e0b15){if(axios[_0x242880(0x2d2)](_0x2e0b15))throw Error(_0x2e0b15[_0x242880(0x227)]?.[_0x242880(0x307)]['message']||_0x2e0b15['response']?.[_0x242880(0x28c)]||_0x2e0b15['message'],{'cause':_0x2e0b15});throw _0x2e0b15;}}}const RETRIEVE_COMPONENT_CHUNK_SIZE=0xa;class ApiService{static async[a0_0x216d83(0x1d4)](_0x5a5646){const _0x87be4d=a0_0x216d83,_0x1782fc=new ListBranchesAction(_0x5a5646);return _0x1782fc[_0x87be4d(0x31a)]();}static async[a0_0x216d83(0x1be)](_0x187e90){const _0x1e8643=a0_0x216d83,_0x42b9c8=new GetDefaultBranchAction(_0x187e90);return _0x42b9c8[_0x1e8643(0x31a)]();}static async['getBranch'](_0xc09520){const _0x5a9e90=a0_0x216d83,_0x37cc7f=await ApiService[_0x5a9e90(0x1d4)]({'devopsUrl':_0xc09520[_0x5a9e90(0x1f0)],'accessToken':_0xc09520[_0x5a9e90(0x1db)],'search':_0xc09520[_0x5a9e90(0x2c6)]});return _0x37cc7f['find'](({name:_0x21a69e})=>_0x21a69e===_0xc09520['branchName'])||null;}static async['getBranchById'](_0x5cf6ce){const _0x5ea484=a0_0x216d83,_0x1de5c2=new GetBranchAction({'accessToken':_0x5cf6ce['accessToken'],'devopsUrl':_0x5cf6ce['devopsUrl']});return _0x1de5c2['execute']({'branchId':_0x5cf6ce[_0x5ea484(0x343)]});}static[a0_0x216d83(0x262)](_0x3cb2ec){const _0x2e7739=a0_0x216d83,_0x1061fb=new ListComponentsAction(_0x3cb2ec);return _0x1061fb[_0x2e7739(0x31a)]();}static async[a0_0x216d83(0x22d)](_0x4dde18){const _0x6460e=a0_0x216d83,_0x1917e0=[];for await(const _0xf20753 of ApiService['listComponentsGenerator'](_0x4dde18)){_0x1917e0[_0x6460e(0x212)](_0xf20753);}return _0x1917e0;}static async*[a0_0x216d83(0x2f9)](_0x93296f){const _0x2e9520=a0_0x216d83,_0x21fab9=new RetrieveComponentAction({'devopsUrl':_0x93296f[_0x2e9520(0x1f0)],'accessToken':_0x93296f[_0x2e9520(0x1db)]});let _0x543c25=[];for await(const _0x3a031c of ApiService[_0x2e9520(0x262)]({'devopsUrl':_0x93296f[_0x2e9520(0x1f0)],'accessToken':_0x93296f[_0x2e9520(0x1db)],'branchId':_0x93296f['branchId'],'commitId':_0x93296f[_0x2e9520(0x219)],'components':_0x93296f['components']})){_0x543c25[_0x2e9520(0x212)](_0x21fab9['execute'](_0x3a031c['id'])),_0x543c25['length']>=RETRIEVE_COMPONENT_CHUNK_SIZE&&(yield*await Promise[_0x2e9520(0x2c4)](_0x543c25),_0x543c25=[]);}_0x543c25['length']&&(yield*await Promise[_0x2e9520(0x2c4)](_0x543c25));}static async[a0_0x216d83(0x274)]({devopsUrl:_0x52596f,accessToken:_0x2fe68b,componentId:_0x542545}){const _0x2d6111=a0_0x216d83,_0x3819f9=new RetrieveComponentAction({'devopsUrl':_0x52596f,'accessToken':_0x2fe68b});return _0x3819f9[_0x2d6111(0x31a)](_0x542545);}static async[a0_0x216d83(0x2cc)](_0x1a5ec8){const _0xb0d20=a0_0x216d83,{accessToken:_0x3b96e6,devopsUrl:_0x6f3187}=await CredentialsManager[_0xb0d20(0x2e5)]({'alias':_0x1a5ec8});if(!_0x6f3187)throw new Error(_0xb0d20(0x2a1));return{'accessToken':_0x3b96e6,'devopsUrl':_0x6f3187};}static async[a0_0x216d83(0x1f5)](_0x5659f7){const _0x353312=a0_0x216d83,_0x5e4801=new GetMeAction(_0x5659f7);return _0x5e4801[_0x353312(0x31a)]();}static async['commit'](_0x5c405d){const _0x1a644c=a0_0x216d83,_0x4b083e=new CommitAction(_0x5c405d);await _0x4b083e[_0x1a644c(0x31a)]();}static async[a0_0x216d83(0x216)](_0x1922fb){const _0x9be88=a0_0x216d83,_0x2bd512=new CreateBranchAction({'accessToken':_0x1922fb['accessToken'],'devopsUrl':_0x1922fb['devopsUrl']});return _0x2bd512[_0x9be88(0x31a)]({'name':_0x1922fb[_0x9be88(0x24f)],'parentId':_0x1922fb[_0x9be88(0x1e3)]});}}var ConfigName=(_0x292205=>{const _0x159c10=a0_0x216d83;return _0x292205[_0x159c10(0x2a6)]=_0x159c10(0x268),_0x292205;})(ConfigName||{}),ChangeType=(_0x1f25c2=>{const _0x1ddfa3=a0_0x216d83;return _0x1f25c2[_0x1ddfa3(0x1bf)]='Create',_0x1f25c2[_0x1ddfa3(0x28d)]=_0x1ddfa3(0x211),_0x1f25c2[_0x1ddfa3(0x2f8)]=_0x1ddfa3(0x2ff),_0x1f25c2;})(ChangeType||{});class CompareWithRemoteBranchAction{[a0_0x216d83(0x1f0)];[a0_0x216d83(0x1db)];[a0_0x216d83(0x252)];[a0_0x216d83(0x338)];[a0_0x216d83(0x2db)];constructor(_0xdf2592){const _0x1dd9ed=a0_0x216d83;this[_0x1dd9ed(0x1f0)]=_0xdf2592[_0x1dd9ed(0x1f0)],this['accessToken']=_0xdf2592[_0x1dd9ed(0x1db)],this[_0x1dd9ed(0x252)]=_0xdf2592['targetBranchId'],this[_0x1dd9ed(0x338)]=_0xdf2592[_0x1dd9ed(0x338)],this[_0x1dd9ed(0x2db)]=_0xdf2592['stage'];}async['execute'](){const _0x4c088a=a0_0x216d83,_0xa6e946=await ApiService[_0x4c088a(0x22d)]({'devopsUrl':this['devopsUrl'],'accessToken':this[_0x4c088a(0x1db)],'branchId':this['targetBranchId'],'commitId':this[_0x4c088a(0x338)]}),_0x22b5da=new Map(_0xa6e946['map'](_0x5e1789=>[_0x5e1789[_0x4c088a(0x30f)]+'_'+_0x5e1789[_0x4c088a(0x24f)],_0x5e1789])),_0x25facb=[];for(const _0x4e371e of this['findDeletedAndUpdated'](_0x22b5da)){_0x25facb[_0x4c088a(0x212)](_0x4e371e),_0x22b5da[_0x4c088a(0x1cf)](_0x4e371e[_0x4c088a(0x30f)]+'_'+_0x4e371e[_0x4c088a(0x24f)]);}for(const [_0x534d58,_0x550816]of _0x22b5da[_0x4c088a(0x2aa)]()){const _0x355871=this[_0x4c088a(0x2db)][_0x4c088a(0x31c)]['get'](_0x534d58);!_0x355871&&_0x25facb['push']({'id':_0x550816['id'],'name':_0x550816[_0x4c088a(0x24f)],'type':_0x550816[_0x4c088a(0x30f)],'fHash':_0x550816[_0x4c088a(0x257)],'changeType':ChangeType[_0x4c088a(0x1bf)]});}return _0x25facb;}*[a0_0x216d83(0x269)](_0x29cae2){const _0x21e752=a0_0x216d83;for(const [_0x19867c,_0x2e819b]of this[_0x21e752(0x2db)][_0x21e752(0x31c)][_0x21e752(0x2aa)]()){const _0x14f9f2=_0x29cae2[_0x21e752(0x2e5)](_0x19867c);!_0x14f9f2&&(yield{'name':_0x2e819b['name'],'type':_0x2e819b[_0x21e752(0x30f)],'changeType':ChangeType['DELETE']}),_0x14f9f2&&_0x14f9f2[_0x21e752(0x257)]!==_0x2e819b[_0x21e752(0x257)]&&(yield{'id':_0x14f9f2['id'],'name':_0x14f9f2[_0x21e752(0x24f)],'type':_0x14f9f2[_0x21e752(0x30f)],'fHash':_0x14f9f2[_0x21e752(0x257)],'changeType':ChangeType[_0x21e752(0x28d)]});}}}class ConfigSetAction{[a0_0x216d83(0x2db)];constructor({stage:_0x5985ba}){const _0x49b00d=a0_0x216d83;this[_0x49b00d(0x2db)]=_0x5985ba;}async[a0_0x216d83(0x31a)]({name:_0x1c4cf6,value:_0x5d7600}){const _0x236057=a0_0x216d83;switch(_0x1c4cf6){case ConfigName[_0x236057(0x2a6)]:await CredentialsManager[_0x236057(0x2e5)]({'alias':_0x5d7600}),this[_0x236057(0x2db)][_0x236057(0x2da)](_0x1c4cf6,_0x5d7600);break;default:throw new Error(_0x236057(0x2dc)+_0x1c4cf6);}}}class FindChangesAction{['stage'];constructor(_0x443312){const _0x227b11=a0_0x216d83;this[_0x227b11(0x2db)]=_0x443312[_0x227b11(0x2db)];}async[a0_0x216d83(0x31a)](){const _0x594c29=a0_0x216d83,_0x37ebf1=new Map(this[_0x594c29(0x2db)]['componentsState']),_0x218470=[];for await(const {componentName:_0x2b6a9c,componentType:_0x302387,filePaths:_0x528430}of salesforce[_0x594c29(0x2a3)][_0x594c29(0x32d)](this[_0x594c29(0x2db)]['projectPath'])){const _0x464b52=_0x302387+'_'+_0x2b6a9c,_0x302479=_0x37ebf1[_0x594c29(0x2e5)](_0x464b52),_0x1022c1=_0x528430[_0x594c29(0x1d8)](_0x218aea=>_0x218aea['replace'](this[_0x594c29(0x2db)][_0x594c29(0x2bf)]+'/',''));if(!_0x302479){_0x218470[_0x594c29(0x212)]({'type':_0x302387,'name':_0x2b6a9c,'changes':_0x1022c1[_0x594c29(0x1d8)](_0x3cf0c6=>({'path':_0x3cf0c6,'changeType':ChangeType[_0x594c29(0x1bf)]}))});continue;}_0x37ebf1[_0x594c29(0x1cf)](_0x464b52);const _0x433a54=await this['getUpdatedComponentChanges'](_0x1022c1,_0x302479['paths']);_0x433a54[_0x594c29(0x200)]&&_0x218470[_0x594c29(0x212)]({'type':_0x302387,'name':_0x2b6a9c,'changes':_0x433a54});}for(const [,_0x11d75e]of _0x37ebf1[_0x594c29(0x2aa)]()){_0x218470[_0x594c29(0x212)]({'type':_0x11d75e[_0x594c29(0x30f)],'name':_0x11d75e[_0x594c29(0x24f)],'changes':_0x11d75e['paths'][_0x594c29(0x1d8)](_0x5bbb84=>({'path':_0x5bbb84,'changeType':ChangeType[_0x594c29(0x2f8)]}))});}return _0x218470;}async[a0_0x216d83(0x2e8)](_0x579937,_0x4b662d){const _0x12e093=a0_0x216d83,{lastStageTimestamp:_0xa61c5}=this[_0x12e093(0x2db)][_0x12e093(0x22f)],_0x501f72=[];for(const _0x4db854 of _0x579937){const _0x105d94=_0x4b662d[_0x12e093(0x289)](_0x4db854);if(!_0x105d94){_0x501f72[_0x12e093(0x212)]({'path':_0x4db854,'changeType':ChangeType['CREATE']});continue;}const {ctimeMs:_0x30ba2f,mtimeMs:_0x44084b}=await promises[_0x12e093(0x21e)](_0x4db854);(!_0xa61c5||Math[_0x12e093(0x1f8)](_0x44084b)>_0xa61c5||Math['trunc'](_0x30ba2f)>_0xa61c5)&&_0x501f72[_0x12e093(0x212)]({'path':_0x4db854,'changeType':ChangeType[_0x12e093(0x28d)]});}for(const _0x3777c1 of _0x4b662d){const _0x394094=!_0x579937['includes'](_0x3777c1);_0x394094&&_0x501f72['push']({'path':_0x3777c1,'changeType':ChangeType[_0x12e093(0x2f8)]});}return _0x501f72;}}const STAGE_FOLDER_NAME=a0_0x216d83(0x1e6),SYSTEM_FOLDER='.'+ROOT_NAME,CONFIG_FILE_NAME=a0_0x216d83(0x32c),BRANCH_STATE_FILE_NAME=a0_0x216d83(0x2b1),COMPONENTS_STATE_FILE_NAME='components-state.json',COMPONENT_PROJECT_PATH=node_path['join']('force-app','main',a0_0x216d83(0x24d)),SFDX_PROJECT_FILE_NAME=a0_0x216d83(0x1c7),INITIAL_BRANCH_STATE={'id':null,'name':null,'headCommitId':null,'lastStageTimestamp':null},INITIAL_CONFIG={'credentialsAlias':null};function a0_0x5404(){const _0x115836=['getFolderFilePaths','has','Update','push','_branchId','split','Config\x20name.\x20Allowed\x20values:\x20','createBranch','Login\x20started','init','commitId','Delete\x20saved\x20credentials.','Display\x20all\x20authorized\x20credentials.','<config-name>','Commit\x20started','stat','stringify','flat','readComponentsState','Stage\x20not\x20found','update','_branchState','\x22\x20wasn\x27t\x20restored','handleRestore','response','fit/branches/','calculateComponentHash','updateBranchState','Credentials\x20with\x20alias\x20\x22','Detecting\x20changes\x20started','listComponents','list-credentials','branchState','updateComponent','isJson','count','env','Retrieve\x20components\x20started','pull','checkout','instance','List\x20credentials\x20completed','Listing\x20remote\x20branches\x20started','createComponent','set','Fail\x20Message','-n,\x20--name\x20<string>','No\x20changes\x20for\x20rollback','flosum','warnDebug','slice','table','indexOf','Alias\x20of\x20credentials\x20which\x20will\x20be\x20used\x20to\x20retrieve\x20your\x20components\x20from\x20devops.','failMessage','createInterface','Status\x20calculation\x20started','Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed','toString','Checkout\x20on\x20another\x20branch.\x20Checkout\x20command\x20retrieves\x20components\x20missing\x20locally.','Value','isDirectoryExists','default','rollback','name','infoDebug','Enter\x20commit\x20message:\x20','targetBranchId','credentials','List\x20credentials\x20started','Committed\x20Components:','manager','fHash','description',':ERROR','access','Logout\x20started','A\x20branch\x20name\x20which\x20you\x20checkout\x20on.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','configName','\x20services','cwd','Project\x20initialization\x20completed','Checking\x20manual\x20changes\x20started','listComponentsGenerator','create','File\x20\x22','areChanges','isFileExists','from','credentialsAlias','findDeletedAndUpdated','Clear\x20project\x20config\x20property.','login','Update:\x20Component\x20not\x20found','errorDebug','addCommand','Return\x20all\x20local\x20not\x20committed\x20changes.','search','Commit\x20message.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','config','value','retrieveComponentById','componentChanges','Not\x20Found','Checking\x20manual\x20changes\x20completed','headCommitId','findChanges','Saved\x20credentials\x20alias.','1503ufMMrI','SALESFORCE','logout','alias','string','constants','convertToCommit','/api/v1/links','commitDate','auth/me','928495qfpHJP','firstName','color','commander','includes','constructor','Config\x20set\x20completed','statusText','UPDATE','register','convertToLocalComponent','rollbackTypes','splice','debug','Rolling\x20back\x20to\x20last\x20committed\x20state\x20completed','globalSettingsUrl','lastStageTimestamp','-a,\x20--alias\x20<string>','readFile','paths','askString','Logger\x20not\x20found','Token\x20for\x20getting\x20access\x20to\x20','save','Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.','node:os','DEVOPS_COMMANDS','applyDelete','Devops\x20url\x20not\x20found','getBranchName','SfProjectScanner','utf-8','5087050fCvHXs','CREDENTIALS_ALIAS','Applies\x20json\x20formatted\x20result.','log','Creation\x20new\x20branch\x20started','entries','commit','catch','enable','.bin','Project\x20initialization\x20started','Name','branch-state.json','Rolled\x20Back\x20Changes:','Global\x20Settings\x20Url','components','error','Config\x20set\x20started','PATH\x20env\x20not\x20found','saveComponent','fHash\x20for\x20component\x20\x22','pendingChanges','stdout','_stagePath','warn','isDirectory','projectPath','2256150KSVOlp','_isUpdateStageTimestamp','Config\x20Name','defineRollbackTypes','all','filesChanges','branchName','Create:\x20Component\x20not\x20found','Changes\x20not\x20found','config-set','getAllCredentials','node:path','getCredentials','api','Local\x20head\x20commit\x20id\x20not\x20found','Set\x20project\x20config.','-t,\x20--token\x20<string>','cleanUpEmptyFolders','isAxiosError','dirname','getBranchById','saveBranchState','buildProjectPath','bind','_componentsState','fileChanges','setConfig','stage','Unknown\x20config\x20name:\x20','Looking\x20for\x20changes\x20started','componentsForRetrieve','findIndex','run','lastName','\x20was\x20deleted','_changes','currentBranch','get','Branch\x20Name','indexes','getUpdatedComponentChanges','/commits','version',':INFO','Invalid\x20credentials\x20type','label','applicationUrl','readBranchState','deleteComponent','A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first','\x22\x20not\x20found','now','\x22\x20completed','userName','W_OK','hex','DELETE','retrieveComponents','readConfig','878uMZEuU','653460HETAut','registerFileChange','_logger','Delete','message','argument','rmdir','logger','parse','buildReport','retrieve','data','targetBranchName','Stage\x20folder\x20not\x20found','abort','_localHeadCommit','Login\x20successfully\x20completed.\x20You\x20credentials\x20are\x20saved\x20with\x20alias\x20\x22','addFileChange','--json','type','Enter\x20api\x20token:\x20','then','branches','writeFile','Change\x20Type','Local\x20and\x20remote\x20head\x20commits\x20don\x27t\x20match.\x20Use\x20\x22flosum\x20devops\x20pull\x22\x20to\x20retrieve\x20latest\x20updates\x20from\x20devops','<value>','1112Thnkee','Missing\x20content\x20for\x20not\x20Delete\x20change\x20type','VLOCITY','execute','2397906faGKqi','componentsState','print','Credentials\x20alias\x20is\x20not\x20configured','localHeadCommit','0.0.2','status','node_modules','Credentials\x20not\x20found','Cloning\x20completed','Rollback\x20started','initProject','Alias','Project\x20is\x20not\x20initialized','getBranchState','abortStage','initStage','config.json','scan','handle','isInitialized','fit/branches','CreateProjectSfCommand','findAndCommitChanges','Component\x20id\x20not\x20found\x20after\x20comparison','readdir','Retrieve\x20components\x20completed','apply','NULL','targetCommitId','No\x20Local\x20Changes','report','mkdir','Status','Creation\x20new\x20branch\x20completed','Deleted','devops','Checkout\x20handler\x20not\x20found','Files','_success','branchId','unsetConfig','\x20of\x20type\x20','component','_credentials','applyCreateUpdate','stagePath','_stage','printJson','arguments','updateComponentState','success','Status\x20calculation\x20completed','Type','compareWithRemoteBranch','getDefaultBranch','CREATE','Roll\x20back\x20your\x20branch\x20state\x20to\x20last\x20committed\x20one.','files','updateSystemFiles','Project\x20Path','Pending\x20Changes:','info','Command','sfdx-project.json','Create\x20salesforce\x20project\x20and\x20cli\x20system\x20files.','Login\x20into\x20global\x20settings\x20and\x20retrieve\x20data\x20about\x20related\x20services.','Devops\x20Url','option','getMessage','targetBranch','getAccessToken','delete','DevOps','find','changeType','Enter\x20project\x20name:\x20','listBranches','sep','credentials.json','rows','map','clone','(((.+)+)+)+$','accessToken','Component\x20','applyFileChanges','Cloning\x20started','fit/file-versions/','File','homedir','digest','parentId','\x22\x20started','join','.stage','ROOT_COMMANDS','\x20components\x20will\x20be\x20committed','Project\x20Updates:','retrievedComponents','Rollback\x20completed','CLI','options','commandName','41672nMVStm','devopsUrl','Branch\x20id\x20not\x20found','changes','size','Retrieve\x20Result:','getMe','path','applyStage','trunc','base64','getCredentialsAlias','Alias\x20which\x20saved\x20credentials\x20will\x20be\x20accessed\x20with.','\x22\x20already\x20exists','\x20files\x20will\x20be\x20rolled\x20back','question','Logout\x20completed','length','Commit\x20local\x20changes\x20to\x20a\x20remote\x20branch\x20on\x20devops.','PATH','values','setIsUpdateStageTimestamp','_projectPath','total','node:readline/promises','retrieveDifference','post','_headCommitId','Checkout\x20on\x20\x22','getInstance','basename','14pxcoLG'];a0_0x5404=function(){return _0x115836;};return a0_0x5404();}class InitProjectAction{[a0_0x216d83(0x2db)];[a0_0x216d83(0x272)];constructor({stage:_0x3772ff,config:_0x45c00f}){const _0x498b95=a0_0x216d83;this[_0x498b95(0x2db)]=_0x3772ff,this['config']=_0x45c00f;}async['execute'](){const _0x30c701=a0_0x216d83,_0x3efee7=new salesforce[(_0x30c701(0x331))]({'cwd':node_path[_0x30c701(0x2d3)](this[_0x30c701(0x2db)][_0x30c701(0x1b5)]),'projectName':node_path[_0x30c701(0x20d)](this[_0x30c701(0x2db)][_0x30c701(0x1b5)])});await _0x3efee7[_0x30c701(0x2e0)]();const _0x48d632=await FileUtils['getFolderFilePaths'](this[_0x30c701(0x2db)][_0x30c701(0x1b5)]);for(const _0x1ce283 of _0x48d632){const _0x46609e=_0x1ce283[_0x30c701(0x214)](STAGE_FOLDER_NAME)[0x1];this[_0x30c701(0x2db)][_0x30c701(0x2fd)]({'path':_0x46609e,'changeType':ChangeType[_0x30c701(0x1bf)]});}if(this[_0x30c701(0x272)])for(const _0x51e911 of Object['values'](ConfigName)){this[_0x30c701(0x2db)]['setConfig'](_0x51e911,this['config'][_0x51e911]);}}}class SaveComponentAction{[a0_0x216d83(0x2db)];constructor(_0x4553f3){const _0x5c90ef=a0_0x216d83;this['stage']=_0x4553f3[_0x5c90ef(0x2db)];}async[a0_0x216d83(0x31a)](_0x39cb99){const _0x2f4a22=a0_0x216d83;switch(_0x39cb99[_0x2f4a22(0x1d2)]){case ChangeType[_0x2f4a22(0x1bf)]:{if(!_0x39cb99['component'])throw new Error(_0x2f4a22(0x2c7));await this['stage'][_0x2f4a22(0x23a)](_0x39cb99[_0x2f4a22(0x1b2)]);break;}case ChangeType[_0x2f4a22(0x28d)]:if(!_0x39cb99['component'])throw new Error(_0x2f4a22(0x26c));await this['stage'][_0x2f4a22(0x230)](_0x39cb99['component']);break;case ChangeType['DELETE']:await this[_0x2f4a22(0x2db)]['deleteComponent']({'name':_0x39cb99[_0x2f4a22(0x24f)],'type':_0x39cb99[_0x2f4a22(0x30f)]});break;}}}class UpdateComponentStateAction{['stage'];[a0_0x216d83(0x24f)];['type'];[a0_0x216d83(0x1f2)];constructor(_0x172a6f){const _0x524047=a0_0x216d83;this[_0x524047(0x2db)]=_0x172a6f[_0x524047(0x2db)],this[_0x524047(0x24f)]=_0x172a6f[_0x524047(0x24f)],this['type']=_0x172a6f[_0x524047(0x30f)],this['changes']=_0x172a6f['changes'];}async[a0_0x216d83(0x31a)](){const _0x314245=a0_0x216d83,_0x274911=this[_0x314245(0x30f)]+'_'+this['name'];let _0x340fc2=this[_0x314245(0x2db)][_0x314245(0x31c)]['get'](_0x274911),_0x5acef8=ChangeType[_0x314245(0x28d)];!_0x340fc2&&(_0x340fc2={'name':this['name'],'type':this['type'],'fHash':'','paths':[]},this[_0x314245(0x2db)]['componentsState'][_0x314245(0x23b)](_0x274911,_0x340fc2),_0x5acef8=ChangeType['CREATE']);for(const _0x3aba62 of this['changes']){this['handleFileChange'](_0x340fc2,_0x3aba62);}if(!_0x340fc2['paths'][_0x314245(0x200)])return this[_0x314245(0x2db)]['componentsState'][_0x314245(0x1cf)](_0x274911),{'name':_0x340fc2[_0x314245(0x24f)],'type':_0x340fc2[_0x314245(0x30f)],'changeType':ChangeType[_0x314245(0x2f8)]};return _0x340fc2[_0x314245(0x257)]=await this[_0x314245(0x229)](_0x340fc2[_0x314245(0x298)]),{..._0x340fc2,'changeType':_0x5acef8};}['handleFileChange'](_0x445dac,{path:_0x424ca2,changeType:_0x20509c}){const _0x58eae9=a0_0x216d83;if(_0x20509c===ChangeType[_0x58eae9(0x1bf)]){if(_0x445dac['paths'][_0x58eae9(0x289)](_0x424ca2))throw new Error(_0x58eae9(0x264)+_0x424ca2+_0x58eae9(0x1fc));_0x445dac['paths'][_0x58eae9(0x212)](_0x424ca2);}if(_0x20509c===ChangeType['DELETE']){const _0x56eac2=_0x445dac['paths'][_0x58eae9(0x243)](_0x424ca2);if(_0x56eac2<0x0)throw new Error('File\x20\x22'+_0x424ca2+_0x58eae9(0x2f2));_0x445dac[_0x58eae9(0x298)][_0x58eae9(0x291)](_0x56eac2,0x1);}}async['calculateComponentHash'](_0x45086a){const _0x3407d4=a0_0x216d83,_0x206639=node_crypto['createHash']('sha1');for(const _0x3752f4 of _0x45086a){const _0x21a5b9=await promises[_0x3407d4(0x297)](node_path[_0x3407d4(0x1e5)](this[_0x3407d4(0x2db)][_0x3407d4(0x2bf)],_0x3752f4),{'encoding':_0x3407d4(0x2a4)}),_0x26c3cf=_0x3752f4[_0x3407d4(0x214)](node_path[_0x3407d4(0x1d5)])[_0x3407d4(0x241)](0x3)['join']('/');_0x206639[_0x3407d4(0x223)](_0x26c3cf),_0x206639[_0x3407d4(0x223)](_0x21a5b9);}const _0x29c21d=_0x206639[_0x3407d4(0x1e2)](_0x3407d4(0x2f7));return _0x29c21d;}}class Stage{[a0_0x216d83(0x205)];[a0_0x216d83(0x2bc)];[a0_0x216d83(0x272)];[a0_0x216d83(0x224)];[a0_0x216d83(0x2d8)];[a0_0x216d83(0x2d9)]=[];[a0_0x216d83(0x2c1)]=!![];set['isUpdateStageTimestamp'](_0x4a1e25){this['_isUpdateStageTimestamp']=_0x4a1e25;}get['projectPath'](){return this['_projectPath'];}get['stagePath'](){const _0x32e4db=a0_0x216d83;return this[_0x32e4db(0x2bc)];}get['branchState'](){return this['_branchState'];}get[a0_0x216d83(0x31c)](){return this['_componentsState'];}constructor(_0x320be0){const _0x38780b=a0_0x216d83;this[_0x38780b(0x205)]=_0x320be0[_0x38780b(0x2bf)],this['_stagePath']=_0x320be0['stagePath'],this['config']=_0x320be0[_0x38780b(0x272)],this['_branchState']=_0x320be0[_0x38780b(0x22f)],this[_0x38780b(0x2d8)]=_0x320be0[_0x38780b(0x31c)]?new Map(_0x320be0[_0x38780b(0x31c)]['map'](_0x36fe4f=>[_0x36fe4f[_0x38780b(0x30f)]+'_'+_0x36fe4f['name'],_0x36fe4f])):new Map();}[a0_0x216d83(0x2da)](_0x47de24,_0x13de21){const _0x3fd0fc=a0_0x216d83;this[_0x3fd0fc(0x272)][_0x47de24]=_0x13de21;}[a0_0x216d83(0x344)](_0x512f08){const _0x3b2c87=a0_0x216d83;this[_0x3b2c87(0x272)][_0x512f08]=null;}[a0_0x216d83(0x22a)](_0x216c74){const _0x2d6e69=a0_0x216d83;this[_0x2d6e69(0x22f)]['id']=_0x216c74['id'],this[_0x2d6e69(0x22f)][_0x2d6e69(0x24f)]=_0x216c74[_0x2d6e69(0x24f)],this[_0x2d6e69(0x22f)][_0x2d6e69(0x278)]=_0x216c74[_0x2d6e69(0x278)];}async['createComponent'](_0x4e09c6){const _0x1f37b8=a0_0x216d83,_0x20502b={'name':_0x4e09c6[_0x1f37b8(0x24f)],'type':_0x4e09c6[_0x1f37b8(0x30f)],'fHash':_0x4e09c6[_0x1f37b8(0x257)],'paths':_0x4e09c6[_0x1f37b8(0x1c1)][_0x1f37b8(0x1d8)](({path:_0x1f516a})=>node_path['join'](COMPONENT_PROJECT_PATH,_0x1f516a))};this[_0x1f37b8(0x2d8)]['set'](_0x4e09c6['type']+'_'+_0x4e09c6['name'],_0x20502b);for(const {path:_0x105302,content:_0x4a0ae4}of _0x4e09c6[_0x1f37b8(0x1c1)]){await this['addFileChange']({'path':node_path[_0x1f37b8(0x1e5)](COMPONENT_PROJECT_PATH,_0x105302),'content':_0x4a0ae4,'changeType':ChangeType[_0x1f37b8(0x1bf)]});}}async[a0_0x216d83(0x230)](_0x1a42d6){const _0x149b99=a0_0x216d83,_0x168633=this[_0x149b99(0x2d8)]['get'](_0x1a42d6[_0x149b99(0x30f)]+'_'+_0x1a42d6['name']),_0x5d5775=[];if(!_0x168633)throw new Error('Update:\x20Component\x20'+_0x1a42d6['name']+_0x149b99(0x1b1)+_0x1a42d6[_0x149b99(0x30f)]+'\x20not\x20found');for(const _0x6b7b6a of _0x168633[_0x149b99(0x298)]){await this[_0x149b99(0x30d)]({'path':_0x6b7b6a,'changeType':ChangeType[_0x149b99(0x2f8)]});}for(const {path:_0x1e3ac7,content:_0x16b6ba}of _0x1a42d6[_0x149b99(0x1c1)]){const _0x403575=node_path['join'](COMPONENT_PROJECT_PATH,_0x1e3ac7);await this[_0x149b99(0x30d)]({'path':_0x403575,'content':_0x16b6ba,'changeType':ChangeType[_0x149b99(0x1bf)]}),_0x5d5775['push'](_0x403575);}_0x168633[_0x149b99(0x257)]=_0x1a42d6['fHash'],_0x168633[_0x149b99(0x298)]=_0x5d5775;}async[a0_0x216d83(0x2f0)](_0x3a5d19){const _0x4a29f2=a0_0x216d83,_0x2f6ef1=_0x3a5d19['type']+'_'+_0x3a5d19[_0x4a29f2(0x24f)],_0x12be14=this['_componentsState'][_0x4a29f2(0x2e5)](_0x2f6ef1);if(!_0x12be14)throw new Error(_0x4a29f2(0x1dc)+_0x3a5d19['name']+'\x20of\x20type\x20'+_0x3a5d19[_0x4a29f2(0x30f)]+'\x20not\x20found');for(const _0x2088c4 of _0x12be14[_0x4a29f2(0x298)]){await this[_0x4a29f2(0x30d)]({'path':_0x2088c4,'changeType':ChangeType['DELETE']});}this[_0x4a29f2(0x2d8)][_0x4a29f2(0x1cf)](_0x2f6ef1);}async[a0_0x216d83(0x30d)]({path:_0x8e15ee,content:_0x5eb6b8,changeType:_0x5c14e5}){const _0x1bb3f=a0_0x216d83;if(_0x5c14e5!==ChangeType[_0x1bb3f(0x2f8)]){if(!_0x5eb6b8)throw new Error(_0x1bb3f(0x318));const _0x40f1a6=node_path[_0x1bb3f(0x1e5)](this[_0x1bb3f(0x1b5)],_0x8e15ee);await promises[_0x1bb3f(0x33b)](node_path[_0x1bb3f(0x2d3)](_0x40f1a6),{'recursive':!![]}),await promises['writeFile'](_0x40f1a6,_0x5eb6b8);}this['fileChanges'][_0x1bb3f(0x212)]({'path':_0x8e15ee,'changeType':_0x5c14e5});}async[a0_0x216d83(0x1b9)](_0x5988c0){const _0x5540e7=new UpdateComponentStateAction({'stage':this,..._0x5988c0});return _0x5540e7['execute']();}async['changeFile'](){}[a0_0x216d83(0x2fd)]({path:_0xfb1a86,changeType:_0x4f48b7}){const _0x500c5f=a0_0x216d83;this['fileChanges'][_0x500c5f(0x212)]({'path':_0xfb1a86,'changeType':_0x4f48b7});}async[a0_0x216d83(0x336)](){const _0x43a8a4=a0_0x216d83,_0x58717a=await FileUtils[_0x43a8a4(0x24c)](this[_0x43a8a4(0x1b5)]);if(!_0x58717a)throw Error(_0x43a8a4(0x309));await this[_0x43a8a4(0x1dd)](),await this[_0x43a8a4(0x1c2)](),await promises['rm'](this[_0x43a8a4(0x1b5)],{'recursive':!![]});const _0x2cd07e=node_path[_0x43a8a4(0x1e5)](this[_0x43a8a4(0x205)],COMPONENT_PROJECT_PATH),_0x1b4fb9=await FileUtils[_0x43a8a4(0x24c)](_0x2cd07e);_0x1b4fb9?await FileUtils[_0x43a8a4(0x2d1)](_0x2cd07e,![]):await promises[_0x43a8a4(0x33b)](_0x2cd07e,{'recursive':!![]});}async[a0_0x216d83(0x30a)](){const _0x1803d2=a0_0x216d83;await promises['rm'](this[_0x1803d2(0x1b5)],{'recursive':!![],'force':!![]});}async[a0_0x216d83(0x1dd)](){const _0x263888=a0_0x216d83;for(const {path:_0x382151,changeType:_0xd8e9a3}of this['fileChanges']){switch(_0xd8e9a3){case ChangeType['CREATE']:case ChangeType[_0x263888(0x28d)]:await this[_0x263888(0x1b4)](_0x382151);break;case ChangeType['DELETE']:await this[_0x263888(0x2a0)](_0x382151);break;}}}async[a0_0x216d83(0x1b4)](_0x53999f){const _0x23bd33=a0_0x216d83,_0x42a6cc=node_path[_0x23bd33(0x1e5)](this[_0x23bd33(0x2bc)],_0x53999f),_0x51bc33=node_path[_0x23bd33(0x1e5)](this[_0x23bd33(0x205)],_0x53999f);await promises['mkdir'](node_path[_0x23bd33(0x2d3)](_0x51bc33),{'recursive':!![]}),await promises['copyFile'](_0x42a6cc,_0x51bc33);}async[a0_0x216d83(0x2a0)](_0x2139c6){const _0x4f5e19=a0_0x216d83;await promises['rm'](node_path[_0x4f5e19(0x1e5)](this[_0x4f5e19(0x205)],_0x2139c6),{'recursive':!![]});}async['updateSystemFiles'](){const _0x2a3d08=a0_0x216d83;await promises[_0x2a3d08(0x313)](node_path['join'](this[_0x2a3d08(0x2bf)],SYSTEM_FOLDER,CONFIG_FILE_NAME),JSON[_0x2a3d08(0x21f)](this['config'])),this[_0x2a3d08(0x2c1)]&&(this['branchState'][_0x2a3d08(0x295)]=Date[_0x2a3d08(0x2f3)]()),await promises[_0x2a3d08(0x313)](node_path[_0x2a3d08(0x1e5)](this[_0x2a3d08(0x2bf)],SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),JSON[_0x2a3d08(0x21f)](this['branchState'])),await promises[_0x2a3d08(0x313)](node_path[_0x2a3d08(0x1e5)](this[_0x2a3d08(0x2bf)],SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),JSON[_0x2a3d08(0x21f)](Array[_0x2a3d08(0x267)](this['_componentsState'][_0x2a3d08(0x203)]())));}}class ProjectManager{static [a0_0x216d83(0x237)];['_stage'];get['stage'](){const _0x5aeeef=a0_0x216d83;if(!this[_0x5aeeef(0x1b6)])throw new Error(_0x5aeeef(0x222));return this[_0x5aeeef(0x1b6)];}constructor(){}static[a0_0x216d83(0x20c)](){const _0x2fe35d=a0_0x216d83;return!ProjectManager['instance']&&(ProjectManager['instance']=new ProjectManager()),ProjectManager[_0x2fe35d(0x237)];}async[a0_0x216d83(0x32b)](_0x107f8d){const _0x3c9420=a0_0x216d83,_0x5816ec=node_path[_0x3c9420(0x1e5)](_0x107f8d,SYSTEM_FOLDER,STAGE_FOLDER_NAME);await promises['rm'](_0x5816ec,{'recursive':!![],'force':!![]}),await promises[_0x3c9420(0x33b)](_0x5816ec,{'recursive':!![]});const _0x1c6ced=await this[_0x3c9420(0x2fa)](_0x107f8d),_0x2ef134=await this[_0x3c9420(0x2ef)](_0x107f8d),_0x286339=await this['readComponentsState'](_0x107f8d);this[_0x3c9420(0x1b6)]=new Stage({'projectPath':_0x107f8d,'stagePath':_0x5816ec,'config':_0x1c6ced,'branchState':_0x2ef134,'componentsState':_0x286339});}async[a0_0x216d83(0x1f7)](){const _0x522ff9=a0_0x216d83;await this[_0x522ff9(0x2db)]['apply']();}async[a0_0x216d83(0x32a)](){const _0x469e6a=a0_0x216d83;await this[_0x469e6a(0x2db)][_0x469e6a(0x30a)]();}async['initProject']({config:_0x5d1ac9}){const _0x8ddf08=a0_0x216d83,_0x180708=new InitProjectAction({'stage':this[_0x8ddf08(0x2db)],'config':_0x5d1ac9});await _0x180708['execute']();}['saveBranchState'](_0x5ee405){const _0x226d2c=a0_0x216d83;this['stage'][_0x226d2c(0x22a)](_0x5ee405);}async[a0_0x216d83(0x2b8)](_0x54752f){const _0x817235=a0_0x216d83,_0x17e2bb=new SaveComponentAction({'stage':this[_0x817235(0x2db)]});await _0x17e2bb['execute'](_0x54752f);}async[a0_0x216d83(0x279)](){const _0xd0b1d1=new FindChangesAction({'stage':this['stage']});return _0xd0b1d1['execute']();}async[a0_0x216d83(0x1bd)](_0x168049){const _0x2c69f0=a0_0x216d83,_0x40ec78=new CompareWithRemoteBranchAction({..._0x168049,'stage':this[_0x2c69f0(0x2db)]});return _0x40ec78['execute']();}async[a0_0x216d83(0x2fa)](_0x447d82){const _0x3a203d=a0_0x216d83,_0x57c361=node_path[_0x3a203d(0x1e5)](_0x447d82,SYSTEM_FOLDER,CONFIG_FILE_NAME),_0x15f9f4=await FileUtils[_0x3a203d(0x266)](_0x57c361);if(!_0x15f9f4)return INITIAL_CONFIG;const _0x188cee=await promises[_0x3a203d(0x297)](_0x57c361);return JSON[_0x3a203d(0x304)](_0x188cee[_0x3a203d(0x249)]());}async[a0_0x216d83(0x2ef)](_0x26db23){const _0x4d44b1=a0_0x216d83,_0x542919=node_path[_0x4d44b1(0x1e5)](_0x26db23,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),_0x16edf8=await FileUtils[_0x4d44b1(0x266)](_0x542919);if(!_0x16edf8)return INITIAL_BRANCH_STATE;const _0x3b3e75=await promises['readFile'](_0x542919);return JSON['parse'](_0x3b3e75[_0x4d44b1(0x249)]());}async[a0_0x216d83(0x221)](_0x130216){const _0x4dbd9c=a0_0x216d83,_0x11e7a0=node_path[_0x4dbd9c(0x1e5)](_0x130216,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),_0x3de487=await FileUtils[_0x4dbd9c(0x266)](_0x11e7a0);if(!_0x3de487)return[];const _0x5ca20a=await promises['readFile'](_0x11e7a0);return JSON[_0x4dbd9c(0x304)](_0x5ca20a[_0x4dbd9c(0x249)]());}async[a0_0x216d83(0x32f)](_0x40164f){const _0x5d98ac=a0_0x216d83,_0x4677b7=[node_path['join'](_0x40164f,SYSTEM_FOLDER,CONFIG_FILE_NAME),node_path['join'](_0x40164f,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),node_path[_0x5d98ac(0x1e5)](_0x40164f,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),node_path['join'](_0x40164f,SFDX_PROJECT_FILE_NAME)];for(const _0x1c87d0 of _0x4677b7){const _0xcc0000=await FileUtils[_0x5d98ac(0x266)](_0x1c87d0);if(!_0xcc0000)return![];}return!![];}async[a0_0x216d83(0x2da)](_0x1f51fd,_0x38900d){const _0x412a2d=a0_0x216d83,_0xc2fdd9=new ConfigSetAction({'stage':this[_0x412a2d(0x2db)]});await _0xc2fdd9['execute']({'name':_0x1f51fd,'value':_0x38900d});}async[a0_0x216d83(0x344)](_0x5db4ec){const _0x33193d=a0_0x216d83;this['stage'][_0x33193d(0x344)](_0x5db4ec);}[a0_0x216d83(0x1b9)](_0x180d8b){const _0x3fedf3=a0_0x216d83;return this[_0x3fedf3(0x2db)]['updateComponentState'](_0x180d8b);}async[a0_0x216d83(0x30d)](_0x219ef0){const _0x262123=a0_0x216d83;await this[_0x262123(0x2db)]['addFileChange'](_0x219ef0);}[a0_0x216d83(0x204)](_0x11044d){const _0x43bbbf=a0_0x216d83;this[_0x43bbbf(0x2db)]['isUpdateStageTimestamp']=_0x11044d;}}class ReadlineUtils{static async['askString'](_0x23b1ef){const _0xe73aa5=a0_0x216d83,_0x4ed7c2=readline[_0xe73aa5(0x246)]({'input':process['stdin'],'output':process[_0xe73aa5(0x2bb)]}),_0x26c252=await _0x4ed7c2[_0xe73aa5(0x1fe)](_0x23b1ef);return _0x4ed7c2['close'](),_0x26c252;}}const INFO_COLOR_INDEX='4',WARN_COLOR_INDEX='3',ERROR_COLOR_INDEX='1';class Logger{[a0_0x216d83(0x231)];[a0_0x216d83(0x250)];[a0_0x216d83(0x240)];[a0_0x216d83(0x26d)];constructor({isJson:_0x300283}){const _0x5b28d3=a0_0x216d83;this[_0x5b28d3(0x231)]=_0x300283,debug[_0x5b28d3(0x2a8)]=console['log'][_0x5b28d3(0x2d7)](console),debug[_0x5b28d3(0x2ad)](ROOT_NAME+':*'),this[_0x5b28d3(0x250)]=debug(ROOT_NAME+_0x5b28d3(0x2eb)),this[_0x5b28d3(0x250)][_0x5b28d3(0x287)]=INFO_COLOR_INDEX,this[_0x5b28d3(0x240)]=debug(ROOT_NAME+':WARN'),this['warnDebug'][_0x5b28d3(0x287)]=WARN_COLOR_INDEX,this[_0x5b28d3(0x26d)]=debug(ROOT_NAME+_0x5b28d3(0x259)),this['errorDebug'][_0x5b28d3(0x287)]=ERROR_COLOR_INDEX;}['info'](_0x4de0bf){const _0x40f890=a0_0x216d83;!this[_0x40f890(0x231)]&&this[_0x40f890(0x250)](_0x4de0bf);}['warn'](_0x23e1f7){const _0x2c1e44=a0_0x216d83;!this['isJson']&&this[_0x2c1e44(0x240)](_0x23e1f7);}[a0_0x216d83(0x2b5)](_0x55e3f3){const _0x536a7b=a0_0x216d83;!this[_0x536a7b(0x231)]&&this[_0x536a7b(0x26d)](_0x55e3f3);}}class BaseCommand{[a0_0x216d83(0x2fe)];get['logger'](){const _0xe9e3bf=a0_0x216d83;if(!this[_0xe9e3bf(0x2fe)])throw new Error(_0xe9e3bf(0x29a));return this[_0xe9e3bf(0x2fe)];}[a0_0x216d83(0x28e)](_0x5cdacb){const _0xfb352=a0_0x216d83,_0x70499b=new commander[(_0xfb352(0x1c6))]()[_0xfb352(0x24f)](this['commandName'])['description'](this['description']);for(const {name:_0x4e8e8f,description:_0x4a9b62,defaultValue:_0x3fa5a0}of this['arguments']){_0x70499b[_0xfb352(0x301)](_0x4e8e8f,_0x4a9b62,_0x3fa5a0);}for(const {flags:_0x22e306,description:_0x545b0f,defaultValue:_0x3e5f76}of this[_0xfb352(0x1ed)]){_0x70499b[_0xfb352(0x1cb)](_0x22e306,_0x545b0f,_0x3e5f76);}_0x70499b['action'](async(..._0x522032)=>{const _0x4f7e23=_0xfb352,_0x1b1df5=this[_0x4f7e23(0x231)](_0x522032);this[_0x4f7e23(0x2fe)]=new Logger({'isJson':_0x1b1df5});try{const _0x4be382=await this[_0x4f7e23(0x31a)](_0x522032);_0x4be382[_0x4f7e23(0x33a)](_0x1b1df5);}catch(_0x4d02bc){_0x4d02bc instanceof Error&&this[_0x4f7e23(0x303)][_0x4f7e23(0x2b5)](_0x4d02bc[_0x4f7e23(0x300)]);throw _0x4d02bc;}}),_0x5cdacb[_0xfb352(0x26e)](_0x70499b);}}class BaseReporter{[a0_0x216d83(0x342)];get[a0_0x216d83(0x1ba)](){const _0x3f8e93=a0_0x216d83;return this[_0x3f8e93(0x342)];}constructor(_0x2d5532){const _0x3ca4a0=a0_0x216d83;this[_0x3ca4a0(0x342)]=_0x2d5532[_0x3ca4a0(0x1ba)];}[a0_0x216d83(0x33a)](_0x114f27){const _0x16a86a=a0_0x216d83,_0x3f263d=this[_0x16a86a(0x305)]();_0x114f27?this[_0x16a86a(0x1b7)](_0x3f263d):this[_0x16a86a(0x31d)](_0x3f263d);}[a0_0x216d83(0x1b7)](_0x285a7e){const _0x120b76=a0_0x216d83,_0x13584c=JSON['stringify'](_0x285a7e,null,0x2);console[_0x120b76(0x2a8)](_0x13584c);}}class FailReporter extends BaseReporter{[a0_0x216d83(0x245)];constructor({failMessage:_0x48c7b1}){super({'success':![]}),this['failMessage']=_0x48c7b1;}[a0_0x216d83(0x305)](){const _0x18f54b=a0_0x216d83;return{'success':this[_0x18f54b(0x1ba)],'failMessage':this[_0x18f54b(0x245)]};}[a0_0x216d83(0x31d)](_0x4502e2){const _0x149332=a0_0x216d83,_0x11e6f4=[[_0x149332(0x23c)],[_0x4502e2[_0x149332(0x245)]]];console[_0x149332(0x2a8)](table['table'](_0x11e6f4,{'columns':[{'width':0x64}]}));}}class CheckoutReporter extends BaseReporter{[a0_0x216d83(0x2e4)];[a0_0x216d83(0x1f2)];constructor({currentBranch:_0xb9b43e,changes:_0x4949db}){const _0x25d4ee=a0_0x216d83;super({'success':!![]}),this[_0x25d4ee(0x2e4)]=_0xb9b43e,this[_0x25d4ee(0x1f2)]=_0x4949db;}[a0_0x216d83(0x305)](){const _0x22e016=a0_0x216d83;return{'success':this[_0x22e016(0x1ba)],'targetBranch':this[_0x22e016(0x2e4)],'changes':this['changes']};}[a0_0x216d83(0x31d)](_0x292e04){const _0x1891f4=a0_0x216d83;console[_0x1891f4(0x2a8)]('Current\x20Branch:\x20'+this[_0x1891f4(0x2e4)][_0x1891f4(0x24f)]+'\x0a'),console[_0x1891f4(0x2a8)](_0x1891f4(0x1e9));const _0x2144dd=[[_0x1891f4(0x314),_0x1891f4(0x2b0),_0x1891f4(0x1bc),_0x1891f4(0x341)]];for(const {changeType:_0x2ae43a,name:_0x58363c,type:_0x4b4d66,paths:_0x2d7839}of _0x292e04['changes']){_0x2144dd['push']([_0x2ae43a,_0x58363c,_0x4b4d66,_0x2d7839?.['join']('\x0a')||'']);}console[_0x1891f4(0x2a8)](table['table'](_0x2144dd,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class BaseHandler{}class TargetBranchExistHandler extends BaseHandler{[a0_0x216d83(0x256)];[a0_0x216d83(0x253)];[a0_0x216d83(0x1cd)];[a0_0x216d83(0x303)];[a0_0x216d83(0x275)]=[];constructor(_0x335d8b){const _0x307bd1=a0_0x216d83;super(),this['manager']=_0x335d8b[_0x307bd1(0x256)],this[_0x307bd1(0x253)]=_0x335d8b[_0x307bd1(0x253)],this[_0x307bd1(0x1cd)]=_0x335d8b['targetBranch'],this[_0x307bd1(0x303)]=_0x335d8b[_0x307bd1(0x303)];}async[a0_0x216d83(0x32e)](){const _0x439e3e=a0_0x216d83,_0x2c7ea2=await this[_0x439e3e(0x265)]();if(_0x2c7ea2)return new FailReporter({'failMessage':'Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed'});return this[_0x439e3e(0x303)][_0x439e3e(0x1c5)]('Checking\x20manual\x20changes\x20completed'),this['logger'][_0x439e3e(0x1c5)](_0x439e3e(0x234)),await this[_0x439e3e(0x208)](),this[_0x439e3e(0x303)][_0x439e3e(0x1c5)](_0x439e3e(0x335)),new CheckoutReporter({'currentBranch':{'id':this[_0x439e3e(0x1cd)]['id'],'name':this['targetBranch'][_0x439e3e(0x24f)],'headCommitId':this[_0x439e3e(0x1cd)][_0x439e3e(0x278)]},'changes':this[_0x439e3e(0x275)]});}async[a0_0x216d83(0x265)](){const _0x2f7e59=a0_0x216d83,_0x4597d5=await this[_0x2f7e59(0x256)][_0x2f7e59(0x279)]();return!!_0x4597d5[_0x2f7e59(0x200)];}async['retrieveDifference'](){const _0x2004ab=a0_0x216d83,{devopsUrl:_0x5a8440,accessToken:_0x805465}=this[_0x2004ab(0x253)],_0x526d6d=await this[_0x2004ab(0x256)][_0x2004ab(0x1bd)]({'devopsUrl':_0x5a8440,'accessToken':_0x805465,'targetBranchId':this[_0x2004ab(0x1cd)]['id'],'targetCommitId':this['targetBranch'][_0x2004ab(0x278)]});for(const {id:_0x5c6b67,name:_0x48e8f9,type:_0x31a8c6,changeType:_0x592b81}of _0x526d6d){if(!_0x5c6b67){if(_0x592b81!==ChangeType[_0x2004ab(0x2f8)])throw new Error('Component\x20id\x20not\x20found\x20after\x20comparison');await this[_0x2004ab(0x256)]['saveComponent']({'name':_0x48e8f9,'type':_0x31a8c6,'changeType':_0x592b81}),this[_0x2004ab(0x275)][_0x2004ab(0x212)]({'changeType':_0x592b81,'name':_0x48e8f9,'type':_0x31a8c6});continue;}const _0x55d2c8=await ApiService['retrieveComponentById']({'devopsUrl':_0x5a8440,'accessToken':_0x805465,'componentId':_0x5c6b67});if(!_0x55d2c8['fHash'])throw new Error(_0x2004ab(0x2b9)+_0x55d2c8['name']+'\x22\x20of\x20type\x20\x22'+_0x55d2c8[_0x2004ab(0x30f)]+'\x22\x20not\x20found');await this[_0x2004ab(0x256)][_0x2004ab(0x2b8)]({'name':_0x48e8f9,'type':_0x31a8c6,'changeType':_0x592b81,'component':{..._0x55d2c8,'fHash':_0x55d2c8[_0x2004ab(0x257)]}}),this[_0x2004ab(0x275)]['push']({'changeType':_0x592b81,'name':_0x48e8f9,'type':_0x31a8c6,'paths':_0x55d2c8[_0x2004ab(0x1c1)][_0x2004ab(0x1d8)](_0x57d072=>_0x57d072[_0x2004ab(0x1f6)])});}this[_0x2004ab(0x256)]['saveBranchState'](this[_0x2004ab(0x1cd)]);}}class TargetBranchNotFoundHandler extends BaseHandler{[a0_0x216d83(0x2bf)];[a0_0x216d83(0x256)];[a0_0x216d83(0x253)];[a0_0x216d83(0x308)];['logger'];constructor(_0x21477d){const _0x663cee=a0_0x216d83;super(),this[_0x663cee(0x2bf)]=_0x21477d[_0x663cee(0x2bf)],this[_0x663cee(0x256)]=_0x21477d[_0x663cee(0x256)],this[_0x663cee(0x253)]=_0x21477d[_0x663cee(0x253)],this[_0x663cee(0x308)]=_0x21477d[_0x663cee(0x308)],this[_0x663cee(0x303)]=_0x21477d[_0x663cee(0x303)];}async[a0_0x216d83(0x32e)](){const _0x59e832=a0_0x216d83;this[_0x59e832(0x303)][_0x59e832(0x1c5)](_0x59e832(0x2a9));const {id:_0x2ad6b6}=await this[_0x59e832(0x256)][_0x59e832(0x2ef)](this[_0x59e832(0x2bf)]);if(!_0x2ad6b6)return new FailReporter({'failMessage':'To\x20create\x20a\x20new\x20branch\x20a\x20branch\x20should\x20be\x20selected.\x20Checkout\x20on\x20any\x20existing\x20branch'});const _0x60c267=await ApiService[_0x59e832(0x216)]({'accessToken':this[_0x59e832(0x253)]['accessToken'],'devopsUrl':this['credentials']['devopsUrl'],'name':this[_0x59e832(0x308)],'parentId':_0x2ad6b6});return this['manager'][_0x59e832(0x2d5)](_0x60c267),this[_0x59e832(0x256)][_0x59e832(0x204)](![]),this[_0x59e832(0x303)][_0x59e832(0x1c5)](_0x59e832(0x33d)),new CheckoutReporter({'currentBranch':_0x60c267,'changes':[]});}}class HandlerFactory{static[a0_0x216d83(0x263)](_0x4235ac){const _0x440e7a=a0_0x216d83;if(_0x4235ac[_0x440e7a(0x1cd)])return new TargetBranchExistHandler({..._0x4235ac,'targetBranch':_0x4235ac[_0x440e7a(0x1cd)]});if(!_0x4235ac[_0x440e7a(0x1cd)])return new TargetBranchNotFoundHandler(_0x4235ac);throw new Error(_0x440e7a(0x340));}}class CheckoutCommand extends BaseCommand{['commandName']=a0_0x216d83(0x236);['description']=a0_0x216d83(0x24a);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':'-b,\x20--branch\x20<string>','description':a0_0x216d83(0x25c)},{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];['projectPath']=process['cwd']();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async[a0_0x216d83(0x31a)]([{branch:_0x309286}]){const _0x459ddc=a0_0x216d83,_0x4ad3ce=await this[_0x459ddc(0x2a2)](_0x309286);this[_0x459ddc(0x303)]['info'](_0x459ddc(0x20b)+_0x4ad3ce+_0x459ddc(0x1e4));const _0x5c460f=await this[_0x459ddc(0x256)][_0x459ddc(0x32f)](this['projectPath']);if(!_0x5c460f)return this[_0x459ddc(0x303)]['warn']('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':_0x459ddc(0x328)});const _0x4993d0=await this['getCredentialsAlias'](),_0x5b65d4=await ApiService[_0x459ddc(0x2cc)](_0x4993d0);await this['manager'][_0x459ddc(0x32b)](this[_0x459ddc(0x2bf)]);try{const _0x2ca0ee=await ApiService['getBranch']({'devopsUrl':_0x5b65d4[_0x459ddc(0x1f0)],'accessToken':_0x5b65d4['accessToken'],'branchName':_0x4ad3ce}),_0x4cf20a=HandlerFactory['create']({'projectPath':this[_0x459ddc(0x2bf)],'manager':this[_0x459ddc(0x256)],'credentials':_0x5b65d4,'targetBranch':_0x2ca0ee,'targetBranchName':_0x4ad3ce,'logger':this[_0x459ddc(0x303)]}),_0x3eefc9=await _0x4cf20a[_0x459ddc(0x32e)]();return _0x3eefc9[_0x459ddc(0x1ba)]?(await this[_0x459ddc(0x256)][_0x459ddc(0x1f7)](),this[_0x459ddc(0x303)]['info'](_0x459ddc(0x20b)+_0x4ad3ce+_0x459ddc(0x2f4))):await this[_0x459ddc(0x256)][_0x459ddc(0x32a)](),_0x3eefc9;}catch(_0x53a10f){await this[_0x459ddc(0x256)][_0x459ddc(0x32a)]();throw _0x53a10f;}}[a0_0x216d83(0x231)]([{json:_0x1a68f2}]){return _0x1a68f2;}async[a0_0x216d83(0x2a2)](_0x5e6c66){if(_0x5e6c66)return _0x5e6c66;return ReadlineUtils['askString']('Enter\x20a\x20branch\x20name:\x20');}async[a0_0x216d83(0x1fa)](){const _0x4a9a62=a0_0x216d83,{credentialsAlias:_0x680a7f}=await this[_0x4a9a62(0x256)][_0x4a9a62(0x2fa)](this[_0x4a9a62(0x2bf)]);if(!_0x680a7f)throw new Error('Credentials\x20alias\x20is\x20not\x20configured');if(typeof _0x680a7f!==_0x4a9a62(0x27f))throw new Error('Invalid\x20credentials\x20type');return _0x680a7f;}}class CloneReporter extends BaseReporter{[a0_0x216d83(0x2bf)];[a0_0x216d83(0x2b4)];constructor({projectPath:_0x38f597,components:_0x60112b}){const _0x54eaa1=a0_0x216d83;super({'success':!![]}),this[_0x54eaa1(0x2bf)]=_0x38f597,this['components']=_0x60112b;}[a0_0x216d83(0x305)](){const _0x4dc84f=a0_0x216d83;return{'success':this[_0x4dc84f(0x1ba)],'projectPath':this['projectPath'],'components':this[_0x4dc84f(0x2b4)]};}[a0_0x216d83(0x31d)](_0x53861b){const _0x4b728b=a0_0x216d83;console[_0x4b728b(0x2a8)]('Init\x20Result:');const _0x41a4a8=[[_0x4b728b(0x1c3)],[_0x53861b[_0x4b728b(0x2bf)]]];console[_0x4b728b(0x2a8)](table['table'](_0x41a4a8,{'columns':[{'width':0x28}]})),console[_0x4b728b(0x2a8)](_0x4b728b(0x1f4));const _0x51932f=[[_0x4b728b(0x2b0),_0x4b728b(0x1bc),_0x4b728b(0x341)]];for(const {name:_0x481ed5,type:_0xf0f33e,paths:_0xad4ab9}of _0x53861b[_0x4b728b(0x2b4)]){_0x51932f[_0x4b728b(0x212)]([_0x481ed5,_0xf0f33e,_0xad4ab9[_0x4b728b(0x1e5)]('\x0a')]);}console[_0x4b728b(0x2a8)](table[_0x4b728b(0x242)](_0x51932f,{'columns':[{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CloneCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x1d9);[a0_0x216d83(0x258)]='Initialize\x20salesforce\x20project\x20and\x20retrieve\x20\x22main\x22\x20branch\x20from\x20registered\x20devops\x20tenant.';[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x23d),'description':'A\x20name\x20of\x20a\x20folder\x20where\x20a\x20project\x20will\x20be\x20stored.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.'},{'flags':a0_0x216d83(0x296),'description':a0_0x216d83(0x244),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':'--json','description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];['manager']=ProjectManager['getInstance']();['retrievedComponents']=[];['_credentials'];get['credentials'](){const _0x8398c0=a0_0x216d83;if(!this[_0x8398c0(0x1b3)])throw new Error(_0x8398c0(0x323));return this[_0x8398c0(0x1b3)];}async['execute']([_0x347d46]){const _0x38566d=a0_0x216d83;this[_0x38566d(0x303)]['info'](_0x38566d(0x1de)),this['_credentials']=await ApiService[_0x38566d(0x2cc)](_0x347d46['alias']);const _0x34525b=await this[_0x38566d(0x2d6)](_0x347d46[_0x38566d(0x24f)]);this[_0x38566d(0x303)][_0x38566d(0x1c5)](_0x38566d(0x2af));const _0x11962c=await this[_0x38566d(0x256)][_0x38566d(0x32f)](_0x34525b);if(_0x11962c)return this['logger'][_0x38566d(0x2bd)](_0x38566d(0x29d)),new FailReporter({'failMessage':'Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.'});await this['manager'][_0x38566d(0x32b)](_0x34525b);try{return await this[_0x38566d(0x256)][_0x38566d(0x326)]({'config':{'credentialsAlias':_0x347d46['alias']}}),this[_0x38566d(0x303)]['info'](_0x38566d(0x260)),await this[_0x38566d(0x306)](),await this[_0x38566d(0x256)][_0x38566d(0x1f7)](),this['logger'][_0x38566d(0x1c5)](_0x38566d(0x324)),new CloneReporter({'projectPath':_0x34525b,'components':this[_0x38566d(0x1ea)]});}catch(_0x45cd61){await this[_0x38566d(0x256)]['abortStage']();throw _0x45cd61;}}[a0_0x216d83(0x231)]([{json:_0x50e4c1}]){return _0x50e4c1;}async['retrieve'](){const _0x385d45=a0_0x216d83;this[_0x385d45(0x303)][_0x385d45(0x1c5)](_0x385d45(0x234));const {accessToken:_0x550201,devopsUrl:_0x82d75}=this[_0x385d45(0x253)],_0x2de2dd=await ApiService[_0x385d45(0x1be)]({'devopsUrl':_0x82d75,'accessToken':_0x550201});this[_0x385d45(0x256)]['saveBranchState'](_0x2de2dd);for await(const _0x7ea521 of ApiService[_0x385d45(0x2f9)]({'devopsUrl':_0x82d75,'accessToken':_0x550201,'branchId':_0x2de2dd['id'],'commitId':_0x2de2dd[_0x385d45(0x278)]})){if(!_0x7ea521[_0x385d45(0x257)])throw new Error(_0x7ea521[_0x385d45(0x24f)]+_0x385d45(0x1b1)+_0x7ea521[_0x385d45(0x30f)]+_0x385d45(0x2e2));await this['manager'][_0x385d45(0x2b8)]({'name':_0x7ea521['name'],'type':_0x7ea521[_0x385d45(0x30f)],'changeType':ChangeType[_0x385d45(0x1bf)],'component':{..._0x7ea521,'fHash':_0x7ea521[_0x385d45(0x257)]}}),this[_0x385d45(0x1ea)]['push']({'name':_0x7ea521[_0x385d45(0x24f)],'type':_0x7ea521[_0x385d45(0x30f)],'paths':_0x7ea521['files']['map'](_0x9bb436=>_0x9bb436['path'])});}this[_0x385d45(0x303)][_0x385d45(0x1c5)](_0x385d45(0x335));}async['buildProjectPath'](_0x542b7f){const _0x8e8c8f=a0_0x216d83;if(_0x542b7f)return node_path[_0x8e8c8f(0x1e5)](process['cwd'](),_0x542b7f);const _0x6e6a3a=await ReadlineUtils[_0x8e8c8f(0x299)](_0x8e8c8f(0x1d3));return node_path[_0x8e8c8f(0x1e5)](process[_0x8e8c8f(0x25f)](),_0x6e6a3a);}}class CommitReporter extends BaseReporter{[a0_0x216d83(0x1f2)];constructor({changes:_0x3ae09a}){const _0x5981cd=a0_0x216d83;super({'success':!![]}),this[_0x5981cd(0x1f2)]=_0x3ae09a;}[a0_0x216d83(0x305)](){const _0x4dc18e=a0_0x216d83;return{'success':this[_0x4dc18e(0x1ba)],'changes':this[_0x4dc18e(0x1f2)]};}[a0_0x216d83(0x31d)](_0x47c14c){const _0x4f3aac=a0_0x216d83;console['log'](_0x4f3aac(0x255));const _0xdc8fcb=[[_0x4f3aac(0x314),_0x4f3aac(0x2b0),_0x4f3aac(0x1bc),'Files']];for(const {changeType:_0x10f9e9,name:_0x479139,type:_0x4d7607,paths:_0xfa473c}of _0x47c14c['changes']){_0xdc8fcb['push']([_0x10f9e9,_0x479139,_0x4d7607,_0xfa473c?.[_0x4f3aac(0x1e5)]('\x0a')||'']);}console[_0x4f3aac(0x2a8)](table['table'](_0xdc8fcb,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CommitCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x2ab);['description']=a0_0x216d83(0x201);['arguments']=[];[a0_0x216d83(0x1ed)]=[{'flags':'-m,\x20--message\x20<string>','description':a0_0x216d83(0x271)},{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();[a0_0x216d83(0x275)]=[];['_credentials'];[a0_0x216d83(0x213)];[a0_0x216d83(0x30b)];[a0_0x216d83(0x2e3)];get[a0_0x216d83(0x253)](){const _0x788553=a0_0x216d83;if(!this[_0x788553(0x1b3)])throw new Error(_0x788553(0x323));return this[_0x788553(0x1b3)];}get[a0_0x216d83(0x343)](){const _0x3034d9=a0_0x216d83;if(!this['_branchId'])throw new Error(_0x3034d9(0x1f1));return this[_0x3034d9(0x213)];}get[a0_0x216d83(0x31f)](){const _0x5daa20=a0_0x216d83;if(!this[_0x5daa20(0x30b)])throw new Error(_0x5daa20(0x2ce));return this[_0x5daa20(0x30b)];}get[a0_0x216d83(0x1f2)](){const _0xd2e8b3=a0_0x216d83;if(!this[_0xd2e8b3(0x2e3)])throw new Error(_0xd2e8b3(0x2c8));return this['_changes'];}async[a0_0x216d83(0x31a)]([_0x23ed6a]){const _0x412f8b=a0_0x216d83;this['logger'][_0x412f8b(0x1c5)](_0x412f8b(0x21d));const _0x32dc23=await this[_0x412f8b(0x256)][_0x412f8b(0x32f)](this[_0x412f8b(0x2bf)]);if(!_0x32dc23)return this['logger'][_0x412f8b(0x2bd)](_0x412f8b(0x328)),new FailReporter({'failMessage':_0x412f8b(0x328)});const _0x13e8b0=await this[_0x412f8b(0x1cc)](_0x23ed6a[_0x412f8b(0x300)]);await this[_0x412f8b(0x329)](),await this[_0x412f8b(0x2cc)]();const _0x18eb1a=await this['areRemoteChanges']();if(_0x18eb1a)return this[_0x412f8b(0x303)]['warn'](_0x412f8b(0x315)),new FailReporter({'failMessage':_0x412f8b(0x315)});await this[_0x412f8b(0x256)]['initStage'](this['projectPath']);try{this[_0x412f8b(0x2e3)]=await this[_0x412f8b(0x256)][_0x412f8b(0x279)]();if(!this[_0x412f8b(0x1f2)][_0x412f8b(0x200)])return this[_0x412f8b(0x303)][_0x412f8b(0x2bd)](_0x412f8b(0x339)),new FailReporter({'failMessage':_0x412f8b(0x339)});return await this[_0x412f8b(0x332)](_0x13e8b0),await this[_0x412f8b(0x256)]['applyStage'](),this[_0x412f8b(0x303)][_0x412f8b(0x1c5)]('Commit\x20completed'),new CommitReporter({'changes':this[_0x412f8b(0x275)]});}catch(_0x3198ac){await this[_0x412f8b(0x256)][_0x412f8b(0x32a)]();throw _0x3198ac;}}[a0_0x216d83(0x231)]([{json:_0x29fa52}]){return _0x29fa52;}async['getMessage'](_0x5a1e41){const _0x208b6f=a0_0x216d83;if(_0x5a1e41)return _0x5a1e41;const _0x4a2027=await ReadlineUtils[_0x208b6f(0x299)](_0x208b6f(0x251));return _0x4a2027;}async[a0_0x216d83(0x2cc)](){const _0x502851=a0_0x216d83,{credentialsAlias:_0x4361b3}=await this['manager']['readConfig'](this[_0x502851(0x2bf)]);if(!_0x4361b3)throw new Error('Credentials\x20alias\x20is\x20not\x20configured');if(typeof _0x4361b3!=='string')throw new Error('Invalid\x20credentials\x20type');this['_credentials']=await ApiService['getCredentials'](_0x4361b3);}async[a0_0x216d83(0x329)](){const _0x4fb6bc=a0_0x216d83,{id:_0x1c66b1,headCommitId:_0x363440}=await this[_0x4fb6bc(0x256)]['readBranchState'](this['projectPath']);this[_0x4fb6bc(0x213)]=_0x1c66b1||void 0x0,this[_0x4fb6bc(0x30b)]=_0x363440||void 0x0;}async['areRemoteChanges'](){const _0xa0edef=a0_0x216d83,{headCommitId:_0x11d5f7}=await ApiService['getBranchById']({'accessToken':this['credentials'][_0xa0edef(0x1db)],'devopsUrl':this[_0xa0edef(0x253)][_0xa0edef(0x1f0)],'branchId':this[_0xa0edef(0x343)]});return this['localHeadCommit']!==_0x11d5f7;}async['findAndCommitChanges'](_0xcec274){const _0x4bef49=a0_0x216d83;this['logger']['info'](_0x4bef49(0x22c));const _0x3ccf3b=await ApiService[_0x4bef49(0x1f5)]({'accessToken':this['credentials'][_0x4bef49(0x1db)],'devopsUrl':this['credentials']['devopsUrl']}),_0x48a254={'accessToken':this[_0x4bef49(0x253)][_0x4bef49(0x1db)],'devopsUrl':this['credentials']['devopsUrl'],'message':_0xcec274,'branchId':this[_0x4bef49(0x343)],'components':[],'userName':_0x3ccf3b[_0x4bef49(0x286)]+'\x20'+_0x3ccf3b[_0x4bef49(0x2e1)]};for(const _0x160d30 of this[_0x4bef49(0x1f2)]){const _0x2743a3=await this[_0x4bef49(0x256)][_0x4bef49(0x1b9)](_0x160d30),_0x1556ea=_0x2743a3['changeType']===ChangeType['CREATE']?_0x2743a3[_0x4bef49(0x24f)]:void 0x0,_0x29ee48=this['convertToLocalComponent'](_0x2743a3[_0x4bef49(0x24f)],_0x1556ea,_0x2743a3['type'],_0x2743a3?.[_0x4bef49(0x298)]||[]);_0x48a254[_0x4bef49(0x2b4)]['push'](_0x29ee48),this[_0x4bef49(0x275)][_0x4bef49(0x212)](_0x2743a3);}this[_0x4bef49(0x303)]['info']('Detecting\x20changes\x20completed.\x20'+this['changes'][_0x4bef49(0x200)]+_0x4bef49(0x1e8)),await ApiService['commit'](_0x48a254);const _0x3057d9=await ApiService[_0x4bef49(0x2d4)]({'accessToken':this[_0x4bef49(0x253)][_0x4bef49(0x1db)],'devopsUrl':this[_0x4bef49(0x253)][_0x4bef49(0x1f0)],'branchId':this['branchId']});this[_0x4bef49(0x256)][_0x4bef49(0x2d5)](_0x3057d9);}[a0_0x216d83(0x28f)](_0x15d30f,_0x126998,_0x41a0f9,_0x306b1c){const _0x31e2e4=a0_0x216d83,_0x53c231={'name':_0x15d30f,'label':_0x126998,'type':_0x41a0f9,'files':[]};for(const _0x1e20d6 of _0x306b1c){const _0x3745cd=_0x1e20d6[_0x31e2e4(0x214)](path[_0x31e2e4(0x1d5)])[_0x31e2e4(0x241)](0x3)[_0x31e2e4(0x1e5)]('/'),_0x11f2c6=path[_0x31e2e4(0x1e5)](this[_0x31e2e4(0x2bf)],_0x1e20d6);_0x53c231[_0x31e2e4(0x1c1)][_0x31e2e4(0x212)]({'path':_0x3745cd,'localPath':_0x11f2c6});}return _0x53c231;}}class ConfigSetReporter extends BaseReporter{[a0_0x216d83(0x25d)];[a0_0x216d83(0x273)];constructor({configName:_0x50409d,value:_0x48240a}){const _0xf91692=a0_0x216d83;super({'success':!![]}),this[_0xf91692(0x25d)]=_0x50409d,this[_0xf91692(0x273)]=_0x48240a;}[a0_0x216d83(0x305)](){const _0x489ca5=a0_0x216d83;return{'success':this[_0x489ca5(0x1ba)],'configName':this[_0x489ca5(0x25d)],'value':this[_0x489ca5(0x273)]};}[a0_0x216d83(0x31d)](_0x510797){const _0x170e29=a0_0x216d83,_0xe3bf0e=[['Config\x20Name','Value'],[_0x510797['configName'],_0x510797[_0x170e29(0x273)]]];console[_0x170e29(0x2a8)](table['table'](_0xe3bf0e));}}const ALLOWED_VALUES=[ConfigName[a0_0x216d83(0x2a6)]+'(string)'];class ConfigSetCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x2c9);[a0_0x216d83(0x258)]=a0_0x216d83(0x2cf);['arguments']=[{'name':a0_0x216d83(0x21c),'description':a0_0x216d83(0x215)+ALLOWED_VALUES['join'](',\x20')+'.'},{'name':a0_0x216d83(0x316),'description':'Config\x20value'}];['options']=[{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async['execute']([_0xd35398,_0x13a265]){const _0x1f762c=a0_0x216d83;this[_0x1f762c(0x303)][_0x1f762c(0x1c5)](_0x1f762c(0x2b6));const _0x2e4ff4=process['cwd'](),_0x20ca9a=await this['manager'][_0x1f762c(0x32f)](_0x2e4ff4);if(!_0x20ca9a)return this['logger'][_0x1f762c(0x2bd)]('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});await this['manager'][_0x1f762c(0x32b)](_0x2e4ff4);try{return await this['manager'][_0x1f762c(0x2da)](_0xd35398,_0x13a265),await this[_0x1f762c(0x256)][_0x1f762c(0x1f7)](),this[_0x1f762c(0x303)][_0x1f762c(0x1c5)](_0x1f762c(0x28b)),new ConfigSetReporter({'configName':_0xd35398,'value':_0x13a265});}catch(_0xcd82b6){await this[_0x1f762c(0x256)][_0x1f762c(0x32a)]();throw _0xcd82b6;}}[a0_0x216d83(0x231)]([,,{json:_0x2baca}]){return _0x2baca;}}class ConfigUnsetReporter extends BaseReporter{[a0_0x216d83(0x25d)];constructor(_0x2ade3e){const _0x3e9890=a0_0x216d83;super({'success':!![]}),this[_0x3e9890(0x25d)]=_0x2ade3e[_0x3e9890(0x25d)];}[a0_0x216d83(0x305)](){const _0x41c82e=a0_0x216d83;return{'success':!![],'configName':this[_0x41c82e(0x25d)],'value':null};}[a0_0x216d83(0x31d)](_0x27449f){const _0x8ed8a5=a0_0x216d83,_0xf59e9d=[[_0x8ed8a5(0x2c2),_0x8ed8a5(0x24b)],[_0x27449f[_0x8ed8a5(0x25d)],_0x27449f[_0x8ed8a5(0x273)]||_0x8ed8a5(0x337)]];console[_0x8ed8a5(0x2a8)](table['table'](_0xf59e9d));}}function a0_0x3826(_0x956c4,_0x52e9f4){const _0x34b2dd=a0_0x5404();return a0_0x3826=function(_0x25e96e,_0x3c45d3){_0x25e96e=_0x25e96e-0x1b1;let _0x5404a5=_0x34b2dd[_0x25e96e];return _0x5404a5;},a0_0x3826(_0x956c4,_0x52e9f4);}class ConfigUnset extends BaseCommand{[a0_0x216d83(0x1ee)]='config-unset';['description']=a0_0x216d83(0x26a);[a0_0x216d83(0x1b8)]=[{'name':a0_0x216d83(0x21c),'description':a0_0x216d83(0x215)+Object[a0_0x216d83(0x203)](ConfigName)[a0_0x216d83(0x1e5)](',\x20')+'.'}];[a0_0x216d83(0x1ed)]=[{'flags':'--json','description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async['execute']([_0x13a9f8]){const _0xc37e96=a0_0x216d83;this['logger'][_0xc37e96(0x1c5)](_0xc37e96(0x2b6));const _0x1f774a=await this[_0xc37e96(0x256)][_0xc37e96(0x32f)](this['projectPath']);if(!_0x1f774a)return this[_0xc37e96(0x303)]['warn'](_0xc37e96(0x328)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});await this[_0xc37e96(0x256)][_0xc37e96(0x32b)](this[_0xc37e96(0x2bf)]);try{return await this[_0xc37e96(0x256)][_0xc37e96(0x344)](_0x13a9f8),await this[_0xc37e96(0x256)][_0xc37e96(0x1f7)](),this[_0xc37e96(0x303)][_0xc37e96(0x1c5)](_0xc37e96(0x28b)),new ConfigUnsetReporter({'configName':_0x13a9f8});}catch(_0x4e9cb6){await this[_0xc37e96(0x256)][_0xc37e96(0x32a)]();throw _0x4e9cb6;}}['isJson']([,{json:_0x274fef}]){return _0x274fef;}}class InitReporter extends BaseReporter{[a0_0x216d83(0x2bf)];constructor({projectPath:_0x3d8fec}){const _0x15e1dc=a0_0x216d83;super({'success':!![]}),this[_0x15e1dc(0x2bf)]=_0x3d8fec;}['buildReport'](){const _0x1a9640=a0_0x216d83;return{'success':this[_0x1a9640(0x1ba)],'projectPath':this[_0x1a9640(0x2bf)]};}[a0_0x216d83(0x31d)](_0x1146b0){const _0x109581=a0_0x216d83,_0x2ea836=[[_0x109581(0x1c3)],[_0x1146b0['projectPath']]];console[_0x109581(0x2a8)](table[_0x109581(0x242)](_0x2ea836,{'columns':[{'width':0x28}]}));}}class InitCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x218);[a0_0x216d83(0x258)]=a0_0x216d83(0x1c8);[a0_0x216d83(0x1b8)]=[];['options']=[{'flags':'-n,\x20--name\x20<string>','description':'A\x20name\x20of\x20a\x20folder\x20where\x20a\x20project\x20will\x20be\x20stored.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.'},{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async[a0_0x216d83(0x31a)]([_0x137ba8]){const _0x4c9d6b=a0_0x216d83;this['logger'][_0x4c9d6b(0x1c5)](_0x4c9d6b(0x2af));const _0x3d3f7c=await this['buildProjectPath'](_0x137ba8[_0x4c9d6b(0x24f)]),_0x19cee1=await this[_0x4c9d6b(0x256)][_0x4c9d6b(0x32f)](_0x3d3f7c);if(_0x19cee1)return this['logger'][_0x4c9d6b(0x2bd)](_0x4c9d6b(0x29d)),new FailReporter({'failMessage':'Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.'});await this[_0x4c9d6b(0x256)][_0x4c9d6b(0x32b)](_0x3d3f7c);try{return await this[_0x4c9d6b(0x256)]['initProject']({}),await this['manager'][_0x4c9d6b(0x1f7)](),this['logger'][_0x4c9d6b(0x1c5)](_0x4c9d6b(0x260)),new InitReporter({'projectPath':_0x3d3f7c});}catch(_0x25b51c){await this['manager'][_0x4c9d6b(0x32a)]();throw _0x25b51c;}}['isJson']([{json:_0x374578}]){return _0x374578;}async['buildProjectPath'](_0x5e19f1){const _0x1a5011=a0_0x216d83;if(_0x5e19f1)return node_path[_0x1a5011(0x1e5)](process[_0x1a5011(0x25f)](),_0x5e19f1);const _0x316dad=await ReadlineUtils[_0x1a5011(0x299)]('Enter\x20project\x20name:\x20');return node_path[_0x1a5011(0x1e5)](process[_0x1a5011(0x25f)](),_0x316dad);}}class ListBranchesReporter extends BaseReporter{[a0_0x216d83(0x312)];constructor(_0x11c243){const _0x3f9f25=a0_0x216d83;super({'success':!![]}),this[_0x3f9f25(0x312)]=_0x11c243[_0x3f9f25(0x312)];}[a0_0x216d83(0x305)](){const _0x2bf476=a0_0x216d83;return{'success':this[_0x2bf476(0x1ba)],'branches':this['branches']};}['print'](_0x5d8590){const _0x3c53f3=a0_0x216d83,_0x209bd9=[[_0x3c53f3(0x2e6)]];for(const _0x440310 of _0x5d8590[_0x3c53f3(0x312)]){_0x209bd9['push']([_0x440310]);}console[_0x3c53f3(0x2a8)](table[_0x3c53f3(0x242)](_0x209bd9,{'columns':[{'width':0x1e}]}));}}class ListBranchesCommand extends BaseCommand{[a0_0x216d83(0x1ee)]='list-branches';[a0_0x216d83(0x258)]='List\x20all\x20remote\x20branches.';[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager['getInstance']();async[a0_0x216d83(0x31a)](){const _0x4f308e=a0_0x216d83;this[_0x4f308e(0x303)][_0x4f308e(0x1c5)](_0x4f308e(0x239));const _0x4c0665=await this[_0x4f308e(0x256)][_0x4f308e(0x32f)](this['projectPath']);if(!_0x4c0665)return this[_0x4f308e(0x303)]['warn'](_0x4f308e(0x328)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0xdedb2d=await this[_0x4f308e(0x1fa)](),{accessToken:_0x51c5e4,devopsUrl:_0x40bab4}=await ApiService[_0x4f308e(0x2cc)](_0xdedb2d),_0x496aff=await ApiService[_0x4f308e(0x1d4)]({'accessToken':_0x51c5e4,'devopsUrl':_0x40bab4});return this['logger'][_0x4f308e(0x1c5)]('Listing\x20remote\x20branches\x20completed'),new ListBranchesReporter({'branches':_0x496aff[_0x4f308e(0x1d8)](_0x1de642=>_0x1de642[_0x4f308e(0x24f)])});}[a0_0x216d83(0x231)]([{json:_0x268be9}]){return _0x268be9;}async['getCredentialsAlias'](){const _0x33bc9c=a0_0x216d83,{credentialsAlias:_0x322014}=await this[_0x33bc9c(0x256)][_0x33bc9c(0x2fa)](this[_0x33bc9c(0x2bf)]);if(!_0x322014)throw new Error(_0x33bc9c(0x31e));if(typeof _0x322014!==_0x33bc9c(0x27f))throw new Error(_0x33bc9c(0x2ec));return _0x322014;}}class ListCredentialsReporter extends BaseReporter{[a0_0x216d83(0x253)];constructor(_0x40450d){const _0xd7300f=a0_0x216d83;super({'success':!![]}),this[_0xd7300f(0x253)]=_0x40450d[_0xd7300f(0x253)];}['buildReport'](){const _0xae387a=a0_0x216d83;return{'success':this[_0xae387a(0x1ba)],'credentials':this[_0xae387a(0x253)]};}['print'](_0x1759ea){const _0x2a9707=a0_0x216d83,_0x349348=[[_0x2a9707(0x327),'Global\x20Settings\x20Url',_0x2a9707(0x1ca)]];for(const {alias:_0x1b1e56,globalSettingsUrl:_0x33380c,devopsUrl:_0x44a342}of _0x1759ea['credentials']){_0x349348['push']([_0x1b1e56,_0x33380c,_0x44a342||_0x2a9707(0x276)]);}console[_0x2a9707(0x2a8)](table[_0x2a9707(0x242)](_0x349348));}}class ListCredentialsCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x22e);[a0_0x216d83(0x258)]=a0_0x216d83(0x21b);[a0_0x216d83(0x1b8)]=[];['options']=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];async[a0_0x216d83(0x31a)](){const _0x5814cc=a0_0x216d83;this['logger'][_0x5814cc(0x1c5)](_0x5814cc(0x254));const _0xc50d2b=await CredentialsManager['list']();return this[_0x5814cc(0x303)][_0x5814cc(0x1c5)](_0x5814cc(0x238)),new ListCredentialsReporter({'credentials':_0xc50d2b[_0x5814cc(0x1d8)](({alias:_0x374abb,globalSettingsUrl:_0x5af898,devopsUrl:_0x245add})=>({'alias':_0x374abb,'globalSettingsUrl':_0x5af898,'devopsUrl':_0x245add}))});}[a0_0x216d83(0x231)]([{json:_0x715d29}]){return _0x715d29;}}const TOKEN_PREFIX='fk_';class LoginAction{constructor(_0x2ab2f2){this['accessToken']=_0x2ab2f2;}async[a0_0x216d83(0x31a)](){const _0x175241=a0_0x216d83;try{const _0x3035a7=this['accessToken']['split'](TOKEN_PREFIX)[0x1],_0x3f1643=JSON[_0x175241(0x304)](Buffer[_0x175241(0x267)](_0x3035a7,_0x175241(0x1f9))[_0x175241(0x249)](_0x175241(0x2a4))),_0x12b80a=await axios[_0x175241(0x2e5)](_0x175241(0x282),{'headers':{'authorization':''+this[_0x175241(0x1db)]},'baseURL':_0x3f1643[_0x175241(0x2ee)]})[_0x175241(0x311)](({data:_0xb2aef3})=>new Map(_0xb2aef3[_0x175241(0x1d8)](_0x156139=>[_0x156139[_0x175241(0x24f)],_0x156139[_0x175241(0x2cd)]]))),_0x5dbd9e={'globalSettingsUrl':_0x3f1643[_0x175241(0x2ee)]};for(const [_0x2906bb,_0x303d9e]of _0x12b80a[_0x175241(0x2aa)]()){_0x2906bb===_0x175241(0x1d0)&&(_0x5dbd9e['devopsUrl']=_0x303d9e);}return _0x5dbd9e;}catch(_0x49fc33){if(axios['isAxiosError'](_0x49fc33))throw Error(_0x49fc33[_0x175241(0x227)]?.[_0x175241(0x307)][_0x175241(0x300)]||_0x49fc33[_0x175241(0x227)]?.[_0x175241(0x28c)]||_0x49fc33[_0x175241(0x300)],{'cause':_0x49fc33});throw _0x49fc33;}}}class GlobalSettingsService{static async['login']({accessToken:_0x4a415d}){const _0x4462b9=a0_0x216d83,_0xe83d63=new LoginAction(_0x4a415d);return _0xe83d63[_0x4462b9(0x31a)]();}}class LoginReporter extends BaseReporter{[a0_0x216d83(0x27e)];[a0_0x216d83(0x294)];[a0_0x216d83(0x1f0)];constructor({alias:_0x5c5dd9,globalSettingsUrl:_0x5aa501,devopsUrl:_0x4ca812}){const _0x97783a=a0_0x216d83;super({'success':!![]}),this[_0x97783a(0x27e)]=_0x5c5dd9,this[_0x97783a(0x294)]=_0x5aa501,this['devopsUrl']=_0x4ca812;}[a0_0x216d83(0x305)](){const _0x488aa1=a0_0x216d83;return{'success':this['success'],'alias':this[_0x488aa1(0x27e)],'globalSettingsUrl':this['globalSettingsUrl'],'devopsUrl':this['devopsUrl']};}[a0_0x216d83(0x31d)](_0x40362c){const _0xb558b4=a0_0x216d83,_0x3bcf53=[['Alias',_0xb558b4(0x2b3),_0xb558b4(0x1ca)],[_0x40362c[_0xb558b4(0x27e)],_0x40362c[_0xb558b4(0x294)],_0x40362c[_0xb558b4(0x1f0)]||_0xb558b4(0x276)]];console[_0xb558b4(0x2a8)](table[_0xb558b4(0x242)](_0x3bcf53));}}class LoginCommand extends BaseCommand{['commandName']=a0_0x216d83(0x26b);[a0_0x216d83(0x258)]=a0_0x216d83(0x1c9);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':'-a,\x20--alias\x20<string>','description':a0_0x216d83(0x1fb),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x216d83(0x2d0),'description':a0_0x216d83(0x29b)+ROOT_NAME+'\x20services.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.'},{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];async['execute']([_0x51ba89]){const _0x7581bc=a0_0x216d83;this[_0x7581bc(0x303)][_0x7581bc(0x1c5)](_0x7581bc(0x217));const _0xb99166=await this[_0x7581bc(0x1ce)](_0x51ba89['token']),_0x11dce6=await GlobalSettingsService[_0x7581bc(0x26b)]({'accessToken':_0xb99166});return await CredentialsManager[_0x7581bc(0x29c)]({'alias':_0x51ba89['alias'],'accessToken':_0xb99166,'globalSettingsUrl':_0x11dce6[_0x7581bc(0x294)],'devopsUrl':_0x11dce6[_0x7581bc(0x1f0)]}),this['logger'][_0x7581bc(0x1c5)](_0x7581bc(0x30c)+_0x51ba89[_0x7581bc(0x27e)]+'\x22'),new LoginReporter({'alias':_0x51ba89[_0x7581bc(0x27e)],'globalSettingsUrl':_0x11dce6['globalSettingsUrl'],'devopsUrl':_0x11dce6['devopsUrl']});}[a0_0x216d83(0x231)]([{json:_0x27fc7e}]){return _0x27fc7e;}async[a0_0x216d83(0x1ce)](_0x3495d8){const _0x197adc=a0_0x216d83;if(_0x3495d8)return _0x3495d8;const _0x1760d4=await ReadlineUtils['askString'](_0x197adc(0x310));return _0x1760d4;}}const DELETED_STATUS=a0_0x216d83(0x33e);class LogoutReporter extends BaseReporter{[a0_0x216d83(0x27e)];constructor({alias:_0x1ce063}){super({'success':!![]}),this['alias']=_0x1ce063;}[a0_0x216d83(0x305)](){return{'success':this['success'],'alias':this['alias'],'status':DELETED_STATUS};}[a0_0x216d83(0x31d)](_0x20d1a2){const _0x5058eb=a0_0x216d83,_0xbb4ed4=[[_0x5058eb(0x327),_0x5058eb(0x33c)],[_0x20d1a2[_0x5058eb(0x27e)],_0x20d1a2[_0x5058eb(0x321)]]];console[_0x5058eb(0x2a8)](table['table'](_0xbb4ed4));}}class LogoutCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x27d);[a0_0x216d83(0x258)]=a0_0x216d83(0x21a);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':'-a,\x20--alias\x20<string>','description':a0_0x216d83(0x27a),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];async['execute']([_0x18afc5]){const _0x3524a4=a0_0x216d83;return this['logger'][_0x3524a4(0x1c5)](_0x3524a4(0x25b)),await CredentialsManager[_0x3524a4(0x1cf)]({'alias':_0x18afc5[_0x3524a4(0x27e)]}),this[_0x3524a4(0x303)][_0x3524a4(0x1c5)](_0x3524a4(0x1ff)),new LogoutReporter({'alias':_0x18afc5[_0x3524a4(0x27e)]});}[a0_0x216d83(0x231)]([{json:_0x1d6376}]){return _0x1d6376;}}class PullReporter extends BaseReporter{[a0_0x216d83(0x1f2)];constructor({changes:_0x14a127}){const _0x35d540=a0_0x216d83;super({'success':!![]}),this[_0x35d540(0x1f2)]=_0x14a127;}['buildReport'](){const _0x5bb244=a0_0x216d83;return{'success':this[_0x5bb244(0x1ba)],'changes':this['changes']};}['print'](_0x511f53){const _0x31bff8=a0_0x216d83;console[_0x31bff8(0x2a8)]('Component\x20Updates:');const _0x3caf79=[[_0x31bff8(0x314),_0x31bff8(0x2b0),'Type',_0x31bff8(0x341)]];for(const {changeType:_0x1fbfda,name:_0x563cdf,type:_0x2cd3b0,paths:_0xf96c06}of _0x511f53[_0x31bff8(0x1f2)]){_0x3caf79[_0x31bff8(0x212)]([_0x1fbfda,_0x563cdf,_0x2cd3b0,_0xf96c06?.['join']('\x0a')||'']);}console[_0x31bff8(0x2a8)](table[_0x31bff8(0x242)](_0x3caf79,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class PullCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x235);[a0_0x216d83(0x258)]='Pull\x20latest\x20branch\x20commit\x20from\x20devops.';[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];['projectPath']=process['cwd']();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();[a0_0x216d83(0x275)]=[];[a0_0x216d83(0x1b3)];get[a0_0x216d83(0x253)](){const _0x47f153=a0_0x216d83;if(!this['_credentials'])throw new Error('Credentials\x20not\x20found');return this[_0x47f153(0x1b3)];}async[a0_0x216d83(0x31a)](){const _0x46a2b9=a0_0x216d83;this['logger']['info']('Pulling\x20latest\x20updates\x20started');const _0x59d7f6=await this[_0x46a2b9(0x256)]['isInitialized'](this[_0x46a2b9(0x2bf)]);if(!_0x59d7f6)return this[_0x46a2b9(0x303)][_0x46a2b9(0x2bd)](_0x46a2b9(0x328)),new FailReporter({'failMessage':_0x46a2b9(0x328)});const _0x1286d0=await this['getCredentialsAlias']();this[_0x46a2b9(0x1b3)]=await ApiService[_0x46a2b9(0x2cc)](_0x1286d0);const {id:_0x4777bd,headCommitId:_0x3cd6cf}=await this[_0x46a2b9(0x256)][_0x46a2b9(0x2ef)](this[_0x46a2b9(0x2bf)]);if(!_0x4777bd)return this[_0x46a2b9(0x303)][_0x46a2b9(0x2bd)](_0x46a2b9(0x2f1)),new FailReporter({'failMessage':_0x46a2b9(0x2f1)});const _0x15aa60=await ApiService['getBranchById']({'accessToken':this[_0x46a2b9(0x253)][_0x46a2b9(0x1db)],'devopsUrl':this[_0x46a2b9(0x253)][_0x46a2b9(0x1f0)],'branchId':_0x4777bd});if(_0x3cd6cf===_0x15aa60[_0x46a2b9(0x278)])return new PullReporter({'changes':this[_0x46a2b9(0x275)]});await this[_0x46a2b9(0x256)][_0x46a2b9(0x32b)](this[_0x46a2b9(0x2bf)]);try{this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)](_0x46a2b9(0x261));const _0x44edb8=await this[_0x46a2b9(0x265)]();if(_0x44edb8)return this[_0x46a2b9(0x303)][_0x46a2b9(0x2bd)](_0x46a2b9(0x248)),await this[_0x46a2b9(0x256)][_0x46a2b9(0x32a)](),new FailReporter({'failMessage':_0x46a2b9(0x248)});return this['logger']['info'](_0x46a2b9(0x277)),this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)](_0x46a2b9(0x234)),await this['retrieveDifference'](_0x15aa60),this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)](_0x46a2b9(0x335)),await this[_0x46a2b9(0x256)]['applyStage'](),this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)]('Pulling\x20latest\x20updates\x20completed'),new PullReporter({'changes':this[_0x46a2b9(0x275)]});}catch(_0x2069f3){await this[_0x46a2b9(0x256)]['abortStage']();throw _0x2069f3;}}[a0_0x216d83(0x231)]([{json:_0x4a76e0}]){return _0x4a76e0;}async[a0_0x216d83(0x1fa)](){const _0x26df41=a0_0x216d83,{credentialsAlias:_0x119059}=await this[_0x26df41(0x256)][_0x26df41(0x2fa)](this[_0x26df41(0x2bf)]);if(!_0x119059)throw new Error(_0x26df41(0x31e));if(typeof _0x119059!==_0x26df41(0x27f))throw new Error(_0x26df41(0x2ec));return _0x119059;}async[a0_0x216d83(0x265)](){const _0x42175c=a0_0x216d83,_0x267b77=await this[_0x42175c(0x256)][_0x42175c(0x279)]();return!!_0x267b77[_0x42175c(0x200)];}async[a0_0x216d83(0x208)](_0x4f2fad){const _0x3e3c55=a0_0x216d83,{devopsUrl:_0x8bbdb2,accessToken:_0x285ae7}=this[_0x3e3c55(0x253)],_0x136be1=await this['manager'][_0x3e3c55(0x1bd)]({'devopsUrl':_0x8bbdb2,'accessToken':_0x285ae7,'targetBranchId':_0x4f2fad['id'],'targetCommitId':_0x4f2fad[_0x3e3c55(0x278)]});for(const {id:_0x2f2c52,name:_0x3728c6,type:_0x17b79f,changeType:_0x5d9595}of _0x136be1){if(!_0x2f2c52){if(_0x5d9595!==ChangeType[_0x3e3c55(0x2f8)])throw new Error(_0x3e3c55(0x333));await this[_0x3e3c55(0x256)][_0x3e3c55(0x2b8)]({'name':_0x3728c6,'type':_0x17b79f,'changeType':_0x5d9595}),this['componentChanges'][_0x3e3c55(0x212)]({'changeType':_0x5d9595,'name':_0x3728c6,'type':_0x17b79f});continue;}const _0x37468d=await ApiService[_0x3e3c55(0x274)]({'devopsUrl':_0x8bbdb2,'accessToken':_0x285ae7,'componentId':_0x2f2c52});if(!_0x37468d[_0x3e3c55(0x257)])throw new Error(_0x3e3c55(0x2b9)+_0x37468d[_0x3e3c55(0x24f)]+'\x22\x20of\x20type\x20\x22'+_0x37468d[_0x3e3c55(0x30f)]+_0x3e3c55(0x2f2));await this[_0x3e3c55(0x256)]['saveComponent']({'name':_0x3728c6,'type':_0x17b79f,'changeType':_0x5d9595,'component':{..._0x37468d,'fHash':_0x37468d[_0x3e3c55(0x257)]}}),this[_0x3e3c55(0x275)][_0x3e3c55(0x212)]({'changeType':_0x5d9595,'name':_0x3728c6,'type':_0x17b79f,'paths':_0x37468d[_0x3e3c55(0x1c1)][_0x3e3c55(0x1d8)](_0x32d1eb=>_0x32d1eb['path'])});}await this[_0x3e3c55(0x256)]['saveBranchState'](_0x4f2fad);}}class RollbackReporter extends BaseReporter{[a0_0x216d83(0x2d9)];constructor({fileChanges:_0x2335b9}){const _0x4ae3b5=a0_0x216d83;super({'success':!![]}),this[_0x4ae3b5(0x2d9)]=_0x2335b9;}[a0_0x216d83(0x305)](){const _0x1c630d=a0_0x216d83;return{'success':this['success'],'fileChanges':this[_0x1c630d(0x2d9)]};}['print'](_0x3f5298){const _0x5f1de0=a0_0x216d83;console[_0x5f1de0(0x2a8)](_0x5f1de0(0x2b2));const _0x24524f=[[_0x5f1de0(0x314),_0x5f1de0(0x1e0)]];for(const {changeType:_0x207aee,path:_0x1909eb}of _0x3f5298[_0x5f1de0(0x2d9)]){_0x24524f[_0x5f1de0(0x212)]([_0x207aee,_0x1909eb]);}console[_0x5f1de0(0x2a8)](table[_0x5f1de0(0x242)](_0x24524f,{'columns':[{},{'width':0x28}]}));}}class RollbackCommand extends BaseCommand{[a0_0x216d83(0x1ee)]='rollback';[a0_0x216d83(0x258)]=a0_0x216d83(0x1c0);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager['getInstance']();['rollbackTypes']=new Map();[a0_0x216d83(0x2de)]=[];[a0_0x216d83(0x2c5)]=[];[a0_0x216d83(0x1b3)];[a0_0x216d83(0x213)];[a0_0x216d83(0x20a)];get[a0_0x216d83(0x253)](){const _0x49dc3a=a0_0x216d83;if(!this[_0x49dc3a(0x1b3)])throw new Error(_0x49dc3a(0x323));return this[_0x49dc3a(0x1b3)];}get['branchId'](){const _0x15e277=a0_0x216d83;if(!this['_branchId'])throw new Error(_0x15e277(0x1f1));return this[_0x15e277(0x213)];}get['headCommitId'](){const _0x413e44=a0_0x216d83;if(!this[_0x413e44(0x20a)])throw new Error('Head\x20commit\x20id\x20not\x20found');return this[_0x413e44(0x20a)];}async[a0_0x216d83(0x31a)](){const _0x35e666=a0_0x216d83;this[_0x35e666(0x303)][_0x35e666(0x1c5)]('Rolling\x20back\x20to\x20last\x20committed\x20state\x20started');const _0x570a81=await this[_0x35e666(0x256)][_0x35e666(0x32f)](this[_0x35e666(0x2bf)]);if(!_0x570a81)return this[_0x35e666(0x303)][_0x35e666(0x2bd)](_0x35e666(0x328)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0x50fd49=await this['getCredentialsAlias']();this[_0x35e666(0x1b3)]=await ApiService[_0x35e666(0x2cc)](_0x50fd49),await this[_0x35e666(0x329)](),await this[_0x35e666(0x256)][_0x35e666(0x32b)](this[_0x35e666(0x2bf)]);try{this['logger'][_0x35e666(0x1c5)](_0x35e666(0x2dd)),await this[_0x35e666(0x2c3)]();if(!this[_0x35e666(0x290)]['size'])return this[_0x35e666(0x303)][_0x35e666(0x1c5)](_0x35e666(0x23e)),new RollbackReporter({'fileChanges':this[_0x35e666(0x2c5)]});return this['logger'][_0x35e666(0x1c5)]('Looking\x20for\x20changes\x20completed.\x20'+this['rollbackTypes'][_0x35e666(0x1f3)]+_0x35e666(0x1fd)),this[_0x35e666(0x303)]['info'](_0x35e666(0x325)),await this[_0x35e666(0x24e)](),this[_0x35e666(0x303)][_0x35e666(0x1c5)](_0x35e666(0x1eb)),await this[_0x35e666(0x256)][_0x35e666(0x1f7)](),this[_0x35e666(0x303)][_0x35e666(0x1c5)](_0x35e666(0x293)),new RollbackReporter({'fileChanges':this[_0x35e666(0x2c5)]});}catch(_0x1ec3e4){await this[_0x35e666(0x256)][_0x35e666(0x32a)]();throw _0x1ec3e4;}}[a0_0x216d83(0x231)]([{json:_0x4483d9}]){return _0x4483d9;}async[a0_0x216d83(0x1fa)](){const _0x108a9e=a0_0x216d83,{credentialsAlias:_0xae21f8}=await this[_0x108a9e(0x256)][_0x108a9e(0x2fa)](this[_0x108a9e(0x2bf)]);if(!_0xae21f8)throw new Error(_0x108a9e(0x31e));if(typeof _0xae21f8!==_0x108a9e(0x27f))throw new Error(_0x108a9e(0x2ec));return _0xae21f8;}async[a0_0x216d83(0x329)](){const _0x212cfe=a0_0x216d83,{id:_0x2a7b7e,headCommitId:_0x50c4a2}=await this[_0x212cfe(0x256)][_0x212cfe(0x2ef)](this[_0x212cfe(0x2bf)]);if(!_0x2a7b7e||!_0x50c4a2)throw new Error('A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first');this[_0x212cfe(0x213)]=_0x2a7b7e||void 0x0,this[_0x212cfe(0x20a)]=_0x50c4a2||void 0x0;}async[a0_0x216d83(0x24e)](){const _0x4d6e20=a0_0x216d83;if(this['componentsForRetrieve']['length'])for await(const {files:_0x965fb}of ApiService[_0x4d6e20(0x2f9)]({'devopsUrl':this[_0x4d6e20(0x253)][_0x4d6e20(0x1f0)],'accessToken':this['credentials'][_0x4d6e20(0x1db)],'branchId':this[_0x4d6e20(0x343)],'commitId':this[_0x4d6e20(0x278)],'components':this[_0x4d6e20(0x2de)]})){await this[_0x4d6e20(0x226)](_0x965fb);}for(const [_0x17a8a7,_0x36d6a0]of this[_0x4d6e20(0x290)][_0x4d6e20(0x2aa)]()){if(_0x36d6a0!==ChangeType['DELETE'])throw new Error('File\x20\x22'+_0x17a8a7+_0x4d6e20(0x225));await this[_0x4d6e20(0x256)]['addFileChange']({'path':_0x17a8a7,'changeType':_0x36d6a0});}return{'success':!![]};}async[a0_0x216d83(0x2c3)](){const _0x273056=a0_0x216d83,_0x31bdfe=await this['manager'][_0x273056(0x279)]();for(const {name:_0x365f4f,type:_0x391e1b,changes:_0x1e45f8}of _0x31bdfe){let _0x15f607=![];for(const {path:_0x4df9cc,changeType:_0x41ae10}of _0x1e45f8){let _0x2a2b50;_0x41ae10===ChangeType[_0x273056(0x1bf)]?_0x2a2b50=ChangeType[_0x273056(0x2f8)]:(_0x2a2b50=_0x41ae10===ChangeType[_0x273056(0x2f8)]?ChangeType['CREATE']:ChangeType[_0x273056(0x28d)],_0x15f607=!![]),this[_0x273056(0x290)][_0x273056(0x23b)](_0x4df9cc,_0x2a2b50),this[_0x273056(0x2c5)][_0x273056(0x212)]({'changeType':_0x2a2b50,'path':_0x4df9cc});}_0x15f607&&this[_0x273056(0x2de)]['push']({'name':_0x365f4f,'type':_0x391e1b});}}async[a0_0x216d83(0x226)](_0x3c21fe){const _0x29ffe7=a0_0x216d83;for(const {path:_0x41d37b,content:_0x354f70}of _0x3c21fe){const _0x24515f=path['join'](COMPONENT_PROJECT_PATH,_0x41d37b),_0x1c9622=this[_0x29ffe7(0x290)][_0x29ffe7(0x2e5)](_0x24515f);if(!_0x1c9622)continue;await this[_0x29ffe7(0x256)][_0x29ffe7(0x30d)]({'path':_0x24515f,'content':_0x354f70,'changeType':_0x1c9622}),this[_0x29ffe7(0x290)][_0x29ffe7(0x1cf)](_0x24515f);}}}class StatusReporter extends BaseReporter{[a0_0x216d83(0x2ba)];constructor({pendingChanges:_0x5a7833}){super({'success':!![]}),this['pendingChanges']=_0x5a7833;}['buildReport'](){const _0x1b794e=a0_0x216d83;return{'success':this[_0x1b794e(0x1ba)],'pendingChanges':this[_0x1b794e(0x2ba)]};}[a0_0x216d83(0x31d)](_0x475bd9){const _0x5d603b=a0_0x216d83;console[_0x5d603b(0x2a8)](_0x5d603b(0x1c4));const _0x3d2a71=[[_0x5d603b(0x314),_0x5d603b(0x1e0)]];for(const {changeType:_0x40bba9,path:_0x47263e}of _0x475bd9[_0x5d603b(0x2ba)]){_0x3d2a71[_0x5d603b(0x212)]([_0x40bba9,_0x47263e]);}console[_0x5d603b(0x2a8)](table[_0x5d603b(0x242)](_0x3d2a71,{'columns':[{},{'width':0x28}]}));}}class StatusCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x321);[a0_0x216d83(0x258)]=a0_0x216d83(0x26f);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();[a0_0x216d83(0x2ba)]=[];async['execute'](){const _0x59aa21=a0_0x216d83;this['logger'][_0x59aa21(0x1c5)](_0x59aa21(0x247));const _0xd86cd4=await this['manager'][_0x59aa21(0x32f)](this['projectPath']);if(!_0xd86cd4)return this['logger'][_0x59aa21(0x2bd)](_0x59aa21(0x328)),new FailReporter({'failMessage':_0x59aa21(0x328)});await this[_0x59aa21(0x256)][_0x59aa21(0x32b)](this[_0x59aa21(0x2bf)]);const _0x311e7c=await this[_0x59aa21(0x256)][_0x59aa21(0x279)]();for(const {changes:_0x1cf4c5}of _0x311e7c){for(const {changeType:_0x3f3dfa,path:_0x11f468}of _0x1cf4c5){this[_0x59aa21(0x2ba)][_0x59aa21(0x212)]({'changeType':_0x3f3dfa,'path':_0x11f468});}}return await this['manager'][_0x59aa21(0x32a)](),this[_0x59aa21(0x303)][_0x59aa21(0x1c5)](_0x59aa21(0x1bb)),new StatusReporter({'pendingChanges':this[_0x59aa21(0x2ba)]});}['isJson']([{json:_0x1b4f8f}]){return _0x1b4f8f;}}configurePathEnv();const ROOT_COMMANDS=[LoginCommand,LogoutCommand,ListCredentialsCommand],DEVOPS_COMMANDS=[InitCommand,CloneCommand,CheckoutCommand,ConfigSetCommand,ConfigUnset,PullCommand,CommitCommand,RollbackCommand,StatusCommand,ListBranchesCommand],root=new commander['Command']()['name'](ROOT_NAME)['description']('CLI\x20for\x20work\x20with\x20'+ROOT_NAME+a0_0x216d83(0x25e))['version'](config[a0_0x216d83(0x2ea)]);for(const command of ROOT_COMMANDS){new command()[a0_0x216d83(0x28e)](root);}const devops=new commander[(a0_0x216d83(0x1c6))]()[a0_0x216d83(0x24f)](a0_0x216d83(0x33f))[a0_0x216d83(0x258)]('Devops\x20commands');for(const command of DEVOPS_COMMANDS){new command()[a0_0x216d83(0x28e)](devops);}root[a0_0x216d83(0x26e)](devops),root['parse']();function configurePathEnv(){const _0x56e6e4=a0_0x216d83,_0x4783c2=process['env'][_0x56e6e4(0x202)]?.['split'](node_path['delimiter']);if(!_0x4783c2)throw new Error(_0x56e6e4(0x2b7));const _0x530346=node_path['join'](node_path[_0x56e6e4(0x2d3)](__dirname),_0x56e6e4(0x322),_0x56e6e4(0x2ae));_0x4783c2[_0x56e6e4(0x212)](_0x530346),process[_0x56e6e4(0x233)][_0x56e6e4(0x202)]=_0x4783c2[_0x56e6e4(0x1e5)](node_path['delimiter']);}exports[a0_0x216d83(0x29f)]=DEVOPS_COMMANDS,exports[a0_0x216d83(0x1e7)]=ROOT_COMMANDS;
2
+ const a0_0xef8a28=a0_0x3d88;(function(_0x362824,_0x4722bd){const _0x40d0e0=a0_0x3d88,_0x5d862a=_0x362824();while(!![]){try{const _0x3fbbae=-parseInt(_0x40d0e0(0xb5))/0x1*(-parseInt(_0x40d0e0(0x1c9))/0x2)+-parseInt(_0x40d0e0(0x8a))/0x3+parseInt(_0x40d0e0(0x21b))/0x4+parseInt(_0x40d0e0(0x150))/0x5*(parseInt(_0x40d0e0(0x1ce))/0x6)+parseInt(_0x40d0e0(0x1ed))/0x7*(parseInt(_0x40d0e0(0xa8))/0x8)+parseInt(_0x40d0e0(0xa1))/0x9+parseInt(_0x40d0e0(0x157))/0xa*(-parseInt(_0x40d0e0(0xcf))/0xb);if(_0x3fbbae===_0x4722bd)break;else _0x5d862a['push'](_0x5d862a['shift']());}catch(_0x388db3){_0x5d862a['push'](_0x5d862a['shift']());}}}(a0_0x5cd1,0x62226));const a0_0x3ebc69=(function(){let _0x3e02a5=!![];return function(_0x53aafb,_0xff5798){const _0x250093=_0x3e02a5?function(){const _0x1f89a6=a0_0x3d88;if(_0xff5798){const _0x14aa61=_0xff5798[_0x1f89a6(0x90)](_0x53aafb,arguments);return _0xff5798=null,_0x14aa61;}}:function(){};return _0x3e02a5=![],_0x250093;};}()),a0_0x66e7eb=a0_0x3ebc69(this,function(){const _0x30d4e3=a0_0x3d88;return a0_0x66e7eb[_0x30d4e3(0x17d)]()[_0x30d4e3(0x1aa)](_0x30d4e3(0xd7))[_0x30d4e3(0x17d)]()['constructor'](a0_0x66e7eb)[_0x30d4e3(0x1aa)](_0x30d4e3(0xd7));});a0_0x66e7eb();'use strict';var node_path=require(a0_0xef8a28(0xaf)),commander=require(a0_0xef8a28(0xea)),promises=require(a0_0xef8a28(0x166)),node_os=require(a0_0xef8a28(0x17b)),axios=require(a0_0xef8a28(0x131)),salesforce=require(a0_0xef8a28(0xf6)),node_crypto=require(a0_0xef8a28(0x1d1)),readline=require('node:readline/promises'),debug=require(a0_0xef8a28(0x1e2)),table=require(a0_0xef8a28(0x125)),version=a0_0xef8a28(0x1cc),config={'version':version};const ROOT_NAME='flosum',DEFAULT_ALIAS_NAME=a0_0xef8a28(0x1d8),INTERNAL_ERROR=a0_0xef8a28(0x1b5);class FileUtils{static async[a0_0xef8a28(0x1db)](_0x3c14a3){const _0x4b569a=a0_0xef8a28,_0xd4ee18=await promises[_0x4b569a(0x10c)](_0x3c14a3,{'withFileTypes':!![]}),_0x487a9c=[];for(const _0x50734e of _0xd4ee18){const _0xb009e3=node_path[_0x4b569a(0x13f)](_0x3c14a3,_0x50734e[_0x4b569a(0x113)]);if(_0x50734e[_0x4b569a(0x1e6)]()){const _0x5008d9=await FileUtils['getFolderFilePaths'](_0xb009e3);_0x487a9c[_0x4b569a(0x1f9)](_0x5008d9);continue;}_0x487a9c[_0x4b569a(0x1f9)](_0xb009e3);}return _0x487a9c[_0x4b569a(0xaa)]();}static async['cleanUpEmptyFolders'](_0x134abe,_0x29b4f4=!![]){const _0x264591=a0_0xef8a28,_0x14ce74=await promises['readdir'](_0x134abe,{'withFileTypes':!![]});let _0x54892e=!![];for(const _0xd52e01 of _0x14ce74){const _0x35aa26=node_path[_0x264591(0x13f)](_0x134abe,_0xd52e01[_0x264591(0x113)]);if(_0xd52e01[_0x264591(0x1e6)]()){const _0x22a08e=await FileUtils[_0x264591(0x11b)](_0x35aa26);!_0x22a08e&&(_0x54892e=![]);}else _0x54892e=![];}return _0x29b4f4&&_0x54892e&&await promises[_0x264591(0x11f)](_0x134abe),_0x54892e;}static async['isDirectoryExists'](_0x3ccdf4){const _0x4a30c3=a0_0xef8a28;return promises['stat'](_0x3ccdf4)['then'](async _0x48c802=>{const _0x4b8df6=a0_0x3d88;return await promises[_0x4b8df6(0xba)](_0x3ccdf4,promises[_0x4b8df6(0xa6)][_0x4b8df6(0x14c)]|promises[_0x4b8df6(0xa6)][_0x4b8df6(0x15f)]),_0x48c802[_0x4b8df6(0x1e6)]();})[_0x4a30c3(0x1cf)](()=>![]);}static async[a0_0xef8a28(0x99)](_0x26d4ab){const _0x4436b5=a0_0xef8a28;return promises[_0x4436b5(0x96)](_0x26d4ab)[_0x4436b5(0x1af)](async _0x5d99d6=>{const _0x564ae0=_0x4436b5;return await promises[_0x564ae0(0xba)](_0x26d4ab,promises['constants']['R_OK']|promises[_0x564ae0(0xa6)][_0x564ae0(0x15f)]),_0x5d99d6['isFile']();})[_0x4436b5(0x1cf)](()=>![]);}}const SYSTEM_FOLDER$1='.'+ROOT_NAME,CREDENTIALS_FILE_NAME='credentials.json';class CredentialsManager{static async['save'](_0x2a405a){const _0x449747=a0_0xef8a28,_0x28f140=node_path[_0x449747(0x13f)](node_os['homedir'](),SYSTEM_FOLDER$1);await promises[_0x449747(0x16f)](_0x28f140,{'recursive':!![]});const _0x346b01=node_path['join'](_0x28f140,CREDENTIALS_FILE_NAME),_0x2f831f=await CredentialsManager['getAllCredentials'](_0x346b01),_0x4c54d6=_0x2f831f['find'](({alias:_0x598c0d})=>_0x598c0d===_0x2a405a[_0x449747(0x145)]);!_0x4c54d6?_0x2f831f[_0x449747(0x1f9)](_0x2a405a):(_0x4c54d6[_0x449747(0xe4)]=_0x2a405a[_0x449747(0xe4)],_0x4c54d6[_0x449747(0x15e)]=_0x2a405a[_0x449747(0x15e)],_0x4c54d6[_0x449747(0x214)]=_0x2a405a[_0x449747(0x214)]),await promises[_0x449747(0xe9)](_0x346b01,Buffer[_0x449747(0x7f)](JSON[_0x449747(0x92)](_0x2f831f)));}static async[a0_0xef8a28(0x174)]({alias:_0x539bf5}){const _0x5c216b=a0_0xef8a28,_0x28a710=node_path[_0x5c216b(0x13f)](node_os[_0x5c216b(0x1dd)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x293502=await CredentialsManager[_0x5c216b(0x18f)](_0x28a710),_0x501c00=_0x293502[_0x5c216b(0x18c)](_0x387c61=>_0x387c61['alias']===_0x539bf5);if(!_0x501c00)throw new Error(_0x5c216b(0x218)+_0x539bf5+'\x22\x20not\x20found');return _0x501c00;}static async['list'](){const _0x379438=a0_0xef8a28,_0x4a3f60=node_path[_0x379438(0x13f)](node_os['homedir'](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x33500e=await CredentialsManager[_0x379438(0x18f)](_0x4a3f60);return _0x33500e;}static async['getAllCredentials'](_0x48f10c){const _0x2a935a=a0_0xef8a28,_0x5b152b=await FileUtils[_0x2a935a(0x99)](_0x48f10c);if(_0x5b152b){const _0x513192=await promises[_0x2a935a(0x1f3)](_0x48f10c);return JSON['parse'](_0x513192[_0x2a935a(0x17d)]());}return[];}static async[a0_0xef8a28(0x111)]({alias:_0x57e985}){const _0x5dacfe=a0_0xef8a28,_0x4c8ef0=node_path[_0x5dacfe(0x13f)](node_os[_0x5dacfe(0x1dd)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x4ea13d=await CredentialsManager[_0x5dacfe(0x18f)](_0x4c8ef0),_0x190a62=_0x4ea13d[_0x5dacfe(0xf3)](_0x606a29=>_0x606a29[_0x5dacfe(0x145)]===_0x57e985);if(_0x190a62<0x0)throw new Error(_0x5dacfe(0x218)+_0x57e985+_0x5dacfe(0x1d3));_0x4ea13d[_0x5dacfe(0x11d)](_0x190a62,0x1),await promises[_0x5dacfe(0xe9)](_0x4c8ef0,Buffer['from'](JSON[_0x5dacfe(0x92)](_0x4ea13d)));}}var ManagementType=(_0xf76ee1=>{const _0x1620c6=a0_0xef8a28;return _0xf76ee1['SALESFORCE']=_0x1620c6(0x163),_0xf76ee1[_0x1620c6(0xeb)]=_0x1620c6(0x79),_0xf76ee1;})(ManagementType||{});class CommitAction{[a0_0xef8a28(0xe4)];[a0_0xef8a28(0x214)];[a0_0xef8a28(0x139)];[a0_0xef8a28(0x135)];['components'];['userName'];['commitDate']=new Date();constructor(_0x15b36c){const _0x653ac5=a0_0xef8a28;this[_0x653ac5(0xe4)]=_0x15b36c[_0x653ac5(0xe4)],this[_0x653ac5(0x214)]=_0x15b36c[_0x653ac5(0x214)],this['message']=_0x15b36c['message'],this[_0x653ac5(0x135)]=_0x15b36c[_0x653ac5(0x135)],this[_0x653ac5(0x21d)]=_0x15b36c[_0x653ac5(0x21d)],this[_0x653ac5(0x1a8)]=_0x15b36c[_0x653ac5(0x1a8)];}async[a0_0xef8a28(0x12b)](){const _0x957ce8=a0_0xef8a28;try{const _0x2cbe6b=await Promise[_0x957ce8(0xcd)](this[_0x957ce8(0x21d)][_0x957ce8(0xdc)](async _0x4bd0e9=>await this[_0x957ce8(0xa2)](_0x4bd0e9))),{data:_0x43d901}=await axios[_0x957ce8(0x1ca)](_0x957ce8(0xe0)+this[_0x957ce8(0x135)]+'/commits',{'message':this[_0x957ce8(0x139)],'components':_0x2cbe6b},{'headers':{'authorization':''+this[_0x957ce8(0xe4)]},'baseURL':this[_0x957ce8(0x214)]});return _0x43d901;}catch(_0x1f223e){if(axios['isAxiosError'](_0x1f223e))throw Error(_0x1f223e[_0x957ce8(0x124)]?.[_0x957ce8(0x1d7)]['message']||_0x1f223e[_0x957ce8(0x124)]?.[_0x957ce8(0x216)]||_0x1f223e['message'],{'cause':_0x1f223e});throw _0x1f223e;}}async['convertToCommit'](_0xc78fb0){const _0x224c90=a0_0xef8a28,_0x53c180=[];for(const {path:_0x577425,localPath:_0x1279ce}of _0xc78fb0[_0x224c90(0x126)]){_0x53c180[_0x224c90(0x1f9)](promises['readFile'](_0x1279ce)[_0x224c90(0x1af)](_0x30f13e=>({'path':_0x577425,'content':_0x30f13e[_0x224c90(0x17d)]('base64')})));}const _0x4f0912=await Promise['all'](_0x53c180);return{'name':_0xc78fb0[_0x224c90(0x113)],'label':_0xc78fb0[_0x224c90(0x120)],'type':_0xc78fb0[_0x224c90(0xb4)],'sourceName':_0x224c90(0xe8),'sourceType':_0x224c90(0xe8),'externalUpdatedAt':this[_0x224c90(0xf8)],'externalUpdatedBy':this[_0x224c90(0x1a8)],'files':_0x4f0912,'managementType':ManagementType[_0x224c90(0x201)]};}}class CreateBranchAction{[a0_0xef8a28(0xe4)];[a0_0xef8a28(0x214)];constructor(_0x160c06){const _0x2a051d=a0_0xef8a28;this[_0x2a051d(0xe4)]=_0x160c06['accessToken'],this[_0x2a051d(0x214)]=_0x160c06[_0x2a051d(0x214)];}async[a0_0xef8a28(0x12b)](_0x56b3ca){const _0x594916=a0_0xef8a28;try{const {data:_0x5cff4c}=await axios['post'](_0x594916(0x191),{..._0x56b3ca},{'headers':{'authorization':''+this[_0x594916(0xe4)]},'baseURL':this['devopsUrl']});return _0x5cff4c;}catch(_0x250f31){if(axios[_0x594916(0x210)](_0x250f31))throw Error(_0x250f31[_0x594916(0x124)]?.['data'][_0x594916(0x139)]||_0x250f31[_0x594916(0x124)]?.[_0x594916(0x216)]||_0x250f31[_0x594916(0x139)],{'cause':_0x250f31});throw _0x250f31;}}}class GetBranchAction{[a0_0xef8a28(0xe4)];[a0_0xef8a28(0x214)];constructor(_0x549778){const _0x4a8c97=a0_0xef8a28;this[_0x4a8c97(0xe4)]=_0x549778[_0x4a8c97(0xe4)],this[_0x4a8c97(0x214)]=_0x549778[_0x4a8c97(0x214)];}async[a0_0xef8a28(0x12b)](_0x5b8abb){const _0x455ab0=a0_0xef8a28;try{const {data:_0x29533f}=await axios[_0x455ab0(0x174)]('fit/branches/'+_0x5b8abb[_0x455ab0(0x135)],{'headers':{'authorization':''+this[_0x455ab0(0xe4)]},'baseURL':this['devopsUrl']});return _0x29533f;}catch(_0x41ce9d){if(axios[_0x455ab0(0x210)](_0x41ce9d))throw Error(_0x41ce9d[_0x455ab0(0x124)]?.[_0x455ab0(0x1d7)][_0x455ab0(0x139)]||_0x41ce9d[_0x455ab0(0x124)]?.[_0x455ab0(0x216)]||_0x41ce9d['message'],{'cause':_0x41ce9d});throw _0x41ce9d;}}}class GetDefaultBranchAction{[a0_0xef8a28(0x214)];[a0_0xef8a28(0xe4)];constructor(_0x1dd233){const _0x162dd4=a0_0xef8a28;this[_0x162dd4(0x214)]=_0x1dd233['devopsUrl'],this[_0x162dd4(0xe4)]=_0x1dd233[_0x162dd4(0xe4)];}async[a0_0xef8a28(0x12b)](){const _0x55a524=a0_0xef8a28;try{const {data:_0x19f036}=await axios[_0x55a524(0x174)]('fit/branches/default',{'headers':{'authorization':''+this[_0x55a524(0xe4)]},'baseURL':this['devopsUrl']});return _0x19f036;}catch(_0x127e9d){if(axios[_0x55a524(0x210)](_0x127e9d))throw Error(_0x127e9d[_0x55a524(0x124)]?.[_0x55a524(0x1d7)][_0x55a524(0x139)]||_0x127e9d[_0x55a524(0x124)]?.[_0x55a524(0x216)]||_0x127e9d['message'],{'cause':_0x127e9d});throw _0x127e9d;}}}function a0_0x3d88(_0x5ee367,_0x461ed3){const _0x374a81=a0_0x5cd1();return a0_0x3d88=function(_0x66e7eb,_0x3ebc69){_0x66e7eb=_0x66e7eb-0x79;let _0x5cd1eb=_0x374a81[_0x66e7eb];return _0x5cd1eb;},a0_0x3d88(_0x5ee367,_0x461ed3);}class GetMeAction{[a0_0xef8a28(0xe4)];[a0_0xef8a28(0x214)];constructor(_0x3c4a11){const _0x517c1f=a0_0xef8a28;this[_0x517c1f(0xe4)]=_0x3c4a11[_0x517c1f(0xe4)],this[_0x517c1f(0x214)]=_0x3c4a11[_0x517c1f(0x214)];}async[a0_0xef8a28(0x12b)](){const _0x276d5d=a0_0xef8a28;try{const {data:_0xb81be6}=await axios[_0x276d5d(0x174)](_0x276d5d(0x171),{'headers':{'authorization':''+this['accessToken']},'baseURL':this[_0x276d5d(0x214)]});return _0xb81be6;}catch(_0x1fbdd6){if(axios[_0x276d5d(0x210)](_0x1fbdd6))throw Error(_0x1fbdd6[_0x276d5d(0x124)]?.[_0x276d5d(0x1d7)][_0x276d5d(0x139)]||_0x1fbdd6[_0x276d5d(0x124)]?.[_0x276d5d(0x216)]||_0x1fbdd6['message'],{'cause':_0x1fbdd6});throw _0x1fbdd6;}}}class ListBranchesAction{[a0_0xef8a28(0x214)];[a0_0xef8a28(0xe4)];['search'];constructor(_0x14151a){const _0x26e0b2=a0_0xef8a28;this[_0x26e0b2(0x214)]=_0x14151a[_0x26e0b2(0x214)],this['accessToken']=_0x14151a[_0x26e0b2(0xe4)],this[_0x26e0b2(0x1aa)]=_0x14151a['search'];}async['execute'](){const _0x39e46f=a0_0xef8a28;try{const _0x2ad512=[];let _0x205b5e=0x0,_0x5c4fdc=0x0;do{const {data:_0x2a82b0}=await axios[_0x39e46f(0x174)](_0x39e46f(0x191),{'headers':{'authorization':''+this[_0x39e46f(0xe4)]},'params':{'search':this['search'],'offset':_0x205b5e,'limit':0x64},'baseURL':this[_0x39e46f(0x214)]});_0x2ad512[_0x39e46f(0x1f9)](..._0x2a82b0['rows']),_0x205b5e+=_0x2a82b0['rows'][_0x39e46f(0x10f)],_0x5c4fdc=_0x2a82b0['total'];}while(_0x205b5e<_0x5c4fdc);return _0x2ad512;}catch(_0x1c83f3){if(axios[_0x39e46f(0x210)](_0x1c83f3))throw Error(_0x1c83f3[_0x39e46f(0x124)]?.[_0x39e46f(0x1d7)][_0x39e46f(0x139)]||_0x1c83f3['response']?.[_0x39e46f(0x216)]||_0x1c83f3[_0x39e46f(0x139)],{'cause':_0x1c83f3});throw _0x1c83f3;}}}class ListComponentsAction{[a0_0xef8a28(0x214)];[a0_0xef8a28(0xe4)];[a0_0xef8a28(0x135)];[a0_0xef8a28(0xf1)];['indexes'];constructor(_0xe96bbb){const _0xc5b033=a0_0xef8a28;this['devopsUrl']=_0xe96bbb[_0xc5b033(0x214)],this[_0xc5b033(0xe4)]=_0xe96bbb[_0xc5b033(0xe4)],this[_0xc5b033(0x135)]=_0xe96bbb[_0xc5b033(0x135)],this[_0xc5b033(0xf1)]=_0xe96bbb['commitId'],_0xe96bbb[_0xc5b033(0x21d)]&&(this[_0xc5b033(0x8e)]=new Set(_0xe96bbb[_0xc5b033(0x21d)][_0xc5b033(0xdc)](({name:_0xc52630,type:_0x35bc9d})=>_0x35bc9d+'_'+_0xc52630)));}async*[a0_0xef8a28(0x12b)](){const _0x40dd7a=a0_0xef8a28;try{let _0x2e2f28=0x0,_0x245319=0x0;do{const {data:_0x3910de}=await axios[_0x40dd7a(0x174)](_0x40dd7a(0xe0)+this[_0x40dd7a(0x135)]+_0x40dd7a(0x189)+this[_0x40dd7a(0xf1)]+_0x40dd7a(0x19a),{'headers':{'authorization':''+this['accessToken']},'params':{'offset':_0x2e2f28,'limit':0x64,'managementType':ManagementType[_0x40dd7a(0x201)]},'baseURL':this['devopsUrl']});_0x2e2f28+=_0x3910de[_0x40dd7a(0xbd)]['length'],_0x245319=_0x3910de[_0x40dd7a(0x12d)];let _0x56c81d=_0x3910de['rows'];this[_0x40dd7a(0x8e)]&&(_0x56c81d=_0x3910de['rows'][_0x40dd7a(0x164)](({name:_0x236cb4,type:_0x4a893b})=>this[_0x40dd7a(0x8e)]?.['has'](_0x4a893b+'_'+_0x236cb4))),yield*_0x56c81d;}while(_0x2e2f28<_0x245319);}catch(_0x5deb00){if(axios[_0x40dd7a(0x210)](_0x5deb00))throw Error(_0x5deb00['response']?.[_0x40dd7a(0x1d7)][_0x40dd7a(0x139)]||_0x5deb00['response']?.['statusText']||_0x5deb00[_0x40dd7a(0x139)],{'cause':_0x5deb00});throw _0x5deb00;}}}class RetrieveComponentAction{['devopsUrl'];[a0_0xef8a28(0xe4)];constructor(_0x40b651){const _0x4fb8e5=a0_0xef8a28;this['devopsUrl']=_0x40b651[_0x4fb8e5(0x214)],this[_0x4fb8e5(0xe4)]=_0x40b651[_0x4fb8e5(0xe4)];}async[a0_0xef8a28(0x12b)](_0x4ccbf5){const _0x14bc5d=a0_0xef8a28;try{const {data:{id:_0xa6d709,name:_0x188963,type:_0x263de2,fHash:_0x5b4a8c,files:_0x170c42}}=await axios['get'](_0x14bc5d(0x187)+_0x4ccbf5,{'headers':{'authorization':''+this['accessToken']},'baseURL':this[_0x14bc5d(0x214)]}),_0x46510a=_0x170c42['map'](_0x24b6f3=>({'path':_0x24b6f3[_0x14bc5d(0x119)],'content':Buffer[_0x14bc5d(0x7f)](_0x24b6f3[_0x14bc5d(0x1c4)],'base64')[_0x14bc5d(0x17d)](_0x14bc5d(0xcb))}));return{'id':_0xa6d709,'name':_0x188963,'type':_0x263de2,'fHash':_0x5b4a8c,'files':_0x46510a};}catch(_0x14d19b){if(axios['isAxiosError'](_0x14d19b))throw Error(_0x14d19b[_0x14bc5d(0x124)]?.[_0x14bc5d(0x1d7)][_0x14bc5d(0x139)]||_0x14d19b[_0x14bc5d(0x124)]?.['statusText']||_0x14d19b[_0x14bc5d(0x139)],{'cause':_0x14d19b});throw _0x14d19b;}}}const RETRIEVE_COMPONENT_CHUNK_SIZE=0xa;class ApiService{static async[a0_0xef8a28(0x11c)](_0x134eda){const _0x534395=a0_0xef8a28,_0x406418=new ListBranchesAction(_0x134eda);return _0x406418[_0x534395(0x12b)]();}static async[a0_0xef8a28(0x1fe)](_0x355238){const _0x403d66=a0_0xef8a28,_0xba0f38=new GetDefaultBranchAction(_0x355238);return _0xba0f38[_0x403d66(0x12b)]();}static async[a0_0xef8a28(0x1e0)](_0x176518){const _0x8a05bc=a0_0xef8a28,_0x537bea=await ApiService[_0x8a05bc(0x11c)]({'devopsUrl':_0x176518[_0x8a05bc(0x214)],'accessToken':_0x176518['accessToken'],'search':_0x176518[_0x8a05bc(0x207)]});return _0x537bea[_0x8a05bc(0x18c)](({name:_0x655e5b})=>_0x655e5b===_0x176518[_0x8a05bc(0x207)])||null;}static async[a0_0xef8a28(0x12f)](_0x580316){const _0x3019ec=a0_0xef8a28,_0x5c3225=new GetBranchAction({'accessToken':_0x580316[_0x3019ec(0xe4)],'devopsUrl':_0x580316[_0x3019ec(0x214)]});return _0x5c3225['execute']({'branchId':_0x580316[_0x3019ec(0x135)]});}static[a0_0xef8a28(0x16b)](_0x49c860){const _0x243ace=a0_0xef8a28,_0x5bdf41=new ListComponentsAction(_0x49c860);return _0x5bdf41[_0x243ace(0x12b)]();}static async['listComponents'](_0x311078){const _0xb7c30a=a0_0xef8a28,_0x3851a6=[];for await(const _0x14db33 of ApiService[_0xb7c30a(0x16b)](_0x311078)){_0x3851a6[_0xb7c30a(0x1f9)](_0x14db33);}return _0x3851a6;}static async*[a0_0xef8a28(0x173)](_0x458736){const _0x1e0f0c=a0_0xef8a28,_0x5d0f32=new RetrieveComponentAction({'devopsUrl':_0x458736[_0x1e0f0c(0x214)],'accessToken':_0x458736[_0x1e0f0c(0xe4)]});let _0x379f99=[];for await(const _0x583122 of ApiService['listComponentsGenerator']({'devopsUrl':_0x458736[_0x1e0f0c(0x214)],'accessToken':_0x458736[_0x1e0f0c(0xe4)],'branchId':_0x458736['branchId'],'commitId':_0x458736[_0x1e0f0c(0xf1)],'components':_0x458736[_0x1e0f0c(0x21d)]})){_0x379f99['push'](_0x5d0f32[_0x1e0f0c(0x12b)](_0x583122['id'])),_0x379f99[_0x1e0f0c(0x10f)]>=RETRIEVE_COMPONENT_CHUNK_SIZE&&(yield*await Promise['all'](_0x379f99),_0x379f99=[]);}_0x379f99[_0x1e0f0c(0x10f)]&&(yield*await Promise['all'](_0x379f99));}static async[a0_0xef8a28(0x209)]({devopsUrl:_0x41c06c,accessToken:_0x4478b2,componentId:_0x24db6d}){const _0x528eb6=a0_0xef8a28,_0x1a17fd=new RetrieveComponentAction({'devopsUrl':_0x41c06c,'accessToken':_0x4478b2});return _0x1a17fd[_0x528eb6(0x12b)](_0x24db6d);}static async[a0_0xef8a28(0x86)](_0x13c917){const _0x220c4f=a0_0xef8a28,{accessToken:_0x204290,devopsUrl:_0x56d1c0}=await CredentialsManager['get']({'alias':_0x13c917});if(!_0x56d1c0)throw new Error(_0x220c4f(0x1c7));return{'accessToken':_0x204290,'devopsUrl':_0x56d1c0};}static async[a0_0xef8a28(0x104)](_0x19bf6e){const _0x13ed2e=a0_0xef8a28,_0x196914=new GetMeAction(_0x19bf6e);return _0x196914[_0x13ed2e(0x12b)]();}static async[a0_0xef8a28(0x1a4)](_0x2047ed){const _0x107d9f=a0_0xef8a28,_0x3f0a9a=new CommitAction(_0x2047ed);await _0x3f0a9a[_0x107d9f(0x12b)]();}static async['createBranch'](_0x19febd){const _0x62436f=a0_0xef8a28,_0x51628c=new CreateBranchAction({'accessToken':_0x19febd['accessToken'],'devopsUrl':_0x19febd[_0x62436f(0x214)]});return _0x51628c[_0x62436f(0x12b)]({'name':_0x19febd['name'],'parentId':_0x19febd[_0x62436f(0xfd)]});}}var ConfigName=(_0xd4ab3c=>{const _0x1e6180=a0_0xef8a28;return _0xd4ab3c[_0x1e6180(0x13c)]=_0x1e6180(0xca),_0xd4ab3c;})(ConfigName||{}),ChangeType=(_0x5d48d9=>{const _0x209683=a0_0xef8a28;return _0x5d48d9[_0x209683(0xf4)]=_0x209683(0x1e8),_0x5d48d9[_0x209683(0x121)]=_0x209683(0x203),_0x5d48d9[_0x209683(0xf0)]='Delete',_0x5d48d9;})(ChangeType||{});class CompareWithRemoteBranchAction{[a0_0xef8a28(0x214)];['accessToken'];[a0_0xef8a28(0x1d2)];[a0_0xef8a28(0x19d)];[a0_0xef8a28(0x137)];constructor(_0x2c9e18){const _0x3382c6=a0_0xef8a28;this[_0x3382c6(0x214)]=_0x2c9e18['devopsUrl'],this[_0x3382c6(0xe4)]=_0x2c9e18['accessToken'],this[_0x3382c6(0x1d2)]=_0x2c9e18['targetBranchId'],this[_0x3382c6(0x19d)]=_0x2c9e18[_0x3382c6(0x19d)],this[_0x3382c6(0x137)]=_0x2c9e18[_0x3382c6(0x137)];}async[a0_0xef8a28(0x12b)](){const _0x51f666=a0_0xef8a28,_0x291dce=await ApiService[_0x51f666(0x1cd)]({'devopsUrl':this[_0x51f666(0x214)],'accessToken':this['accessToken'],'branchId':this[_0x51f666(0x1d2)],'commitId':this[_0x51f666(0x19d)]}),_0x29b076=new Map(_0x291dce[_0x51f666(0xdc)](_0x3af819=>[_0x3af819[_0x51f666(0xb4)]+'_'+_0x3af819[_0x51f666(0x113)],_0x3af819])),_0x394b01=[];for(const _0x42bbc9 of this['findDeletedAndUpdated'](_0x29b076)){_0x394b01[_0x51f666(0x1f9)](_0x42bbc9),_0x29b076['delete'](_0x42bbc9[_0x51f666(0xb4)]+'_'+_0x42bbc9['name']);}for(const [_0x4304bd,_0x1545f1]of _0x29b076[_0x51f666(0x1d6)]()){const _0x3a36bf=this[_0x51f666(0x137)]['componentsState'][_0x51f666(0x174)](_0x4304bd);!_0x3a36bf&&_0x394b01['push']({'id':_0x1545f1['id'],'name':_0x1545f1[_0x51f666(0x113)],'type':_0x1545f1[_0x51f666(0xb4)],'fHash':_0x1545f1[_0x51f666(0xee)],'changeType':ChangeType[_0x51f666(0xf4)]});}return _0x394b01;}*[a0_0xef8a28(0xc2)](_0x292706){const _0x9272ab=a0_0xef8a28;for(const [_0x7f14b1,_0x4222fa]of this[_0x9272ab(0x137)][_0x9272ab(0x81)][_0x9272ab(0x1d6)]()){const _0x13eb8f=_0x292706[_0x9272ab(0x174)](_0x7f14b1);!_0x13eb8f&&(yield{'name':_0x4222fa[_0x9272ab(0x113)],'type':_0x4222fa['type'],'changeType':ChangeType[_0x9272ab(0xf0)]}),_0x13eb8f&&_0x13eb8f['fHash']!==_0x4222fa[_0x9272ab(0xee)]&&(yield{'id':_0x13eb8f['id'],'name':_0x13eb8f[_0x9272ab(0x113)],'type':_0x13eb8f[_0x9272ab(0xb4)],'fHash':_0x13eb8f[_0x9272ab(0xee)],'changeType':ChangeType['UPDATE']});}}}class ConfigSetAction{[a0_0xef8a28(0x137)];constructor({stage:_0x23c5b2}){const _0x14d85f=a0_0xef8a28;this[_0x14d85f(0x137)]=_0x23c5b2;}async[a0_0xef8a28(0x12b)]({name:_0x1a95b7,value:_0x5cb22e}){const _0x5d66e9=a0_0xef8a28;switch(_0x1a95b7){case ConfigName['CREDENTIALS_ALIAS']:await CredentialsManager[_0x5d66e9(0x174)]({'alias':_0x5cb22e}),this[_0x5d66e9(0x137)][_0x5d66e9(0x1de)](_0x1a95b7,_0x5cb22e);break;default:throw new Error('Unknown\x20config\x20name:\x20'+_0x1a95b7);}}}class FindChangesAction{['stage'];constructor(_0x51fc50){const _0x1759fd=a0_0xef8a28;this[_0x1759fd(0x137)]=_0x51fc50[_0x1759fd(0x137)];}async[a0_0xef8a28(0x12b)](){const _0x1e6536=a0_0xef8a28,_0x17d590=new Map(this[_0x1e6536(0x137)]['componentsState']),_0x393cad=[];for await(const {componentName:_0x112180,componentType:_0x2a3d81,filePaths:_0x3494c2}of salesforce[_0x1e6536(0x14d)][_0x1e6536(0x21f)](this[_0x1e6536(0x137)][_0x1e6536(0x202)])){const _0x2d559c=_0x2a3d81+'_'+_0x112180,_0x30b44b=_0x17d590[_0x1e6536(0x174)](_0x2d559c),_0x529413=_0x3494c2[_0x1e6536(0xdc)](_0x4e2f0b=>_0x4e2f0b[_0x1e6536(0xda)](this[_0x1e6536(0x137)][_0x1e6536(0x202)]+'/',''));if(!_0x30b44b){_0x393cad[_0x1e6536(0x1f9)]({'type':_0x2a3d81,'name':_0x112180,'changes':_0x529413[_0x1e6536(0xdc)](_0x14dcfc=>({'path':_0x14dcfc,'changeType':ChangeType[_0x1e6536(0xf4)]}))});continue;}_0x17d590[_0x1e6536(0x111)](_0x2d559c);const _0x17d3c6=await this[_0x1e6536(0x1d9)](_0x529413,_0x30b44b[_0x1e6536(0xb1)]);_0x17d3c6['length']&&_0x393cad[_0x1e6536(0x1f9)]({'type':_0x2a3d81,'name':_0x112180,'changes':_0x17d3c6});}for(const [,_0x2b3bfc]of _0x17d590[_0x1e6536(0x1d6)]()){_0x393cad[_0x1e6536(0x1f9)]({'type':_0x2b3bfc['type'],'name':_0x2b3bfc['name'],'changes':_0x2b3bfc[_0x1e6536(0xb1)][_0x1e6536(0xdc)](_0x3d27bc=>({'path':_0x3d27bc,'changeType':ChangeType[_0x1e6536(0xf0)]}))});}return _0x393cad;}async['getUpdatedComponentChanges'](_0x7b510a,_0x261d33){const _0x44f4ed=a0_0xef8a28,{lastStageTimestamp:_0x4d35cc}=this[_0x44f4ed(0x137)]['branchState'],_0x21d6b0=[];for(const _0x2abfbe of _0x7b510a){const _0x2243f4=_0x261d33[_0x44f4ed(0x136)](_0x2abfbe);if(!_0x2243f4){_0x21d6b0[_0x44f4ed(0x1f9)]({'path':_0x2abfbe,'changeType':ChangeType['CREATE']});continue;}const {ctimeMs:_0x30f753,mtimeMs:_0x36a5db}=await promises['stat'](_0x2abfbe);(!_0x4d35cc||Math[_0x44f4ed(0x1be)](_0x36a5db)>_0x4d35cc||Math['trunc'](_0x30f753)>_0x4d35cc)&&_0x21d6b0[_0x44f4ed(0x1f9)]({'path':_0x2abfbe,'changeType':ChangeType[_0x44f4ed(0x121)]});}for(const _0x35dd7f of _0x261d33){const _0x2fb6f9=!_0x7b510a[_0x44f4ed(0x136)](_0x35dd7f);_0x2fb6f9&&_0x21d6b0[_0x44f4ed(0x1f9)]({'path':_0x35dd7f,'changeType':ChangeType['DELETE']});}return _0x21d6b0;}}const STAGE_FOLDER_NAME='.stage',SYSTEM_FOLDER='.'+ROOT_NAME,CONFIG_FILE_NAME=a0_0xef8a28(0x20a),BRANCH_STATE_FILE_NAME=a0_0xef8a28(0x1fa),COMPONENTS_STATE_FILE_NAME=a0_0xef8a28(0x21e),COMPONENT_PROJECT_PATH=node_path[a0_0xef8a28(0x13f)](a0_0xef8a28(0x13e),'main',a0_0xef8a28(0x1d8)),SFDX_PROJECT_FILE_NAME=a0_0xef8a28(0x8f),INITIAL_BRANCH_STATE={'id':null,'name':null,'headCommitId':null,'lastStageTimestamp':null},INITIAL_CONFIG={'credentialsAlias':null};class InitProjectAction{[a0_0xef8a28(0x137)];['config'];constructor({stage:_0x18cdda,config:_0x88305b}){const _0x2e0284=a0_0xef8a28;this['stage']=_0x18cdda,this[_0x2e0284(0x170)]=_0x88305b;}async[a0_0xef8a28(0x12b)](){const _0x3aa6b0=a0_0xef8a28,_0x4d6684=new salesforce['CreateProjectSfCommand']({'cwd':node_path[_0x3aa6b0(0x18e)](this[_0x3aa6b0(0x137)][_0x3aa6b0(0x19f)]),'projectName':node_path[_0x3aa6b0(0xf7)](this[_0x3aa6b0(0x137)][_0x3aa6b0(0x19f)])});await _0x4d6684['run']();const _0x5dc1c2=await FileUtils['getFolderFilePaths'](this['stage'][_0x3aa6b0(0x19f)]);for(const _0x9ce421 of _0x5dc1c2){const _0x544ce1=_0x9ce421[_0x3aa6b0(0x188)](STAGE_FOLDER_NAME)[0x1];this[_0x3aa6b0(0x137)][_0x3aa6b0(0xe3)]({'path':_0x544ce1,'changeType':ChangeType['CREATE']});}if(this[_0x3aa6b0(0x170)])for(const _0x44bafe of Object['values'](ConfigName)){this[_0x3aa6b0(0x137)][_0x3aa6b0(0x1de)](_0x44bafe,this['config'][_0x44bafe]);}}}class SaveComponentAction{['stage'];constructor(_0x574586){const _0x1598eb=a0_0xef8a28;this[_0x1598eb(0x137)]=_0x574586['stage'];}async[a0_0xef8a28(0x12b)](_0x53f3c2){const _0x5f5cae=a0_0xef8a28;switch(_0x53f3c2[_0x5f5cae(0x1c3)]){case ChangeType[_0x5f5cae(0xf4)]:{if(!_0x53f3c2[_0x5f5cae(0xa4)])throw new Error(_0x5f5cae(0xe2));await this[_0x5f5cae(0x137)][_0x5f5cae(0x183)](_0x53f3c2[_0x5f5cae(0xa4)]);break;}case ChangeType['UPDATE']:if(!_0x53f3c2['component'])throw new Error(_0x5f5cae(0x221));await this[_0x5f5cae(0x137)][_0x5f5cae(0x20c)](_0x53f3c2['component']);break;case ChangeType[_0x5f5cae(0xf0)]:await this['stage']['deleteComponent']({'name':_0x53f3c2['name'],'type':_0x53f3c2[_0x5f5cae(0xb4)]});break;}}}class UpdateComponentStateAction{[a0_0xef8a28(0x137)];[a0_0xef8a28(0x113)];[a0_0xef8a28(0xb4)];[a0_0xef8a28(0x190)];constructor(_0x24e98f){const _0x2e4c90=a0_0xef8a28;this[_0x2e4c90(0x137)]=_0x24e98f['stage'],this[_0x2e4c90(0x113)]=_0x24e98f['name'],this[_0x2e4c90(0xb4)]=_0x24e98f[_0x2e4c90(0xb4)],this[_0x2e4c90(0x190)]=_0x24e98f['changes'];}async[a0_0xef8a28(0x12b)](){const _0x177be8=a0_0xef8a28,_0x1f8207=this[_0x177be8(0xb4)]+'_'+this[_0x177be8(0x113)];let _0x324828=this[_0x177be8(0x137)][_0x177be8(0x81)][_0x177be8(0x174)](_0x1f8207),_0x419e71=ChangeType[_0x177be8(0x121)];!_0x324828&&(_0x324828={'name':this[_0x177be8(0x113)],'type':this['type'],'fHash':'','paths':[]},this[_0x177be8(0x137)][_0x177be8(0x81)][_0x177be8(0x123)](_0x1f8207,_0x324828),_0x419e71=ChangeType[_0x177be8(0xf4)]);for(const _0x54813a of this[_0x177be8(0x190)]){this[_0x177be8(0xed)](_0x324828,_0x54813a);}if(!_0x324828[_0x177be8(0xb1)][_0x177be8(0x10f)])return this[_0x177be8(0x137)][_0x177be8(0x81)][_0x177be8(0x111)](_0x1f8207),{'name':_0x324828[_0x177be8(0x113)],'type':_0x324828[_0x177be8(0xb4)],'changeType':ChangeType[_0x177be8(0xf0)]};return _0x324828[_0x177be8(0xee)]=await this[_0x177be8(0x8d)](_0x324828[_0x177be8(0xb1)]),{..._0x324828,'changeType':_0x419e71};}['handleFileChange'](_0x2bcc92,{path:_0x4bd1c0,changeType:_0xfcb0b6}){const _0x342d59=a0_0xef8a28;if(_0xfcb0b6===ChangeType[_0x342d59(0xf4)]){if(_0x2bcc92[_0x342d59(0xb1)][_0x342d59(0x136)](_0x4bd1c0))throw new Error('File\x20\x22'+_0x4bd1c0+_0x342d59(0xf2));_0x2bcc92[_0x342d59(0xb1)][_0x342d59(0x1f9)](_0x4bd1c0);}if(_0xfcb0b6===ChangeType[_0x342d59(0xf0)]){const _0xdf07fa=_0x2bcc92[_0x342d59(0xb1)][_0x342d59(0x1d5)](_0x4bd1c0);if(_0xdf07fa<0x0)throw new Error(_0x342d59(0x97)+_0x4bd1c0+_0x342d59(0x1d3));_0x2bcc92[_0x342d59(0xb1)][_0x342d59(0x11d)](_0xdf07fa,0x1);}}async[a0_0xef8a28(0x8d)](_0x5dbb79){const _0x4822c7=a0_0xef8a28,_0x784a6d=node_crypto[_0x4822c7(0x91)](_0x4822c7(0x108));for(const _0x3b6912 of _0x5dbb79){const _0x3f2cf0=await promises[_0x4822c7(0x1f3)](node_path['join'](this[_0x4822c7(0x137)][_0x4822c7(0x202)],_0x3b6912),{'encoding':_0x4822c7(0xcb)}),_0x360ea3=_0x3b6912[_0x4822c7(0x188)](node_path[_0x4822c7(0xfe)])[_0x4822c7(0x16e)](0x3)[_0x4822c7(0x13f)]('/');_0x784a6d[_0x4822c7(0x94)](_0x360ea3),_0x784a6d[_0x4822c7(0x94)](_0x3f2cf0);}const _0x538965=_0x784a6d[_0x4822c7(0xb6)](_0x4822c7(0x151));return _0x538965;}}class Stage{['_projectPath'];['_stagePath'];[a0_0xef8a28(0x170)];['_branchState'];[a0_0xef8a28(0x9d)];[a0_0xef8a28(0x12a)]=[];[a0_0xef8a28(0x7a)]=!![];set[a0_0xef8a28(0xbe)](_0x396c23){this['_isUpdateStageTimestamp']=_0x396c23;}get['projectPath'](){return this['_projectPath'];}get[a0_0xef8a28(0x19f)](){return this['_stagePath'];}get['branchState'](){const _0x377b9c=a0_0xef8a28;return this[_0x377b9c(0x1ff)];}get[a0_0xef8a28(0x81)](){const _0x4f34f6=a0_0xef8a28;return this[_0x4f34f6(0x9d)];}constructor(_0x37939a){const _0x9d9527=a0_0xef8a28;this['_projectPath']=_0x37939a[_0x9d9527(0x202)],this[_0x9d9527(0x160)]=_0x37939a[_0x9d9527(0x19f)],this['config']=_0x37939a[_0x9d9527(0x170)],this[_0x9d9527(0x1ff)]=_0x37939a[_0x9d9527(0x100)],this['_componentsState']=_0x37939a['componentsState']?new Map(_0x37939a[_0x9d9527(0x81)][_0x9d9527(0xdc)](_0x1f7ec0=>[_0x1f7ec0[_0x9d9527(0xb4)]+'_'+_0x1f7ec0['name'],_0x1f7ec0])):new Map();}[a0_0xef8a28(0x1de)](_0xd09599,_0xfec21c){const _0x31b93c=a0_0xef8a28;this[_0x31b93c(0x170)][_0xd09599]=_0xfec21c;}[a0_0xef8a28(0x1e9)](_0x34a547){const _0x3de635=a0_0xef8a28;this[_0x3de635(0x170)][_0x34a547]=null;}[a0_0xef8a28(0x95)](_0x336a67){const _0x3a9d5c=a0_0xef8a28;this[_0x3a9d5c(0x100)]['id']=_0x336a67['id'],this[_0x3a9d5c(0x100)][_0x3a9d5c(0x113)]=_0x336a67['name'],this[_0x3a9d5c(0x100)]['headCommitId']=_0x336a67[_0x3a9d5c(0x1dc)];}async[a0_0xef8a28(0x183)](_0x2d711f){const _0xc028bd=a0_0xef8a28,_0x3fcc9e={'name':_0x2d711f[_0xc028bd(0x113)],'type':_0x2d711f[_0xc028bd(0xb4)],'fHash':_0x2d711f['fHash'],'paths':_0x2d711f[_0xc028bd(0x126)][_0xc028bd(0xdc)](({path:_0x2757c0})=>node_path[_0xc028bd(0x13f)](COMPONENT_PROJECT_PATH,_0x2757c0))};this['_componentsState'][_0xc028bd(0x123)](_0x2d711f[_0xc028bd(0xb4)]+'_'+_0x2d711f['name'],_0x3fcc9e);for(const {path:_0x2f206b,content:_0x5b75ea}of _0x2d711f[_0xc028bd(0x126)]){await this['addFileChange']({'path':node_path['join'](COMPONENT_PROJECT_PATH,_0x2f206b),'content':_0x5b75ea,'changeType':ChangeType[_0xc028bd(0xf4)]});}}async[a0_0xef8a28(0x20c)](_0x564615){const _0x2e2527=a0_0xef8a28,_0x1a452c=this[_0x2e2527(0x9d)][_0x2e2527(0x174)](_0x564615['type']+'_'+_0x564615[_0x2e2527(0x113)]),_0x4e0558=[];if(!_0x1a452c)throw new Error('Update:\x20Component\x20'+_0x564615[_0x2e2527(0x113)]+_0x2e2527(0x1b0)+_0x564615[_0x2e2527(0xb4)]+_0x2e2527(0x158));for(const _0x1bf695 of _0x1a452c[_0x2e2527(0xb1)]){await this[_0x2e2527(0x16a)]({'path':_0x1bf695,'changeType':ChangeType['DELETE']});}for(const {path:_0xaa3ed4,content:_0x81d307}of _0x564615[_0x2e2527(0x126)]){const _0x2cfff=node_path[_0x2e2527(0x13f)](COMPONENT_PROJECT_PATH,_0xaa3ed4);await this[_0x2e2527(0x16a)]({'path':_0x2cfff,'content':_0x81d307,'changeType':ChangeType[_0x2e2527(0xf4)]}),_0x4e0558[_0x2e2527(0x1f9)](_0x2cfff);}_0x1a452c[_0x2e2527(0xee)]=_0x564615[_0x2e2527(0xee)],_0x1a452c[_0x2e2527(0xb1)]=_0x4e0558;}async[a0_0xef8a28(0x213)](_0x322b4b){const _0xca389e=a0_0xef8a28,_0x4646aa=_0x322b4b['type']+'_'+_0x322b4b[_0xca389e(0x113)],_0x2bbd9c=this[_0xca389e(0x9d)][_0xca389e(0x174)](_0x4646aa);if(!_0x2bbd9c)throw new Error(_0xca389e(0x1ad)+_0x322b4b[_0xca389e(0x113)]+'\x20of\x20type\x20'+_0x322b4b[_0xca389e(0xb4)]+_0xca389e(0x158));for(const _0x1d5714 of _0x2bbd9c[_0xca389e(0xb1)]){await this['addFileChange']({'path':_0x1d5714,'changeType':ChangeType[_0xca389e(0xf0)]});}this[_0xca389e(0x9d)]['delete'](_0x4646aa);}async[a0_0xef8a28(0x16a)]({path:_0x4cfb07,content:_0x4f5651,changeType:_0x224f27}){const _0x1d81e9=a0_0xef8a28;if(_0x224f27!==ChangeType[_0x1d81e9(0xf0)]){if(!_0x4f5651)throw new Error(_0x1d81e9(0x103));const _0x402cef=node_path[_0x1d81e9(0x13f)](this[_0x1d81e9(0x19f)],_0x4cfb07);await promises[_0x1d81e9(0x16f)](node_path[_0x1d81e9(0x18e)](_0x402cef),{'recursive':!![]}),await promises[_0x1d81e9(0xe9)](_0x402cef,_0x4f5651);}this['fileChanges'][_0x1d81e9(0x1f9)]({'path':_0x4cfb07,'changeType':_0x224f27});}async[a0_0xef8a28(0x88)](_0xc1f7f7){const _0x59c6d6=a0_0xef8a28,_0x53f78b=new UpdateComponentStateAction({'stage':this,..._0xc1f7f7});return _0x53f78b[_0x59c6d6(0x12b)]();}async[a0_0xef8a28(0x85)](){}[a0_0xef8a28(0xe3)]({path:_0x1ce8f2,changeType:_0x15d676}){const _0x394d16=a0_0xef8a28;this[_0x394d16(0x12a)][_0x394d16(0x1f9)]({'path':_0x1ce8f2,'changeType':_0x15d676});}async[a0_0xef8a28(0x90)](){const _0x59d213=a0_0xef8a28,_0xf01fcb=await FileUtils['isDirectoryExists'](this[_0x59d213(0x19f)]);if(!_0xf01fcb)throw Error(_0x59d213(0xb2));await this[_0x59d213(0xc8)](),await this[_0x59d213(0x101)](),await promises['rm'](this[_0x59d213(0x19f)],{'recursive':!![]});const _0x387da0=node_path[_0x59d213(0x13f)](this[_0x59d213(0x20e)],COMPONENT_PROJECT_PATH),_0x33d057=await FileUtils[_0x59d213(0x199)](_0x387da0);_0x33d057?await FileUtils[_0x59d213(0x11b)](_0x387da0,![]):await promises[_0x59d213(0x16f)](_0x387da0,{'recursive':!![]});}async[a0_0xef8a28(0x7d)](){const _0x346324=a0_0xef8a28;await promises['rm'](this[_0x346324(0x19f)],{'recursive':!![],'force':!![]});}async['applyFileChanges'](){const _0x3edcae=a0_0xef8a28;for(const {path:_0x4e4e01,changeType:_0x27d3f9}of this['fileChanges']){switch(_0x27d3f9){case ChangeType[_0x3edcae(0xf4)]:case ChangeType[_0x3edcae(0x121)]:await this['applyCreateUpdate'](_0x4e4e01);break;case ChangeType[_0x3edcae(0xf0)]:await this[_0x3edcae(0x212)](_0x4e4e01);break;}}}async[a0_0xef8a28(0x19c)](_0x5bb7ee){const _0x38992f=a0_0xef8a28,_0x5df60c=node_path[_0x38992f(0x13f)](this[_0x38992f(0x160)],_0x5bb7ee),_0x527b87=node_path[_0x38992f(0x13f)](this['_projectPath'],_0x5bb7ee);await promises['mkdir'](node_path['dirname'](_0x527b87),{'recursive':!![]}),await promises[_0x38992f(0x1c0)](_0x5df60c,_0x527b87);}async[a0_0xef8a28(0x212)](_0x440fd4){const _0x5ae61d=a0_0xef8a28;await promises['rm'](node_path[_0x5ae61d(0x13f)](this['_projectPath'],_0x440fd4),{'recursive':!![]});}async[a0_0xef8a28(0x101)](){const _0x5150c9=a0_0xef8a28;await promises[_0x5150c9(0xe9)](node_path['join'](this['projectPath'],SYSTEM_FOLDER,CONFIG_FILE_NAME),JSON[_0x5150c9(0x92)](this[_0x5150c9(0x170)])),this[_0x5150c9(0x7a)]&&(this[_0x5150c9(0x100)]['lastStageTimestamp']=Date[_0x5150c9(0xac)]()),await promises[_0x5150c9(0xe9)](node_path[_0x5150c9(0x13f)](this['projectPath'],SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),JSON[_0x5150c9(0x92)](this[_0x5150c9(0x100)])),await promises[_0x5150c9(0xe9)](node_path[_0x5150c9(0x13f)](this[_0x5150c9(0x202)],SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),JSON[_0x5150c9(0x92)](Array[_0x5150c9(0x7f)](this[_0x5150c9(0x9d)][_0x5150c9(0xe6)]())));}}class ProjectManager{static [a0_0xef8a28(0x149)];['_stage'];get[a0_0xef8a28(0x137)](){const _0x44ca19=a0_0xef8a28;if(!this[_0x44ca19(0x122)])throw new Error('Stage\x20not\x20found');return this[_0x44ca19(0x122)];}constructor(){}static[a0_0xef8a28(0x219)](){const _0x130b3b=a0_0xef8a28;return!ProjectManager['instance']&&(ProjectManager[_0x130b3b(0x149)]=new ProjectManager()),ProjectManager[_0x130b3b(0x149)];}async[a0_0xef8a28(0x1ef)](_0x47e710){const _0x19d301=a0_0xef8a28,_0x5c4395=node_path['join'](_0x47e710,SYSTEM_FOLDER,STAGE_FOLDER_NAME);await promises['rm'](_0x5c4395,{'recursive':!![],'force':!![]}),await promises[_0x19d301(0x16f)](_0x5c4395,{'recursive':!![]});const _0x4e5449=await this['readConfig'](_0x47e710),_0x29b6d4=await this[_0x19d301(0x114)](_0x47e710),_0x5ed5c5=await this[_0x19d301(0x192)](_0x47e710);this[_0x19d301(0x122)]=new Stage({'projectPath':_0x47e710,'stagePath':_0x5c4395,'config':_0x4e5449,'branchState':_0x29b6d4,'componentsState':_0x5ed5c5});}async['applyStage'](){const _0x5eca22=a0_0xef8a28;await this[_0x5eca22(0x137)][_0x5eca22(0x90)]();}async[a0_0xef8a28(0x1a7)](){const _0x32378b=a0_0xef8a28;await this[_0x32378b(0x137)][_0x32378b(0x7d)]();}async['initProject']({config:_0x43261d}){const _0x24599d=a0_0xef8a28,_0x4cfda3=new InitProjectAction({'stage':this[_0x24599d(0x137)],'config':_0x43261d});await _0x4cfda3[_0x24599d(0x12b)]();}[a0_0xef8a28(0xd2)](_0x2d469d){const _0x308d67=a0_0xef8a28;this[_0x308d67(0x137)][_0x308d67(0x95)](_0x2d469d);}async[a0_0xef8a28(0x205)](_0x269ec5){const _0x706bf4=a0_0xef8a28,_0x51aa82=new SaveComponentAction({'stage':this[_0x706bf4(0x137)]});await _0x51aa82[_0x706bf4(0x12b)](_0x269ec5);}async[a0_0xef8a28(0x161)](){const _0x36dced=a0_0xef8a28,_0x51bc55=new FindChangesAction({'stage':this[_0x36dced(0x137)]});return _0x51bc55['execute']();}async['compareWithRemoteBranch'](_0x29ae60){const _0x2a4e98=a0_0xef8a28,_0x22a60b=new CompareWithRemoteBranchAction({..._0x29ae60,'stage':this['stage']});return _0x22a60b[_0x2a4e98(0x12b)]();}async['readConfig'](_0x5973a2){const _0x492fdb=a0_0xef8a28,_0x5b5e9d=node_path[_0x492fdb(0x13f)](_0x5973a2,SYSTEM_FOLDER,CONFIG_FILE_NAME),_0x295e69=await FileUtils[_0x492fdb(0x99)](_0x5b5e9d);if(!_0x295e69)return INITIAL_CONFIG;const _0x596273=await promises['readFile'](_0x5b5e9d);return JSON[_0x492fdb(0x10b)](_0x596273['toString']());}async['readBranchState'](_0xc0299b){const _0xac13a8=a0_0xef8a28,_0x255768=node_path[_0xac13a8(0x13f)](_0xc0299b,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),_0xcefa83=await FileUtils[_0xac13a8(0x99)](_0x255768);if(!_0xcefa83)return INITIAL_BRANCH_STATE;const _0x182e59=await promises[_0xac13a8(0x1f3)](_0x255768);return JSON[_0xac13a8(0x10b)](_0x182e59[_0xac13a8(0x17d)]());}async['readComponentsState'](_0x5941c8){const _0x15a8d1=a0_0xef8a28,_0x2c80d1=node_path[_0x15a8d1(0x13f)](_0x5941c8,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),_0x342149=await FileUtils[_0x15a8d1(0x99)](_0x2c80d1);if(!_0x342149)return[];const _0x526d24=await promises['readFile'](_0x2c80d1);return JSON[_0x15a8d1(0x10b)](_0x526d24[_0x15a8d1(0x17d)]());}async[a0_0xef8a28(0x193)](_0x3fc9cf){const _0x579b17=a0_0xef8a28,_0x22ebba=[node_path[_0x579b17(0x13f)](_0x3fc9cf,SYSTEM_FOLDER,CONFIG_FILE_NAME),node_path[_0x579b17(0x13f)](_0x3fc9cf,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),node_path[_0x579b17(0x13f)](_0x3fc9cf,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),node_path['join'](_0x3fc9cf,SFDX_PROJECT_FILE_NAME)];for(const _0x33a99c of _0x22ebba){const _0x39c3dc=await FileUtils[_0x579b17(0x99)](_0x33a99c);if(!_0x39c3dc)return![];}return!![];}async['setConfig'](_0x831a37,_0x4752ea){const _0x400f52=a0_0xef8a28,_0x275fd9=new ConfigSetAction({'stage':this[_0x400f52(0x137)]});await _0x275fd9[_0x400f52(0x12b)]({'name':_0x831a37,'value':_0x4752ea});}async[a0_0xef8a28(0x1e9)](_0x1a7660){const _0x294407=a0_0xef8a28;this[_0x294407(0x137)][_0x294407(0x1e9)](_0x1a7660);}[a0_0xef8a28(0x88)](_0x35caa7){const _0x594c31=a0_0xef8a28;return this[_0x594c31(0x137)][_0x594c31(0x88)](_0x35caa7);}async[a0_0xef8a28(0x16a)](_0x96f002){const _0x14e415=a0_0xef8a28;await this[_0x14e415(0x137)][_0x14e415(0x16a)](_0x96f002);}[a0_0xef8a28(0x9a)](_0x40aa89){const _0x327b99=a0_0xef8a28;this[_0x327b99(0x137)][_0x327b99(0xbe)]=_0x40aa89;}}class ReadlineUtils{static async[a0_0xef8a28(0x168)](_0x5d473c){const _0x3580c5=a0_0xef8a28,_0x4f4c20=readline['createInterface']({'input':process[_0x3580c5(0x128)],'output':process[_0x3580c5(0x181)]}),_0x3fdb4f=await _0x4f4c20[_0x3580c5(0x1a1)](_0x5d473c);return _0x4f4c20[_0x3580c5(0xd8)](),_0x3fdb4f;}}const INFO_COLOR_INDEX='4',WARN_COLOR_INDEX='3',ERROR_COLOR_INDEX='1';class Logger{[a0_0xef8a28(0x19e)];['infoDebug'];[a0_0xef8a28(0x1b3)];['errorDebug'];constructor({isJson:_0x11c359}){const _0x4221dd=a0_0xef8a28;this[_0x4221dd(0x19e)]=_0x11c359,debug[_0x4221dd(0xb3)]=console[_0x4221dd(0xb3)][_0x4221dd(0x1f8)](console),debug[_0x4221dd(0x1b9)](ROOT_NAME+':*'),this['infoDebug']=debug(ROOT_NAME+_0x4221dd(0x8c)),this[_0x4221dd(0x20f)]['color']=INFO_COLOR_INDEX,this[_0x4221dd(0x1b3)]=debug(ROOT_NAME+_0x4221dd(0x116)),this[_0x4221dd(0x1b3)][_0x4221dd(0x13b)]=WARN_COLOR_INDEX,this[_0x4221dd(0x14e)]=debug(ROOT_NAME+_0x4221dd(0xdf)),this['errorDebug']['color']=ERROR_COLOR_INDEX;}[a0_0xef8a28(0x1a5)](_0x42a422){const _0x433c5d=a0_0xef8a28;!this[_0x433c5d(0x19e)]&&this['infoDebug'](_0x42a422);}['warn'](_0x1aaa33){const _0x334894=a0_0xef8a28;!this[_0x334894(0x19e)]&&this[_0x334894(0x1b3)](_0x1aaa33);}[a0_0xef8a28(0x152)](_0x51d7d3){const _0x49a5e0=a0_0xef8a28;!this[_0x49a5e0(0x19e)]&&this[_0x49a5e0(0x14e)](_0x51d7d3);}}class BaseCommand{['_logger'];get[a0_0xef8a28(0x1fd)](){const _0x2cdfda=a0_0xef8a28;if(!this[_0x2cdfda(0x127)])throw new Error(_0x2cdfda(0x185));return this[_0x2cdfda(0x127)];}[a0_0xef8a28(0x215)](_0x49a00d){const _0x221161=a0_0xef8a28,_0x51bff4=new commander[(_0x221161(0xad))]()[_0x221161(0x113)](this[_0x221161(0x204)])[_0x221161(0xc9)](this[_0x221161(0xc9)]);for(const {name:_0x1d72b2,description:_0x9f3936,defaultValue:_0xdb4e6f}of this['arguments']){_0x51bff4[_0x221161(0x1f2)](_0x1d72b2,_0x9f3936,_0xdb4e6f);}for(const {flags:_0x5530a9,description:_0x57e483,defaultValue:_0x4c21d2}of this[_0x221161(0x83)]){_0x51bff4[_0x221161(0xcc)](_0x5530a9,_0x57e483,_0x4c21d2);}_0x51bff4['action'](async(..._0x5d3400)=>{const _0x254d6b=_0x221161,_0x57dbc9=this['isJson'](_0x5d3400);this[_0x254d6b(0x127)]=new Logger({'isJson':_0x57dbc9});try{const _0x1b4664=await this[_0x254d6b(0x12b)](_0x5d3400);_0x1b4664[_0x254d6b(0x80)](_0x57dbc9);}catch(_0x3c6a98){_0x3c6a98 instanceof Error&&this[_0x254d6b(0x1fd)]['error'](_0x3c6a98[_0x254d6b(0x139)]||INTERNAL_ERROR);}}),_0x49a00d[_0x221161(0xc1)](_0x51bff4);}}class BaseReporter{[a0_0xef8a28(0x10a)];get['success'](){return this['_success'];}constructor(_0x55d8fa){const _0x1ebe35=a0_0xef8a28;this[_0x1ebe35(0x10a)]=_0x55d8fa[_0x1ebe35(0x11a)];}[a0_0xef8a28(0x80)](_0x39b6b3){const _0x1acd14=a0_0xef8a28,_0x2db9da=this[_0x1acd14(0xa5)]();_0x39b6b3?this[_0x1acd14(0x1d0)](_0x2db9da):this['print'](_0x2db9da);}[a0_0xef8a28(0x1d0)](_0x143a82){const _0x24dccc=a0_0xef8a28,_0x4c8821=JSON['stringify'](_0x143a82,null,0x2);console[_0x24dccc(0xb3)](_0x4c8821);}}class FailReporter extends BaseReporter{['failMessage'];constructor({failMessage:_0x3f203b}){const _0x42c02e=a0_0xef8a28;super({'success':![]}),this[_0x42c02e(0x16d)]=_0x3f203b;}[a0_0xef8a28(0xa5)](){const _0x27b5ed=a0_0xef8a28;return{'success':this[_0x27b5ed(0x11a)],'failMessage':this[_0x27b5ed(0x16d)]};}[a0_0xef8a28(0xff)](_0x558fba){const _0x34ec78=a0_0xef8a28,_0xe8fb71=[['Fail\x20Message'],[_0x558fba[_0x34ec78(0x16d)]]];console[_0x34ec78(0xb3)](table[_0x34ec78(0x125)](_0xe8fb71,{'columns':[{'width':0x64}]}));}}class CheckoutReporter extends BaseReporter{['currentBranch'];[a0_0xef8a28(0x190)];constructor({currentBranch:_0x2d05fe,changes:_0x1fc403}){const _0x4e0d54=a0_0xef8a28;super({'success':!![]}),this['currentBranch']=_0x2d05fe,this[_0x4e0d54(0x190)]=_0x1fc403;}[a0_0xef8a28(0xa5)](){return{'success':this['success'],'targetBranch':this['currentBranch'],'changes':this['changes']};}[a0_0xef8a28(0xff)](_0x2c69fe){const _0x991649=a0_0xef8a28;console[_0x991649(0xb3)](_0x991649(0x15c)+this['currentBranch'][_0x991649(0x113)]+'\x0a'),console[_0x991649(0xb3)](_0x991649(0x93));const _0x166687=[[_0x991649(0x194),_0x991649(0x1a2),_0x991649(0x148),_0x991649(0x155)]];for(const {changeType:_0x36f292,name:_0x57bbc3,type:_0xcb83f6,paths:_0x30b62f}of _0x2c69fe[_0x991649(0x190)]){_0x166687[_0x991649(0x1f9)]([_0x36f292,_0x57bbc3,_0xcb83f6,_0x30b62f?.[_0x991649(0x13f)]('\x0a')||'']);}console[_0x991649(0xb3)](table['table'](_0x166687,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class BaseHandler{}class TargetBranchExistHandler extends BaseHandler{['manager'];[a0_0xef8a28(0x146)];[a0_0xef8a28(0x184)];[a0_0xef8a28(0x1fd)];[a0_0xef8a28(0x18b)]=[];constructor(_0x306f98){const _0x107b14=a0_0xef8a28;super(),this[_0x107b14(0x1a9)]=_0x306f98[_0x107b14(0x1a9)],this[_0x107b14(0x146)]=_0x306f98['credentials'],this[_0x107b14(0x184)]=_0x306f98[_0x107b14(0x184)],this[_0x107b14(0x1fd)]=_0x306f98[_0x107b14(0x1fd)];}async[a0_0xef8a28(0x1e3)](){const _0x1c1f13=a0_0xef8a28,_0x2bf600=await this[_0x1c1f13(0x1c2)]();if(_0x2bf600)return new FailReporter({'failMessage':_0x1c1f13(0x19b)});return this[_0x1c1f13(0x1fd)][_0x1c1f13(0x1a5)](_0x1c1f13(0xb8)),this[_0x1c1f13(0x1fd)]['info'](_0x1c1f13(0x20b)),await this['retrieveDifference'](),this[_0x1c1f13(0x1fd)][_0x1c1f13(0x1a5)](_0x1c1f13(0x98)),new CheckoutReporter({'currentBranch':{'id':this[_0x1c1f13(0x184)]['id'],'name':this[_0x1c1f13(0x184)]['name'],'headCommitId':this['targetBranch'][_0x1c1f13(0x1dc)]},'changes':this[_0x1c1f13(0x18b)]});}async[a0_0xef8a28(0x1c2)](){const _0x144f4e=a0_0xef8a28,_0x981a74=await this[_0x144f4e(0x1a9)][_0x144f4e(0x161)]();return!!_0x981a74[_0x144f4e(0x10f)];}async[a0_0xef8a28(0xa7)](){const _0x4e4c0e=a0_0xef8a28,{devopsUrl:_0x41a151,accessToken:_0x1f1ec1}=this['credentials'],_0x1c695d=await this[_0x4e4c0e(0x1a9)][_0x4e4c0e(0x206)]({'devopsUrl':_0x41a151,'accessToken':_0x1f1ec1,'targetBranchId':this[_0x4e4c0e(0x184)]['id'],'targetCommitId':this[_0x4e4c0e(0x184)]['headCommitId']});for(const {id:_0x5ee2b8,name:_0x1ac77a,type:_0xe6e5e6,changeType:_0x4955df}of _0x1c695d){if(!_0x5ee2b8){if(_0x4955df!==ChangeType[_0x4e4c0e(0xf0)])throw new Error(_0x4e4c0e(0x84));await this['manager'][_0x4e4c0e(0x205)]({'name':_0x1ac77a,'type':_0xe6e5e6,'changeType':_0x4955df}),this['componentChanges'][_0x4e4c0e(0x1f9)]({'changeType':_0x4955df,'name':_0x1ac77a,'type':_0xe6e5e6});continue;}const _0x73e8d=await ApiService[_0x4e4c0e(0x209)]({'devopsUrl':_0x41a151,'accessToken':_0x1f1ec1,'componentId':_0x5ee2b8});if(!_0x73e8d[_0x4e4c0e(0xee)])throw new Error('fHash\x20for\x20component\x20\x22'+_0x73e8d[_0x4e4c0e(0x113)]+_0x4e4c0e(0x1f1)+_0x73e8d[_0x4e4c0e(0xb4)]+'\x22\x20not\x20found');await this[_0x4e4c0e(0x1a9)]['saveComponent']({'name':_0x1ac77a,'type':_0xe6e5e6,'changeType':_0x4955df,'component':{..._0x73e8d,'fHash':_0x73e8d[_0x4e4c0e(0xee)]}}),this[_0x4e4c0e(0x18b)]['push']({'changeType':_0x4955df,'name':_0x1ac77a,'type':_0xe6e5e6,'paths':_0x73e8d[_0x4e4c0e(0x126)][_0x4e4c0e(0xdc)](_0x1b1a3a=>_0x1b1a3a['path'])});}this[_0x4e4c0e(0x1a9)]['saveBranchState'](this[_0x4e4c0e(0x184)]);}}class TargetBranchNotFoundHandler extends BaseHandler{[a0_0xef8a28(0x202)];['manager'];[a0_0xef8a28(0x146)];['targetBranchName'];['logger'];constructor(_0x43fcc5){const _0x1d2e79=a0_0xef8a28;super(),this['projectPath']=_0x43fcc5[_0x1d2e79(0x202)],this['manager']=_0x43fcc5[_0x1d2e79(0x1a9)],this[_0x1d2e79(0x146)]=_0x43fcc5['credentials'],this[_0x1d2e79(0x197)]=_0x43fcc5[_0x1d2e79(0x197)],this[_0x1d2e79(0x1fd)]=_0x43fcc5[_0x1d2e79(0x1fd)];}async[a0_0xef8a28(0x1e3)](){const _0x4c7d73=a0_0xef8a28;this[_0x4c7d73(0x1fd)]['info'](_0x4c7d73(0x1da));const {id:_0x2fddf6}=await this[_0x4c7d73(0x1a9)][_0x4c7d73(0x114)](this['projectPath']);if(!_0x2fddf6)return new FailReporter({'failMessage':_0x4c7d73(0x1e1)});const _0x3baf93=await ApiService[_0x4c7d73(0x159)]({'accessToken':this[_0x4c7d73(0x146)][_0x4c7d73(0xe4)],'devopsUrl':this[_0x4c7d73(0x146)]['devopsUrl'],'name':this[_0x4c7d73(0x197)],'parentId':_0x2fddf6});return this[_0x4c7d73(0x1a9)][_0x4c7d73(0xd2)](_0x3baf93),this['manager'][_0x4c7d73(0x9a)](![]),this['logger'][_0x4c7d73(0x1a5)](_0x4c7d73(0x20d)),new CheckoutReporter({'currentBranch':_0x3baf93,'changes':[]});}}class HandlerFactory{static[a0_0xef8a28(0x21a)](_0x5743d1){const _0x5b9594=a0_0xef8a28;if(_0x5743d1['targetBranch'])return new TargetBranchExistHandler({..._0x5743d1,'targetBranch':_0x5743d1[_0x5b9594(0x184)]});if(!_0x5743d1['targetBranch'])return new TargetBranchNotFoundHandler(_0x5743d1);throw new Error(_0x5b9594(0x118));}}class CheckoutCommand extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0x15d);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x102);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0xae),'description':'A\x20branch\x20name\x20which\x20you\x20checkout\x20on.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.'},{'flags':a0_0xef8a28(0x196),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();async[a0_0xef8a28(0x12b)]([{branch:_0x317133}]){const _0x214bd7=a0_0xef8a28,_0x304a50=await this[_0x214bd7(0x1bd)](_0x317133);this[_0x214bd7(0x1fd)][_0x214bd7(0x1a5)](_0x214bd7(0xd3)+_0x304a50+_0x214bd7(0x156));const _0x43d287=await this['manager'][_0x214bd7(0x193)](this['projectPath']);if(!_0x43d287)return this[_0x214bd7(0x1fd)][_0x214bd7(0x1eb)](_0x214bd7(0x1bf)),new FailReporter({'failMessage':_0x214bd7(0x1bf)});const _0x2479bb=await this[_0x214bd7(0xfa)](),_0x2d134a=await ApiService[_0x214bd7(0x86)](_0x2479bb);await this[_0x214bd7(0x1a9)]['initStage'](this[_0x214bd7(0x202)]);try{const _0x3c7f8d=await ApiService[_0x214bd7(0x1e0)]({'devopsUrl':_0x2d134a[_0x214bd7(0x214)],'accessToken':_0x2d134a[_0x214bd7(0xe4)],'branchName':_0x304a50}),_0x47c206=HandlerFactory['create']({'projectPath':this[_0x214bd7(0x202)],'manager':this[_0x214bd7(0x1a9)],'credentials':_0x2d134a,'targetBranch':_0x3c7f8d,'targetBranchName':_0x304a50,'logger':this[_0x214bd7(0x1fd)]}),_0x2376ad=await _0x47c206[_0x214bd7(0x1e3)]();return _0x2376ad[_0x214bd7(0x11a)]?(await this[_0x214bd7(0x1a9)][_0x214bd7(0x129)](),this[_0x214bd7(0x1fd)][_0x214bd7(0x1a5)](_0x214bd7(0xd3)+_0x304a50+_0x214bd7(0x105))):await this[_0x214bd7(0x1a9)][_0x214bd7(0x1a7)](),_0x2376ad;}catch(_0x2f73df){await this[_0x214bd7(0x1a9)][_0x214bd7(0x1a7)]();throw _0x2f73df;}}[a0_0xef8a28(0x19e)]([{json:_0x2308c4}]){return _0x2308c4;}async[a0_0xef8a28(0x1bd)](_0x3b396b){const _0x58ffce=a0_0xef8a28;if(_0x3b396b)return _0x3b396b;return ReadlineUtils[_0x58ffce(0x168)](_0x58ffce(0x9c));}async['getCredentialsAlias'](){const _0x1c915b=a0_0xef8a28,{credentialsAlias:_0x177873}=await this[_0x1c915b(0x1a9)][_0x1c915b(0xf9)](this[_0x1c915b(0x202)]);if(!_0x177873)throw new Error(_0x1c915b(0x1ac));if(typeof _0x177873!==_0x1c915b(0xd9))throw new Error(_0x1c915b(0xbb));return _0x177873;}}class CloneReporter extends BaseReporter{[a0_0xef8a28(0x202)];[a0_0xef8a28(0x21d)];constructor({projectPath:_0x58a2cc,components:_0x4f2733}){const _0x104ac4=a0_0xef8a28;super({'success':!![]}),this[_0x104ac4(0x202)]=_0x58a2cc,this[_0x104ac4(0x21d)]=_0x4f2733;}[a0_0xef8a28(0xa5)](){const _0x55de56=a0_0xef8a28;return{'success':this['success'],'projectPath':this[_0x55de56(0x202)],'components':this['components']};}[a0_0xef8a28(0xff)](_0x379841){const _0x4aa42c=a0_0xef8a28;console['log'](_0x4aa42c(0x162));const _0x1e9036=[[_0x4aa42c(0x147)],[_0x379841[_0x4aa42c(0x202)]]];console[_0x4aa42c(0xb3)](table['table'](_0x1e9036,{'columns':[{'width':0x28}]})),console[_0x4aa42c(0xb3)](_0x4aa42c(0x217));const _0xb35053=[[_0x4aa42c(0x1a2),'Type',_0x4aa42c(0x155)]];for(const {name:_0x1704c8,type:_0x3cdf85,paths:_0x27c4de}of _0x379841[_0x4aa42c(0x21d)]){_0xb35053[_0x4aa42c(0x1f9)]([_0x1704c8,_0x3cdf85,_0x27c4de[_0x4aa42c(0x13f)]('\x0a')]);}console[_0x4aa42c(0xb3)](table['table'](_0xb35053,{'columns':[{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CloneCommand extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0x1fc);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x1e4);['arguments']=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0xc4),'description':a0_0xef8a28(0x17e)},{'flags':a0_0xef8a28(0x21c),'description':a0_0xef8a28(0xa9),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':'--json','description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();['retrievedComponents']=[];[a0_0xef8a28(0x154)];get[a0_0xef8a28(0x146)](){const _0x403a93=a0_0xef8a28;if(!this[_0x403a93(0x154)])throw new Error(_0x403a93(0x178));return this[_0x403a93(0x154)];}async[a0_0xef8a28(0x12b)]([_0x50eb96]){const _0x12380b=a0_0xef8a28;this[_0x12380b(0x1fd)][_0x12380b(0x1a5)]('Cloning\x20started'),this[_0x12380b(0x154)]=await ApiService[_0x12380b(0x86)](_0x50eb96[_0x12380b(0x145)]);const _0x517af3=await this['buildProjectPath'](_0x50eb96[_0x12380b(0x113)]);this[_0x12380b(0x1fd)][_0x12380b(0x1a5)](_0x12380b(0x112));const _0x2291bf=await this[_0x12380b(0x1a9)][_0x12380b(0x193)](_0x517af3);if(_0x2291bf)return this[_0x12380b(0x1fd)]['warn']('Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.'),new FailReporter({'failMessage':_0x12380b(0x175)});await this[_0x12380b(0x1a9)][_0x12380b(0x1ef)](_0x517af3);try{return await this['manager'][_0x12380b(0x133)]({'config':{'credentialsAlias':_0x50eb96['alias']}}),this[_0x12380b(0x1fd)]['info'](_0x12380b(0x1b1)),await this['retrieve'](),await this['manager']['applyStage'](),this[_0x12380b(0x1fd)][_0x12380b(0x1a5)]('Cloning\x20completed'),new CloneReporter({'projectPath':_0x517af3,'components':this[_0x12380b(0xdb)]});}catch(_0x5ab8c9){await this[_0x12380b(0x1a9)][_0x12380b(0x1a7)]();throw _0x5ab8c9;}}[a0_0xef8a28(0x19e)]([{json:_0x439342}]){return _0x439342;}async['retrieve'](){const _0x5ac487=a0_0xef8a28;this[_0x5ac487(0x1fd)][_0x5ac487(0x1a5)]('Retrieve\x20components\x20started');const {accessToken:_0x581b7f,devopsUrl:_0x1a9c5c}=this[_0x5ac487(0x146)],_0x1dfdd5=await ApiService['getDefaultBranch']({'devopsUrl':_0x1a9c5c,'accessToken':_0x581b7f});this[_0x5ac487(0x1a9)][_0x5ac487(0xd2)](_0x1dfdd5);for await(const _0x343c42 of ApiService[_0x5ac487(0x173)]({'devopsUrl':_0x1a9c5c,'accessToken':_0x581b7f,'branchId':_0x1dfdd5['id'],'commitId':_0x1dfdd5['headCommitId']})){if(!_0x343c42[_0x5ac487(0xee)])throw new Error(_0x343c42[_0x5ac487(0x113)]+'\x20of\x20type\x20'+_0x343c42[_0x5ac487(0xb4)]+'\x20was\x20deleted');await this[_0x5ac487(0x1a9)][_0x5ac487(0x205)]({'name':_0x343c42[_0x5ac487(0x113)],'type':_0x343c42[_0x5ac487(0xb4)],'changeType':ChangeType['CREATE'],'component':{..._0x343c42,'fHash':_0x343c42[_0x5ac487(0xee)]}}),this['retrievedComponents'][_0x5ac487(0x1f9)]({'name':_0x343c42[_0x5ac487(0x113)],'type':_0x343c42[_0x5ac487(0xb4)],'paths':_0x343c42[_0x5ac487(0x126)][_0x5ac487(0xdc)](_0x4f71f5=>_0x4f71f5[_0x5ac487(0x119)])});}this['logger']['info'](_0x5ac487(0x98));}async[a0_0xef8a28(0x1ba)](_0x1850fe){const _0x272e3f=a0_0xef8a28;if(_0x1850fe)return node_path[_0x272e3f(0x13f)](process[_0x272e3f(0x141)](),_0x1850fe);const _0x5b7b77=await ReadlineUtils[_0x272e3f(0x168)](_0x272e3f(0x7e));return node_path['join'](process[_0x272e3f(0x141)](),_0x5b7b77);}}class CommitReporter extends BaseReporter{[a0_0xef8a28(0x190)];constructor({changes:_0xef84ca}){const _0x1d43cc=a0_0xef8a28;super({'success':!![]}),this[_0x1d43cc(0x190)]=_0xef84ca;}[a0_0xef8a28(0xa5)](){const _0x128f38=a0_0xef8a28;return{'success':this[_0x128f38(0x11a)],'changes':this[_0x128f38(0x190)]};}[a0_0xef8a28(0xff)](_0x3251f3){const _0x1c6c9d=a0_0xef8a28;console[_0x1c6c9d(0xb3)](_0x1c6c9d(0x1ec));const _0x521d99=[[_0x1c6c9d(0x194),_0x1c6c9d(0x1a2),'Type',_0x1c6c9d(0x155)]];for(const {changeType:_0x5493a6,name:_0x533f97,type:_0xe53c6c,paths:_0x273115}of _0x3251f3[_0x1c6c9d(0x190)]){_0x521d99['push']([_0x5493a6,_0x533f97,_0xe53c6c,_0x273115?.[_0x1c6c9d(0x13f)]('\x0a')||'']);}console['log'](table[_0x1c6c9d(0x125)](_0x521d99,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CommitCommand extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0x1a4);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x198);['arguments']=[];['options']=[{'flags':a0_0xef8a28(0x17f),'description':a0_0xef8a28(0x153)},{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();['componentChanges']=[];[a0_0xef8a28(0x154)];[a0_0xef8a28(0x9f)];[a0_0xef8a28(0x9b)];['_changes'];get[a0_0xef8a28(0x146)](){const _0x2872ea=a0_0xef8a28;if(!this['_credentials'])throw new Error('Credentials\x20not\x20found');return this[_0x2872ea(0x154)];}get[a0_0xef8a28(0x135)](){const _0x3ec03e=a0_0xef8a28;if(!this['_branchId'])throw new Error(_0x3ec03e(0xbc));return this[_0x3ec03e(0x9f)];}get[a0_0xef8a28(0xc7)](){const _0x14baeb=a0_0xef8a28;if(!this[_0x14baeb(0x9b)])throw new Error(_0x14baeb(0x115));return this[_0x14baeb(0x9b)];}get[a0_0xef8a28(0x190)](){const _0xe5dd68=a0_0xef8a28;if(!this[_0xe5dd68(0xc0)])throw new Error(_0xe5dd68(0x200));return this[_0xe5dd68(0xc0)];}async['execute']([_0x34720c]){const _0x5a336b=a0_0xef8a28;this[_0x5a336b(0x1fd)]['info'](_0x5a336b(0x1c6));const _0x40b2f1=await this[_0x5a336b(0x1a9)]['isInitialized'](this[_0x5a336b(0x202)]);if(!_0x40b2f1)return this[_0x5a336b(0x1fd)][_0x5a336b(0x1eb)](_0x5a336b(0x1bf)),new FailReporter({'failMessage':_0x5a336b(0x1bf)});const _0x32a6ca=await this[_0x5a336b(0xd6)](_0x34720c[_0x5a336b(0x139)]);await this[_0x5a336b(0x172)](),await this[_0x5a336b(0x86)]();const _0xb3ab53=await this[_0x5a336b(0x165)]();if(_0xb3ab53)return this['logger'][_0x5a336b(0x1eb)]('Local\x20and\x20remote\x20head\x20commits\x20don\x27t\x20match.\x20Use\x20\x22flosum\x20devops\x20pull\x22\x20to\x20retrieve\x20latest\x20updates\x20from\x20devops'),new FailReporter({'failMessage':_0x5a336b(0xab)});await this['manager'][_0x5a336b(0x1ef)](this[_0x5a336b(0x202)]);try{this[_0x5a336b(0xc0)]=await this['manager'][_0x5a336b(0x161)]();if(!this[_0x5a336b(0x190)][_0x5a336b(0x10f)])return this[_0x5a336b(0x1fd)]['warn']('No\x20Local\x20Changes'),new FailReporter({'failMessage':'No\x20Local\x20Changes'});return await this[_0x5a336b(0x134)](_0x32a6ca),await this[_0x5a336b(0x1a9)]['applyStage'](),this[_0x5a336b(0x1fd)][_0x5a336b(0x1a5)](_0x5a336b(0x1a0)),new CommitReporter({'changes':this[_0x5a336b(0x18b)]});}catch(_0x548f74){await this['manager']['abortStage']();throw _0x548f74;}}['isJson']([{json:_0x55b93a}]){return _0x55b93a;}async[a0_0xef8a28(0xd6)](_0x572052){const _0x15948f=a0_0xef8a28;if(_0x572052)return _0x572052;const _0x27b023=await ReadlineUtils[_0x15948f(0x168)](_0x15948f(0x10d));return _0x27b023;}async['getCredentials'](){const _0x5efd7a=a0_0xef8a28,{credentialsAlias:_0x1ef509}=await this[_0x5efd7a(0x1a9)][_0x5efd7a(0xf9)](this[_0x5efd7a(0x202)]);if(!_0x1ef509)throw new Error(_0x5efd7a(0x1ac));if(typeof _0x1ef509!==_0x5efd7a(0xd9))throw new Error(_0x5efd7a(0xbb));this['_credentials']=await ApiService[_0x5efd7a(0x86)](_0x1ef509);}async[a0_0xef8a28(0x172)](){const _0x24dc4e=a0_0xef8a28,{id:_0x1777bb,headCommitId:_0x5740e4}=await this[_0x24dc4e(0x1a9)][_0x24dc4e(0x114)](this[_0x24dc4e(0x202)]);this[_0x24dc4e(0x9f)]=_0x1777bb||void 0x0,this[_0x24dc4e(0x9b)]=_0x5740e4||void 0x0;}async[a0_0xef8a28(0x165)](){const _0x359704=a0_0xef8a28,{headCommitId:_0x2bff7f}=await ApiService[_0x359704(0x12f)]({'accessToken':this[_0x359704(0x146)][_0x359704(0xe4)],'devopsUrl':this[_0x359704(0x146)][_0x359704(0x214)],'branchId':this[_0x359704(0x135)]});return this[_0x359704(0xc7)]!==_0x2bff7f;}async[a0_0xef8a28(0x134)](_0x3393a5){const _0x262760=a0_0xef8a28;this[_0x262760(0x1fd)]['info'](_0x262760(0x1b2));const _0x9c1a33=await ApiService[_0x262760(0x104)]({'accessToken':this[_0x262760(0x146)][_0x262760(0xe4)],'devopsUrl':this[_0x262760(0x146)][_0x262760(0x214)]}),_0x316492={'accessToken':this[_0x262760(0x146)][_0x262760(0xe4)],'devopsUrl':this['credentials'][_0x262760(0x214)],'message':_0x3393a5,'branchId':this[_0x262760(0x135)],'components':[],'userName':_0x9c1a33[_0x262760(0x11e)]+'\x20'+_0x9c1a33['lastName']};for(const _0x121e90 of this['changes']){const _0x283c72=await this['manager']['updateComponentState'](_0x121e90),_0x1985a3=_0x283c72[_0x262760(0x1c3)]===ChangeType[_0x262760(0xf4)]?_0x283c72[_0x262760(0x113)]:void 0x0,_0x589179=this[_0x262760(0x12e)](_0x283c72[_0x262760(0x113)],_0x1985a3,_0x283c72[_0x262760(0xb4)],_0x283c72?.['paths']||[]);_0x316492[_0x262760(0x21d)][_0x262760(0x1f9)](_0x589179),this['componentChanges'][_0x262760(0x1f9)](_0x283c72);}this[_0x262760(0x1fd)][_0x262760(0x1a5)](_0x262760(0x1ee)+this[_0x262760(0x190)][_0x262760(0x10f)]+_0x262760(0x13a)),await ApiService[_0x262760(0x1a4)](_0x316492);const _0x31ef8e=await ApiService[_0x262760(0x12f)]({'accessToken':this[_0x262760(0x146)][_0x262760(0xe4)],'devopsUrl':this[_0x262760(0x146)][_0x262760(0x214)],'branchId':this['branchId']});this[_0x262760(0x1a9)][_0x262760(0xd2)](_0x31ef8e);}[a0_0xef8a28(0x12e)](_0x12da9a,_0xe9c7c4,_0xbee3b9,_0x156708){const _0x5d09ee=a0_0xef8a28,_0x10d205={'name':_0x12da9a,'label':_0xe9c7c4,'type':_0xbee3b9,'files':[]};for(const _0x519001 of _0x156708){const _0x15ceae=_0x519001[_0x5d09ee(0x188)](node_path[_0x5d09ee(0xfe)])['slice'](0x3)[_0x5d09ee(0x13f)]('/'),_0x5c29c3=node_path[_0x5d09ee(0x13f)](this['projectPath'],_0x519001);_0x10d205['files'][_0x5d09ee(0x1f9)]({'path':_0x15ceae,'localPath':_0x5c29c3});}return _0x10d205;}}class ConfigSetReporter extends BaseReporter{[a0_0xef8a28(0xfb)];[a0_0xef8a28(0x109)];constructor({configName:_0x1c5df1,value:_0x47f626}){const _0x2785fb=a0_0xef8a28;super({'success':!![]}),this[_0x2785fb(0xfb)]=_0x1c5df1,this[_0x2785fb(0x109)]=_0x47f626;}[a0_0xef8a28(0xa5)](){const _0x86a587=a0_0xef8a28;return{'success':this['success'],'configName':this[_0x86a587(0xfb)],'value':this[_0x86a587(0x109)]};}[a0_0xef8a28(0xff)](_0x5edda6){const _0x5c960f=a0_0xef8a28,_0x1c615d=[[_0x5c960f(0x1ea),_0x5c960f(0x1b7)],[_0x5edda6[_0x5c960f(0xfb)],_0x5edda6[_0x5c960f(0x109)]]];console[_0x5c960f(0xb3)](table[_0x5c960f(0x125)](_0x1c615d));}}function a0_0x5cd1(){const _0x19044c=['retrieveDifference','1194808yeGBTQ','Alias\x20of\x20credentials\x20which\x20will\x20be\x20used\x20to\x20retrieve\x20your\x20components\x20from\x20devops.','flat','Local\x20and\x20remote\x20head\x20commits\x20don\x27t\x20match.\x20Use\x20\x22flosum\x20devops\x20pull\x22\x20to\x20retrieve\x20latest\x20updates\x20from\x20devops','now','Command','-b,\x20--branch\x20<string>','node:path','fHash\x20for\x20component\x20\x22','paths','Stage\x20folder\x20not\x20found','log','type','1jgBpCP','digest','interceptors','Checking\x20manual\x20changes\x20completed','pendingChanges','access','Invalid\x20credentials\x20type','Branch\x20id\x20not\x20found','rows','isUpdateStageTimestamp','list','_changes','addCommand','findDeletedAndUpdated','Config\x20value','-n,\x20--name\x20<string>','Rollback\x20started','save','localHeadCommit','applyFileChanges','description','credentialsAlias','utf-8','option','all','List\x20all\x20remote\x20branches.','228426AmesGI','status','Rolled\x20Back\x20Changes:','saveBranchState','Checkout\x20on\x20\x22','Pull\x20latest\x20branch\x20commit\x20from\x20devops.','list-branches','getMessage','(((.+)+)+)+$','close','string','replace','retrievedComponents','map','Logout\x20completed','Looking\x20for\x20changes\x20started',':ERROR','fit/branches/','PATH\x20env\x20not\x20found','Create:\x20Component\x20not\x20found','registerFileChange','accessToken','reject','values','<value>','CLI','writeFile','commander','VLOCITY','Enter\x20api\x20token:\x20','handleFileChange','fHash','use','DELETE','commitId','\x22\x20already\x20exists','findIndex','CREATE','Status\x20calculation\x20started','@flosum/salesforce','basename','commitDate','readConfig','getCredentialsAlias','configName','Config\x20set\x20started','parentId','sep','print','branchState','updateSystemFiles','Checkout\x20on\x20another\x20branch.\x20Checkout\x20command\x20retrieves\x20components\x20missing\x20locally.','Missing\x20content\x20for\x20not\x20Delete\x20change\x20type','getMe','\x22\x20completed','login','Status','sha1','value','_success','parse','readdir','Enter\x20commit\x20message:\x20','Logout\x20started','length','fk_','delete','Project\x20initialization\x20started','name','readBranchState','Local\x20head\x20commit\x20id\x20not\x20found',':WARN','Rollback\x20completed','Checkout\x20handler\x20not\x20found','path','success','cleanUpEmptyFolders','listBranches','splice','firstName','rmdir','label','UPDATE','_stage','set','response','table','files','_logger','stdin','applyStage','fileChanges','execute','<config-name>','count','convertToLocalComponent','getBranchById','cause','axios','branches','initProject','findAndCommitChanges','branchId','includes','stage','\x20services','message','\x20components\x20will\x20be\x20committed','color','CREDENTIALS_ALIAS','Pulling\x20latest\x20updates\x20completed','force-app','join','List\x20credentials\x20started','cwd','CLI\x20for\x20work\x20with\x20','\x20services.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','Pulling\x20latest\x20updates\x20started','alias','credentials','Project\x20Path','Type','instance','File','logout','R_OK','SfProjectScanner','errorDebug','-t,\x20--token\x20<string>','12010iEnNBT','hex','error','Commit\x20message.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','_credentials','Files','\x22\x20started','1090dPUjuL','\x20not\x20found','createBranch','Saved\x20credentials\x20alias.','PATH','Current\x20Branch:\x20','checkout','globalSettingsUrl','W_OK','_stagePath','findChanges','Init\x20Result:','Salesforce','filter','areRemoteChanges','node:fs/promises','Alias','askString','Applies\x20json\x20formatted\x20result.','addFileChange','listComponentsGenerator','Devops\x20commands','failMessage','slice','mkdir','config','auth/me','getBranchState','retrieveComponents','get','Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.','Login\x20into\x20global\x20settings\x20and\x20retrieve\x20data\x20about\x20related\x20services.','Global\x20Settings\x20Url','Credentials\x20not\x20found','componentsForRetrieve','Config\x20name.\x20Allowed\x20values:\x20','node:os','size','toString','A\x20name\x20of\x20a\x20folder\x20where\x20a\x20project\x20will\x20be\x20stored.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','-m,\x20--message\x20<string>','Pending\x20Changes:','stdout','ECONNREFUSED','createComponent','targetBranch','Logger\x20not\x20found','\x22\x20wasn\x27t\x20restored','fit/file-versions/','split','/commits/','version','componentChanges','find','Listing\x20remote\x20branches\x20completed','dirname','getAllCredentials','changes','fit/branches','readComponentsState','isInitialized','Change\x20Type','rollback','--json','targetBranchName','Commit\x20local\x20changes\x20to\x20a\x20remote\x20branch\x20on\x20devops.','isDirectoryExists','/components','Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed','applyCreateUpdate','targetCommitId','isJson','stagePath','Commit\x20completed','question','Name','handleRestore','commit','info','A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first','abortStage','userName','manager','search','filesChanges','Credentials\x20alias\x20is\x20not\x20configured','Component\x20','Rolling\x20back\x20to\x20last\x20committed\x20state\x20completed','then','\x20of\x20type\x20','Project\x20initialization\x20completed','Detecting\x20changes\x20started','warnDebug','No\x20changes\x20for\x20rollback','INTERNAL\x20ERROR','Not\x20Found','Value','_headCommitId','enable','buildProjectPath','Branch\x20Name','DEVOPS_COMMANDS','getBranchName','trunc','Project\x20is\x20not\x20initialized','copyFile','base64','areChanges','changeType','content','arguments','Commit\x20started','Devops\x20url\x20not\x20found','code','1451122cFImrD','post','Roll\x20back\x20your\x20branch\x20state\x20to\x20last\x20committed\x20one.','0.0.3','listComponents','1716fkllMA','catch','printJson','node:crypto','targetBranchId','\x22\x20not\x20found','ROOT_COMMANDS','indexOf','entries','data','default','getUpdatedComponentChanges','Creation\x20new\x20branch\x20started','getFolderFilePaths','headCommitId','homedir','setConfig','delimiter','getBranch','To\x20create\x20a\x20new\x20branch\x20a\x20branch\x20should\x20be\x20selected.\x20Checkout\x20on\x20any\x20existing\x20branch','debug','handle','Initialize\x20salesforce\x20project\x20and\x20retrieve\x20\x22main\x22\x20branch\x20from\x20registered\x20devops\x20tenant.','Delete\x20saved\x20credentials.','isDirectory','Alias\x20which\x20saved\x20credentials\x20will\x20be\x20accessed\x20with.','Create','unsetConfig','Config\x20Name','warn','Committed\x20Components:','14AikKNO','Detecting\x20changes\x20completed.\x20','initStage','Head\x20commit\x20id\x20not\x20found','\x22\x20of\x20type\x20\x22','argument','readFile','rollbackTypes','DevOps','config-unset','env','bind','push','branch-state.json','Connection\x20refused','clone','logger','getDefaultBranch','_branchState','Changes\x20not\x20found','SALESFORCE','projectPath','Update','commandName','saveComponent','compareWithRemoteBranch','branchName','Devops\x20Url','retrieveComponentById','config.json','Retrieve\x20components\x20started','updateComponent','Creation\x20new\x20branch\x20completed','_projectPath','infoDebug','isAxiosError','Return\x20all\x20local\x20not\x20committed\x20changes.','applyDelete','deleteComponent','devopsUrl','register','statusText','Retrieve\x20Result:','Credentials\x20with\x20alias\x20\x22','getInstance','create','1673108tZApBQ','-a,\x20--alias\x20<string>','components','components-state.json','scan','(string)','Update:\x20Component\x20not\x20found','Vlocity','_isUpdateStageTimestamp','.bin','Create\x20salesforce\x20project\x20and\x20cli\x20system\x20files.','abort','Enter\x20project\x20name:\x20','from','report','componentsState','NULL','options','Component\x20id\x20not\x20found\x20after\x20comparison','changeFile','getCredentials','Display\x20all\x20authorized\x20credentials.','updateComponentState','Set\x20project\x20config.','156324JuUBie','Config\x20set\x20completed',':INFO','calculateComponentHash','indexes','sfdx-project.json','apply','createHash','stringify','Project\x20Updates:','update','updateBranchState','stat','File\x20\x22','Retrieve\x20components\x20completed','isFileExists','setIsUpdateStageTimestamp','_localHeadCommit','Enter\x20a\x20branch\x20name:\x20','_componentsState','List\x20credentials\x20completed','_branchId','\x20files\x20will\x20be\x20rolled\x20back','5292432sMFYuS','convertToCommit','defineRollbackTypes','component','buildReport','constants'];a0_0x5cd1=function(){return _0x19044c;};return a0_0x5cd1();}const ALLOWED_VALUES=[ConfigName['CREDENTIALS_ALIAS']+a0_0xef8a28(0x220)];class ConfigSetCommand extends BaseCommand{['commandName']='config-set';[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x89);['arguments']=[{'name':'<config-name>','description':a0_0xef8a28(0x17a)+ALLOWED_VALUES[a0_0xef8a28(0x13f)](',\x20')+'.'},{'name':a0_0xef8a28(0xe7),'description':a0_0xef8a28(0xc3)}];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();async['execute']([_0x5dd16e,_0x38db79]){const _0x5a6c44=a0_0xef8a28;this['logger']['info']('Config\x20set\x20started');const _0x292962=process[_0x5a6c44(0x141)](),_0x212187=await this[_0x5a6c44(0x1a9)][_0x5a6c44(0x193)](_0x292962);if(!_0x212187)return this[_0x5a6c44(0x1fd)][_0x5a6c44(0x1eb)](_0x5a6c44(0x1bf)),new FailReporter({'failMessage':_0x5a6c44(0x1bf)});await this['manager'][_0x5a6c44(0x1ef)](_0x292962);try{return await this[_0x5a6c44(0x1a9)][_0x5a6c44(0x1de)](_0x5dd16e,_0x38db79),await this[_0x5a6c44(0x1a9)][_0x5a6c44(0x129)](),this[_0x5a6c44(0x1fd)][_0x5a6c44(0x1a5)]('Config\x20set\x20completed'),new ConfigSetReporter({'configName':_0x5dd16e,'value':_0x38db79});}catch(_0x3e006e){await this['manager'][_0x5a6c44(0x1a7)]();throw _0x3e006e;}}[a0_0xef8a28(0x19e)]([,,{json:_0x31bc2c}]){return _0x31bc2c;}}class ConfigUnsetReporter extends BaseReporter{[a0_0xef8a28(0xfb)];constructor(_0x16128d){const _0x46dd4a=a0_0xef8a28;super({'success':!![]}),this[_0x46dd4a(0xfb)]=_0x16128d['configName'];}['buildReport'](){const _0x2f6216=a0_0xef8a28;return{'success':!![],'configName':this[_0x2f6216(0xfb)],'value':null};}[a0_0xef8a28(0xff)](_0xbc86a7){const _0x1d1a05=a0_0xef8a28,_0x31a0f9=[['Config\x20Name','Value'],[_0xbc86a7[_0x1d1a05(0xfb)],_0xbc86a7[_0x1d1a05(0x109)]||_0x1d1a05(0x82)]];console[_0x1d1a05(0xb3)](table[_0x1d1a05(0x125)](_0x31a0f9));}}class ConfigUnset extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0x1f6);['description']='Clear\x20project\x20config\x20property.';[a0_0xef8a28(0x1c5)]=[{'name':a0_0xef8a28(0x12c),'description':a0_0xef8a28(0x17a)+Object[a0_0xef8a28(0xe6)](ConfigName)[a0_0xef8a28(0x13f)](',\x20')+'.'}];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();async['execute']([_0x39e5a0]){const _0xf48039=a0_0xef8a28;this[_0xf48039(0x1fd)][_0xf48039(0x1a5)](_0xf48039(0xfc));const _0x15287e=await this[_0xf48039(0x1a9)][_0xf48039(0x193)](this[_0xf48039(0x202)]);if(!_0x15287e)return this[_0xf48039(0x1fd)]['warn'](_0xf48039(0x1bf)),new FailReporter({'failMessage':_0xf48039(0x1bf)});await this[_0xf48039(0x1a9)][_0xf48039(0x1ef)](this[_0xf48039(0x202)]);try{return await this[_0xf48039(0x1a9)][_0xf48039(0x1e9)](_0x39e5a0),await this[_0xf48039(0x1a9)][_0xf48039(0x129)](),this[_0xf48039(0x1fd)][_0xf48039(0x1a5)](_0xf48039(0x8b)),new ConfigUnsetReporter({'configName':_0x39e5a0});}catch(_0x433454){await this[_0xf48039(0x1a9)][_0xf48039(0x1a7)]();throw _0x433454;}}[a0_0xef8a28(0x19e)]([,{json:_0x474421}]){return _0x474421;}}class InitReporter extends BaseReporter{[a0_0xef8a28(0x202)];constructor({projectPath:_0x39d2bf}){super({'success':!![]}),this['projectPath']=_0x39d2bf;}[a0_0xef8a28(0xa5)](){const _0x1ea157=a0_0xef8a28;return{'success':this[_0x1ea157(0x11a)],'projectPath':this[_0x1ea157(0x202)]};}[a0_0xef8a28(0xff)](_0x3a0304){const _0x4d6635=a0_0xef8a28,_0x2644b9=[[_0x4d6635(0x147)],[_0x3a0304[_0x4d6635(0x202)]]];console['log'](table['table'](_0x2644b9,{'columns':[{'width':0x28}]}));}}class InitCommand extends BaseCommand{[a0_0xef8a28(0x204)]='init';['description']=a0_0xef8a28(0x7c);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':'-n,\x20--name\x20<string>','description':a0_0xef8a28(0x17e)},{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x1a9)]=ProjectManager['getInstance']();async[a0_0xef8a28(0x12b)]([_0x53b5f7]){const _0x1fc84d=a0_0xef8a28;this[_0x1fc84d(0x1fd)][_0x1fc84d(0x1a5)]('Project\x20initialization\x20started');const _0xb02dfd=await this[_0x1fc84d(0x1ba)](_0x53b5f7[_0x1fc84d(0x113)]),_0x2ecd88=await this[_0x1fc84d(0x1a9)][_0x1fc84d(0x193)](_0xb02dfd);if(_0x2ecd88)return this[_0x1fc84d(0x1fd)][_0x1fc84d(0x1eb)](_0x1fc84d(0x175)),new FailReporter({'failMessage':_0x1fc84d(0x175)});await this['manager'][_0x1fc84d(0x1ef)](_0xb02dfd);try{return await this[_0x1fc84d(0x1a9)][_0x1fc84d(0x133)]({}),await this[_0x1fc84d(0x1a9)][_0x1fc84d(0x129)](),this['logger']['info'](_0x1fc84d(0x1b1)),new InitReporter({'projectPath':_0xb02dfd});}catch(_0x4c6a80){await this['manager']['abortStage']();throw _0x4c6a80;}}[a0_0xef8a28(0x19e)]([{json:_0x20f8ca}]){return _0x20f8ca;}async[a0_0xef8a28(0x1ba)](_0x1d96ff){const _0x14a0ea=a0_0xef8a28;if(_0x1d96ff)return node_path[_0x14a0ea(0x13f)](process[_0x14a0ea(0x141)](),_0x1d96ff);const _0x5adeef=await ReadlineUtils['askString']('Enter\x20project\x20name:\x20');return node_path[_0x14a0ea(0x13f)](process[_0x14a0ea(0x141)](),_0x5adeef);}}class ListBranchesReporter extends BaseReporter{[a0_0xef8a28(0x132)];constructor(_0xa36f93){const _0x55e560=a0_0xef8a28;super({'success':!![]}),this[_0x55e560(0x132)]=_0xa36f93[_0x55e560(0x132)];}['buildReport'](){const _0x581341=a0_0xef8a28;return{'success':this[_0x581341(0x11a)],'branches':this['branches']};}['print'](_0x4e1400){const _0x2799ca=a0_0xef8a28,_0x28870c=[[_0x2799ca(0x1bb)]];for(const _0xaac820 of _0x4e1400[_0x2799ca(0x132)]){_0x28870c[_0x2799ca(0x1f9)]([_0xaac820]);}console[_0x2799ca(0xb3)](table[_0x2799ca(0x125)](_0x28870c,{'columns':[{'width':0x1e}]}));}}class ListBranchesCommand extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0xd5);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0xce);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();[a0_0xef8a28(0x1a9)]=ProjectManager[a0_0xef8a28(0x219)]();async['execute'](){const _0x2f3da1=a0_0xef8a28;this[_0x2f3da1(0x1fd)]['info']('Listing\x20remote\x20branches\x20started');const _0x42a86e=await this[_0x2f3da1(0x1a9)]['isInitialized'](this[_0x2f3da1(0x202)]);if(!_0x42a86e)return this[_0x2f3da1(0x1fd)][_0x2f3da1(0x1eb)]('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0x5dcd56=await this[_0x2f3da1(0xfa)](),{accessToken:_0x14b7ef,devopsUrl:_0x2f5a47}=await ApiService[_0x2f3da1(0x86)](_0x5dcd56),_0x34d61f=await ApiService['listBranches']({'accessToken':_0x14b7ef,'devopsUrl':_0x2f5a47});return this[_0x2f3da1(0x1fd)][_0x2f3da1(0x1a5)](_0x2f3da1(0x18d)),new ListBranchesReporter({'branches':_0x34d61f['map'](_0x469b6d=>_0x469b6d[_0x2f3da1(0x113)])});}[a0_0xef8a28(0x19e)]([{json:_0x10e4b3}]){return _0x10e4b3;}async[a0_0xef8a28(0xfa)](){const _0x411506=a0_0xef8a28,{credentialsAlias:_0x427419}=await this['manager'][_0x411506(0xf9)](this[_0x411506(0x202)]);if(!_0x427419)throw new Error(_0x411506(0x1ac));if(typeof _0x427419!==_0x411506(0xd9))throw new Error('Invalid\x20credentials\x20type');return _0x427419;}}class ListCredentialsReporter extends BaseReporter{[a0_0xef8a28(0x146)];constructor(_0x4b4fff){const _0x36236a=a0_0xef8a28;super({'success':!![]}),this[_0x36236a(0x146)]=_0x4b4fff[_0x36236a(0x146)];}[a0_0xef8a28(0xa5)](){const _0x3cabb4=a0_0xef8a28;return{'success':this[_0x3cabb4(0x11a)],'credentials':this[_0x3cabb4(0x146)]};}[a0_0xef8a28(0xff)](_0x2ba494){const _0x1d1734=a0_0xef8a28,_0x515090=[[_0x1d1734(0x167),_0x1d1734(0x177),_0x1d1734(0x208)]];for(const {alias:_0x43de45,globalSettingsUrl:_0x521eb8,devopsUrl:_0x25696d}of _0x2ba494[_0x1d1734(0x146)]){_0x515090['push']([_0x43de45,_0x521eb8,_0x25696d||_0x1d1734(0x1b6)]);}console[_0x1d1734(0xb3)](table['table'](_0x515090));}}class ListCredentialsCommand extends BaseCommand{[a0_0xef8a28(0x204)]='list-credentials';[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x87);[a0_0xef8a28(0x1c5)]=[];['options']=[{'flags':'--json','description':a0_0xef8a28(0x169),'defaultValue':![]}];async[a0_0xef8a28(0x12b)](){const _0x322066=a0_0xef8a28;this[_0x322066(0x1fd)][_0x322066(0x1a5)](_0x322066(0x140));const _0x37987a=await CredentialsManager[_0x322066(0xbf)]();return this[_0x322066(0x1fd)]['info'](_0x322066(0x9e)),new ListCredentialsReporter({'credentials':_0x37987a[_0x322066(0xdc)](({alias:_0x6c027b,globalSettingsUrl:_0x115657,devopsUrl:_0x3e9dfe})=>({'alias':_0x6c027b,'globalSettingsUrl':_0x115657,'devopsUrl':_0x3e9dfe}))});}['isJson']([{json:_0x29aaa1}]){return _0x29aaa1;}}const TOKEN_PREFIX=a0_0xef8a28(0x110);class LoginAction{constructor(_0xfa99c2){this['accessToken']=_0xfa99c2;}async[a0_0xef8a28(0x12b)](){const _0x26adaa=a0_0xef8a28;try{const _0x3d5c70=this[_0x26adaa(0xe4)][_0x26adaa(0x188)](TOKEN_PREFIX)[0x1],_0x33aeee=JSON[_0x26adaa(0x10b)](Buffer['from'](_0x3d5c70,_0x26adaa(0x1c1))['toString']('utf-8')),_0x143c01=await axios['get']('/api/v1/links',{'headers':{'authorization':''+this[_0x26adaa(0xe4)]},'baseURL':_0x33aeee['applicationUrl']})[_0x26adaa(0x1af)](({data:_0xd6ef91})=>new Map(_0xd6ef91[_0x26adaa(0xdc)](_0x4b2432=>[_0x4b2432['name'],_0x4b2432['api']]))),_0x5d5cd6={'globalSettingsUrl':_0x33aeee['applicationUrl']};for(const [_0x5e3d4f,_0x49de54]of _0x143c01['entries']()){_0x5e3d4f===_0x26adaa(0x1f5)&&(_0x5d5cd6[_0x26adaa(0x214)]=_0x49de54);}return _0x5d5cd6;}catch(_0x45ec4d){if(axios[_0x26adaa(0x210)](_0x45ec4d))throw Error(_0x45ec4d[_0x26adaa(0x124)]?.[_0x26adaa(0x1d7)]['message']||_0x45ec4d[_0x26adaa(0x124)]?.[_0x26adaa(0x216)]||_0x45ec4d[_0x26adaa(0x139)],{'cause':_0x45ec4d});throw _0x45ec4d;}}}class GlobalSettingsService{static async[a0_0xef8a28(0x106)]({accessToken:_0xca09be}){const _0x52643c=new LoginAction(_0xca09be);return _0x52643c['execute']();}}class LoginReporter extends BaseReporter{[a0_0xef8a28(0x145)];[a0_0xef8a28(0x15e)];[a0_0xef8a28(0x214)];constructor({alias:_0x486eec,globalSettingsUrl:_0x48512d,devopsUrl:_0xd80d56}){const _0x1640db=a0_0xef8a28;super({'success':!![]}),this[_0x1640db(0x145)]=_0x486eec,this[_0x1640db(0x15e)]=_0x48512d,this[_0x1640db(0x214)]=_0xd80d56;}[a0_0xef8a28(0xa5)](){const _0x5704da=a0_0xef8a28;return{'success':this[_0x5704da(0x11a)],'alias':this['alias'],'globalSettingsUrl':this[_0x5704da(0x15e)],'devopsUrl':this[_0x5704da(0x214)]};}[a0_0xef8a28(0xff)](_0xaa4f6c){const _0x263445=a0_0xef8a28,_0x145222=[[_0x263445(0x167),_0x263445(0x177),'Devops\x20Url'],[_0xaa4f6c[_0x263445(0x145)],_0xaa4f6c[_0x263445(0x15e)],_0xaa4f6c[_0x263445(0x214)]||'Not\x20Found']];console[_0x263445(0xb3)](table[_0x263445(0x125)](_0x145222));}}class LoginCommand extends BaseCommand{['commandName']=a0_0xef8a28(0x106);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x176);[a0_0xef8a28(0x1c5)]=[];['options']=[{'flags':a0_0xef8a28(0x21c),'description':a0_0xef8a28(0x1e7),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0xef8a28(0x14f),'description':'Token\x20for\x20getting\x20access\x20to\x20'+ROOT_NAME+a0_0xef8a28(0x143)},{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];async['execute']([_0x2c47ce]){const _0x256182=a0_0xef8a28;this[_0x256182(0x1fd)][_0x256182(0x1a5)]('Login\x20started');const _0x420993=await this['getAccessToken'](_0x2c47ce['token']),_0x2bc022=await GlobalSettingsService['login']({'accessToken':_0x420993});return await CredentialsManager[_0x256182(0xc6)]({'alias':_0x2c47ce[_0x256182(0x145)],'accessToken':_0x420993,'globalSettingsUrl':_0x2bc022[_0x256182(0x15e)],'devopsUrl':_0x2bc022[_0x256182(0x214)]}),this['logger'][_0x256182(0x1a5)]('Login\x20successfully\x20completed.\x20You\x20credentials\x20are\x20saved\x20with\x20alias\x20\x22'+_0x2c47ce['alias']+'\x22'),new LoginReporter({'alias':_0x2c47ce[_0x256182(0x145)],'globalSettingsUrl':_0x2bc022[_0x256182(0x15e)],'devopsUrl':_0x2bc022['devopsUrl']});}[a0_0xef8a28(0x19e)]([{json:_0x475825}]){return _0x475825;}async['getAccessToken'](_0xde454b){const _0x2496b4=a0_0xef8a28;if(_0xde454b)return _0xde454b;const _0x1f0976=await ReadlineUtils[_0x2496b4(0x168)](_0x2496b4(0xec));return _0x1f0976;}}const DELETED_STATUS='Deleted';class LogoutReporter extends BaseReporter{[a0_0xef8a28(0x145)];constructor({alias:_0x52ef36}){super({'success':!![]}),this['alias']=_0x52ef36;}[a0_0xef8a28(0xa5)](){const _0x251cf5=a0_0xef8a28;return{'success':this[_0x251cf5(0x11a)],'alias':this[_0x251cf5(0x145)],'status':DELETED_STATUS};}[a0_0xef8a28(0xff)](_0x1fe32e){const _0x4ee218=a0_0xef8a28,_0x179bf2=[[_0x4ee218(0x167),_0x4ee218(0x107)],[_0x1fe32e['alias'],_0x1fe32e[_0x4ee218(0xd0)]]];console[_0x4ee218(0xb3)](table[_0x4ee218(0x125)](_0x179bf2));}}class LogoutCommand extends BaseCommand{[a0_0xef8a28(0x204)]=a0_0xef8a28(0x14b);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x1e5);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x21c),'description':a0_0xef8a28(0x15a),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];async[a0_0xef8a28(0x12b)]([_0x5581e3]){const _0x137e68=a0_0xef8a28;return this[_0x137e68(0x1fd)][_0x137e68(0x1a5)](_0x137e68(0x10e)),await CredentialsManager[_0x137e68(0x111)]({'alias':_0x5581e3['alias']}),this[_0x137e68(0x1fd)]['info'](_0x137e68(0xdd)),new LogoutReporter({'alias':_0x5581e3[_0x137e68(0x145)]});}['isJson']([{json:_0x1903a4}]){return _0x1903a4;}}class PullReporter extends BaseReporter{['changes'];constructor({changes:_0x4e2254}){const _0x30dbd1=a0_0xef8a28;super({'success':!![]}),this[_0x30dbd1(0x190)]=_0x4e2254;}[a0_0xef8a28(0xa5)](){const _0x494231=a0_0xef8a28;return{'success':this['success'],'changes':this[_0x494231(0x190)]};}[a0_0xef8a28(0xff)](_0x4b70c3){const _0xc74b30=a0_0xef8a28;console[_0xc74b30(0xb3)]('Component\x20Updates:');const _0x58551b=[['Change\x20Type',_0xc74b30(0x1a2),_0xc74b30(0x148),_0xc74b30(0x155)]];for(const {changeType:_0x106ebd,name:_0x3718ee,type:_0x47810b,paths:_0x154337}of _0x4b70c3[_0xc74b30(0x190)]){_0x58551b[_0xc74b30(0x1f9)]([_0x106ebd,_0x3718ee,_0x47810b,_0x154337?.[_0xc74b30(0x13f)]('\x0a')||'']);}console['log'](table[_0xc74b30(0x125)](_0x58551b,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class PullCommand extends BaseCommand{[a0_0xef8a28(0x204)]='pull';[a0_0xef8a28(0xc9)]=a0_0xef8a28(0xd4);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();['manager']=ProjectManager['getInstance']();[a0_0xef8a28(0x18b)]=[];[a0_0xef8a28(0x154)];get[a0_0xef8a28(0x146)](){const _0x29f28c=a0_0xef8a28;if(!this[_0x29f28c(0x154)])throw new Error(_0x29f28c(0x178));return this[_0x29f28c(0x154)];}async[a0_0xef8a28(0x12b)](){const _0xabe976=a0_0xef8a28;this[_0xabe976(0x1fd)][_0xabe976(0x1a5)](_0xabe976(0x144));const _0x18494a=await this[_0xabe976(0x1a9)][_0xabe976(0x193)](this[_0xabe976(0x202)]);if(!_0x18494a)return this[_0xabe976(0x1fd)][_0xabe976(0x1eb)](_0xabe976(0x1bf)),new FailReporter({'failMessage':_0xabe976(0x1bf)});const _0x579529=await this['getCredentialsAlias']();this['_credentials']=await ApiService[_0xabe976(0x86)](_0x579529);const {id:_0x1d5443,headCommitId:_0x55861b}=await this[_0xabe976(0x1a9)][_0xabe976(0x114)](this[_0xabe976(0x202)]);if(!_0x1d5443)return this[_0xabe976(0x1fd)]['warn'](_0xabe976(0x1a6)),new FailReporter({'failMessage':_0xabe976(0x1a6)});const _0x23c2a7=await ApiService[_0xabe976(0x12f)]({'accessToken':this[_0xabe976(0x146)][_0xabe976(0xe4)],'devopsUrl':this[_0xabe976(0x146)][_0xabe976(0x214)],'branchId':_0x1d5443});if(_0x55861b===_0x23c2a7[_0xabe976(0x1dc)])return new PullReporter({'changes':this[_0xabe976(0x18b)]});await this['manager'][_0xabe976(0x1ef)](this[_0xabe976(0x202)]);try{this[_0xabe976(0x1fd)][_0xabe976(0x1a5)]('Checking\x20manual\x20changes\x20started');const _0x2e2850=await this[_0xabe976(0x1c2)]();if(_0x2e2850)return this[_0xabe976(0x1fd)][_0xabe976(0x1eb)](_0xabe976(0x19b)),await this[_0xabe976(0x1a9)][_0xabe976(0x1a7)](),new FailReporter({'failMessage':_0xabe976(0x19b)});return this[_0xabe976(0x1fd)]['info'](_0xabe976(0xb8)),this[_0xabe976(0x1fd)][_0xabe976(0x1a5)](_0xabe976(0x20b)),await this[_0xabe976(0xa7)](_0x23c2a7),this['logger'][_0xabe976(0x1a5)](_0xabe976(0x98)),await this[_0xabe976(0x1a9)]['applyStage'](),this[_0xabe976(0x1fd)]['info'](_0xabe976(0x13d)),new PullReporter({'changes':this['componentChanges']});}catch(_0x320a9f){await this[_0xabe976(0x1a9)][_0xabe976(0x1a7)]();throw _0x320a9f;}}['isJson']([{json:_0xb0ddfd}]){return _0xb0ddfd;}async[a0_0xef8a28(0xfa)](){const _0x421af5=a0_0xef8a28,{credentialsAlias:_0x47f6c5}=await this[_0x421af5(0x1a9)]['readConfig'](this['projectPath']);if(!_0x47f6c5)throw new Error(_0x421af5(0x1ac));if(typeof _0x47f6c5!==_0x421af5(0xd9))throw new Error(_0x421af5(0xbb));return _0x47f6c5;}async['areChanges'](){const _0xa79f6f=a0_0xef8a28,_0x2c6ad5=await this[_0xa79f6f(0x1a9)][_0xa79f6f(0x161)]();return!!_0x2c6ad5['length'];}async[a0_0xef8a28(0xa7)](_0xac25f0){const _0xaaef63=a0_0xef8a28,{devopsUrl:_0x269d1b,accessToken:_0x2d82d9}=this[_0xaaef63(0x146)],_0x290ae8=await this[_0xaaef63(0x1a9)][_0xaaef63(0x206)]({'devopsUrl':_0x269d1b,'accessToken':_0x2d82d9,'targetBranchId':_0xac25f0['id'],'targetCommitId':_0xac25f0[_0xaaef63(0x1dc)]});for(const {id:_0x185830,name:_0x1bda6f,type:_0x1d38dc,changeType:_0x2d6e71}of _0x290ae8){if(!_0x185830){if(_0x2d6e71!==ChangeType[_0xaaef63(0xf0)])throw new Error(_0xaaef63(0x84));await this[_0xaaef63(0x1a9)]['saveComponent']({'name':_0x1bda6f,'type':_0x1d38dc,'changeType':_0x2d6e71}),this[_0xaaef63(0x18b)][_0xaaef63(0x1f9)]({'changeType':_0x2d6e71,'name':_0x1bda6f,'type':_0x1d38dc});continue;}const _0x253fe2=await ApiService[_0xaaef63(0x209)]({'devopsUrl':_0x269d1b,'accessToken':_0x2d82d9,'componentId':_0x185830});if(!_0x253fe2['fHash'])throw new Error(_0xaaef63(0xb0)+_0x253fe2[_0xaaef63(0x113)]+'\x22\x20of\x20type\x20\x22'+_0x253fe2[_0xaaef63(0xb4)]+_0xaaef63(0x1d3));await this[_0xaaef63(0x1a9)][_0xaaef63(0x205)]({'name':_0x1bda6f,'type':_0x1d38dc,'changeType':_0x2d6e71,'component':{..._0x253fe2,'fHash':_0x253fe2[_0xaaef63(0xee)]}}),this[_0xaaef63(0x18b)]['push']({'changeType':_0x2d6e71,'name':_0x1bda6f,'type':_0x1d38dc,'paths':_0x253fe2[_0xaaef63(0x126)][_0xaaef63(0xdc)](_0x57fc56=>_0x57fc56[_0xaaef63(0x119)])});}await this['manager'][_0xaaef63(0xd2)](_0xac25f0);}}class RollbackReporter extends BaseReporter{[a0_0xef8a28(0x12a)];constructor({fileChanges:_0x394984}){const _0x4ebafe=a0_0xef8a28;super({'success':!![]}),this[_0x4ebafe(0x12a)]=_0x394984;}[a0_0xef8a28(0xa5)](){const _0x4f9ad7=a0_0xef8a28;return{'success':this[_0x4f9ad7(0x11a)],'fileChanges':this[_0x4f9ad7(0x12a)]};}[a0_0xef8a28(0xff)](_0xa8bc89){const _0x4d4e4a=a0_0xef8a28;console['log'](_0x4d4e4a(0xd1));const _0x5458cc=[[_0x4d4e4a(0x194),_0x4d4e4a(0x14a)]];for(const {changeType:_0x2ce912,path:_0x588206}of _0xa8bc89['fileChanges']){_0x5458cc[_0x4d4e4a(0x1f9)]([_0x2ce912,_0x588206]);}console[_0x4d4e4a(0xb3)](table[_0x4d4e4a(0x125)](_0x5458cc,{'columns':[{},{'width':0x28}]}));}}class RollbackCommand extends BaseCommand{['commandName']=a0_0xef8a28(0x195);['description']=a0_0xef8a28(0x1cb);['arguments']=[];[a0_0xef8a28(0x83)]=[{'flags':a0_0xef8a28(0x196),'description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();['manager']=ProjectManager['getInstance']();[a0_0xef8a28(0x1f4)]=new Map();[a0_0xef8a28(0x179)]=[];[a0_0xef8a28(0x1ab)]=[];[a0_0xef8a28(0x154)];[a0_0xef8a28(0x9f)];['_headCommitId'];get[a0_0xef8a28(0x146)](){const _0x3dcc99=a0_0xef8a28;if(!this['_credentials'])throw new Error(_0x3dcc99(0x178));return this['_credentials'];}get[a0_0xef8a28(0x135)](){const _0x3bba47=a0_0xef8a28;if(!this['_branchId'])throw new Error('Branch\x20id\x20not\x20found');return this[_0x3bba47(0x9f)];}get[a0_0xef8a28(0x1dc)](){const _0x5caf84=a0_0xef8a28;if(!this[_0x5caf84(0x1b8)])throw new Error(_0x5caf84(0x1f0));return this[_0x5caf84(0x1b8)];}async[a0_0xef8a28(0x12b)](){const _0x2493b7=a0_0xef8a28;this[_0x2493b7(0x1fd)][_0x2493b7(0x1a5)]('Rolling\x20back\x20to\x20last\x20committed\x20state\x20started');const _0x1cb923=await this[_0x2493b7(0x1a9)][_0x2493b7(0x193)](this[_0x2493b7(0x202)]);if(!_0x1cb923)return this[_0x2493b7(0x1fd)][_0x2493b7(0x1eb)](_0x2493b7(0x1bf)),new FailReporter({'failMessage':_0x2493b7(0x1bf)});const _0x1a7aaf=await this[_0x2493b7(0xfa)]();this[_0x2493b7(0x154)]=await ApiService[_0x2493b7(0x86)](_0x1a7aaf),await this[_0x2493b7(0x172)](),await this[_0x2493b7(0x1a9)][_0x2493b7(0x1ef)](this[_0x2493b7(0x202)]);try{this[_0x2493b7(0x1fd)][_0x2493b7(0x1a5)](_0x2493b7(0xde)),await this[_0x2493b7(0xa3)]();if(!this[_0x2493b7(0x1f4)][_0x2493b7(0x17c)])return this[_0x2493b7(0x1fd)][_0x2493b7(0x1a5)](_0x2493b7(0x1b4)),new RollbackReporter({'fileChanges':this[_0x2493b7(0x1ab)]});return this[_0x2493b7(0x1fd)][_0x2493b7(0x1a5)]('Looking\x20for\x20changes\x20completed.\x20'+this[_0x2493b7(0x1f4)][_0x2493b7(0x17c)]+_0x2493b7(0xa0)),this['logger'][_0x2493b7(0x1a5)](_0x2493b7(0xc5)),await this[_0x2493b7(0x195)](),this['logger']['info'](_0x2493b7(0x117)),await this['manager']['applyStage'](),this[_0x2493b7(0x1fd)][_0x2493b7(0x1a5)](_0x2493b7(0x1ae)),new RollbackReporter({'fileChanges':this[_0x2493b7(0x1ab)]});}catch(_0x3c2588){await this[_0x2493b7(0x1a9)][_0x2493b7(0x1a7)]();throw _0x3c2588;}}[a0_0xef8a28(0x19e)]([{json:_0x110ec7}]){return _0x110ec7;}async[a0_0xef8a28(0xfa)](){const _0x3b1dc2=a0_0xef8a28,{credentialsAlias:_0x28b618}=await this[_0x3b1dc2(0x1a9)]['readConfig'](this[_0x3b1dc2(0x202)]);if(!_0x28b618)throw new Error(_0x3b1dc2(0x1ac));if(typeof _0x28b618!==_0x3b1dc2(0xd9))throw new Error(_0x3b1dc2(0xbb));return _0x28b618;}async[a0_0xef8a28(0x172)](){const _0x43d295=a0_0xef8a28,{id:_0x65ba19,headCommitId:_0xad3d79}=await this['manager'][_0x43d295(0x114)](this[_0x43d295(0x202)]);if(!_0x65ba19||!_0xad3d79)throw new Error(_0x43d295(0x1a6));this[_0x43d295(0x9f)]=_0x65ba19||void 0x0,this[_0x43d295(0x1b8)]=_0xad3d79||void 0x0;}async[a0_0xef8a28(0x195)](){const _0x4236cc=a0_0xef8a28;if(this[_0x4236cc(0x179)][_0x4236cc(0x10f)])for await(const {files:_0x4d90a5}of ApiService[_0x4236cc(0x173)]({'devopsUrl':this[_0x4236cc(0x146)][_0x4236cc(0x214)],'accessToken':this[_0x4236cc(0x146)][_0x4236cc(0xe4)],'branchId':this['branchId'],'commitId':this[_0x4236cc(0x1dc)],'components':this[_0x4236cc(0x179)]})){await this[_0x4236cc(0x1a3)](_0x4d90a5);}for(const [_0x2a84e8,_0x2af85f]of this[_0x4236cc(0x1f4)][_0x4236cc(0x1d6)]()){if(_0x2af85f!==ChangeType[_0x4236cc(0xf0)])throw new Error(_0x4236cc(0x97)+_0x2a84e8+_0x4236cc(0x186));await this[_0x4236cc(0x1a9)][_0x4236cc(0x16a)]({'path':_0x2a84e8,'changeType':_0x2af85f});}return{'success':!![]};}async['defineRollbackTypes'](){const _0x129a32=a0_0xef8a28,_0x445874=await this[_0x129a32(0x1a9)]['findChanges']();for(const {name:_0x3c8cf0,type:_0x26bda0,changes:_0xed1175}of _0x445874){let _0x5c7fd5=![];for(const {path:_0x102ab7,changeType:_0x19fe5a}of _0xed1175){let _0x2db36d;_0x19fe5a===ChangeType['CREATE']?_0x2db36d=ChangeType[_0x129a32(0xf0)]:(_0x2db36d=_0x19fe5a===ChangeType['DELETE']?ChangeType[_0x129a32(0xf4)]:ChangeType[_0x129a32(0x121)],_0x5c7fd5=!![]),this[_0x129a32(0x1f4)][_0x129a32(0x123)](_0x102ab7,_0x2db36d),this[_0x129a32(0x1ab)][_0x129a32(0x1f9)]({'changeType':_0x2db36d,'path':_0x102ab7});}_0x5c7fd5&&this[_0x129a32(0x179)][_0x129a32(0x1f9)]({'name':_0x3c8cf0,'type':_0x26bda0});}}async['handleRestore'](_0x5d5884){const _0x4df58e=a0_0xef8a28;for(const {path:_0x2ceb01,content:_0x6e4e2d}of _0x5d5884){const _0x20f490=node_path['join'](COMPONENT_PROJECT_PATH,_0x2ceb01),_0x407f4f=this[_0x4df58e(0x1f4)][_0x4df58e(0x174)](_0x20f490);if(!_0x407f4f)continue;await this[_0x4df58e(0x1a9)][_0x4df58e(0x16a)]({'path':_0x20f490,'content':_0x6e4e2d,'changeType':_0x407f4f}),this[_0x4df58e(0x1f4)][_0x4df58e(0x111)](_0x20f490);}}}class StatusReporter extends BaseReporter{[a0_0xef8a28(0xb9)];constructor({pendingChanges:_0x4b7ab5}){const _0x2d5dac=a0_0xef8a28;super({'success':!![]}),this[_0x2d5dac(0xb9)]=_0x4b7ab5;}['buildReport'](){const _0x53615d=a0_0xef8a28;return{'success':this[_0x53615d(0x11a)],'pendingChanges':this['pendingChanges']};}[a0_0xef8a28(0xff)](_0x26f437){const _0x400f9a=a0_0xef8a28;console[_0x400f9a(0xb3)](_0x400f9a(0x180));const _0x23005e=[[_0x400f9a(0x194),_0x400f9a(0x14a)]];for(const {changeType:_0x36aafa,path:_0x141ece}of _0x26f437['pendingChanges']){_0x23005e['push']([_0x36aafa,_0x141ece]);}console[_0x400f9a(0xb3)](table[_0x400f9a(0x125)](_0x23005e,{'columns':[{},{'width':0x28}]}));}}class StatusCommand extends BaseCommand{['commandName']=a0_0xef8a28(0xd0);[a0_0xef8a28(0xc9)]=a0_0xef8a28(0x211);[a0_0xef8a28(0x1c5)]=[];[a0_0xef8a28(0x83)]=[{'flags':'--json','description':a0_0xef8a28(0x169),'defaultValue':![]}];[a0_0xef8a28(0x202)]=process[a0_0xef8a28(0x141)]();[a0_0xef8a28(0x1a9)]=ProjectManager['getInstance']();[a0_0xef8a28(0xb9)]=[];async[a0_0xef8a28(0x12b)](){const _0x18f09e=a0_0xef8a28;this[_0x18f09e(0x1fd)]['info'](_0x18f09e(0xf5));const _0xffd8da=await this[_0x18f09e(0x1a9)][_0x18f09e(0x193)](this[_0x18f09e(0x202)]);if(!_0xffd8da)return this[_0x18f09e(0x1fd)][_0x18f09e(0x1eb)]('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':_0x18f09e(0x1bf)});await this[_0x18f09e(0x1a9)]['initStage'](this['projectPath']);const _0x4a3ac6=await this[_0x18f09e(0x1a9)]['findChanges']();for(const {changes:_0x197d35}of _0x4a3ac6){for(const {changeType:_0x59b621,path:_0x626466}of _0x197d35){this['pendingChanges'][_0x18f09e(0x1f9)]({'changeType':_0x59b621,'path':_0x626466});}}return await this['manager'][_0x18f09e(0x1a7)](),this['logger']['info']('Status\x20calculation\x20completed'),new StatusReporter({'pendingChanges':this[_0x18f09e(0xb9)]});}['isJson']([{json:_0x33778a}]){return _0x33778a;}}const ECONN_REFUSED=a0_0xef8a28(0x182);function setupAxiosInterceptors(){const _0x37da51=a0_0xef8a28;axios[_0x37da51(0xb7)]['response'][_0x37da51(0xef)](_0x533f22=>_0x533f22,async _0x8a463c=>{const _0x55b873=_0x37da51;if(_0x8a463c[_0x55b873(0x1c8)]!==ECONN_REFUSED)return Promise[_0x55b873(0xe5)](_0x8a463c);if(_0x8a463c[_0x55b873(0x130)]instanceof AggregateError){const _0x25dff2=_0x8a463c[_0x55b873(0x130)]['errors'][_0x55b873(0xdc)](({message:_0x4e5c64})=>_0x4e5c64);return Promise[_0x55b873(0xe5)](new Error(_0x25dff2['join'](',\x20')));}return Promise['reject'](new Error(_0x55b873(0x1fb)));});}configurePathEnv(),setupAxiosInterceptors();const ROOT_COMMANDS=[LoginCommand,LogoutCommand,ListCredentialsCommand],DEVOPS_COMMANDS=[InitCommand,CloneCommand,CheckoutCommand,ConfigSetCommand,ConfigUnset,PullCommand,CommitCommand,RollbackCommand,StatusCommand,ListBranchesCommand],root=new commander[(a0_0xef8a28(0xad))]()[a0_0xef8a28(0x113)](ROOT_NAME)['description'](a0_0xef8a28(0x142)+ROOT_NAME+a0_0xef8a28(0x138))['version'](config[a0_0xef8a28(0x18a)]);for(const command of ROOT_COMMANDS){new command()[a0_0xef8a28(0x215)](root);}const devops=new commander[(a0_0xef8a28(0xad))]()[a0_0xef8a28(0x113)]('devops')['description'](a0_0xef8a28(0x16c));for(const command of DEVOPS_COMMANDS){new command()[a0_0xef8a28(0x215)](devops);}root['addCommand'](devops),root[a0_0xef8a28(0x10b)]();function configurePathEnv(){const _0x29d842=a0_0xef8a28,_0x15024a=process[_0x29d842(0x1f7)][_0x29d842(0x15b)]?.[_0x29d842(0x188)](node_path[_0x29d842(0x1df)]);if(!_0x15024a)throw new Error(_0x29d842(0xe1));const _0x15cac1=node_path[_0x29d842(0x13f)](node_path['dirname'](__dirname),'node_modules',_0x29d842(0x7b));_0x15024a[_0x29d842(0x1f9)](_0x15cac1),process[_0x29d842(0x1f7)][_0x29d842(0x15b)]=_0x15024a[_0x29d842(0x13f)](node_path[_0x29d842(0x1df)]);}exports[a0_0xef8a28(0x1bc)]=DEVOPS_COMMANDS,exports[a0_0xef8a28(0x1d4)]=ROOT_COMMANDS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flosum/cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "author": "Flosum",
5
5
  "license": "ISC",
6
6
  "description": "Devops cli",