Built motion from commit e1760111.|2.6.18
[motion2.git] / server / components / realtime / agents.js
index 399b92c..4a70343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4afb=['isArray','Queue','map','findOne','then','all','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','smsPause','voicePause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','getUpdatedSortOptions','internal','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','faxPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','lodash','jayson/promise','client','http','chatPause','mailPause','openchannelPause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','every','chatStatus','faxStatus','openchannelStatus','smsStatus','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','getRealtimeAgents','busy','getAgentStatus'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x4afb,0x164));var _0xb4af=function(_0x5ce52e,_0x5741a9){_0x5ce52e=_0x5ce52e-0x0;var _0x196dfa=_0x4afb[_0x5ce52e];return _0x196dfa;};'use strict';var _=require(_0xb4af('0x0'));var jayson=require(_0xb4af('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xb4af('0x2')][_0xb4af('0x3')]({'port':0x232a});var routingClient=jayson[_0xb4af('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x1992d8,_0x1c94b0){var _0x217579=[_0x1992d8[_0xb4af('0x4')],_0x1992d8['faxPause'],_0x1992d8[_0xb4af('0x5')],_0x1992d8[_0xb4af('0x6')],_0x1992d8['smsPause'],_0x1992d8['voicePause'],_0x1992d8[_0xb4af('0x7')]];if(!_0x1c94b0)return _['every'](_0x217579);var _0xa8da8=_[_0xb4af('0x8')](_0x217579);return _0xa8da8[_0xb4af('0x9')]>0x0&&_0xa8da8[_0xb4af('0x9')]<_0x217579['length']?!![]:![];}function isIdle(_0x5a6a31){return _0x5a6a31===_0xb4af('0xa')||_0x5a6a31===_0xb4af('0xb')||_0x5a6a31===_0xb4af('0xc')||_0x5a6a31===_0xb4af('0xd')||_[_0xb4af('0xe')](_0x5a6a31);}function isAgentIdle(_0x358ef6){if(_0x358ef6[_0xb4af('0xf')]!==_0xb4af('0xa')&&_0x358ef6['voicePause']){_0x358ef6[_0xb4af('0xf')]=_0xb4af('0x10');return![];}return _[_0xb4af('0x11')]([_0x358ef6[_0xb4af('0x12')],_0x358ef6[_0xb4af('0x13')],_0x358ef6['mailStatus'],_0x358ef6[_0xb4af('0x14')],_0x358ef6[_0xb4af('0x15')],_0x358ef6['voiceStatus'],_0x358ef6['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xb4af('0x16')](_0xb4af('0x17'),{})['then'](function(_0x2018a0){if(_0x2018a0['error']){throw new Error(_0xb4af('0x18'));}var _0x377280=_0x2018a0['result'];return routingClient[_0xb4af('0x16')](_0xb4af('0x17'),{})['then'](function(_0x19840a){if(_0x19840a['error']){throw new Error(_0xb4af('0x19'));}var _0x12f928=_0x19840a[_0xb4af('0x1a')];return _[_0xb4af('0x1b')]({},_0x377280,_0x12f928);});})[_0xb4af('0x1c')](function(_0xe94753){throw _0xe94753;});}exports[_0xb4af('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x914a82){var _0x7da709='unknown';if(isAgentPaused(_0x914a82))_0x7da709=_0xb4af('0x10');else if(isAgentPaused(_0x914a82,!![]))_0x7da709='*pause';else if(isAgentIdle(_0x914a82))_0x7da709=_0xb4af('0xa');else _0x7da709=_0xb4af('0x1e');return _0x7da709;}exports[_0xb4af('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x5bbc03,_0x47e056){var _0x299824=_[_0xb4af('0x20')](_0x5bbc03)?_0x5bbc03:[_0x5bbc03];var _0x2c119f=_['startCase'](_0x47e056)+_0xb4af('0x21');var _0x44ec54=_[_0xb4af('0x22')](_0x299824,function(_0x2862ce){return db[_0x2c119f][_0xb4af('0x23')]({'where':{'id':_0x2862ce}})[_0xb4af('0x24')](function(_0x200714){if(!_0x200714)return[];return _0x200714['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xb4af('0x25')](_0x44ec54)[_0xb4af('0x24')](function(_0x58bcec){var _0x3c1050=_(_0x58bcec)['flatten']()['map']('id')[_0xb4af('0x26')]()[_0xb4af('0x27')]();return _0x3c1050;});}exports[_0xb4af('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x399bd4,_0x1fad34,_0x2b069f){try{if(_0x1fad34[_0xb4af('0x9')]>0x0){_0x399bd4=_0x399bd4[_0xb4af('0x8')](function(_0xa0c002){return _0x1fad34[_0xb4af('0x29')](_0xa0c002['id']);});}var _0x401c21=_0x399bd4['filter'](function(_0x2a541e){var _0x28088f=_0xb4af('0x1e');if(isAgentIdle(_0x2a541e)){_0x28088f=_0xb4af('0xa');}return _0x28088f===_0x2b069f;});return _[_0xb4af('0x22')](_0x401c21,'id');}catch(_0x3d4c65){throw _0x3d4c65;}}exports[_0xb4af('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1472be,_0x5eb64b,_0x299730){return Promise[_0xb4af('0x2b')]()[_0xb4af('0x24')](function(){if(_0x5eb64b[_0xb4af('0x9')]>0x0){_0x1472be=_0x1472be[_0xb4af('0x8')](function(_0x3d90bc){return _0x5eb64b['includes'](_0x3d90bc['id']);});}return _0x1472be;})[_0xb4af('0x24')](function(){return db['User'][_0xb4af('0x2c')]({'attributes':['id',_0xb4af('0x2d'),_0xb4af('0x2e'),_0xb4af('0x4'),'faxPause',_0xb4af('0x5'),_0xb4af('0x6'),_0xb4af('0x2f'),_0xb4af('0x30'),_0xb4af('0x7'),_0xb4af('0x31')],'where':{'id':{'$in':_[_0xb4af('0x22')](_0x1472be,'id')}},'raw':!![]});})['then'](function(_0xe1e0ce){return _0xe1e0ce[_0xb4af('0x22')](function(_0x2e47f9){var _0x3b8271=_[_0xb4af('0x32')](_0x1472be,['id',_0x2e47f9['id']]);var _0x1d7713=filterAgentAttributes(_0x3b8271);_[_0xb4af('0x1b')](_0x2e47f9,_0x1d7713);_0x2e47f9[_0xb4af('0x33')]=getAgentStatus(_0x2e47f9);return _0x2e47f9;});})[_0xb4af('0x24')](function(_0x29c04f){var _0x2040c7=sortAgentsByStatus(_0x29c04f,_0x299730);return _[_0xb4af('0x22')](_0x2040c7,'id');})[_0xb4af('0x1c')](function(_0x2e204d){throw _0x2e204d;});}exports[_0xb4af('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x515fc0){var _0xe3db16={'fields':[],'order':null};var _0x5ecb0a=_0x515fc0[_0xb4af('0x35')](',');_0xe3db16[_0xb4af('0x36')]=_[_0xb4af('0x8')](_0x5ecb0a,function(_0x36858f){if(!_0x36858f[_0xb4af('0x29')](_0xb4af('0x33'))){return!![];}_0xe3db16['order']=_[_0xb4af('0x37')](_0x36858f,'-')?_0xb4af('0x38'):'ASC';return![];});return _0xe3db16;}exports[_0xb4af('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x3d907c){if(_0x3d907c[_0xb4af('0x29')](_0xb4af('0x2e'))&&!_0x3d907c['includes'](_0xb4af('0x3a'))){var _0x4211aa=_0x3d907c['substring'](0x0,_0x3d907c[_0xb4af('0x3b')](_0xb4af('0x2e')));_0x3d907c+=','+_0x4211aa+_0xb4af('0x3a');}return _0x3d907c;}exports[_0xb4af('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x2fe6d4,_0x13ac28){var _0x3073c8=_0x2fe6d4[_0xb4af('0x3d')](function(_0x4daf80,_0xcc6cfb){if(_0x4daf80[_0xb4af('0x33')]===_0xcc6cfb[_0xb4af('0x33')]){if(_0x4daf80[_0xb4af('0x33')]===_0xb4af('0x10')){if(_0x13ac28==='DESC'){return(_0x4daf80[_0xb4af('0x31')]||'')<(_0xcc6cfb['pauseType']||'')||_0x4daf80[_0xb4af('0x2e')][_0xb4af('0x3e')]()>_0xcc6cfb['fullname'][_0xb4af('0x3e')]()?0x1:-0x1;}else{return(_0x4daf80['pauseType']||'')<(_0xcc6cfb[_0xb4af('0x31')]||'')||_0x4daf80[_0xb4af('0x2e')]['toLowerCase']()>_0xcc6cfb[_0xb4af('0x2e')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x13ac28==='DESC'){return _0x4daf80[_0xb4af('0x2e')]['toLowerCase']()<_0xcc6cfb[_0xb4af('0x2e')][_0xb4af('0x3e')]()?0x1:-0x1;}else{return _0x4daf80[_0xb4af('0x2e')][_0xb4af('0x3e')]()<_0xcc6cfb[_0xb4af('0x2e')][_0xb4af('0x3e')]()?-0x1:0x1;}}}else{if(_0x13ac28===_0xb4af('0x38')){return _0x4daf80[_0xb4af('0x33')]<_0xcc6cfb[_0xb4af('0x33')]?0x1:-0x1;}else{return _0x4daf80[_0xb4af('0x33')]<_0xcc6cfb[_0xb4af('0x33')]?-0x1:0x1;}}});return _0x3073c8;}exports[_0xb4af('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x2d39a5){var _0x22f234=[_0xb4af('0x40'),_0xb4af('0x41'),_0xb4af('0x42'),_0xb4af('0x43'),_0xb4af('0x31'),_0xb4af('0x43'),'internal',_0xb4af('0x44'),_0xb4af('0x4'),_0xb4af('0x6'),'mailPause','smsPause','whatsappPause',_0xb4af('0x45'),_0xb4af('0x30'),_0xb4af('0x46'),_0xb4af('0x47'),_0xb4af('0x48'),_0xb4af('0x49'),_0xb4af('0x4a'),_0xb4af('0x4b'),_0xb4af('0x4c'),_0xb4af('0x4d'),_0xb4af('0x4e'),_0xb4af('0x4f'),_0xb4af('0x50'),_0xb4af('0x51'),_0xb4af('0x12'),_0xb4af('0x14'),_0xb4af('0x52'),_0xb4af('0x15'),_0xb4af('0x53'),_0xb4af('0x13'),_0xb4af('0xf'),'chatStatusTime',_0xb4af('0x54'),'mailStatusTime',_0xb4af('0x55'),_0xb4af('0x56'),_0xb4af('0x57'),_0xb4af('0x58'),_0xb4af('0x59'),_0xb4af('0x5a'),_0xb4af('0x5b'),_0xb4af('0x5c'),_0xb4af('0x5d'),_0xb4af('0x5e')];var _0x1c4087=['chatPause',_0xb4af('0x6'),_0xb4af('0x5'),_0xb4af('0x2f'),_0xb4af('0x7'),_0xb4af('0x45'),_0xb4af('0x30'),_0xb4af('0x41')];var _0x57bac0=_(_0x2d39a5)[_0xb4af('0x5f')](_0x1c4087)[_0xb4af('0x60')](_0x22f234)[_0xb4af('0x27')]();return _0x57bac0;}exports['filterAgentAttributes']=filterAgentAttributes;
\ No newline at end of file
+var _0x4d03=['Agents','then','error','result','merge','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','Queue','map','getAgents','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','User','findAll','name','fullname','pauseType','find','globalStatus','split','fields','order','startsWith','ASC','getUpdatedSortOptions','internal','indexOf','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','address','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','faxCurrentCapacity','faxStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','pick','lodash','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','voicePause','pause','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x4d03,0x99));var _0x34d0=function(_0xf8a129,_0x1b4a7b){_0xf8a129=_0xf8a129-0x0;var _0x4ca873=_0x4d03[_0xf8a129];return _0x4ca873;};'use strict';var _=require(_0x34d0('0x0'));var jayson=require('jayson/promise');var db=require(_0x34d0('0x1'))['db'];var amiClient=jayson[_0x34d0('0x2')][_0x34d0('0x3')]({'port':0x232a});var routingClient=jayson[_0x34d0('0x2')][_0x34d0('0x3')]({'port':0x232c});function isAgentPaused(_0x23c118,_0x515af2){var _0x1fdc71=[_0x23c118[_0x34d0('0x4')],_0x23c118[_0x34d0('0x5')],_0x23c118[_0x34d0('0x6')],_0x23c118[_0x34d0('0x7')],_0x23c118[_0x34d0('0x8')],_0x23c118['voicePause'],_0x23c118[_0x34d0('0x9')]];if(!_0x515af2)return _[_0x34d0('0xa')](_0x1fdc71);var _0xb22129=_[_0x34d0('0xb')](_0x1fdc71);return _0xb22129[_0x34d0('0xc')]>0x0&&_0xb22129['length']<_0x1fdc71['length']?!![]:![];}function isIdle(_0x5a7ad6){return _0x5a7ad6===_0x34d0('0xd')||_0x5a7ad6===_0x34d0('0xe')||_0x5a7ad6===_0x34d0('0xf')||_0x5a7ad6===_0x34d0('0x10')||_[_0x34d0('0x11')](_0x5a7ad6);}function isAgentIdle(_0x1acf3c){if(_0x1acf3c[_0x34d0('0x12')]!==_0x34d0('0xd')&&_0x1acf3c[_0x34d0('0x13')]){_0x1acf3c[_0x34d0('0x12')]=_0x34d0('0x14');return![];}return _[_0x34d0('0xa')]([_0x1acf3c[_0x34d0('0x15')],_0x1acf3c['faxStatus'],_0x1acf3c[_0x34d0('0x16')],_0x1acf3c[_0x34d0('0x17')],_0x1acf3c[_0x34d0('0x18')],_0x1acf3c[_0x34d0('0x12')],_0x1acf3c[_0x34d0('0x19')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x34d0('0x1a')](_0x34d0('0x1b'),{})[_0x34d0('0x1c')](function(_0x84d2c8){if(_0x84d2c8[_0x34d0('0x1d')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x18dfde=_0x84d2c8[_0x34d0('0x1e')];return routingClient[_0x34d0('0x1a')](_0x34d0('0x1b'),{})[_0x34d0('0x1c')](function(_0x28f73b){if(_0x28f73b[_0x34d0('0x1d')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x18c94c=_0x28f73b['result'];return _[_0x34d0('0x1f')]({},_0x18dfde,_0x18c94c);});})[_0x34d0('0x20')](function(_0x5edb10){throw _0x5edb10;});}exports[_0x34d0('0x21')]=getRealtimeAgents;function getAgentStatus(_0x3ae8c7){var _0x4bc80b='unknown';if(isAgentPaused(_0x3ae8c7))_0x4bc80b=_0x34d0('0x14');else if(isAgentPaused(_0x3ae8c7,!![]))_0x4bc80b=_0x34d0('0x22');else if(isAgentIdle(_0x3ae8c7))_0x4bc80b=_0x34d0('0xd');else _0x4bc80b=_0x34d0('0x23');return _0x4bc80b;}exports[_0x34d0('0x24')]=getAgentStatus;function getAgentIdsByQueues(_0xadb5f7,_0x6cfef8){var _0x19acb7=_[_0x34d0('0x25')](_0xadb5f7)?_0xadb5f7:[_0xadb5f7];var _0x1bf379=_['startCase'](_0x6cfef8)+_0x34d0('0x26');var _0xc7fd91=_[_0x34d0('0x27')](_0x19acb7,function(_0x21bff4){return db[_0x1bf379]['findOne']({'where':{'id':_0x21bff4}})['then'](function(_0x52b7bd){if(!_0x52b7bd)return[];return _0x52b7bd[_0x34d0('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x34d0('0x29')](_0xc7fd91)[_0x34d0('0x1c')](function(_0x55ac03){var _0x434188=_(_0x55ac03)[_0x34d0('0x2a')]()[_0x34d0('0x27')]('id')['uniq']()[_0x34d0('0x2b')]();return _0x434188;});}exports[_0x34d0('0x2c')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x10bc8e,_0x58ec21,_0x13a7c5){try{if(_0x58ec21[_0x34d0('0xc')]>0x0){_0x10bc8e=_0x10bc8e[_0x34d0('0xb')](function(_0x33e524){return _0x58ec21[_0x34d0('0x2d')](_0x33e524['id']);});}var _0x415ba6=_0x10bc8e['filter'](function(_0x22de2f){var _0x589631=_0x34d0('0x23');if(isAgentIdle(_0x22de2f)){_0x589631='idle';}return _0x589631===_0x13a7c5;});return _['map'](_0x415ba6,'id');}catch(_0x36d838){throw _0x36d838;}}exports[_0x34d0('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2978c2,_0x4bd7e3,_0x28568a){return Promise['resolve']()[_0x34d0('0x1c')](function(){if(_0x4bd7e3[_0x34d0('0xc')]>0x0){_0x2978c2=_0x2978c2[_0x34d0('0xb')](function(_0x15c172){return _0x4bd7e3[_0x34d0('0x2d')](_0x15c172['id']);});}return _0x2978c2;})[_0x34d0('0x1c')](function(){return db[_0x34d0('0x2f')][_0x34d0('0x30')]({'attributes':['id',_0x34d0('0x31'),_0x34d0('0x32'),'chatPause',_0x34d0('0x5'),_0x34d0('0x6'),_0x34d0('0x7'),_0x34d0('0x8'),_0x34d0('0x13'),'whatsappPause',_0x34d0('0x33')],'where':{'id':{'$in':_['map'](_0x2978c2,'id')}},'raw':!![]});})[_0x34d0('0x1c')](function(_0x24bc5a){return _0x24bc5a[_0x34d0('0x27')](function(_0x2ab2b0){var _0x4c7052=_[_0x34d0('0x34')](_0x2978c2,['id',_0x2ab2b0['id']]);var _0x55f6b9=filterAgentAttributes(_0x4c7052);_[_0x34d0('0x1f')](_0x2ab2b0,_0x55f6b9);_0x2ab2b0[_0x34d0('0x35')]=getAgentStatus(_0x2ab2b0);return _0x2ab2b0;});})[_0x34d0('0x1c')](function(_0x4e309e){var _0x1070a0=sortAgentsByStatus(_0x4e309e,_0x28568a);return _[_0x34d0('0x27')](_0x1070a0,'id');})['catch'](function(_0x3664ac){throw _0x3664ac;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x546b12){var _0x102686={'fields':[],'order':null};var _0x49195d=_0x546b12[_0x34d0('0x36')](',');_0x102686[_0x34d0('0x37')]=_['filter'](_0x49195d,function(_0x5a5d72){if(!_0x5a5d72[_0x34d0('0x2d')](_0x34d0('0x35'))){return!![];}_0x102686[_0x34d0('0x38')]=_[_0x34d0('0x39')](_0x5a5d72,'-')?'DESC':_0x34d0('0x3a');return![];});return _0x102686;}exports[_0x34d0('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x59d862){if(_0x59d862[_0x34d0('0x2d')](_0x34d0('0x32'))&&!_0x59d862[_0x34d0('0x2d')](_0x34d0('0x3c'))){var _0x5824fe=_0x59d862['substring'](0x0,_0x59d862[_0x34d0('0x3d')](_0x34d0('0x32')));_0x59d862+=','+_0x5824fe+_0x34d0('0x3c');}return _0x59d862;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x4f9406,_0x22cca9){var _0x43a6c3=_0x4f9406[_0x34d0('0x3e')](function(_0x10c4c5,_0xe0f27a){if(_0x10c4c5['globalStatus']===_0xe0f27a[_0x34d0('0x35')]){if(_0x10c4c5[_0x34d0('0x35')]===_0x34d0('0x14')){if(_0x22cca9===_0x34d0('0x3f')){return(_0x10c4c5[_0x34d0('0x33')]||'')<(_0xe0f27a[_0x34d0('0x33')]||'')||_0x10c4c5['fullname'][_0x34d0('0x40')]()>_0xe0f27a[_0x34d0('0x32')][_0x34d0('0x40')]()?0x1:-0x1;}else{return(_0x10c4c5['pauseType']||'')<(_0xe0f27a[_0x34d0('0x33')]||'')||_0x10c4c5['fullname'][_0x34d0('0x40')]()>_0xe0f27a[_0x34d0('0x32')][_0x34d0('0x40')]()?-0x1:0x1;}}else{if(_0x22cca9==='DESC'){return _0x10c4c5[_0x34d0('0x32')][_0x34d0('0x40')]()<_0xe0f27a[_0x34d0('0x32')]['toLowerCase']()?0x1:-0x1;}else{return _0x10c4c5[_0x34d0('0x32')][_0x34d0('0x40')]()<_0xe0f27a['fullname'][_0x34d0('0x40')]()?-0x1:0x1;}}}else{if(_0x22cca9===_0x34d0('0x3f')){return _0x10c4c5['globalStatus']<_0xe0f27a[_0x34d0('0x35')]?0x1:-0x1;}else{return _0x10c4c5[_0x34d0('0x35')]<_0xe0f27a[_0x34d0('0x35')]?-0x1:0x1;}}});return _0x43a6c3;}exports[_0x34d0('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0xbcc3e7){var _0x587571=[_0x34d0('0x42'),'online',_0x34d0('0x43'),'lastPauseAt',_0x34d0('0x33'),_0x34d0('0x44'),'internal',_0x34d0('0x45'),'chatPause',_0x34d0('0x7'),_0x34d0('0x6'),_0x34d0('0x8'),_0x34d0('0x9'),_0x34d0('0x5'),_0x34d0('0x13'),_0x34d0('0x46'),'openchannelCapacity',_0x34d0('0x47'),_0x34d0('0x48'),_0x34d0('0x49'),_0x34d0('0x4a'),'chatCurrentCapacity',_0x34d0('0x4b'),_0x34d0('0x4c'),'smsCurrentCapacity','whatsappCurrentCapacity',_0x34d0('0x4d'),_0x34d0('0x15'),_0x34d0('0x17'),_0x34d0('0x16'),_0x34d0('0x18'),_0x34d0('0x19'),_0x34d0('0x4e'),'voiceStatus',_0x34d0('0x4f'),_0x34d0('0x50'),'mailStatusTime',_0x34d0('0x51'),_0x34d0('0x52'),_0x34d0('0x53'),'voiceStatusTime',_0x34d0('0x54'),_0x34d0('0x55'),'screenrecording',_0x34d0('0x56'),_0x34d0('0x57'),_0x34d0('0x58')];var _0x6ecb89=[_0x34d0('0x4'),_0x34d0('0x7'),_0x34d0('0x6'),_0x34d0('0x8'),_0x34d0('0x9'),_0x34d0('0x5'),_0x34d0('0x13'),'online'];var _0x30065a=_(_0xbcc3e7)['omit'](_0x6ecb89)[_0x34d0('0x59')](_0x587571)[_0x34d0('0x2b')]();return _0x30065a;}exports['filterAgentAttributes']=filterAgentAttributes;
\ No newline at end of file