Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / components / realtime / agents.js
index aa5321e..ab02769 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7b3=['unknown','pause','*pause','getAgentStatus','isArray','startCase','Queue','map','getAgents','flatten','uniq','value','getAgentIdsByQueues','filter','busy','getAgentIdsByStatus','includes','User','name','faxPause','pauseType','find','merge','globalStatus','getSortedAgentsIdsByStatus','split','order','startsWith','getUpdatedSortOptions','fullname','internal','substring','indexOf','validateSortParameter','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatPause','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','routealias','omit','lodash','jayson/promise','../../mysqldb','client','http','mailPause','openchannelPause','smsPause','whatsappPause','every','length','ringing','voiceStatus','idle','voicePause','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','catch','getRealtimeAgents'];(function(_0x1106c3,_0x284014){var _0x439ff1=function(_0x4b5107){while(--_0x4b5107){_0x1106c3['push'](_0x1106c3['shift']());}};_0x439ff1(++_0x284014);}(_0xe7b3,0x9a));var _0x3e7b=function(_0x503928,_0x1e0d26){_0x503928=_0x503928-0x0;var _0x5af7b9=_0xe7b3[_0x503928];return _0x5af7b9;};'use strict';var _=require(_0x3e7b('0x0'));var jayson=require(_0x3e7b('0x1'));var db=require(_0x3e7b('0x2'))['db'];var amiClient=jayson[_0x3e7b('0x3')][_0x3e7b('0x4')]({'port':0x232a});var routingClient=jayson[_0x3e7b('0x3')][_0x3e7b('0x4')]({'port':0x232c});function isAgentPaused(_0x310218,_0x439ea6){var _0xfc205=[_0x310218['chatPause'],_0x310218['faxPause'],_0x310218[_0x3e7b('0x5')],_0x310218[_0x3e7b('0x6')],_0x310218[_0x3e7b('0x7')],_0x310218['voicePause'],_0x310218[_0x3e7b('0x8')]];if(!_0x439ea6)return _[_0x3e7b('0x9')](_0xfc205);var _0xcc8d60=_['filter'](_0xfc205);return _0xcc8d60[_0x3e7b('0xa')]>0x0&&_0xcc8d60[_0x3e7b('0xa')]<_0xfc205[_0x3e7b('0xa')]?!![]:![];}function isIdle(_0x19ab30){return _0x19ab30==='idle'||_0x19ab30==='unknown'||_0x19ab30==='unavailable'||_0x19ab30===_0x3e7b('0xb')||_['isNil'](_0x19ab30);}function isAgentIdle(_0x60a01a){if(_0x60a01a[_0x3e7b('0xc')]!==_0x3e7b('0xd')&&_0x60a01a[_0x3e7b('0xe')]){_0x60a01a['voiceStatus']='pause';return![];}return _[_0x3e7b('0x9')]([_0x60a01a['chatStatus'],_0x60a01a[_0x3e7b('0xf')],_0x60a01a[_0x3e7b('0x10')],_0x60a01a[_0x3e7b('0x11')],_0x60a01a['smsStatus'],_0x60a01a[_0x3e7b('0xc')],_0x60a01a[_0x3e7b('0x12')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x3e7b('0x13')](_0x3e7b('0x14'),{})[_0x3e7b('0x15')](function(_0x240541){if(_0x240541[_0x3e7b('0x16')]){throw new Error(_0x3e7b('0x17'));}var _0x4b4471=_0x240541['result'];return routingClient[_0x3e7b('0x13')](_0x3e7b('0x14'),{})[_0x3e7b('0x15')](function(_0x453414){if(_0x453414[_0x3e7b('0x16')]){throw new Error(_0x3e7b('0x18'));}var _0x5e6049=_0x453414[_0x3e7b('0x19')];return _['merge']({},_0x4b4471,_0x5e6049);});})[_0x3e7b('0x1a')](function(_0x14df64){throw _0x14df64;});}exports[_0x3e7b('0x1b')]=getRealtimeAgents;function getAgentStatus(_0x223235){var _0xb7e66c=_0x3e7b('0x1c');if(isAgentPaused(_0x223235))_0xb7e66c=_0x3e7b('0x1d');else if(isAgentPaused(_0x223235,!![]))_0xb7e66c=_0x3e7b('0x1e');else if(isAgentIdle(_0x223235))_0xb7e66c=_0x3e7b('0xd');else _0xb7e66c='busy';return _0xb7e66c;}exports[_0x3e7b('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x576c60,_0x5e15ef){var _0x5b0820=_[_0x3e7b('0x20')](_0x576c60)?_0x576c60:[_0x576c60];var _0x2726e3=_[_0x3e7b('0x21')](_0x5e15ef)+_0x3e7b('0x22');var _0x41ceab=_[_0x3e7b('0x23')](_0x5b0820,function(_0x23ceb0){return db[_0x2726e3]['findOne']({'where':{'id':_0x23ceb0}})['then'](function(_0x129569){if(!_0x129569)return[];return _0x129569[_0x3e7b('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x41ceab)[_0x3e7b('0x15')](function(_0xa24191){var _0x2f00af=_(_0xa24191)[_0x3e7b('0x25')]()['map']('id')[_0x3e7b('0x26')]()[_0x3e7b('0x27')]();return _0x2f00af;});}exports[_0x3e7b('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x109510,_0x1987f1,_0x443c00){try{if(_0x1987f1[_0x3e7b('0xa')]>0x0){_0x109510=_0x109510['filter'](function(_0x5df9c7){return _0x1987f1['includes'](_0x5df9c7['id']);});}var _0xd7ba02=_0x109510[_0x3e7b('0x29')](function(_0x7d504b){var _0x1a23b3=_0x3e7b('0x2a');if(isAgentIdle(_0x7d504b)){_0x1a23b3=_0x3e7b('0xd');}return _0x1a23b3===_0x443c00;});return _[_0x3e7b('0x23')](_0xd7ba02,'id');}catch(_0x106b0e){throw _0x106b0e;}}exports[_0x3e7b('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4ef442,_0x3956d2,_0x4e2fb6){return Promise['resolve']()[_0x3e7b('0x15')](function(){if(_0x3956d2[_0x3e7b('0xa')]>0x0){_0x4ef442=_0x4ef442[_0x3e7b('0x29')](function(_0xb8a2bd){return _0x3956d2[_0x3e7b('0x2c')](_0xb8a2bd['id']);});}return _0x4ef442;})[_0x3e7b('0x15')](function(){return db[_0x3e7b('0x2d')]['findAll']({'attributes':['id',_0x3e7b('0x2e'),'fullname','chatPause',_0x3e7b('0x2f'),_0x3e7b('0x5'),_0x3e7b('0x6'),_0x3e7b('0x7'),_0x3e7b('0xe'),_0x3e7b('0x8'),_0x3e7b('0x30')],'where':{'id':{'$in':_[_0x3e7b('0x23')](_0x4ef442,'id')}},'raw':!![]});})[_0x3e7b('0x15')](function(_0x2735a2){return _0x2735a2[_0x3e7b('0x23')](function(_0x65cb42){var _0x14daf1=_[_0x3e7b('0x31')](_0x4ef442,['id',_0x65cb42['id']]);var _0x1da0b7=filterAgentAttributes(_0x14daf1);_[_0x3e7b('0x32')](_0x65cb42,_0x1da0b7);_0x65cb42[_0x3e7b('0x33')]=getAgentStatus(_0x65cb42);return _0x65cb42;});})['then'](function(_0x56ed9c){var _0x5e3988=sortAgentsByStatus(_0x56ed9c,_0x4e2fb6);return _['map'](_0x5e3988,'id');})['catch'](function(_0x5ba823){throw _0x5ba823;});}exports[_0x3e7b('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x6975b3){var _0x2a901d={'fields':[],'order':null};var _0x54e116=_0x6975b3[_0x3e7b('0x35')](',');_0x2a901d['fields']=_[_0x3e7b('0x29')](_0x54e116,function(_0x2e0e48){if(!_0x2e0e48[_0x3e7b('0x2c')](_0x3e7b('0x33'))){return!![];}_0x2a901d[_0x3e7b('0x36')]=_[_0x3e7b('0x37')](_0x2e0e48,'-')?'DESC':'ASC';return![];});return _0x2a901d;}exports[_0x3e7b('0x38')]=getUpdatedSortOptions;function validateSortParameter(_0x4f3594){if(_0x4f3594[_0x3e7b('0x2c')](_0x3e7b('0x39'))&&!_0x4f3594['includes'](_0x3e7b('0x3a'))){var _0x2da930=_0x4f3594[_0x3e7b('0x3b')](0x0,_0x4f3594[_0x3e7b('0x3c')](_0x3e7b('0x39')));_0x4f3594+=','+_0x2da930+_0x3e7b('0x3a');}return _0x4f3594;}exports[_0x3e7b('0x3d')]=validateSortParameter;function sortAgentsByStatus(_0xb18385,_0x519c8b){var _0x1d058f=_0xb18385[_0x3e7b('0x3e')](function(_0x219254,_0x1930af){if(_0x219254['globalStatus']===_0x1930af['globalStatus']){if(_0x219254[_0x3e7b('0x33')]==='pause'){if(_0x519c8b===_0x3e7b('0x3f')){return(_0x219254[_0x3e7b('0x30')]||'')<(_0x1930af[_0x3e7b('0x30')]||'')||_0x219254[_0x3e7b('0x39')][_0x3e7b('0x40')]()>_0x1930af['fullname'][_0x3e7b('0x40')]()?0x1:-0x1;}else{return(_0x219254[_0x3e7b('0x30')]||'')<(_0x1930af[_0x3e7b('0x30')]||'')||_0x219254['fullname'][_0x3e7b('0x40')]()>_0x1930af['fullname'][_0x3e7b('0x40')]()?-0x1:0x1;}}else{if(_0x519c8b==='DESC'){return _0x219254[_0x3e7b('0x39')][_0x3e7b('0x40')]()<_0x1930af[_0x3e7b('0x39')]['toLowerCase']()?0x1:-0x1;}else{return _0x219254[_0x3e7b('0x39')][_0x3e7b('0x40')]()<_0x1930af['fullname']['toLowerCase']()?-0x1:0x1;}}}else{if(_0x519c8b===_0x3e7b('0x3f')){return _0x219254['globalStatus']<_0x1930af[_0x3e7b('0x33')]?0x1:-0x1;}else{return _0x219254[_0x3e7b('0x33')]<_0x1930af[_0x3e7b('0x33')]?-0x1:0x1;}}});return _0x1d058f;}exports[_0x3e7b('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0x449c76){var _0x462f1d=[_0x3e7b('0x42'),_0x3e7b('0x43'),_0x3e7b('0x44'),_0x3e7b('0x45'),_0x3e7b('0x30'),_0x3e7b('0x45'),'internal',_0x3e7b('0x46'),_0x3e7b('0x47'),_0x3e7b('0x6'),_0x3e7b('0x5'),_0x3e7b('0x7'),_0x3e7b('0x8'),_0x3e7b('0x2f'),_0x3e7b('0xe'),'chatCapacity','openchannelCapacity',_0x3e7b('0x48'),_0x3e7b('0x49'),_0x3e7b('0x4a'),_0x3e7b('0x4b'),'chatCurrentCapacity',_0x3e7b('0x4c'),_0x3e7b('0x4d'),_0x3e7b('0x4e'),_0x3e7b('0x4f'),_0x3e7b('0x50'),'chatStatus',_0x3e7b('0x11'),'mailStatus','smsStatus','whatsappStatus',_0x3e7b('0xf'),_0x3e7b('0xc'),'chatStatusTime',_0x3e7b('0x51'),_0x3e7b('0x52'),_0x3e7b('0x53'),_0x3e7b('0x54'),_0x3e7b('0x55'),_0x3e7b('0x56'),'queue',_0x3e7b('0x57'),'screenrecording',_0x3e7b('0x58'),'phoneBarEnableAutomaticScreenRecording',_0x3e7b('0x59')];var _0x5a71aa=[_0x3e7b('0x47'),_0x3e7b('0x6'),'mailPause','smsPause',_0x3e7b('0x8'),_0x3e7b('0x2f'),_0x3e7b('0xe'),'online'];var _0x54149f=_(_0x449c76)[_0x3e7b('0x5a')](_0x5a71aa)['pick'](_0x462f1d)['value']();return _0x54149f;}exports['filterAgentAttributes']=filterAgentAttributes;
\ No newline at end of file
+var _0xea7d=['openchannelPause','whatsappPause','pauseType','find','merge','getSortedAgentsIdsByStatus','split','globalStatus','order','startsWith','DESC','ASC','getUpdatedSortOptions','includes','internal','substring','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','filterAgentAttributes','lodash','../../mysqldb','client','chatPause','faxPause','smsPause','voicePause','every','filter','length','idle','unknown','unavailable','ringing','voiceStatus','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','catch','getRealtimeAgents','pause','*pause','busy','getAgentStatus','startCase','map','getAgents','all','flatten','value','getAgentIdsByQueues','getAgentIdsByStatus','User','findAll','name','fullname','mailPause'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0xea7d,0x88));var _0xdea7=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0xea7d[_0x553a87];return _0x12d1e6;};'use strict';var _=require(_0xdea7('0x0'));var jayson=require('jayson/promise');var db=require(_0xdea7('0x1'))['db'];var amiClient=jayson[_0xdea7('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0xdea7('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x44f735,_0x45ce06){var _0x17451c=[_0x44f735[_0xdea7('0x3')],_0x44f735[_0xdea7('0x4')],_0x44f735['mailPause'],_0x44f735['openchannelPause'],_0x44f735[_0xdea7('0x5')],_0x44f735[_0xdea7('0x6')],_0x44f735['whatsappPause']];if(!_0x45ce06)return _[_0xdea7('0x7')](_0x17451c);var _0x3734aa=_[_0xdea7('0x8')](_0x17451c);return _0x3734aa[_0xdea7('0x9')]>0x0&&_0x3734aa[_0xdea7('0x9')]<_0x17451c['length']?!![]:![];}function isIdle(_0xdd7a10){return _0xdd7a10===_0xdea7('0xa')||_0xdd7a10===_0xdea7('0xb')||_0xdd7a10===_0xdea7('0xc')||_0xdd7a10===_0xdea7('0xd')||_['isNil'](_0xdd7a10);}function isAgentIdle(_0x33800a){if(_0x33800a[_0xdea7('0xe')]!==_0xdea7('0xa')&&_0x33800a[_0xdea7('0x6')]){_0x33800a[_0xdea7('0xe')]='pause';return![];}return _['every']([_0x33800a[_0xdea7('0xf')],_0x33800a[_0xdea7('0x10')],_0x33800a[_0xdea7('0x11')],_0x33800a[_0xdea7('0x12')],_0x33800a[_0xdea7('0x13')],_0x33800a[_0xdea7('0xe')],_0x33800a[_0xdea7('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xdea7('0x15')](_0xdea7('0x16'),{})['then'](function(_0x55686c){if(_0x55686c[_0xdea7('0x17')]){throw new Error(_0xdea7('0x18'));}var _0x23ec8e=_0x55686c[_0xdea7('0x19')];return routingClient[_0xdea7('0x15')](_0xdea7('0x16'),{})[_0xdea7('0x1a')](function(_0x7e5d82){if(_0x7e5d82[_0xdea7('0x17')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x4d666f=_0x7e5d82['result'];return _['merge']({},_0x23ec8e,_0x4d666f);});})[_0xdea7('0x1b')](function(_0x1d9686){throw _0x1d9686;});}exports[_0xdea7('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x12c280){var _0x4850b5=_0xdea7('0xb');if(isAgentPaused(_0x12c280))_0x4850b5=_0xdea7('0x1d');else if(isAgentPaused(_0x12c280,!![]))_0x4850b5=_0xdea7('0x1e');else if(isAgentIdle(_0x12c280))_0x4850b5=_0xdea7('0xa');else _0x4850b5=_0xdea7('0x1f');return _0x4850b5;}exports[_0xdea7('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x21877c,_0xa24f7d){var _0x24267c=_['isArray'](_0x21877c)?_0x21877c:[_0x21877c];var _0x543e6a=_[_0xdea7('0x21')](_0xa24f7d)+'Queue';var _0x3ccd7d=_[_0xdea7('0x22')](_0x24267c,function(_0x4692ad){return db[_0x543e6a]['findOne']({'where':{'id':_0x4692ad}})[_0xdea7('0x1a')](function(_0x4e1ccd){if(!_0x4e1ccd)return[];return _0x4e1ccd[_0xdea7('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xdea7('0x24')](_0x3ccd7d)[_0xdea7('0x1a')](function(_0x1be059){var _0x2f3da0=_(_0x1be059)[_0xdea7('0x25')]()['map']('id')['uniq']()[_0xdea7('0x26')]();return _0x2f3da0;});}exports[_0xdea7('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1a30d9,_0xead704,_0x4580f0){try{if(_0xead704[_0xdea7('0x9')]>0x0){_0x1a30d9=_0x1a30d9['filter'](function(_0x28a463){return _0xead704['includes'](_0x28a463['id']);});}var _0x24ccbd=_0x1a30d9['filter'](function(_0xec02e8){var _0x54ef01=_0xdea7('0x1f');if(isAgentIdle(_0xec02e8)){_0x54ef01=_0xdea7('0xa');}return _0x54ef01===_0x4580f0;});return _[_0xdea7('0x22')](_0x24ccbd,'id');}catch(_0x3c1846){throw _0x3c1846;}}exports[_0xdea7('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x26a4e1,_0x1a72a1,_0x14ae8b){return Promise['resolve']()['then'](function(){if(_0x1a72a1[_0xdea7('0x9')]>0x0){_0x26a4e1=_0x26a4e1[_0xdea7('0x8')](function(_0x5a18d9){return _0x1a72a1['includes'](_0x5a18d9['id']);});}return _0x26a4e1;})['then'](function(){return db[_0xdea7('0x29')][_0xdea7('0x2a')]({'attributes':['id',_0xdea7('0x2b'),_0xdea7('0x2c'),_0xdea7('0x3'),_0xdea7('0x4'),_0xdea7('0x2d'),_0xdea7('0x2e'),'smsPause','voicePause',_0xdea7('0x2f'),_0xdea7('0x30')],'where':{'id':{'$in':_['map'](_0x26a4e1,'id')}},'raw':!![]});})[_0xdea7('0x1a')](function(_0x5382cf){return _0x5382cf[_0xdea7('0x22')](function(_0x4a17be){var _0x4343f5=_[_0xdea7('0x31')](_0x26a4e1,['id',_0x4a17be['id']]);var _0x43fedc=filterAgentAttributes(_0x4343f5);_[_0xdea7('0x32')](_0x4a17be,_0x43fedc);_0x4a17be['globalStatus']=getAgentStatus(_0x4a17be);return _0x4a17be;});})[_0xdea7('0x1a')](function(_0x21ab81){var _0x5bb676=sortAgentsByStatus(_0x21ab81,_0x14ae8b);return _['map'](_0x5bb676,'id');})[_0xdea7('0x1b')](function(_0x5ca190){throw _0x5ca190;});}exports[_0xdea7('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x4860bc){var _0xcbe3de={'fields':[],'order':null};var _0x42a831=_0x4860bc[_0xdea7('0x34')](',');_0xcbe3de['fields']=_[_0xdea7('0x8')](_0x42a831,function(_0x170baf){if(!_0x170baf['includes'](_0xdea7('0x35'))){return!![];}_0xcbe3de[_0xdea7('0x36')]=_[_0xdea7('0x37')](_0x170baf,'-')?_0xdea7('0x38'):_0xdea7('0x39');return![];});return _0xcbe3de;}exports[_0xdea7('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x21d26f){if(_0x21d26f[_0xdea7('0x3b')](_0xdea7('0x2c'))&&!_0x21d26f['includes'](_0xdea7('0x3c'))){var _0x9c99e2=_0x21d26f[_0xdea7('0x3d')](0x0,_0x21d26f['indexOf']('fullname'));_0x21d26f+=','+_0x9c99e2+_0xdea7('0x3c');}return _0x21d26f;}exports[_0xdea7('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x16cfcc,_0x40ab8f){var _0x496142=_0x16cfcc[_0xdea7('0x3f')](function(_0x3d4702,_0x326091){if(_0x3d4702[_0xdea7('0x35')]===_0x326091['globalStatus']){if(_0x3d4702[_0xdea7('0x35')]===_0xdea7('0x1d')){if(_0x40ab8f===_0xdea7('0x38')){return(_0x3d4702[_0xdea7('0x30')]||'')<(_0x326091['pauseType']||'')||_0x3d4702[_0xdea7('0x2c')][_0xdea7('0x40')]()>_0x326091['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x3d4702[_0xdea7('0x30')]||'')<(_0x326091['pauseType']||'')||_0x3d4702[_0xdea7('0x2c')][_0xdea7('0x40')]()>_0x326091['fullname'][_0xdea7('0x40')]()?-0x1:0x1;}}else{if(_0x40ab8f===_0xdea7('0x38')){return _0x3d4702['fullname'][_0xdea7('0x40')]()<_0x326091['fullname']['toLowerCase']()?0x1:-0x1;}else{return _0x3d4702[_0xdea7('0x2c')][_0xdea7('0x40')]()<_0x326091[_0xdea7('0x2c')][_0xdea7('0x40')]()?-0x1:0x1;}}}else{if(_0x40ab8f===_0xdea7('0x38')){return _0x3d4702['globalStatus']<_0x326091[_0xdea7('0x35')]?0x1:-0x1;}else{return _0x3d4702['globalStatus']<_0x326091[_0xdea7('0x35')]?-0x1:0x1;}}});return _0x496142;}exports[_0xdea7('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0x58a66a){var _0x38b862=[_0xdea7('0x42'),_0xdea7('0x43'),_0xdea7('0x44'),_0xdea7('0x45'),_0xdea7('0x30'),_0xdea7('0x45'),'internal',_0xdea7('0x46'),_0xdea7('0x3'),_0xdea7('0x2e'),_0xdea7('0x2d'),_0xdea7('0x5'),'whatsappPause',_0xdea7('0x4'),'voicePause','chatCapacity',_0xdea7('0x47'),_0xdea7('0x48'),_0xdea7('0x49'),'whatsappCapacity',_0xdea7('0x4a'),_0xdea7('0x4b'),'openchannelCurrentCapacity',_0xdea7('0x4c'),_0xdea7('0x4d'),_0xdea7('0x4e'),'faxCurrentCapacity',_0xdea7('0xf'),_0xdea7('0x12'),'mailStatus',_0xdea7('0x13'),_0xdea7('0x14'),_0xdea7('0x10'),'voiceStatus',_0xdea7('0x4f'),'openchannelStatusTime',_0xdea7('0x50'),_0xdea7('0x51'),_0xdea7('0x52'),_0xdea7('0x53'),_0xdea7('0x54'),_0xdea7('0x55'),_0xdea7('0x56'),_0xdea7('0x57'),'phoneBarEnableScreenRecordingByAgent',_0xdea7('0x58'),'routealias'];var _0x30fde4=[_0xdea7('0x3'),_0xdea7('0x2e'),_0xdea7('0x2d'),_0xdea7('0x5'),_0xdea7('0x2f'),_0xdea7('0x4'),_0xdea7('0x6'),_0xdea7('0x43')];var _0x7c1209=_(_0x58a66a)[_0xdea7('0x59')](_0x30fde4)['pick'](_0x38b862)[_0xdea7('0x26')]();return _0x7c1209;}exports[_0xdea7('0x5a')]=filterAgentAttributes;
\ No newline at end of file