Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / chatMessage / chatMessage.controller.js
index 0ee1db2..a801feb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70da=['fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','create','body','describe','accept','chat','readAt','format','UserId','user','agent','ChatInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','SELECT','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','attributes','intersection'];(function(_0x3fe2be,_0x24cfba){var _0x16b3ca=function(_0x266d1e){while(--_0x266d1e){_0x3fe2be['push'](_0x3fe2be['shift']());}};_0x16b3ca(++_0x24cfba);}(_0x70da,0xbd));var _0xa70d=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x70da[_0x1ccdf7];return _0x52a0ae;};'use strict';var emlformat=require(_0xa70d('0x0'));var rimraf=require(_0xa70d('0x1'));var zipdir=require(_0xa70d('0x2'));var jsonpatch=require(_0xa70d('0x3'));var rp=require(_0xa70d('0x4'));var moment=require(_0xa70d('0x5'));var BPromise=require(_0xa70d('0x6'));var Mustache=require(_0xa70d('0x7'));var util=require(_0xa70d('0x8'));var path=require(_0xa70d('0x9'));var sox=require(_0xa70d('0xa'));var csv=require(_0xa70d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa70d('0xc'));var squel=require('squel');var crypto=require(_0xa70d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa70d('0xe'));var Papa=require(_0xa70d('0xf'));var Redis=require(_0xa70d('0x10'));var authService=require(_0xa70d('0x11'));var qs=require(_0xa70d('0x12'));var as=require(_0xa70d('0x13'));var hardwareService=require(_0xa70d('0x14'));var logger=require(_0xa70d('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa70d('0x16'));var db=require('../../mysqldb')['db'];config[_0xa70d('0x17')]=_[_0xa70d('0x18')](config['redis'],{'host':_0xa70d('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa70d('0x17')]));require(_0xa70d('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xa70d('0x1b')][_0xa70d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x470189,_0x13d625,_0x2f7aca,_0x105af1){return new BPromise(function(_0xa7e32,_0x3e4350){var _0x6b0177=_0x105af1||client;return _0x6b0177[_0xa70d('0x1d')](_0x470189,_0x2f7aca)[_0xa70d('0x1e')](function(_0x34ac4b){logger[_0xa70d('0x1f')](_0xa70d('0x20'),_0x13d625,_0xa70d('0x21'));logger['debug'](_0xa70d('0x22'),_0x13d625,_0xa70d('0x21'),JSON[_0xa70d('0x23')](_0x34ac4b));if(_0x34ac4b[_0xa70d('0x24')]){if(_0x34ac4b['error'][_0xa70d('0x25')]===0x1f4){logger[_0xa70d('0x24')](_0xa70d('0x20'),_0x13d625,_0x34ac4b['error']['message']);return _0x3e4350(_0x34ac4b['error'][_0xa70d('0x26')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x13d625,_0x34ac4b['error'][_0xa70d('0x26')]);return _0xa7e32(_0x34ac4b[_0xa70d('0x24')][_0xa70d('0x26')]);}else{logger[_0xa70d('0x1f')](_0xa70d('0x20'),_0x13d625,_0xa70d('0x21'));_0xa7e32(_0x34ac4b['result'][_0xa70d('0x26')]);}})[_0xa70d('0x27')](function(_0x527420){logger[_0xa70d('0x24')]('ChatMessage,\x20%s,\x20%s',_0x13d625,_0x527420);_0x3e4350(_0x527420);});});}function respondWithStatusCode(_0xd90429,_0x1e27e9){_0x1e27e9=_0x1e27e9||0xcc;return function(_0x519872){if(_0x519872){return _0xd90429[_0xa70d('0x28')](_0x1e27e9);}return _0xd90429[_0xa70d('0x29')](_0x1e27e9)[_0xa70d('0x2a')]();};}function respondWithResult(_0x249a77,_0x486109){_0x486109=_0x486109||0xc8;return function(_0x2528df){if(_0x2528df){return _0x249a77[_0xa70d('0x29')](_0x486109)[_0xa70d('0x2b')](_0x2528df);}};}function respondWithFilteredResult(_0x377a97,_0x4bd4c3){return function(_0x4e4730){if(_0x4e4730){var _0x27d249=typeof _0x4bd4c3[_0xa70d('0x2c')]===_0xa70d('0x2d')&&typeof _0x4bd4c3['limit']===_0xa70d('0x2d');var _0x1dd3c8=_0x4e4730['count'];var _0x2a879d=_0x27d249?0x0:_0x4bd4c3['offset'];var _0x37ed86=_0x27d249?_0x4e4730[_0xa70d('0x2e')]:_0x4bd4c3[_0xa70d('0x2c')]+_0x4bd4c3[_0xa70d('0x2f')];var _0x186599;if(_0x37ed86>=_0x1dd3c8){_0x37ed86=_0x1dd3c8;_0x186599=0xc8;}else{_0x186599=0xce;}_0x377a97['status'](_0x186599);return _0x377a97[_0xa70d('0x30')](_0xa70d('0x31'),_0x2a879d+'-'+_0x37ed86+'/'+_0x1dd3c8)[_0xa70d('0x2b')](_0x4e4730);}return null;};}function patchUpdates(_0x144afc){return function(_0x213466){try{jsonpatch['apply'](_0x213466,_0x144afc,!![]);}catch(_0x3c99ab){return BPromise[_0xa70d('0x32')](_0x3c99ab);}return _0x213466[_0xa70d('0x33')]();};}function saveUpdates(_0x24d991,_0x30cf73){return function(_0x478271){if(_0x478271){return _0x478271[_0xa70d('0x34')](_0x24d991)[_0xa70d('0x1e')](function(_0x3531aa){return _0x3531aa;});}return null;};}function removeEntity(_0x32098c,_0x39943b){return function(_0x34bf78){if(_0x34bf78){return _0x34bf78[_0xa70d('0x35')]()[_0xa70d('0x1e')](function(){_0x32098c[_0xa70d('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27b824,_0x1644bc){return function(_0x401456){if(!_0x401456){_0x27b824['sendStatus'](0x194);}return _0x401456;};}function handleError(_0x4ea2a1,_0x59a3e9){_0x59a3e9=_0x59a3e9||0x1f4;return function(_0xc717a3){logger[_0xa70d('0x24')](_0xc717a3[_0xa70d('0x36')]);if(_0xc717a3[_0xa70d('0x37')]){delete _0xc717a3[_0xa70d('0x37')];}_0x4ea2a1[_0xa70d('0x29')](_0x59a3e9)[_0xa70d('0x38')](_0xc717a3);};}exports[_0xa70d('0x39')]=function(_0x44a66a,_0x3c566f){var _0x404183={},_0x24e3d2={},_0x2e3025={'count':0x0,'rows':[]};var _0x49873b=_[_0xa70d('0x3a')](db[_0xa70d('0x3b')]['rawAttributes'],function(_0x4cf9cd){return{'name':_0x4cf9cd[_0xa70d('0x3c')],'type':_0x4cf9cd[_0xa70d('0x3d')][_0xa70d('0x3e')]};});_0x24e3d2[_0xa70d('0x3f')]=_[_0xa70d('0x3a')](_0x49873b,'name');_0x24e3d2[_0xa70d('0x40')]=_[_0xa70d('0x41')](_0x44a66a[_0xa70d('0x40')]);_0x24e3d2[_0xa70d('0x42')]=_['intersection'](_0x24e3d2[_0xa70d('0x3f')],_0x24e3d2[_0xa70d('0x40')]);_0x404183[_0xa70d('0x43')]=_[_0xa70d('0x44')](_0x24e3d2['model'],qs[_0xa70d('0x45')](_0x44a66a[_0xa70d('0x40')]['fields']));_0x404183[_0xa70d('0x43')]=_0x404183[_0xa70d('0x43')][_0xa70d('0x46')]?_0x404183['attributes']:_0x24e3d2[_0xa70d('0x3f')];if(!_0x44a66a[_0xa70d('0x40')][_0xa70d('0x47')](_0xa70d('0x48'))){_0x404183['limit']=qs['limit'](_0x44a66a[_0xa70d('0x40')][_0xa70d('0x2f')]);_0x404183['offset']=qs[_0xa70d('0x2c')](_0x44a66a['query'][_0xa70d('0x2c')]);}_0x404183['order']=qs[_0xa70d('0x49')](_0x44a66a[_0xa70d('0x40')][_0xa70d('0x49')]);_0x404183[_0xa70d('0x4a')]=qs['filters'](_[_0xa70d('0x4b')](_0x44a66a[_0xa70d('0x40')],_0x24e3d2[_0xa70d('0x42')]),_0x49873b);if(_0x44a66a[_0xa70d('0x40')][_0xa70d('0x4c')]){_0x404183['where']=_['merge'](_0x404183[_0xa70d('0x4a')],{'$or':_[_0xa70d('0x3a')](_0x49873b,function(_0x4d6256){if(_0x4d6256[_0xa70d('0x3d')]!==_0xa70d('0x4d')){var _0x60826d={};_0x60826d[_0x4d6256['name']]={'$like':'%'+_0x44a66a[_0xa70d('0x40')][_0xa70d('0x4c')]+'%'};return _0x60826d;}})});}_0x404183=_['merge']({},_0x404183,_0x44a66a['options']);var _0x3be967={'where':_0x404183['where']};return db[_0xa70d('0x3b')]['count'](_0x3be967)[_0xa70d('0x1e')](function(_0x4d371b){_0x2e3025[_0xa70d('0x2e')]=_0x4d371b;if(_0x44a66a[_0xa70d('0x40')][_0xa70d('0x4e')]){_0x404183[_0xa70d('0x4f')]=[{'all':!![]}];}return db[_0xa70d('0x3b')][_0xa70d('0x50')](_0x404183);})[_0xa70d('0x1e')](function(_0x608bf4){_0x2e3025[_0xa70d('0x51')]=_0x608bf4;return _0x2e3025;})[_0xa70d('0x1e')](respondWithFilteredResult(_0x3c566f,_0x404183))['catch'](handleError(_0x3c566f,null));};exports[_0xa70d('0x52')]=function(_0x4ee349,_0x461031){var _0x1ac7dd={'raw':!![],'where':{'id':_0x4ee349[_0xa70d('0x53')]['id']}},_0x2734a2={};_0x2734a2['model']=_[_0xa70d('0x41')](db[_0xa70d('0x3b')][_0xa70d('0x54')]);_0x2734a2[_0xa70d('0x40')]=_['keys'](_0x4ee349['query']);_0x2734a2[_0xa70d('0x42')]=_[_0xa70d('0x44')](_0x2734a2[_0xa70d('0x3f')],_0x2734a2[_0xa70d('0x40')]);_0x1ac7dd[_0xa70d('0x43')]=_[_0xa70d('0x44')](_0x2734a2[_0xa70d('0x3f')],qs['fields'](_0x4ee349[_0xa70d('0x40')][_0xa70d('0x45')]));_0x1ac7dd[_0xa70d('0x43')]=_0x1ac7dd[_0xa70d('0x43')][_0xa70d('0x46')]?_0x1ac7dd[_0xa70d('0x43')]:_0x2734a2[_0xa70d('0x3f')];if(_0x4ee349['query']['includeAll']){_0x1ac7dd[_0xa70d('0x4f')]=[{'all':!![]}];}_0x1ac7dd=_[_0xa70d('0x55')]({},_0x1ac7dd,_0x4ee349['options']);return db['ChatMessage'][_0xa70d('0x56')](_0x1ac7dd)[_0xa70d('0x1e')](handleEntityNotFound(_0x461031,null))[_0xa70d('0x1e')](respondWithResult(_0x461031,null))['catch'](handleError(_0x461031,null));};exports[_0xa70d('0x57')]=function(_0x5040f9,_0xbdeaa3){return db[_0xa70d('0x3b')][_0xa70d('0x57')](_0x5040f9[_0xa70d('0x58')],{})['then'](respondWithResult(_0xbdeaa3,0xc9))[_0xa70d('0x27')](handleError(_0xbdeaa3,null));};exports[_0xa70d('0x34')]=function(_0x4d2f75,_0x5c5c7e){if(_0x4d2f75[_0xa70d('0x58')]['id']){delete _0x4d2f75['body']['id'];}return db[_0xa70d('0x3b')]['find']({'where':{'id':_0x4d2f75['params']['id']}})[_0xa70d('0x1e')](handleEntityNotFound(_0x5c5c7e,null))[_0xa70d('0x1e')](saveUpdates(_0x4d2f75[_0xa70d('0x58')],null))[_0xa70d('0x1e')](respondWithResult(_0x5c5c7e,null))['catch'](handleError(_0x5c5c7e,null));};exports[_0xa70d('0x35')]=function(_0x4e8c68,_0x9661b6){return db[_0xa70d('0x3b')][_0xa70d('0x56')]({'where':{'id':_0x4e8c68[_0xa70d('0x53')]['id']}})[_0xa70d('0x1e')](handleEntityNotFound(_0x9661b6,null))[_0xa70d('0x1e')](removeEntity(_0x9661b6,null))[_0xa70d('0x27')](handleError(_0x9661b6,null));};exports[_0xa70d('0x59')]=function(_0x5a975c,_0x503728){return db['ChatMessage'][_0xa70d('0x59')]()['then'](respondWithResult(_0x503728,null))[_0xa70d('0x27')](handleError(_0x503728,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xa70d('0x5a')]=function(_0x136268,_0xb2de81,_0x447893){var _0x415dcd={'agent':{},'channel':_0xa70d('0x5b')};if(_0x136268[_0xa70d('0x58')]['id']){delete _0x136268[_0xa70d('0x58')]['id'];}_0x136268[_0xa70d('0x58')]['read']=!![];_0x136268[_0xa70d('0x58')][_0xa70d('0x5c')]=moment()[_0xa70d('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x136268[_0xa70d('0x58')]['UserId']=_0x136268[_0xa70d('0x58')][_0xa70d('0x5e')]||_0x136268[_0xa70d('0x5f')]['id'];_0x415dcd[_0xa70d('0x60')]['id']=_0x136268[_0xa70d('0x58')][_0xa70d('0x5e')];return db['ChatMessage']['find']({'where':{'id':_0x136268[_0xa70d('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xb2de81,null))[_0xa70d('0x1e')](saveUpdates(_0x136268[_0xa70d('0x58')],null))['then'](function(_0x11d682){if(_0x11d682){_0x415dcd[_0xa70d('0x26')]=_0x11d682['get']({'plain':!![]});return db[_0xa70d('0x61')][_0xa70d('0x56')]({'where':{'id':_0x11d682['ChatInteractionId']}});}return null;})[_0xa70d('0x1e')](handleEntityNotFound(_0xb2de81,null))[_0xa70d('0x1e')](function(_0x16daa4){if(_0x16daa4){return _0x16daa4[_0xa70d('0x34')]({'UserId':_0x136268['body'][_0xa70d('0x5e')],'read1stAt':_[_0xa70d('0x62')](_0x16daa4['read1stAt'])?moment()['format'](_0xa70d('0x63')):undefined});}return null;})[_0xa70d('0x1e')](function(_0x3eb141){if(_0x3eb141){_0x415dcd[_0xa70d('0x64')]=_0x3eb141['get']({'plain':!![]});interaction_log[_0xa70d('0x1f')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x136268[_0xa70d('0x5f')]['id'],_0x136268['user'][_0xa70d('0x37')],_0x136268['user'][_0xa70d('0x65')],_0x415dcd[_0xa70d('0x64')]['id'],_0x136268[_0xa70d('0x58')]?JSON[_0xa70d('0x23')](_0x136268[_0xa70d('0x58')]):_0xa70d('0x66'));return respondWithRpcPromise(_0xa70d('0x67'),_0xa70d('0x68'),_0x415dcd);}return null;})[_0xa70d('0x1e')](function(_0x2efe3c){var _0x271aae=_0xa70d('0x69')+_0x2efe3c[_0xa70d('0x26')][_0xa70d('0x6a')];return db['sequelize'][_0xa70d('0x40')](_0x271aae,{'type':db[_0xa70d('0x6b')][_0xa70d('0x6c')]['SELECT'],'raw':!![]})[_0xa70d('0x1e')](function(_0x5af10c){return _0x5af10c;});})[_0xa70d('0x1e')](function(_0x32a4c2){if(_0x32a4c2){_0x415dcd['message'][_0xa70d('0x6d')]=_0x32a4c2[0x0];if(!_0x136268[_0xa70d('0x58')][_0xa70d('0x5e')])return;return db[_0xa70d('0x6e')]['find']({'where':{'id':_0x136268[_0xa70d('0x58')][_0xa70d('0x5e')],'role':_0xa70d('0x60')},'attributes':['id',_0xa70d('0x37'),_0xa70d('0x6f'),'email',_0xa70d('0x70')],'raw':!![]});}return null;})[_0xa70d('0x1e')](function(_0x75b516){if(!_0x75b516)return null;_0x415dcd[_0xa70d('0x26')][_0xa70d('0x60')]=_0x75b516;return _0x415dcd;})['then'](function(_0x2af126){if(_0x2af126){if(_0x136268[_0xa70d('0x58')]['manual']){_0x415dcd[_0xa70d('0x26')][_0xa70d('0x71')]=util[_0xa70d('0x5d')](_0xa70d('0x72'),_0x136268[_0xa70d('0x5f')][_0xa70d('0x37')]);_0x415dcd[_0xa70d('0x26')]['channel']=_0x415dcd[_0xa70d('0x73')];_0x415dcd[_0xa70d('0x26')][_0xa70d('0x74')]=_0x415dcd[_0xa70d('0x73')];_0x415dcd['message'][_0xa70d('0x75')]='accept';return respondWithRpcPromise(_0xa70d('0x76'),_0xa70d('0x76'),{'event':_0xa70d('0x77'),'message':_[_0xa70d('0x55')](_0x415dcd[_0xa70d('0x26')],JSON[_0xa70d('0x78')](_0x415dcd[_0xa70d('0x64')]['formData']))},client9002)['then'](function(){return _0x415dcd;});}return _0x415dcd;}return null;})[_0xa70d('0x1e')](respondWithResult(_0xb2de81,null))[_0xa70d('0x27')](handleError(_0xb2de81,null));};var interaction_log=require(_0xa70d('0x15'))(_0xa70d('0x79'));exports['reject']=function(_0x27d416,_0x57f600,_0xfaa068){var _0x378a13={'agent':{},'channel':'chat'};if(_0x27d416[_0xa70d('0x58')]['id']){delete _0x27d416[_0xa70d('0x58')]['id'];}_0x27d416['body'][_0xa70d('0x5e')]=_0x27d416['body'][_0xa70d('0x5e')]||_0x27d416[_0xa70d('0x5f')]['id'];_0x378a13['agent']['id']=_0x27d416[_0xa70d('0x58')][_0xa70d('0x5e')];return db['ChatMessage'][_0xa70d('0x56')]({'where':{'id':_0x27d416[_0xa70d('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x57f600,null))[_0xa70d('0x1e')](function(_0x5ab017){if(_0x5ab017){_0x378a13[_0xa70d('0x26')]=_0x5ab017['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x5ab017[_0xa70d('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x57f600,null))[_0xa70d('0x1e')](function(_0x53a86a){if(_0x53a86a){_0x378a13['interaction']=_0x53a86a['get']({'plain':!![]});interaction_log[_0xa70d('0x1f')](_0xa70d('0x7b'),_0x27d416['user']['id'],_0x27d416[_0xa70d('0x5f')][_0xa70d('0x37')],_0x27d416[_0xa70d('0x5f')][_0xa70d('0x65')],_0x378a13[_0xa70d('0x64')]['id'],_0x27d416[_0xa70d('0x58')]?JSON[_0xa70d('0x23')](_0x27d416['body']):_0xa70d('0x66'));return respondWithRpcPromise(_0xa70d('0x7c'),_0xa70d('0x7d'),_0x378a13);}return null;})['then'](function(_0x457e59){var _0x198840=_0xa70d('0x69')+_0x457e59[_0xa70d('0x26')][_0xa70d('0x6a')];return db[_0xa70d('0x7e')]['query'](_0x198840,{'type':db[_0xa70d('0x6b')][_0xa70d('0x6c')][_0xa70d('0x7f')],'raw':!![]})[_0xa70d('0x1e')](function(_0x12f349){return _0x12f349;});})[_0xa70d('0x1e')](function(_0x16d241){if(_0x16d241){_0x378a13[_0xa70d('0x26')][_0xa70d('0x6d')]=_0x16d241[0x0];if(!_0x27d416[_0xa70d('0x58')][_0xa70d('0x5e')])return;return db['User'][_0xa70d('0x56')]({'where':{'id':_0x27d416['body']['UserId'],'role':_0xa70d('0x60')},'attributes':['id',_0xa70d('0x37'),'fullname','email',_0xa70d('0x70')],'raw':!![]});}return null;})[_0xa70d('0x1e')](function(_0x24d80c){if(!_0x24d80c)return null;_0x378a13[_0xa70d('0x26')][_0xa70d('0x60')]=_0x24d80c;return _0x378a13;})['then'](function(_0x4b0e22){if(_0x4b0e22){_0x4b0e22[_0xa70d('0x26')][_0xa70d('0x71')]=util[_0xa70d('0x5d')](_0xa70d('0x72'),_0x27d416[_0xa70d('0x5f')][_0xa70d('0x37')]);_0x4b0e22[_0xa70d('0x26')][_0xa70d('0x73')]=_0x378a13[_0xa70d('0x73')];_0x4b0e22[_0xa70d('0x26')]['motionChannel']=_0x378a13[_0xa70d('0x73')];_0x4b0e22[_0xa70d('0x26')]['event']=_0xa70d('0x32');respondWithRpcPromise('EventManager',_0xa70d('0x76'),{'event':_0xa70d('0x80'),'message':_[_0xa70d('0x55')](_0x378a13[_0xa70d('0x26')],JSON[_0xa70d('0x78')](_0x378a13[_0xa70d('0x64')]['formData']))},client9002);return _0x378a13;}return null;})['then'](respondWithResult(_0x57f600,null))[_0xa70d('0x27')](handleError(_0x57f600,null));};
\ No newline at end of file
+var _0xd714=['sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','show','include','options','create','body','find','params','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','update','isNil','read1stAt','get','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','sequelize','QueryTypes','rejectmessage','formData','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatMessage.socket','jayson/promise','http','client','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','name','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xd714,0xc3));var _0x4d71=function(_0xed9fea,_0x5ed774){_0xed9fea=_0xed9fea-0x0;var _0x198f12=_0xd714[_0xed9fea];return _0x198f12;};'use strict';var emlformat=require(_0x4d71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d71('0x1'));var jsonpatch=require(_0x4d71('0x2'));var rp=require(_0x4d71('0x3'));var moment=require('moment');var BPromise=require(_0x4d71('0x4'));var Mustache=require(_0x4d71('0x5'));var util=require(_0x4d71('0x6'));var path=require(_0x4d71('0x7'));var sox=require(_0x4d71('0x8'));var csv=require(_0x4d71('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d71('0xa'));var _=require(_0x4d71('0xb'));var squel=require(_0x4d71('0xc'));var crypto=require(_0x4d71('0xd'));var jsforce=require(_0x4d71('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4d71('0xf'));var Papa=require('papaparse');var Redis=require(_0x4d71('0x10'));var authService=require(_0x4d71('0x11'));var qs=require(_0x4d71('0x12'));var as=require(_0x4d71('0x13'));var hardwareService=require(_0x4d71('0x14'));var logger=require(_0x4d71('0x15'))(_0x4d71('0x16'));var utils=require('../../config/utils');var config=require(_0x4d71('0x17'));var licenseUtil=require(_0x4d71('0x18'));var db=require(_0x4d71('0x19'))['db'];config['redis']=_[_0x4d71('0x1a')](config[_0x4d71('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d71('0x1c'))(new Redis(config[_0x4d71('0x1b')]));require(_0x4d71('0x1d'))['register'](socket);var jayson=require(_0x4d71('0x1e'));var client=jayson['client'][_0x4d71('0x1f')]({'port':0x232c});var client9002=jayson[_0x4d71('0x20')][_0x4d71('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x38bdf6,_0x222030,_0x2bc0ab,_0x3707f2){return new BPromise(function(_0x1aa80a,_0x47140b){var _0x28529a=_0x3707f2||client;return _0x28529a[_0x4d71('0x21')](_0x38bdf6,_0x2bc0ab)[_0x4d71('0x22')](function(_0x2349e8){logger['info'](_0x4d71('0x23'),_0x222030,_0x4d71('0x24'));logger[_0x4d71('0x25')](_0x4d71('0x26'),_0x222030,_0x4d71('0x24'),JSON[_0x4d71('0x27')](_0x2349e8));if(_0x2349e8[_0x4d71('0x28')]){if(_0x2349e8['error'][_0x4d71('0x29')]===0x1f4){logger['error'](_0x4d71('0x23'),_0x222030,_0x2349e8[_0x4d71('0x28')][_0x4d71('0x2a')]);return _0x47140b(_0x2349e8['error']['message']);}logger['error'](_0x4d71('0x23'),_0x222030,_0x2349e8[_0x4d71('0x28')][_0x4d71('0x2a')]);return _0x1aa80a(_0x2349e8['error'][_0x4d71('0x2a')]);}else{logger['info'](_0x4d71('0x23'),_0x222030,_0x4d71('0x24'));_0x1aa80a(_0x2349e8[_0x4d71('0x2b')]['message']);}})[_0x4d71('0x2c')](function(_0x23ae64){logger[_0x4d71('0x28')](_0x4d71('0x23'),_0x222030,_0x23ae64);_0x47140b(_0x23ae64);});});}function respondWithStatusCode(_0xf24421,_0x2b4c59){_0x2b4c59=_0x2b4c59||0xcc;return function(_0x4d5abb){if(_0x4d5abb){return _0xf24421[_0x4d71('0x2d')](_0x2b4c59);}return _0xf24421['status'](_0x2b4c59)[_0x4d71('0x2e')]();};}function respondWithResult(_0x156dac,_0x19aa09){_0x19aa09=_0x19aa09||0xc8;return function(_0x4cf177){if(_0x4cf177){return _0x156dac[_0x4d71('0x2f')](_0x19aa09)['json'](_0x4cf177);}};}function respondWithFilteredResult(_0xc5af41,_0x149632){return function(_0x34cd1e){if(_0x34cd1e){var _0x17f553=typeof _0x149632[_0x4d71('0x30')]===_0x4d71('0x31')&&typeof _0x149632['limit']===_0x4d71('0x31');var _0x2bae9b=_0x34cd1e['count'];var _0x473fd6=_0x17f553?0x0:_0x149632[_0x4d71('0x30')];var _0x5d28e3=_0x17f553?_0x34cd1e['count']:_0x149632['offset']+_0x149632[_0x4d71('0x32')];var _0x5a6298;if(_0x5d28e3>=_0x2bae9b){_0x5d28e3=_0x2bae9b;_0x5a6298=0xc8;}else{_0x5a6298=0xce;}_0xc5af41[_0x4d71('0x2f')](_0x5a6298);return _0xc5af41[_0x4d71('0x33')](_0x4d71('0x34'),_0x473fd6+'-'+_0x5d28e3+'/'+_0x2bae9b)['json'](_0x34cd1e);}return null;};}function patchUpdates(_0xe96cd5){return function(_0x2c4b89){try{jsonpatch[_0x4d71('0x35')](_0x2c4b89,_0xe96cd5,!![]);}catch(_0x37fec0){return BPromise[_0x4d71('0x36')](_0x37fec0);}return _0x2c4b89[_0x4d71('0x37')]();};}function saveUpdates(_0x4ae075,_0xdb8a9c){return function(_0x57dfbd){if(_0x57dfbd){return _0x57dfbd['update'](_0x4ae075)[_0x4d71('0x22')](function(_0x456611){return _0x456611;});}return null;};}function removeEntity(_0x161007,_0xf56683){return function(_0x261811){if(_0x261811){return _0x261811[_0x4d71('0x38')]()[_0x4d71('0x22')](function(){_0x161007['status'](0xcc)[_0x4d71('0x2e')]();});}};}function handleEntityNotFound(_0x5e3dcf,_0x48f99a){return function(_0x3e45d4){if(!_0x3e45d4){_0x5e3dcf[_0x4d71('0x2d')](0x194);}return _0x3e45d4;};}function handleError(_0x4b9b3c,_0x1a6786){_0x1a6786=_0x1a6786||0x1f4;return function(_0x4706ae){logger[_0x4d71('0x28')](_0x4706ae['stack']);if(_0x4706ae['name']){delete _0x4706ae[_0x4d71('0x39')];}_0x4b9b3c[_0x4d71('0x2f')](_0x1a6786)['send'](_0x4706ae);};}exports['index']=function(_0x51541f,_0x2b3226){var _0x247204={},_0x3ec5c5={},_0x53a3fd={'count':0x0,'rows':[]};var _0xd126c5=_[_0x4d71('0x3a')](db[_0x4d71('0x3b')][_0x4d71('0x3c')],function(_0x56e707){return{'name':_0x56e707[_0x4d71('0x3d')],'type':_0x56e707[_0x4d71('0x3e')][_0x4d71('0x3f')]};});_0x3ec5c5[_0x4d71('0x40')]=_[_0x4d71('0x3a')](_0xd126c5,'name');_0x3ec5c5[_0x4d71('0x41')]=_[_0x4d71('0x42')](_0x51541f[_0x4d71('0x41')]);_0x3ec5c5[_0x4d71('0x43')]=_[_0x4d71('0x44')](_0x3ec5c5['model'],_0x3ec5c5[_0x4d71('0x41')]);_0x247204[_0x4d71('0x45')]=_[_0x4d71('0x44')](_0x3ec5c5[_0x4d71('0x40')],qs[_0x4d71('0x46')](_0x51541f[_0x4d71('0x41')][_0x4d71('0x46')]));_0x247204[_0x4d71('0x45')]=_0x247204[_0x4d71('0x45')][_0x4d71('0x47')]?_0x247204['attributes']:_0x3ec5c5[_0x4d71('0x40')];if(!_0x51541f[_0x4d71('0x41')][_0x4d71('0x48')]('nolimit')){_0x247204['limit']=qs[_0x4d71('0x32')](_0x51541f['query'][_0x4d71('0x32')]);_0x247204[_0x4d71('0x30')]=qs['offset'](_0x51541f[_0x4d71('0x41')][_0x4d71('0x30')]);}_0x247204['order']=qs[_0x4d71('0x49')](_0x51541f[_0x4d71('0x41')][_0x4d71('0x49')]);_0x247204[_0x4d71('0x4a')]=qs[_0x4d71('0x43')](_[_0x4d71('0x4b')](_0x51541f[_0x4d71('0x41')],_0x3ec5c5['filters']),_0xd126c5);if(_0x51541f['query'][_0x4d71('0x4c')]){_0x247204[_0x4d71('0x4a')]=_[_0x4d71('0x4d')](_0x247204[_0x4d71('0x4a')],{'$or':_[_0x4d71('0x3a')](_0xd126c5,function(_0x34acf4){if(_0x34acf4[_0x4d71('0x3e')]!==_0x4d71('0x4e')){var _0x1e1b5f={};_0x1e1b5f[_0x34acf4['name']]={'$like':'%'+_0x51541f[_0x4d71('0x41')][_0x4d71('0x4c')]+'%'};return _0x1e1b5f;}})});}_0x247204=_['merge']({},_0x247204,_0x51541f['options']);var _0x8b07a3={'where':_0x247204[_0x4d71('0x4a')]};return db['ChatMessage'][_0x4d71('0x4f')](_0x8b07a3)[_0x4d71('0x22')](function(_0xeaacac){_0x53a3fd[_0x4d71('0x4f')]=_0xeaacac;if(_0x51541f[_0x4d71('0x41')][_0x4d71('0x50')]){_0x247204['include']=[{'all':!![]}];}return db[_0x4d71('0x3b')][_0x4d71('0x51')](_0x247204);})[_0x4d71('0x22')](function(_0x5218d3){_0x53a3fd[_0x4d71('0x52')]=_0x5218d3;return _0x53a3fd;})[_0x4d71('0x22')](respondWithFilteredResult(_0x2b3226,_0x247204))['catch'](handleError(_0x2b3226,null));};exports[_0x4d71('0x53')]=function(_0x2b2a6e,_0xbffe1e){var _0x540128={'raw':!![],'where':{'id':_0x2b2a6e['params']['id']}},_0x4b7bc3={};_0x4b7bc3[_0x4d71('0x40')]=_['keys'](db[_0x4d71('0x3b')]['rawAttributes']);_0x4b7bc3[_0x4d71('0x41')]=_[_0x4d71('0x42')](_0x2b2a6e[_0x4d71('0x41')]);_0x4b7bc3['filters']=_[_0x4d71('0x44')](_0x4b7bc3[_0x4d71('0x40')],_0x4b7bc3['query']);_0x540128['attributes']=_[_0x4d71('0x44')](_0x4b7bc3[_0x4d71('0x40')],qs[_0x4d71('0x46')](_0x2b2a6e['query']['fields']));_0x540128['attributes']=_0x540128[_0x4d71('0x45')][_0x4d71('0x47')]?_0x540128['attributes']:_0x4b7bc3[_0x4d71('0x40')];if(_0x2b2a6e['query'][_0x4d71('0x50')]){_0x540128[_0x4d71('0x54')]=[{'all':!![]}];}_0x540128=_[_0x4d71('0x4d')]({},_0x540128,_0x2b2a6e[_0x4d71('0x55')]);return db[_0x4d71('0x3b')]['find'](_0x540128)[_0x4d71('0x22')](handleEntityNotFound(_0xbffe1e,null))[_0x4d71('0x22')](respondWithResult(_0xbffe1e,null))['catch'](handleError(_0xbffe1e,null));};exports[_0x4d71('0x56')]=function(_0x2d81e1,_0x3103ed){return db[_0x4d71('0x3b')][_0x4d71('0x56')](_0x2d81e1[_0x4d71('0x57')],{})['then'](respondWithResult(_0x3103ed,0xc9))[_0x4d71('0x2c')](handleError(_0x3103ed,null));};exports['update']=function(_0x308b02,_0x1c3476){if(_0x308b02[_0x4d71('0x57')]['id']){delete _0x308b02[_0x4d71('0x57')]['id'];}return db[_0x4d71('0x3b')][_0x4d71('0x58')]({'where':{'id':_0x308b02[_0x4d71('0x59')]['id']}})[_0x4d71('0x22')](handleEntityNotFound(_0x1c3476,null))[_0x4d71('0x22')](saveUpdates(_0x308b02[_0x4d71('0x57')],null))[_0x4d71('0x22')](respondWithResult(_0x1c3476,null))[_0x4d71('0x2c')](handleError(_0x1c3476,null));};exports[_0x4d71('0x38')]=function(_0x30c451,_0xbe7d4b){return db[_0x4d71('0x3b')][_0x4d71('0x58')]({'where':{'id':_0x30c451[_0x4d71('0x59')]['id']}})[_0x4d71('0x22')](handleEntityNotFound(_0xbe7d4b,null))[_0x4d71('0x22')](removeEntity(_0xbe7d4b,null))[_0x4d71('0x2c')](handleError(_0xbe7d4b,null));};exports['describe']=function(_0x13e2b5,_0x130aba){return db['ChatMessage']['describe']()[_0x4d71('0x22')](respondWithResult(_0x130aba,null))[_0x4d71('0x2c')](handleError(_0x130aba,null));};var interaction_log=require(_0x4d71('0x15'))(_0x4d71('0x5a'));exports[_0x4d71('0x5b')]=function(_0x4058cc,_0x163798,_0x5a01ad){var _0xc5c458={'agent':{},'channel':_0x4d71('0x5c')};if(_0x4058cc['body']['id']){delete _0x4058cc[_0x4d71('0x57')]['id'];}_0x4058cc[_0x4d71('0x57')][_0x4d71('0x5d')]=!![];_0x4058cc[_0x4d71('0x57')][_0x4d71('0x5e')]=moment()[_0x4d71('0x5f')](_0x4d71('0x60'));_0x4058cc[_0x4d71('0x57')][_0x4d71('0x61')]=_0x4058cc[_0x4d71('0x57')][_0x4d71('0x61')]||_0x4058cc[_0x4d71('0x62')]['id'];_0xc5c458[_0x4d71('0x63')]['id']=_0x4058cc[_0x4d71('0x57')][_0x4d71('0x61')];return db[_0x4d71('0x3b')][_0x4d71('0x58')]({'where':{'id':_0x4058cc[_0x4d71('0x59')]['id'],'UserId':null}})[_0x4d71('0x22')](handleEntityNotFound(_0x163798,null))['then'](saveUpdates(_0x4058cc[_0x4d71('0x57')],null))[_0x4d71('0x22')](function(_0x41eac8){if(_0x41eac8){_0xc5c458['message']=_0x41eac8['get']({'plain':!![]});return db['ChatInteraction'][_0x4d71('0x58')]({'where':{'id':_0x41eac8['ChatInteractionId']}});}return null;})[_0x4d71('0x22')](handleEntityNotFound(_0x163798,null))['then'](function(_0x1875aa){if(_0x1875aa){return _0x1875aa[_0x4d71('0x64')]({'UserId':_0x4058cc[_0x4d71('0x57')][_0x4d71('0x61')],'read1stAt':_[_0x4d71('0x65')](_0x1875aa[_0x4d71('0x66')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4d71('0x22')](function(_0x387451){if(_0x387451){_0xc5c458['interaction']=_0x387451[_0x4d71('0x67')]({'plain':!![]});interaction_log[_0x4d71('0x68')](_0x4d71('0x69'),_0x4058cc[_0x4d71('0x62')]['id'],_0x4058cc[_0x4d71('0x62')][_0x4d71('0x39')],_0x4058cc['user'][_0x4d71('0x6a')],_0xc5c458[_0x4d71('0x6b')]['id'],_0x4058cc[_0x4d71('0x57')]?JSON[_0x4d71('0x27')](_0x4058cc[_0x4d71('0x57')]):_0x4d71('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x4d71('0x6d'),_0xc5c458);}return null;})[_0x4d71('0x22')](function(_0x4fd6e8){var _0x208b39=_0x4d71('0x6e')+_0x4fd6e8[_0x4d71('0x2a')][_0x4d71('0x6f')];return db['sequelize'][_0x4d71('0x41')](_0x208b39,{'type':db[_0x4d71('0x70')]['QueryTypes'][_0x4d71('0x71')],'raw':!![]})[_0x4d71('0x22')](function(_0x9a5e9){return _0x9a5e9;});})[_0x4d71('0x22')](function(_0xd4079f){if(_0xd4079f){_0xc5c458[_0x4d71('0x2a')][_0x4d71('0x72')]=_0xd4079f[0x0];if(!_0x4058cc['body']['UserId'])return;return db[_0x4d71('0x73')]['find']({'where':{'id':_0x4058cc[_0x4d71('0x57')][_0x4d71('0x61')],'role':_0x4d71('0x63')},'attributes':['id','name',_0x4d71('0x74'),_0x4d71('0x75'),_0x4d71('0x76')],'raw':!![]});}return null;})['then'](function(_0xb09eb0){if(!_0xb09eb0)return null;_0xc5c458[_0x4d71('0x2a')]['agent']=_0xb09eb0;return _0xc5c458;})['then'](function(_0x471a4f){if(_0x471a4f){if(_0x4058cc['body']['manual']){_0xc5c458[_0x4d71('0x2a')][_0x4d71('0x77')]=util['format'](_0x4d71('0x78'),_0x4058cc[_0x4d71('0x62')]['name']);_0xc5c458['message'][_0x4d71('0x79')]=_0xc5c458[_0x4d71('0x79')];_0xc5c458[_0x4d71('0x2a')][_0x4d71('0x7a')]=_0xc5c458[_0x4d71('0x79')];_0xc5c458[_0x4d71('0x2a')][_0x4d71('0x7b')]='accept';return respondWithRpcPromise(_0x4d71('0x7c'),_0x4d71('0x7c'),{'event':_0x4d71('0x7d'),'message':_[_0x4d71('0x4d')](_0xc5c458[_0x4d71('0x2a')],JSON[_0x4d71('0x7e')](_0xc5c458['interaction']['formData']))},client9002)['then'](function(){return _0xc5c458;});}return _0xc5c458;}return null;})[_0x4d71('0x22')](respondWithResult(_0x163798,null))[_0x4d71('0x2c')](handleError(_0x163798,null));};var interaction_log=require(_0x4d71('0x15'))(_0x4d71('0x5a'));exports[_0x4d71('0x36')]=function(_0x5d3f7b,_0x707c8e,_0x28e243){var _0xcf0ca5={'agent':{},'channel':_0x4d71('0x5c')};if(_0x5d3f7b[_0x4d71('0x57')]['id']){delete _0x5d3f7b[_0x4d71('0x57')]['id'];}_0x5d3f7b[_0x4d71('0x57')]['UserId']=_0x5d3f7b[_0x4d71('0x57')][_0x4d71('0x61')]||_0x5d3f7b[_0x4d71('0x62')]['id'];_0xcf0ca5[_0x4d71('0x63')]['id']=_0x5d3f7b['body'][_0x4d71('0x61')];return db['ChatMessage'][_0x4d71('0x58')]({'where':{'id':_0x5d3f7b[_0x4d71('0x59')]['id'],'UserId':null}})[_0x4d71('0x22')](handleEntityNotFound(_0x707c8e,null))[_0x4d71('0x22')](function(_0x20e41e){if(_0x20e41e){_0xcf0ca5['message']=_0x20e41e[_0x4d71('0x67')]({'plain':!![]});return db[_0x4d71('0x7f')][_0x4d71('0x58')]({'where':{'id':_0x20e41e[_0x4d71('0x80')]}});}return null;})[_0x4d71('0x22')](handleEntityNotFound(_0x707c8e,null))[_0x4d71('0x22')](function(_0x49df43){if(_0x49df43){_0xcf0ca5['interaction']=_0x49df43[_0x4d71('0x67')]({'plain':!![]});interaction_log['info'](_0x4d71('0x81'),_0x5d3f7b[_0x4d71('0x62')]['id'],_0x5d3f7b[_0x4d71('0x62')][_0x4d71('0x39')],_0x5d3f7b[_0x4d71('0x62')]['role'],_0xcf0ca5['interaction']['id'],_0x5d3f7b[_0x4d71('0x57')]?JSON[_0x4d71('0x27')](_0x5d3f7b[_0x4d71('0x57')]):_0x4d71('0x6c'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0xcf0ca5);}return null;})[_0x4d71('0x22')](function(_0x2a1bbb){var _0x119f92=_0x4d71('0x6e')+_0x2a1bbb[_0x4d71('0x2a')][_0x4d71('0x6f')];return db[_0x4d71('0x82')][_0x4d71('0x41')](_0x119f92,{'type':db[_0x4d71('0x70')][_0x4d71('0x83')][_0x4d71('0x71')],'raw':!![]})['then'](function(_0x26098c){return _0x26098c;});})['then'](function(_0x8c5d3){if(_0x8c5d3){_0xcf0ca5[_0x4d71('0x2a')][_0x4d71('0x72')]=_0x8c5d3[0x0];if(!_0x5d3f7b[_0x4d71('0x57')][_0x4d71('0x61')])return;return db[_0x4d71('0x73')]['find']({'where':{'id':_0x5d3f7b['body'][_0x4d71('0x61')],'role':_0x4d71('0x63')},'attributes':['id',_0x4d71('0x39'),_0x4d71('0x74'),'email',_0x4d71('0x76')],'raw':!![]});}return null;})[_0x4d71('0x22')](function(_0x1f33f6){if(!_0x1f33f6)return null;_0xcf0ca5[_0x4d71('0x2a')][_0x4d71('0x63')]=_0x1f33f6;return _0xcf0ca5;})[_0x4d71('0x22')](function(_0xd36461){if(_0xd36461){_0xd36461[_0x4d71('0x2a')][_0x4d71('0x77')]=util[_0x4d71('0x5f')](_0x4d71('0x78'),_0x5d3f7b[_0x4d71('0x62')][_0x4d71('0x39')]);_0xd36461['message'][_0x4d71('0x79')]=_0xcf0ca5[_0x4d71('0x79')];_0xd36461[_0x4d71('0x2a')][_0x4d71('0x7a')]=_0xcf0ca5[_0x4d71('0x79')];_0xd36461[_0x4d71('0x2a')]['event']='reject';respondWithRpcPromise(_0x4d71('0x7c'),_0x4d71('0x7c'),{'event':_0x4d71('0x84'),'message':_[_0x4d71('0x4d')](_0xcf0ca5['message'],JSON['parse'](_0xcf0ca5[_0x4d71('0x6b')][_0x4d71('0x85')]))},client9002);return _0xcf0ca5;}return null;})[_0x4d71('0x22')](respondWithResult(_0x707c8e,null))[_0x4d71('0x2c')](handleError(_0x707c8e,null));};
\ No newline at end of file