(function(_0x5f32fd,_0x3cdf69){const _0x219f6e={_0x59b96a:0x20f,_0x2a75f9:0x20d,_0x4645d8:0x218,_0x2449f2:0x53,_0x49c4a4:0x45,_0x172f22:0x49,_0x1c453f:0x56,_0x5310dc:0x53,_0x301804:0x62,_0xfa3a57:0x50,_0x44d89e:0x49,_0x4a2617:0x5c,_0x15a463:0x63,_0x5d08f7:0x21d,_0x1914b9:0x21f,_0x4a75c9:0x22f,_0x5d0de3:0x22d,_0x3fc670:0x207,_0x5c6387:0x20c,_0x2806af:0x202,_0x2e0e3e:0x215,_0x300e7d:0x4a,_0x2d5231:0x4f,_0x5cf89a:0x3f},_0x462bbd={_0x4cf17b:0x1f7},_0x55eba0={_0x582fb7:0x3cc};function _0x14cbb7(_0x4cab4b,_0x170bf9,_0x2f3cae,_0x1f5c99){return _0x1ee5(_0x1f5c99- -_0x55eba0._0x582fb7,_0x4cab4b);}function _0x39bed1(_0x103eb1,_0x38f7ea,_0x4638cd,_0x127099){return _0x1ee5(_0x4638cd- -_0x462bbd._0x4cf17b,_0x38f7ea);}const _0x4d92dd=_0x5f32fd();while(!![]){try{const _0x1a6163=parseInt(_0x14cbb7(-_0x219f6e._0x59b96a,-_0x219f6e._0x2a75f9,-_0x219f6e._0x4645d8,-0x21c))/(0x8eb+-0x190*0xb+0x2*0x423)+-parseInt(_0x39bed1(-_0x219f6e._0x2449f2,-_0x219f6e._0x49c4a4,-0x56,-0x58))/(-0x2704+0xb7e*-0x2+0x1f01*0x2)+-parseInt(_0x39bed1(-_0x219f6e._0x172f22,-_0x219f6e._0x1c453f,-_0x219f6e._0x5310dc,-_0x219f6e._0x301804))/(-0xf*-0x24d+0xb6c+-0x2dec)+-parseInt(_0x39bed1(-_0x219f6e._0xfa3a57,-_0x219f6e._0x44d89e,-_0x219f6e._0x4a2617,-_0x219f6e._0x15a463))/(0x1f9e+0x1613+0x1*-0x35ad)*(-parseInt(_0x14cbb7(-0x218,-0x215,-0x227,-0x21a))/(-0x2467+0x1*0x1b27+0x153*0x7))+-parseInt(_0x14cbb7(-_0x219f6e._0x5d08f7,-_0x219f6e._0x1914b9,-_0x219f6e._0x4a75c9,-_0x219f6e._0x5d0de3))/(0x832+-0x1079+-0x1a9*-0x5)+parseInt(_0x14cbb7(-_0x219f6e._0x3fc670,-_0x219f6e._0x5c6387,-_0x219f6e._0x2806af,-_0x219f6e._0x2e0e3e))/(0x1b*-0xed+-0x577*0x3+0x296b*0x1)*(parseInt(_0x39bed1(-0x4a,-_0x219f6e._0x300e7d,-0x5a,-0x68))/(0x1*-0x203b+-0x111d+0x3160))+parseInt(_0x39bed1(-_0x219f6e._0x2d5231,-0x49,-_0x219f6e._0x5cf89a,-0x4a))/(0x160e+-0x80*-0xb+0x581*-0x5);if(_0x1a6163===_0x3cdf69)break;else _0x4d92dd['push'](_0x4d92dd['shift']());}catch(_0x51ffbf){_0x4d92dd['push'](_0x4d92dd['shift']());}}}(_0x541c,-0x163d7e+-0x122c2*0x6+0x28cbda));const _0x35b51a=(function(){const _0x124d99={_0x16b701:0x2e7,_0x2598bc:0x2e5,_0x202989:0x2d6};let _0x2bd7bc=!![];return function(_0x50980b,_0x33d358){const _0x58d6b2=_0x2bd7bc?function(){const _0x382bb6={_0x56d026:0x138};function _0x3e7a43(_0x5c6d33,_0x3454de,_0xc405ec,_0x358a2d){return _0x1ee5(_0x3454de-_0x382bb6._0x56d026,_0x5c6d33);}if(_0x33d358){const _0x504921=_0x33d358[_0x3e7a43(_0x124d99._0x16b701,0x2e2,_0x124d99._0x2598bc,_0x124d99._0x202989)](_0x50980b,arguments);return _0x33d358=null,_0x504921;}}:function(){};return _0x2bd7bc=![],_0x58d6b2;};}()),_0x39925e=_0x35b51a(this,function(){const _0x3983fa={_0x5458b0:0x1bd,_0x2f7c4d:0x1b9,_0x488554:0x1c1,_0x2949f3:0x1c9,_0x2b6fa5:0x1cc,_0x4ba10c:0x1b2,_0x1c7ee3:0x1ca,_0xc90998:0x1c0,_0x231dc6:0x4ef,_0x16ec8:0x4ed,_0x5a73d0:0x4f4,_0x311f6d:0x4fe,_0xa1c173:0x1a4,_0x441a4d:0x1b5,_0x26c467:0x1b9,_0x3ee43a:0x1d4,_0x3b620d:0x1c1,_0x39721a:0x1cb,_0x5e82fb:0x1b6},_0xdbbcba={_0xcc10e7:0xe},_0x5d8978={_0x536861:0x351};function _0x1a896b(_0x5670e2,_0x344fc9,_0x32089f,_0x3092ee){return _0x1ee5(_0x32089f-_0x5d8978._0x536861,_0x344fc9);}function _0x5479ba(_0x5a4464,_0x3b0bb6,_0x2a6059,_0x4be8f2){return _0x1ee5(_0x3b0bb6-_0xdbbcba._0xcc10e7,_0x4be8f2);}return _0x39925e[_0x5479ba(0x1bb,_0x3983fa._0x5458b0,0x1c6,_0x3983fa._0x2f7c4d)]()['search'](_0x5479ba(0x1b3,_0x3983fa._0x488554,_0x3983fa._0x2949f3,_0x3983fa._0x2b6fa5)+'+$')[_0x5479ba(_0x3983fa._0x4ba10c,0x1bd,_0x3983fa._0x1c7ee3,_0x3983fa._0xc90998)]()[_0x1a896b(_0x3983fa._0x231dc6,_0x3983fa._0x16ec8,_0x3983fa._0x5a73d0,_0x3983fa._0x311f6d)+'r'](_0x39925e)[_0x5479ba(_0x3983fa._0xa1c173,_0x3983fa._0x441a4d,0x1ac,_0x3983fa._0x26c467)](_0x5479ba(_0x3983fa._0x3ee43a,_0x3983fa._0x3b620d,_0x3983fa._0x39721a,_0x3983fa._0x5e82fb)+'+$');});_0x39925e();const REGISTER_ROUTES=require('./registration'),{isMemberActive,getMemberForDeviceKey}=require('./query');function _0x1ef310(_0x2cb7d0,_0x43f4eb,_0x3291ad,_0x4b0f1d){const _0x2d8e1f={_0x17552f:0xe};return _0x1ee5(_0x43f4eb-_0x2d8e1f._0x17552f,_0x4b0f1d);}const {reactionStats}=require('./stats'),{KeetContractError}=require('./errors');function _0x541c(){const _0x17e61e=['delete','apply','clock','timestamp','-by-messag','key','toString','236352bEVXRs','all','4334530AKhLMv','(((.+)+)+)','tions','stats','ve-reactio','406QsZVFS','10247616yWjWEl','ABORT','reaction','exports','@keet/thre','@keet/remo','add','ads','@keet/reac','4QpYnnr','status','50104SlBvMm','isMuted','1801158OVgaYf','chat','1168898YukASE','insert','constructo','2853018ElVJUX','e-id','get','search','@keet/chat'];_0x541c=function(){return _0x17e61e;};return _0x541c();}function _0x1ee5(_0x5138f1,_0x40140f){const _0x2887d2=_0x541c();return _0x1ee5=function(_0x1ec07b,_0x54c7dd){_0x1ec07b=_0x1ec07b-(0x4*0x486+0x1311*0x1+-0x238e);let _0x1e8cd3=_0x2887d2[_0x1ec07b];return _0x1e8cd3;},_0x1ee5(_0x5138f1,_0x40140f);}async function handleAddReaction({header:_0x994d5d,oplog:_0x26a872,reaction:_0x3c7bfc},{db:_0x33ad04,writer:_0x2a9496}){const _0x168313={_0x1de478:0x225,_0xcedd1:0x21d,_0x1adc7e:0x21a,_0x2d8166:0x21b,_0x3505ea:0x219,_0x2da347:0x21a,_0x1b26eb:0x21e,_0xf8f73c:0x224,_0x26714a:0x21f,_0x668ffb:0x93,_0x3d3e78:0xa6,_0x96f42c:0xa5,_0x23a919:0x20f,_0x3f2554:0xa4,_0x331f78:0xb8,_0x280c31:0xa2,_0x3004e:0x92,_0x1e8bc6:0x95,_0x1a195b:0xa7,_0x55a328:0x8c,_0x3cf5b4:0x9e,_0x15dcf1:0x97,_0x5a9975:0x9c,_0x35ba72:0xab,_0x332048:0xbd,_0x42f939:0xb1,_0x4dd01b:0x22d,_0x22bc67:0x227,_0x2ba3bd:0x23b,_0x52b862:0x221,_0x37ac12:0x222,_0x39aad4:0x218,_0x43fd1b:0x21b,_0x30d6ce:0x232,_0x4bee83:0x229,_0x7cdd5c:0x237,_0x2bcb6a:0x226,_0x390bc8:0x23a,_0x506075:0xa4,_0x1b763c:0x99,_0x4682a8:0x21f,_0x2fcb09:0x21e,_0x3633e7:0x216},_0xd46926={_0x534192:0x107},_0x17be08={_0x54b87a:0x74},[_0x258a64,_0x49b788,_0x4073f0]=await Promise[_0x1595e4(_0x168313._0x1de478,_0x168313._0xcedd1,0x213,0x21c)]([getMemberForDeviceKey(_0x33ad04,_0x2a9496[_0x1595e4(0x222,_0x168313._0x1adc7e,_0x168313._0x2d8166,_0x168313._0x3505ea)]),_0x33ad04[_0x1595e4(_0x168313._0x2da347,_0x168313._0x1b26eb,_0x168313._0xf8f73c,_0x168313._0x26714a)]('@keet/chat'+_0x5e4443(0xa6,_0x168313._0x668ffb,_0x168313._0x3d3e78,_0x168313._0x96f42c)+'e-id',{'oplog':_0x26a872}),_0x33ad04[_0x1595e4(0x21a,_0x168313._0x23a919,0x227,_0x168313._0x26714a)](_0x5e4443(0xa7,0xb3,0xb5,_0x168313._0x3f2554)+_0x5e4443(0xbf,0xad,0xb8,_0x168313._0x331f78),{'id':0x0})]);function _0x1595e4(_0x3cf1e6,_0x2aa150,_0x5f55da,_0x1e79d0){return _0x1ee5(_0x3cf1e6-_0x17be08._0x54b87a,_0x5f55da);}if(!isMemberActive(_0x258a64)||!_0x49b788||_0x258a64[_0x5e4443(_0x168313._0x280c31,_0x168313._0x3004e,_0x168313._0x1e8bc6,_0x168313._0x1a195b)][_0x5e4443(_0x168313._0x55a328,_0x168313._0x3cf5b4,_0x168313._0x15dcf1,_0x168313._0x5a9975)]||!_0x3c7bfc)return;const _0x32590e=await _0x33ad04['get']('@keet/reac'+_0x5e4443(_0x168313._0x35ba72,_0x168313._0x332048,0xad,_0x168313._0x42f939),{'id':_0x49b788['id'],'sender':_0x258a64['key'],'reaction':_0x3c7bfc});if(_0x32590e)throw KeetContractError[_0x1595e4(_0x168313._0x4dd01b,_0x168313._0x22bc67,_0x168313._0x2ba3bd,_0x168313._0x52b862)]();function _0x5e4443(_0x28beb3,_0x553a7f,_0x279573,_0x1d81e5){return _0x1ee5(_0x279573- -_0xd46926._0x534192,_0x553a7f);}const _0x2262cb={'id':_0x49b788['id'],'sender':_0x258a64[_0x1595e4(_0x168313._0x37ac12,_0x168313._0x39aad4,_0x168313._0x43fd1b,_0x168313._0x30d6ce)],'clock':_0x4073f0[_0x1595e4(_0x168313._0x4bee83,_0x168313._0x7cdd5c,_0x168313._0x2bcb6a,_0x168313._0x390bc8)][_0x5e4443(0x9f,_0x168313._0x506075,_0x168313._0x1b763c,0x8f)][_0x1595e4(_0x168313._0x4682a8,0x222,_0x168313._0x2fcb09,_0x168313._0x30d6ce)],'reaction':_0x3c7bfc};await _0x33ad04[_0x1595e4(_0x168313._0x3633e7,0x229,_0x168313._0x2bcb6a,0x21a)]('@keet/reac'+'tions',_0x2262cb),await reactionStats(_0x33ad04,_0x4073f0,_0x2262cb,null,_0x994d5d['timestamp']);}async function handleRemoveReaction({header:_0x45cf63,oplog:_0x2dd807,reaction:_0x9a0f97},{db:_0x6d8be2,writer:_0x118b87}){const _0x394ccb={_0x1b42d2:0x159,_0x2242c9:0x15c,_0x3a5703:0x420,_0x33bd94:0x426,_0x1df5cf:0x41b,_0x2ee496:0x177,_0x5075d6:0x16d,_0x568a9f:0x15c,_0x2a5728:0x41a,_0x3a32f4:0x40f,_0x1bf3b5:0x41f,_0x5e7f9a:0x41e,_0x55d512:0x40d,_0x3dc418:0x165,_0x1b4704:0x155,_0x34eb1c:0x16c,_0x4a8785:0x431,_0x35ffba:0x42c,_0x46dcdd:0x421,_0x336860:0x16e,_0x607d1e:0x173,_0x1916cd:0x17c,_0x48e6bb:0x16c,_0x1815aa:0x179,_0x5e78ee:0x171,_0x92d44b:0x418,_0x41bf9f:0x41a,_0x153852:0x41f,_0x567149:0x148,_0x39979b:0x14a,_0x361179:0x138,_0x583695:0x417,_0x3d6f18:0x15c,_0x23a611:0x154,_0x11ed6f:0x15d,_0x2b3398:0x432,_0x53e973:0x42a,_0x4417c0:0x440,_0x2c29ea:0x14f,_0x34a695:0x156,_0x4ebc8:0x14b,_0x538048:0x167,_0x5826d0:0x14f},_0x4dbcd8={_0x4791cb:0x272},[_0x31ad06,_0x155141,_0x422ae6]=await Promise[_0x597b90(-0x146,-_0x394ccb._0x1b42d2,-_0x394ccb._0x2242c9,-0x157)]([getMemberForDeviceKey(_0x6d8be2,_0x118b87[_0x463693(_0x394ccb._0x3a5703,_0x394ccb._0x33bd94,_0x394ccb._0x1df5cf,0x40e)]),_0x6d8be2[_0x597b90(-_0x394ccb._0x2ee496,-0x164,-_0x394ccb._0x5075d6,-_0x394ccb._0x568a9f)](_0x463693(_0x394ccb._0x2a5728,_0x394ccb._0x3a32f4,_0x394ccb._0x1bf3b5,_0x394ccb._0x5e7f9a)+_0x463693(0x41f,0x428,_0x394ccb._0x55d512,0x412)+_0x597b90(-0x160,-_0x394ccb._0x3dc418,-_0x394ccb._0x1b4704,-_0x394ccb._0x34eb1c),{'oplog':_0x2dd807}),_0x6d8be2['get']('@keet/thre'+_0x463693(_0x394ccb._0x4a8785,_0x394ccb._0x35ffba,_0x394ccb._0x46dcdd,_0x394ccb._0x5e7f9a),{'id':0x0})]);function _0x597b90(_0x315e47,_0x43ecae,_0x109a27,_0x166e41){return _0x1ee5(_0x43ecae- -0x30a,_0x166e41);}if(!isMemberActive(_0x31ad06)||!_0x155141||_0x31ad06[_0x597b90(-0x166,-_0x394ccb._0x336860,-_0x394ccb._0x607d1e,-_0x394ccb._0x1916cd)][_0x597b90(-0x15b,-_0x394ccb._0x48e6bb,-_0x394ccb._0x1815aa,-_0x394ccb._0x5e78ee)])return;const _0x181ac3=await _0x6d8be2[_0x463693(_0x394ccb._0x92d44b,_0x394ccb._0x41bf9f,_0x394ccb._0x153852,_0x394ccb._0x55d512)](_0x597b90(-_0x394ccb._0x567149,-_0x394ccb._0x39979b,-0x159,-_0x394ccb._0x361179)+_0x463693(_0x394ccb._0x33bd94,_0x394ccb._0x4a8785,0x420,_0x394ccb._0x583695),{'id':_0x155141['id'],'sender':_0x31ad06[_0x597b90(-_0x394ccb._0x34eb1c,-_0x394ccb._0x3d6f18,-_0x394ccb._0x23a611,-_0x394ccb._0x11ed6f)],'reaction':_0x9a0f97});function _0x463693(_0x2056b8,_0x297e64,_0x45fe97,_0x33d33c){return _0x1ee5(_0x2056b8-_0x4dbcd8._0x4791cb,_0x297e64);}if(!_0x181ac3)throw KeetContractError['ABORT']();await _0x6d8be2[_0x463693(0x41b,_0x394ccb._0x583695,0x420,_0x394ccb._0x33bd94)](_0x463693(_0x394ccb._0x2b3398,0x42c,_0x394ccb._0x53e973,_0x394ccb._0x4417c0)+_0x597b90(-_0x394ccb._0x2c29ea,-_0x394ccb._0x34a695,-0x147,-_0x394ccb._0x4ebc8),_0x181ac3),await reactionStats(_0x6d8be2,_0x422ae6,null,_0x181ac3,_0x45cf63[_0x597b90(-_0x394ccb._0x11ed6f,-0x15e,-_0x394ccb._0x538048,-_0x394ccb._0x5826d0)]);}function registerRoutes(_0x178419){const _0x1f6f1e={_0x253640:0x44,_0x4cb4b7:0x51,_0x4173b4:0x2fb,_0x6bdf3a:0x2e8,_0x34e0ad:0x2d8,_0x2d0fc0:0x2f9,_0x46170b:0x2da,_0x27e5aa:0x2de},_0x557826={_0x4f23e5:0x12a};function _0x4cd6e7(_0x451815,_0x57464d,_0x2694d6,_0x244ee1){return _0x1ee5(_0x244ee1- -0x170,_0x451815);}function _0x233ead(_0x5387f4,_0x47c03d,_0x2f9a9b,_0x2bead2){return _0x1ee5(_0x47c03d-_0x557826._0x4f23e5,_0x5387f4);}_0x178419['add']('@keet/add-'+_0x4cd6e7(_0x1f6f1e._0x253640,0x4f,_0x1f6f1e._0x4cb4b7,0x4a),handleAddReaction),_0x178419[_0x233ead(_0x1f6f1e._0x4173b4,_0x1f6f1e._0x6bdf3a,_0x1f6f1e._0x34e0ad,0x2e5)](_0x233ead(_0x1f6f1e._0x2d0fc0,0x2e7,_0x1f6f1e._0x46170b,0x2fa)+_0x233ead(0x2d3,0x2e0,0x2e1,_0x1f6f1e._0x27e5aa)+'n',handleRemoveReaction);}module[_0x1ef310(0x1bb,0x1c9,0x1d1,0x1b7)]={[REGISTER_ROUTES]:registerRoutes};