OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-deps / @holepunchto / keet-store / store / chat / reply-message / reply-message.reducer.js

1 lines · javascript ref:
(function(_0x1eb4d9,_0x23fd32){const _0x1b8ef3={_0x347382:0x1b1,_0x417498:0x1a2,_0x55f0fe:0x1b5,_0x2e2dae:0x1a5,_0x4ed56d:0xd,_0x308860:0xd,_0x5249f5:0xf,_0x4e6d5b:0x2c,_0x377861:0x36,_0x4c04e1:0x27,_0x3573d5:0x25,_0x4bab3a:0x3c,_0x457b3f:0x30,_0x2fe68d:0x34,_0x5d4075:0x24,_0x2d6e66:0x1b0,_0x848847:0x1b0,_0x2b02ec:0x1b9,_0x33869b:0x1a5,_0x4024bc:0x1ae,_0x3043ce:0x1a6,_0x46a38c:0x1a0,_0x192aea:0x2b},_0xc4cbc9={_0x50d9cd:0x73},_0x1db29a=_0x1eb4d9();function _0x314b3f(_0x45b940,_0x109afa,_0x2ee86e,_0x35c8a3){return _0x298e(_0x109afa- -0x16c,_0x45b940);}function _0x5ed6b3(_0x559c0f,_0x2c0d4d,_0x372e28,_0x27460d){return _0x298e(_0x559c0f-_0xc4cbc9._0x50d9cd,_0x2c0d4d);}while(!![]){try{const _0x4aee4f=parseInt(_0x5ed6b3(0x1ba,0x1b6,0x1c5,0x1b0))/(0xfd1+-0x9a5+-0x62b)*(parseInt(_0x5ed6b3(_0x1b8ef3._0x347382,_0x1b8ef3._0x417498,_0x1b8ef3._0x55f0fe,_0x1b8ef3._0x2e2dae))/(0x1*0x95b+-0xc73*-0x1+-0x15cc))+parseInt(_0x314b3f(-_0x1b8ef3._0x4ed56d,-0x1b,-0x1b,-_0x1b8ef3._0x308860))/(-0x1c09*0x1+-0x17b4+0x33c0)+-parseInt(_0x314b3f(-_0x1b8ef3._0x5249f5,-0x20,-_0x1b8ef3._0x4e6d5b,-0x2a))/(-0x5aa*-0x4+-0x13f9*-0x1+-0x2a9d)+-parseInt(_0x314b3f(-_0x1b8ef3._0x377861,-_0x1b8ef3._0x4c04e1,-_0x1b8ef3._0x377861,-_0x1b8ef3._0x3573d5))/(0x6*-0x5c5+0x1*0x208e+0xd*0x29)+parseInt(_0x314b3f(-_0x1b8ef3._0x4bab3a,-_0x1b8ef3._0x457b3f,-_0x1b8ef3._0x2fe68d,-_0x1b8ef3._0x5d4075))/(0x22b+0xaf*0x17+0x8ef*-0x2)+-parseInt(_0x5ed6b3(_0x1b8ef3._0x2d6e66,_0x1b8ef3._0x848847,_0x1b8ef3._0x2b02ec,_0x1b8ef3._0x33869b))/(0x252e*-0x1+0x21ee+-0x1*-0x347)*(-parseInt(_0x5ed6b3(_0x1b8ef3._0x4024bc,_0x1b8ef3._0x3043ce,_0x1b8ef3._0x46a38c,_0x1b8ef3._0x417498))/(0x11f1*-0x1+0x1a*0x147+-0xf3d))+-parseInt(_0x314b3f(-0x26,-_0x1b8ef3._0x192aea,-0x22,-_0x1b8ef3._0x2fe68d))/(-0x1684+-0x60a+0xd*0x233);if(_0x4aee4f===_0x23fd32)break;else _0x1db29a['push'](_0x1db29a['shift']());}catch(_0x2f6d0e){_0x1db29a['push'](_0x1db29a['shift']());}}}(_0x5017,-0x538f*0x2+-0xa0c3*0x4+-0x3193e*-0x5));function _0x5017(){const _0x34217b=['type','5579470BrCrNe','apply','6DQHVvW','chat/reply','ge-by-id','/clear-rep','sages','3989696LfxEkq','seq','ing-cmd','includes','(((.+)+)+)','3623985dhwJCm','ssage','groupedMes','messageId','toString','byId','replyTo','ing-messag','push','/set-messa','lying-mess','/set-reply','/ask-reply','8imEZLO','2274390cYIiZV','4068589HqvjxH','492678eGKgxb','replyingMe','search','6525495pehTOr','payload','constructo'];_0x5017=function(){return _0x34217b;};return _0x5017();}const _0x35e6b0=(function(){const _0x2215f9={_0x140a39:0x37e,_0x5de311:0x36c,_0x561cb0:0x364};let _0x4ef6e0=!![];return function(_0x1c3abf,_0x585355){const _0x25e882={_0x559527:0x226},_0x56806e=_0x4ef6e0?function(){function _0x453fe3(_0x2bba68,_0x3f6bf7,_0x37accc,_0x41fb02){return _0x298e(_0x3f6bf7-_0x25e882._0x559527,_0x41fb02);}if(_0x585355){const _0x1c4e60=_0x585355[_0x453fe3(_0x2215f9._0x140a39,_0x2215f9._0x5de311,_0x2215f9._0x561cb0,0x364)](_0x1c3abf,arguments);return _0x585355=null,_0x1c4e60;}}:function(){};return _0x4ef6e0=![],_0x56806e;};}()),_0xb16b1e=_0x35e6b0(this,function(){const _0x1a364e={_0x8d6758:0x223,_0x160274:0x233,_0x3fc57f:0x221,_0x509661:0x3f6,_0x1980a0:0x3ef,_0x52e36d:0x3f4,_0x5261b4:0x3f7,_0xc84d45:0x22d,_0x45ba5c:0x212,_0x5113de:0x22a,_0x3e1cae:0x3fb,_0x54adfe:0x3fb,_0x1196c4:0x401,_0x27c92e:0x40f},_0x25883b={_0xf9c888:0xde},_0x1eafe0={_0x19bd56:0x2b1};function _0x572659(_0x36e96a,_0x207ad1,_0x4e6916,_0x28fa70){return _0x298e(_0x4e6916-_0x1eafe0._0x19bd56,_0x36e96a);}function _0x1ed53c(_0x491436,_0x235b15,_0x5caec6,_0x59371f){return _0x298e(_0x5caec6-_0x25883b._0xf9c888,_0x235b15);}return _0xb16b1e['toString']()['search']('(((.+)+)+)'+'+$')[_0x1ed53c(0x229,_0x1a364e._0x8d6758,_0x1a364e._0x160274,_0x1a364e._0x3fc57f)]()[_0x572659(_0x1a364e._0x509661,_0x1a364e._0x1980a0,_0x1a364e._0x52e36d,_0x1a364e._0x5261b4)+'r'](_0xb16b1e)[_0x1ed53c(_0x1a364e._0xc84d45,_0x1a364e._0x45ba5c,0x21e,_0x1a364e._0x5113de)](_0x572659(_0x1a364e._0x3e1cae,_0x1a364e._0x54adfe,_0x1a364e._0x1196c4,_0x1a364e._0x27c92e)+'+$');});_0xb16b1e();import{createAction,createSelector}from'@reduxjs/toolkit';import{EMPTY_OBJ,isEmpty}from'../../lib/object';import{myMemberMuted}from'../../member';import{CHAT_STATE_KEY}from'../chat.constant';import{REPLY_MESSAGE_STATE_KEY}from'./reply-message.constant';import{EMPTY_ARRAY}from'../../lib/array';function _0x338153(_0x597f86,_0x4a93a7,_0x351c54,_0x706cf6){const _0x1f8f73={_0x46f7dd:0x6c};return _0x298e(_0x706cf6- -_0x1f8f73._0x46f7dd,_0x4a93a7);}import{getChatMessageById,getChatMessagesInView,getChatMessageState}from'../list-view';import{isSeqInRange}from'../chat.model';import{isMessageChanged,sendChatMessageSuccess}from'../message';export const askReplyingMessageCmd=createAction(_0x2d3424(0x472,0x468,0x47b,0x47d)+_0x338153(0xc4,0xd6,0xc7,0xce)+_0x338153(0xf1,0xe6,0xe0,0xe2));export const setReplyingMessage=createAction(_0x338153(0xdf,0xd1,0xcb,0xdc)+_0x2d3424(0x463,0x46a,0x473,0x469)+_0x338153(0xb7,0xb8,0xbe,0xc9)+'e');export const clearReplyingMessage=createAction(_0x338153(0xe2,0xce,0xd2,0xdc)+_0x338153(0xd7,0xcf,0xee,0xde)+_0x338153(0xd9,0xc5,0xca,0xcc)+'age');export const setReplyToMessage=createAction(_0x2d3424(0x472,0x464,0x46d,0x467)+_0x338153(0xd1,0xc3,0xbb,0xcb)+_0x2d3424(0x473,0x46e,0x464,0x477));export const REPLY_MESSAGE_INITIAL_STATE={'byId':EMPTY_OBJ,'replyingMessage':EMPTY_OBJ};export const replyMessageReducer=(_0x3d2d7d,_0x3f9002)=>{const _0x1c064f={_0x527252:0x30,_0x2d2309:0x27,_0x565146:0x23,_0x59d306:0x27,_0x5da5c7:0x31,_0x5e12d4:0x23,_0x147362:0x27b,_0x4fb332:0x279,_0x5d7649:0x33,_0x253aa6:0x2b,_0xbbe315:0x23,_0x26e75c:0x25a,_0x514d78:0x26e,_0x4f4dea:0x26b,_0x3ab93e:0x2e,_0x367979:0x30,_0xfa720e:0x28,_0x2400d4:0x13,_0x3aa10e:0x1f},_0x5c2ec7={_0x142e11:0x1d2,_0x5de202:0x178,_0xc407ef:0x193},_0x345869={_0x552fae:0x9a,_0x4b9b42:0x1c0};function _0xb05de4(_0x2c2e33,_0x527b6a,_0x498340,_0x6b8707){return _0x2d3424(_0x6b8707- -0x491,_0x527b6a-_0x345869._0x552fae,_0x498340-_0x345869._0x4b9b42,_0x527b6a);}function _0x2ae63f(_0x386b18,_0xa40038,_0x713fce,_0x289d6c){return _0x338153(_0x386b18-_0x5c2ec7._0x142e11,_0x386b18,_0x713fce-_0x5c2ec7._0x5de202,_0x289d6c-_0x5c2ec7._0xc407ef);}switch(_0x3f9002[_0xb05de4(-_0x1c064f._0x527252,-0x16,-_0x1c064f._0x2d2309,-_0x1c064f._0x565146)]){case setReplyingMessage[_0xb05de4(-0x21,-_0x1c064f._0x59d306,-_0x1c064f._0x5da5c7,-_0x1c064f._0x5e12d4)]:{const {messageId:_0x1002da,memberName:_0x20b3b1}=_0x3f9002[_0x2ae63f(_0x1c064f._0x147362,_0x1c064f._0x4fb332,_0x1c064f._0x4fb332,0x269)]||{};return{..._0x3d2d7d,'replyingMessage':{'messageId':_0x1002da,'memberName':_0x20b3b1}};}case setReplyToMessage[_0xb05de4(-0x20,-_0x1c064f._0x5d7649,-_0x1c064f._0x253aa6,-_0x1c064f._0xbbe315)]:{const {payload:_0x2b3134}=_0x3f9002,_0xe1146c=_0x3d2d7d['byId'][_0x2b3134['id']],_0x176346=_0xe1146c&&!isMessageChanged(_0x2b3134,_0xe1146c);if(_0x176346)return _0x3d2d7d;return{..._0x3d2d7d,'byId':{..._0x3d2d7d['byId'],[_0x2b3134['id']]:_0x2b3134}};}case myMemberMuted['type']:case sendChatMessageSuccess['type']:case clearReplyingMessage[_0x2ae63f(0x260,_0x1c064f._0x26e75c,_0x1c064f._0x514d78,_0x1c064f._0x4f4dea)]:{if(_0x3d2d7d[_0xb05de4(-0x1c,-_0x1c064f._0x3ab93e,-_0x1c064f._0x367979,-_0x1c064f._0xfa720e)+_0xb05de4(-_0x1c064f._0x2400d4,-_0x1c064f._0x3aa10e,-0x10,-0x15)]===EMPTY_OBJ)return _0x3d2d7d;return{..._0x3d2d7d,'replyingMessage':EMPTY_OBJ};}default:return _0x3d2d7d;}};export const getReplyMessageState=_0x464a13=>_0x464a13[CHAT_STATE_KEY][REPLY_MESSAGE_STATE_KEY];export const getReplyingMessage=_0x14e4ee=>getReplyMessageState(_0x14e4ee)[_0x338153(0xc3,0xd0,0xc3,0xd3)+_0x338153(0xe7,0xe3,0xed,0xe6)];export const getReplyingMessageId=_0x313304=>getReplyMessageState(_0x313304)[_0x2d3424(0x469,0x46c,0x474,0x45a)+_0x2d3424(0x47c,0x474,0x46d,0x479)]?.[_0x2d3424(0x47e,0x482,0x477,0x484)];function _0x2d3424(_0x3d3530,_0x5d4acf,_0x26b27d,_0x22e7d4){const _0xb8dc85={_0x2a7c56:0x32a};return _0x298e(_0x3d3530-_0xb8dc85._0x2a7c56,_0x22e7d4);}export const getChatReplyToMessages=_0x1cfb1f=>getReplyMessageState(_0x1cfb1f)[_0x2d3424(0x45d,0x44c,0x454,0x469)];export const getChatReplyToMessageById=(_0xdbdb3c,_0x3a14e1)=>getChatMessageById(_0xdbdb3c,_0x3a14e1)||getReplyMessageState(_0xdbdb3c)[_0x338153(0xc3,0xcf,0xc8,0xc7)][_0x3a14e1];export const getChatReplyPreLoad=createSelector(_0x5e41f5=>getChatMessageState(_0x5e41f5)[_0x2d3424(0x47d,0x48e,0x476,0x483)+_0x338153(0xe2,0xda,0xcf,0xdf)],_0x3669db=>{const _0x49eb42={_0x411bc4:0x1c0,_0x31e7f3:0x1be,_0x4559b1:0xe4,_0x352305:0xc7,_0x1ba835:0xd7,_0x15e2a0:0x1bc,_0x2da395:0x1c2,_0x4dd01a:0x1ba,_0x5ae07b:0x1c9,_0xc475b7:0x1be},_0x45f93e={_0x4192e5:0x61c,_0x17e1a0:0x15f,_0x18c70f:0x1c7},_0x59d391={_0x206c4e:0xf4,_0x21c03d:0xed,_0x1f8b32:0x1ba},_0xecb54a=[];for(const _0x57d826 of _0x3669db){_0x57d826?.[_0x19a269(-_0x49eb42._0x411bc4,-_0x49eb42._0x31e7f3,-0x1ca,-0x1c1)]&&!_0xecb54a[_0x43e70c(-_0x49eb42._0x4559b1,-_0x49eb42._0x352305,-_0x49eb42._0x1ba835,-0xe1)](_0x57d826['replyTo'])&&_0xecb54a[_0x19a269(-0x1c4,-_0x49eb42._0x15e2a0,-_0x49eb42._0x2da395,-_0x49eb42._0x4dd01a)](_0x57d826[_0x19a269(-_0x49eb42._0x5ae07b,-_0x49eb42._0xc475b7,-_0x49eb42._0x5ae07b,-0x1bc)]);}if(isEmpty(_0xecb54a))return EMPTY_ARRAY;function _0x43e70c(_0x21b7d0,_0x579432,_0x336085,_0x324cef){return _0x338153(_0x21b7d0-_0x59d391._0x206c4e,_0x324cef,_0x336085-_0x59d391._0x21c03d,_0x336085- -_0x59d391._0x1f8b32);}function _0x19a269(_0x10818a,_0x55f318,_0xd67e0d,_0x4bc39c){return _0x2d3424(_0x55f318- -_0x45f93e._0x4192e5,_0x55f318-_0x45f93e._0x17e1a0,_0xd67e0d-_0x45f93e._0x18c70f,_0x4bc39c);}return _0xecb54a;});function _0x298e(_0x4a21cb,_0x55134e){const _0x476f4c=_0x5017();return _0x298e=function(_0xfde32f,_0x56afd1){_0xfde32f=_0xfde32f-(-0xabd*0x1+-0xd63*-0x1+-0x173);let _0x5bef5d=_0x476f4c[_0xfde32f];return _0x5bef5d;},_0x298e(_0x4a21cb,_0x55134e);}export const getChatReplyToInView=createSelector(_0x3352ca=>getChatMessageState(_0x3352ca)[_0x338153(0xdc,0xf8,0xe6,0xe7)+_0x338153(0xd3,0xe6,0xd3,0xdf)],getChatMessagesInView,(_0x450f53,_0x50ca9e)=>{const _0x131361={_0x3fa3d4:0x277,_0x5724d1:0x27c,_0x4db9b3:0x250,_0x304510:0x270,_0x37448e:0x24f,_0x1c27c0:0x26b,_0x4cb97d:0x25c,_0x477e83:0x207,_0xdbac08:0x1fe,_0x10383e:0x1fb,_0x3d2f3d:0x27f,_0x59d14c:0x281,_0x3bc6a2:0x264},_0x25051d={_0x4fb7e1:0x23,_0x551b1b:0x1dd},_0xa98040={_0x1c9da5:0x91,_0x2803aa:0x157,_0x23588b:0x2d1},_0x3bb915=[];function _0xfa4490(_0xba2068,_0x4a568a,_0xa2d434,_0x3fe3b0){return _0x338153(_0xba2068-_0xa98040._0x1c9da5,_0x3fe3b0,_0xa2d434-_0xa98040._0x2803aa,_0x4a568a- -_0xa98040._0x23588b);}function _0x471161(_0x1d2579,_0x5a7c4c,_0x4ceb6f,_0x5ba68c){return _0x338153(_0x1d2579-_0x25051d._0x4fb7e1,_0x1d2579,_0x4ceb6f-_0x25051d._0x551b1b,_0x5ba68c- -0x33f);}for(const _0xf8e6aa of _0x450f53){_0xf8e6aa?.[_0x471161(-_0x131361._0x3fa3d4,-_0x131361._0x5724d1,-0x273,-_0x131361._0x3fa3d4)]&&isSeqInRange(_0x50ca9e,_0xf8e6aa[_0x471161(-_0x131361._0x4db9b3,-0x25d,-_0x131361._0x304510,-0x25e)])&&!_0x3bb915[_0x471161(-0x26a,-_0x131361._0x37448e,-_0x131361._0x1c27c0,-_0x131361._0x4cb97d)](_0xf8e6aa[_0xfa4490(-_0x131361._0x477e83,-0x209,-_0x131361._0xdbac08,-_0x131361._0x10383e)])&&_0x3bb915[_0x471161(-_0x131361._0x3d2f3d,-_0x131361._0x59d14c,-_0x131361._0x3bc6a2,-0x275)](_0xf8e6aa['replyTo']);}if(isEmpty(_0x3bb915))return EMPTY_ARRAY;return _0x3bb915;});