OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-deps / @holepunchto / keet-store / store / ui-desktop / ui-user-profile.saga.js

1 lines · javascript ref:
(function(_0x2d0826,_0x4fc78e){const _0x347d97={_0x5852da:0x3e9,_0x2f7b7d:0x3e9,_0x4d5c3a:0x417,_0x345524:0x413,_0x20cac6:0x404,_0x631ae1:0x3f5,_0x262629:0x3d9,_0x4474:0x3d0,_0x39e13b:0x3bf,_0x48a823:0x3ba,_0x557c41:0x3b0,_0x4ca860:0x3c6,_0x2ef26e:0x3b9,_0x1aa020:0x3c1,_0x496003:0x3aa,_0x120412:0x3f7,_0x27dd25:0x3da,_0x2468c6:0x3eb,_0x323dd5:0x3c4,_0x2c76ce:0x3d8,_0x120bb8:0x3cd,_0x1c735d:0x3bc,_0x605e96:0x3dd,_0x284837:0x409,_0x587748:0x3ee,_0x15eded:0x410,_0x4b4333:0x3fe,_0x29c412:0x3de,_0x499eaf:0x3e0,_0x320764:0x3f0,_0x438d0c:0x3ea,_0x543953:0x3e7,_0x1061ba:0x3e5,_0xc4ffdd:0x405,_0x2ba4cb:0x3f3},_0x349905={_0xf23e7c:0x2ec},_0x529e74=_0x2d0826();function _0x587b53(_0x165bfe,_0x4f632f,_0x13a9ea,_0x45e828){return _0x1e30(_0x45e828-_0x349905._0xf23e7c,_0x13a9ea);}function _0xf33a54(_0x3beb9a,_0x399a87,_0x3756fe,_0x5c7cb1){return _0x1e30(_0x3beb9a-0x2c0,_0x5c7cb1);}while(!![]){try{const _0x4c328a=parseInt(_0x587b53(0x3e9,_0x347d97._0x5852da,0x3ed,_0x347d97._0x2f7b7d))/(0x24ee+0xbde+-0x30cb)+-parseInt(_0x587b53(_0x347d97._0x4d5c3a,0x413,_0x347d97._0x345524,_0x347d97._0x20cac6))/(0x50a*-0x5+-0xfda+0x290e)*(parseInt(_0x587b53(0x3db,_0x347d97._0x631ae1,_0x347d97._0x262629,0x3ec))/(0x1*-0x9d9+0x25fe+-0x1c22))+parseInt(_0xf33a54(_0x347d97._0x4474,0x3dc,0x3d3,_0x347d97._0x39e13b))/(-0x95e+0xfd3*0x1+0x671*-0x1)*(-parseInt(_0xf33a54(_0x347d97._0x48a823,0x3a7,_0x347d97._0x557c41,_0x347d97._0x4ca860))/(0x1bca+-0x4*0x74a+0x163))+parseInt(_0xf33a54(_0x347d97._0x2ef26e,0x3ae,_0x347d97._0x1aa020,_0x347d97._0x496003))/(-0x260d+0x6fa*-0x4+0x41fb)*(-parseInt(_0x587b53(0x3f5,_0x347d97._0x120412,_0x347d97._0x27dd25,_0x347d97._0x2468c6))/(0x1*0x681+-0x1601+0xf87))+-parseInt(_0xf33a54(_0x347d97._0x323dd5,0x3b2,_0x347d97._0x4ca860,_0x347d97._0x2c76ce))/(-0x1a51*0x1+0xac1+0xf98)*(-parseInt(_0xf33a54(_0x347d97._0x120bb8,0x3cc,_0x347d97._0x1c735d,_0x347d97._0x605e96))/(-0x1ff*-0x12+-0x5a0+0xa17*-0x3))+-parseInt(_0x587b53(_0x347d97._0x284837,_0x347d97._0x587748,_0x347d97._0x15eded,_0x347d97._0x4b4333))/(-0x915+-0x1ade+0x23fd)*(-parseInt(_0xf33a54(_0x347d97._0x29c412,_0x347d97._0x499eaf,_0x347d97._0x605e96,0x3d8))/(-0x123b+0x117e+0xc8))+parseInt(_0x587b53(_0x347d97._0x320764,_0x347d97._0x29c412,_0x347d97._0x438d0c,_0x347d97._0x587748))/(-0xe8*-0x13+-0x1e5*-0x3+-0x16db)*(parseInt(_0x587b53(_0x347d97._0x543953,_0x347d97._0x1061ba,_0x347d97._0xc4ffdd,_0x347d97._0x2ba4cb))/(0x2*0x3eb+-0x1a86+-0x12bd*-0x1));if(_0x4c328a===_0x4fc78e)break;else _0x529e74['push'](_0x529e74['shift']());}catch(_0x879f8e){_0x529e74['push'](_0x529e74['shift']());}}}(_0x11a7,-0x33eca+-0x14e*-0x548+0x2320b));const _0x3200c0=(function(){let _0xc20bfe=!![];return function(_0x720422,_0x5b4838){const _0x1d9ac8={_0x40abc2:0x408,_0x5e617d:0x3f8},_0x54d34c={_0x3cd770:0x2de},_0x58caf8=_0xc20bfe?function(){function _0x61b126(_0x200062,_0x376aa5,_0x4ea294,_0x234ca9){return _0x1e30(_0x234ca9-_0x54d34c._0x3cd770,_0x376aa5);}if(_0x5b4838){const _0x488109=_0x5b4838[_0x61b126(0x3f1,0x3eb,_0x1d9ac8._0x40abc2,_0x1d9ac8._0x5e617d)](_0x720422,arguments);return _0x5b4838=null,_0x488109;}}:function(){};return _0xc20bfe=![],_0x58caf8;};}()),_0x6d07a=_0x3200c0(this,function(){const _0x33446c={_0x58d22d:0x2e2,_0x1a0658:0x2ea,_0x5b954a:0x2fa,_0x42c9ee:0x2e4,_0x3d6b70:0x2f3,_0x29d990:0x27a,_0x3c2857:0x278,_0x3506a0:0x2e5,_0x276e33:0x2f0,_0x210f06:0x2f8},_0x314592={_0x135c53:0x177},_0x288817={_0x98db2b:0x1dc};function _0x20a3fa(_0x1ef031,_0x29d9f1,_0x186189,_0x4751f6){return _0x1e30(_0x4751f6-_0x288817._0x98db2b,_0x1ef031);}function _0x3ff8fb(_0x475c15,_0x3f70d4,_0x255c49,_0x43af83){return _0x1e30(_0x3f70d4-_0x314592._0x135c53,_0x255c49);}return _0x6d07a[_0x20a3fa(_0x33446c._0x58d22d,0x2f2,0x2f7,_0x33446c._0x1a0658)]()['search'](_0x20a3fa(_0x33446c._0x5b954a,_0x33446c._0x42c9ee,0x2e3,_0x33446c._0x3d6b70)+'+$')['toString']()[_0x3ff8fb(0x27b,_0x33446c._0x29d990,0x272,_0x33446c._0x3c2857)+'r'](_0x6d07a)[_0x20a3fa(_0x33446c._0x3506a0,0x2e7,_0x33446c._0x276e33,_0x33446c._0x210f06)]('(((.+)+)+)'+'+$');});_0x6d07a();function _0x11a7(){const _0x5288bf=['aga','ROOT','(((.+)+)+)','15728bCcvEJ','letBalance','apply','message','search','match','20416xjuEwQ','name','twareDepsS','3670872zuJYxk','545TiEaik','balance','length','34575GlTExw','fork','7RBpean','114EUXGmd','PROFILE','192228GXaHVx','constructo','8kaLYrY','transactio','VERSION','156UqFDCZ','dev','key','NETWORK_ST','dependenci','profileWal','6411681KXcDTa','toString','profileSof','10636KxgxOy','tionsSaga','3470pwnTuK','payload','letTransac'];_0x11a7=function(){return _0x5288bf;};return _0x11a7();}import{call,takeLatest,select,fork,put,getContext}from'redux-saga/effects';import{getCoreBackend}from'../../backend';import{apiCall}from'../../api/core';import{PLATFORM_CONTEXT_KEY,APP_CONTEXT_KEY}from'../constants';function _0x1e30(_0x1e3048,_0x25d784){const _0x195bbd=_0x11a7();return _0x1e30=function(_0x395b8a,_0x25ccfd){_0x395b8a=_0x395b8a-(0x1705+-0x1e05+-0x9d*-0xd);let _0x322a6b=_0x195bbd[_0x395b8a];return _0x322a6b;},_0x1e30(_0x1e3048,_0x25d784);}import{taskErrorSaga}from'../error';import{getProfileWalletConfig,getProfileSoftwareVersion,setProfileCurrentSection,setProfileSoftwareVersion,setProfileSoftwareDependencies,setProfileWalletBalance,setProfileWalletError,setProfileWalletLoading,setProfileWalletTransactions}from'./ui-user-profile.reducer';import{UI_PANEL,PROFILE_SECTIONS}from'./ui.constants';import{getUIPanelState,toggleUIPanel}from'./ui.reducer';async function getTransactions(_0x258096){const _0x2ef7a1=[];for await(const _0x385a09 of _0x258096){_0x2ef7a1['push'](_0x385a09);}return _0x2ef7a1;}export function*profileWalletTransactionsSaga(){const _0x217ba3={_0x287de4:0x6,_0x1bbd23:0xe,_0x43aaee:0x14,_0x34e235:0x4,_0x5b0695:0x15,_0x496c0a:0x23,_0x2194d7:0x24,_0x573d55:0x1d,_0x1f8fba:0xdf,_0x342e3d:0xd0,_0x33ba3a:0xe2},_0x3c8c52={_0x180515:0x2f},_0x6e7f63={_0x458519:0xf7};function _0x564bbb(_0x22e630,_0x21d472,_0x19d308,_0x2a355a){return _0x1e30(_0x2a355a- -_0x6e7f63._0x458519,_0x19d308);}function _0x50c311(_0x208a56,_0x4a367f,_0x128614,_0x2b6f15){return _0x1e30(_0x2b6f15- -_0x3c8c52._0x180515,_0x128614);}const {lightning:_0x15c1c6}=yield getContext(PLATFORM_CONTEXT_KEY);try{yield put(setProfileWalletLoading(!![]));const _0x360e63=yield call([_0x15c1c6,_0x15c1c6[_0x564bbb(_0x217ba3._0x287de4,_0x217ba3._0x287de4,-0x1,_0x217ba3._0x1bbd23)+'ns']],{'live':!![],'seq':0x0}),_0x3ab2fc=yield getTransactions(_0x360e63);yield put(setProfileWalletTransactions(_0x3ab2fc));}catch(_0xe3b53f){yield put(setProfileWalletError(_0xe3b53f['message'])),yield taskErrorSaga(_0x564bbb(_0x217ba3._0x43aaee,0x1e,_0x217ba3._0x34e235,_0x217ba3._0x5b0695)+_0x564bbb(0x9,_0x217ba3._0x496c0a,_0x217ba3._0x2194d7,_0x217ba3._0x573d55)+_0x50c311(0xd1,_0x217ba3._0x1f8fba,_0x217ba3._0x342e3d,_0x217ba3._0x33ba3a),_0xe3b53f);}finally{yield put(setProfileWalletLoading(![]));}}export function*profileWalletBalanceSaga(){const _0x1007f8={_0x4e91f9:0x257,_0x45c4d5:0x26a,_0x362e18:0x25c,_0xafa298:0x418,_0x5e2839:0x42d,_0x5b72ac:0x433,_0x36cd49:0x421,_0x4a869a:0x272,_0x59e38e:0x265,_0x19965f:0x273,_0x2eaf74:0x26d,_0xd144f7:0x424,_0x4bd70e:0x423,_0x2538b4:0x41b},_0x308cb8={_0x2c97ed:0x306};function _0x2dda5d(_0xe0e3f1,_0x487fce,_0x398fec,_0x322d2b){return _0x1e30(_0x322d2b-_0x308cb8._0x2c97ed,_0x398fec);}const {lightning:_0x4fc6a3}=yield getContext(PLATFORM_CONTEXT_KEY);function _0x1aafc5(_0x17cd93,_0x3bd476,_0x4b9cc4,_0x35f56c){return _0x1e30(_0x35f56c-0x161,_0x17cd93);}try{yield put(setProfileWalletBalance(null));const _0x5e5aec=yield call([_0x4fc6a3,_0x4fc6a3[_0x1aafc5(0x252,_0x1007f8._0x4e91f9,_0x1007f8._0x45c4d5,_0x1007f8._0x362e18)]]);yield put(setProfileWalletBalance(_0x5e5aec));}catch(_0x107689){yield put(setProfileWalletError(_0x107689[_0x2dda5d(_0x1007f8._0xafa298,_0x1007f8._0x5e2839,_0x1007f8._0x5b72ac,_0x1007f8._0x36cd49)])),yield taskErrorSaga(_0x1aafc5(_0x1007f8._0x4a869a,_0x1007f8._0x59e38e,_0x1007f8._0x19965f,_0x1007f8._0x2eaf74)+_0x2dda5d(_0x1007f8._0xd144f7,_0x1007f8._0x4bd70e,_0x1007f8._0x2538b4,0x41f)+'Saga',_0x107689);}}export function*profileWalletSaga(){const _0x2b5e08=yield select(getProfileWalletConfig);if(!_0x2b5e08)return;yield put(setProfileWalletError('')),yield fork(profileWalletBalanceSaga),yield fork(profileWalletTransactionsSaga);}export function*profileSoftwareSaga(){const _0x5cc21a={_0x3e2859:0x49,_0x2f5bd2:0x43,_0x36dd35:0x40,_0x14d2de:0x2d,_0x339be5:0x1e,_0x4d6f2c:0x26,_0x5e3745:0x29,_0x539e17:0x20,_0xd1cdf1:0x2e,_0x97739e:0x3d,_0x58c09c:0x22,_0x233de8:0x2d,_0x1ee485:0x34,_0x5529e2:0x35,_0x43f387:0x1d,_0x53d9ac:0x2c,_0x1de6ca:0x2d,_0x2bf71b:0x25,_0x369b3a:0x3c,_0x4551ae:0xaf,_0x4e9bb7:0xbb},_0x1aa0a8={_0x193321:0x4e},_0x1bc6f7={_0x1a573a:0xdc},{versions:_0x30477f,config:_0x311fd5}=yield getContext(PLATFORM_CONTEXT_KEY);function _0x50ca1c(_0x523101,_0x183680,_0x5b9a0d,_0x193105){return _0x1e30(_0x5b9a0d- -_0x1bc6f7._0x1a573a,_0x523101);}function _0x2d2c21(_0x53cc44,_0x1e4dac,_0x5877aa,_0x56082a){return _0x1e30(_0x5877aa- -_0x1aa0a8._0x193321,_0x1e4dac);}try{const {app:_0x370805,platform:_0x473dde,runtimes:_0x30e6f5}=yield _0x30477f();yield put(setProfileSoftwareVersion({'appName':_0x311fd5[_0x50ca1c(0x4b,_0x5cc21a._0x3e2859,_0x5cc21a._0x2f5bd2,_0x5cc21a._0x36dd35)],'appVersion':_0x370805[_0x50ca1c(_0x5cc21a._0x14d2de,0x28,0x22,_0x5cc21a._0x339be5)]+'.'+_0x370805[_0x50ca1c(_0x5cc21a._0x4d6f2c,_0x5cc21a._0x5e3745,_0x5cc21a._0x539e17,_0x5cc21a._0xd1cdf1)]+'.'+(_0x370805[_0x50ca1c(_0x5cc21a._0x97739e,_0x5cc21a._0x58c09c,_0x5cc21a._0x233de8,_0x5cc21a._0x1ee485)]||_0x50ca1c(_0x5cc21a._0x5529e2,_0x5cc21a._0x43f387,_0x5cc21a._0x53d9ac,0x3c)),'platformVersion':_0x473dde['fork']+'.'+_0x473dde['length']+'.'+(_0x473dde['key']||_0x50ca1c(_0x5cc21a._0x1de6ca,_0x5cc21a._0x2bf71b,_0x5cc21a._0x53d9ac,_0x5cc21a._0x369b3a)),'runtimes':_0x30e6f5}));}catch(_0x3c1583){yield taskErrorSaga(_0x2d2c21(0xb0,_0x5cc21a._0x4551ae,0xc1,_0x5cc21a._0x4e9bb7)+'twareSaga',_0x3c1583);}}function _0x1a07ef(_0x205d9f,_0x4ca0d8,_0x561359,_0x39aa55){const _0x4a20e2={_0x4b3394:0x1f3};return _0x1e30(_0x39aa55-_0x4a20e2._0x4b3394,_0x561359);}export function*profileSoftwareDependenciesSaga(){const _0x529c58={_0x1d013f:0x64,_0x3bfe36:0x73,_0x3e6314:0x61,_0xc71d79:0x87,_0x5c5017:0x5b,_0x5618a7:0x5f,_0x5ce6b2:0x77,_0x5978be:0x2,_0x5e0aaa:0x1e,_0x48d691:0x76,_0x179ae8:0x69,_0x273712:0x78},_0xe15830={_0x5cca16:0x17e},_0x472040={_0x346368:0x110};function _0x23cc62(_0x3df37b,_0x3c756c,_0x4e6787,_0x587943){return _0x1e30(_0x3c756c- -_0x472040._0x346368,_0x3df37b);}function _0x579590(_0x530993,_0x4ca6a5,_0x588e54,_0xc9c5f0){return _0x1e30(_0x4ca6a5- -_0xe15830._0x5cca16,_0xc9c5f0);}try{const _0x5521f1=yield select(getProfileSoftwareVersion);if(!_0x5521f1[_0x579590(-_0x529c58._0x1d013f,-_0x529c58._0x3bfe36,-_0x529c58._0x3e6314,-_0x529c58._0xc71d79)+'es']){const {versions:_0x13740d}=yield getContext(APP_CONTEXT_KEY),_0x54bfe0=yield _0x13740d(),{modules:_0x23aae2}=yield apiCall(getCoreBackend()['getVersion']);yield put(setProfileSoftwareDependencies({..._0x54bfe0,..._0x23aae2}));}}catch(_0x4f7208){yield taskErrorSaga(_0x579590(-_0x529c58._0x5c5017,-0x6f,-_0x529c58._0x5618a7,-_0x529c58._0x5ce6b2)+_0x23cc62(_0x529c58._0x5978be,0x10,_0x529c58._0x5978be,_0x529c58._0x5e0aaa)+_0x579590(-_0x529c58._0x48d691,-_0x529c58._0x179ae8,-_0x529c58._0x273712,-0x65),_0x4f7208);}}export function*sectionSetHandler({payload:_0x1e5eaf}){const _0x4bcd6e={_0x4ed399:0x157,_0x2550b7:0x16c,_0x3096f9:0xf8,_0x157f19:0x10a,_0x3af669:0xed,_0x1770e1:0xf7},_0x9e7ec={_0x189278:0x275},_0x56503f={_0x56ca0d:0x1fd};function _0x52b81b(_0x5c56be,_0x244956,_0x34f008,_0x445d5a){return _0x1e30(_0x445d5a- -_0x56503f._0x56ca0d,_0x244956);}function _0xc433b2(_0x141200,_0x2d35f4,_0x248e80,_0x26940e){return _0x1e30(_0x141200- -_0x9e7ec._0x189278,_0x248e80);}switch(_0x1e5eaf){case PROFILE_SECTIONS['WALLET']:{yield profileWalletSaga();break;}case PROFILE_SECTIONS[_0xc433b2(-0x16b,-_0x4bcd6e._0x4ed399,-_0x4bcd6e._0x2550b7,-0x169)+'ATUS']:{yield profileSoftwareDependenciesSaga();break;}case PROFILE_SECTIONS[_0x52b81b(-_0x4bcd6e._0x3096f9,-_0x4bcd6e._0x157f19,-_0x4bcd6e._0x3af669,-_0x4bcd6e._0x1770e1)]:{yield profileSoftwareSaga(),yield profileSoftwareDependenciesSaga();break;}default:{break;}}}export function*resetProfileSection(){const _0x1d337b={_0x421cae:0x1d4},{profile:_0x40ed3b}=yield select(getUIPanelState);function _0x21e4ed(_0x28f79c,_0x30984a,_0x504193,_0x832d0a){return _0x1e30(_0x832d0a- -_0x1d337b._0x421cae,_0x504193);}_0x40ed3b&&(yield put(setProfileCurrentSection(PROFILE_SECTIONS[_0x21e4ed(-0xc1,-0xb4,-0xc2,-0xbe)])));}function _0xf4d6bc(_0x422f77,_0x3ceadb,_0x50e160,_0x2267e4){const _0x548cd4={_0x33c772:0x305};return _0x1e30(_0x2267e4- -_0x548cd4._0x33c772,_0x3ceadb);}export function*profileSectionToggle(){yield resetProfileSection();}export const isUIToggleProfilePanel=_0x12e863=>toggleUIPanel[_0x1a07ef(0x30a,0x319,0x30b,0x310)](_0x12e863)&&_0x12e863[_0x1a07ef(0x30d,0x313,0x30d,0x306)]?.[_0x1a07ef(0x2e8,0x2eb,0x306,0x2fc)]===UI_PANEL[_0x1a07ef(0x2ed,0x2fc,0x2e1,0x2f4)];export function*userProfileSaga(){yield takeLatest(setProfileCurrentSection,sectionSetHandler),yield takeLatest(isUIToggleProfilePanel,profileSectionToggle);}