Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / components / realtime / agents.js
index 035604d..a52fc4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ae9=['merge','globalStatus','getSortedAgentsIdsByStatus','fields','order','DESC','ASC','fullname,internal','fullname','internal','substring','indexOf','sort','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','openchannelStatusTime','mailStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','omit','pick','whatsappStatusTime','chatCapacity','smsCapacity','chatCurrentCapacity','mailCurrentCapacity','onhold','getRealtimeAgentsQueryFields','lodash','client','http','faxPause','mailPause','openchannelPause','smsPause','voicePause','filter','length','idle','unknown','unavailable','ringing','voiceStatus','every','chatStatus','faxStatus','openchannelStatus','smsStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','catch','pause','*pause','getAgentStatus','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','findAll','name','chatPause','whatsappPause'];(function(_0x145fcb,_0x2cc29c){var _0x24d908=function(_0xc6803){while(--_0xc6803){_0x145fcb['push'](_0x145fcb['shift']());}};_0x24d908(++_0x2cc29c);}(_0x5ae9,0x19b));var _0x95ae=function(_0x4ed9c9,_0x1b9648){_0x4ed9c9=_0x4ed9c9-0x0;var _0x591fc0=_0x5ae9[_0x4ed9c9];return _0x591fc0;};'use strict';var _=require(_0x95ae('0x0'));var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x95ae('0x1')][_0x95ae('0x2')]({'port':0x232a});var routingClient=jayson['client'][_0x95ae('0x2')]({'port':0x232c});function isAgentPaused(_0x43c580,_0x559cb2){var _0x22469d=[_0x43c580['chatPause'],_0x43c580[_0x95ae('0x3')],_0x43c580[_0x95ae('0x4')],_0x43c580[_0x95ae('0x5')],_0x43c580[_0x95ae('0x6')],_0x43c580[_0x95ae('0x7')],_0x43c580['whatsappPause']];if(!_0x559cb2)return _['every'](_0x22469d);var _0x19ba28=_[_0x95ae('0x8')](_0x22469d);return _0x19ba28[_0x95ae('0x9')]>0x0&&_0x19ba28[_0x95ae('0x9')]<_0x22469d['length']?!![]:![];}function isIdle(_0x47c902){return _0x47c902===_0x95ae('0xa')||_0x47c902===_0x95ae('0xb')||_0x47c902===_0x95ae('0xc')||_0x47c902===_0x95ae('0xd')||_['isNil'](_0x47c902);}function isAgentIdle(_0x50c18a){if(_0x50c18a[_0x95ae('0xe')]!=='idle'&&_0x50c18a[_0x95ae('0x7')]){_0x50c18a[_0x95ae('0xe')]='pause';return![];}return _[_0x95ae('0xf')]([_0x50c18a[_0x95ae('0x10')],_0x50c18a[_0x95ae('0x11')],_0x50c18a['mailStatus'],_0x50c18a[_0x95ae('0x12')],_0x50c18a[_0x95ae('0x13')],_0x50c18a[_0x95ae('0xe')],_0x50c18a['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0x95ae('0x14')]('Agents',{})[_0x95ae('0x15')](function(_0x57bd67){if(_0x57bd67[_0x95ae('0x16')]){throw new Error(_0x95ae('0x17'));}var _0x3fc518=_0x57bd67[_0x95ae('0x18')];return routingClient[_0x95ae('0x14')](_0x95ae('0x19'),{})[_0x95ae('0x15')](function(_0x24d5d2){if(_0x24d5d2[_0x95ae('0x16')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x4ef50f=_0x24d5d2[_0x95ae('0x18')];return _['merge']({},_0x3fc518,_0x4ef50f);});})[_0x95ae('0x1a')](function(_0x13d7a7){throw _0x13d7a7;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x4daf55){var _0x2649c4=_0x95ae('0xb');if(isAgentPaused(_0x4daf55))_0x2649c4=_0x95ae('0x1b');else if(isAgentPaused(_0x4daf55,!![]))_0x2649c4=_0x95ae('0x1c');else if(isAgentIdle(_0x4daf55))_0x2649c4=_0x95ae('0xa');else _0x2649c4='busy';return _0x2649c4;}exports[_0x95ae('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x457324,_0x1ecde4){var _0x2ad155=_['isArray'](_0x457324)?_0x457324:[_0x457324];var _0x176780=_['startCase'](_0x1ecde4)+_0x95ae('0x1e');var _0x59f88a=_[_0x95ae('0x1f')](_0x2ad155,function(_0x199c68){return db[_0x176780][_0x95ae('0x20')]({'where':{'id':_0x199c68}})['then'](function(_0xdc8e7e){if(!_0xdc8e7e)return[];return _0xdc8e7e[_0x95ae('0x21')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x95ae('0x22')](_0x59f88a)[_0x95ae('0x15')](function(_0x36351e){var _0x4d24a6=_(_0x36351e)[_0x95ae('0x23')]()[_0x95ae('0x1f')]('id')[_0x95ae('0x24')]()[_0x95ae('0x25')]();return _0x4d24a6;});}exports[_0x95ae('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x51ba5d,_0x46b590,_0x4d1708){try{if(_0x46b590[_0x95ae('0x9')]>0x0){_0x51ba5d=_0x51ba5d[_0x95ae('0x8')](function(_0x611fca){return _0x46b590[_0x95ae('0x27')](_0x611fca['id']);});}var _0x4fa625=_0x51ba5d[_0x95ae('0x8')](function(_0x2751c9){var _0x2e0b58='busy';if(isAgentIdle(_0x2751c9)){_0x2e0b58=_0x95ae('0xa');}return _0x2e0b58===_0x4d1708;});return _['map'](_0x4fa625,'id');}catch(_0x4c44f4){throw _0x4c44f4;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1820b4,_0x1e893e,_0x1719e6){return Promise['resolve']()[_0x95ae('0x15')](function(){if(_0x1e893e['length']>0x0){_0x1820b4=_0x1820b4[_0x95ae('0x8')](function(_0x5ac97){return _0x1e893e['includes'](_0x5ac97['id']);});}return _0x1820b4;})[_0x95ae('0x15')](function(){return db['User'][_0x95ae('0x28')]({'attributes':['id',_0x95ae('0x29'),'fullname',_0x95ae('0x2a'),_0x95ae('0x3'),_0x95ae('0x4'),_0x95ae('0x5'),_0x95ae('0x6'),_0x95ae('0x7'),_0x95ae('0x2b'),'pauseType'],'where':{'id':{'$in':_['map'](_0x1820b4,'id')}},'raw':!![]});})[_0x95ae('0x15')](function(_0x2aa190){return _0x2aa190[_0x95ae('0x1f')](function(_0x1ae7b0){var _0x3f7585=_['find'](_0x1820b4,['id',_0x1ae7b0['id']]);var _0x140a4d=filterAgentAttributes(_0x3f7585);_[_0x95ae('0x2c')](_0x1ae7b0,_0x140a4d);_0x1ae7b0[_0x95ae('0x2d')]=getAgentStatus(_0x1ae7b0);return _0x1ae7b0;});})[_0x95ae('0x15')](function(_0x26a3de){var _0x45cde9=sortAgentsByStatus(_0x26a3de,_0x1719e6);return _['map'](_0x45cde9,'id');})[_0x95ae('0x1a')](function(_0x43c830){throw _0x43c830;});}exports[_0x95ae('0x2e')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x3262b1){var _0x48575f={'fields':[],'order':null};var _0x20a0cc=_0x3262b1['split'](',');_0x48575f[_0x95ae('0x2f')]=_[_0x95ae('0x8')](_0x20a0cc,function(_0x6fa9b5){if(!_0x6fa9b5[_0x95ae('0x27')](_0x95ae('0x2d'))){return!![];}_0x48575f[_0x95ae('0x30')]=_['startsWith'](_0x6fa9b5,'-')?_0x95ae('0x31'):_0x95ae('0x32');return![];});return _0x48575f;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x52ee88){if(!_0x52ee88){_0x52ee88=_0x95ae('0x33');}if(_0x52ee88[_0x95ae('0x27')](_0x95ae('0x34'))&&!_0x52ee88['includes'](_0x95ae('0x35'))){var _0x1763d7=_0x52ee88[_0x95ae('0x36')](0x0,_0x52ee88[_0x95ae('0x37')](_0x95ae('0x34')));_0x52ee88+=','+_0x1763d7+_0x95ae('0x35');}return _0x52ee88;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x3a3923,_0x39941f){var _0x29bba6=_0x3a3923[_0x95ae('0x38')](function(_0x198350,_0xf41d5b){if(_0x198350[_0x95ae('0x2d')]===_0xf41d5b['globalStatus']){if(_0x198350[_0x95ae('0x2d')]===_0x95ae('0x1b')){if(_0x39941f===_0x95ae('0x31')){return(_0x198350[_0x95ae('0x39')]||'')<(_0xf41d5b[_0x95ae('0x39')]||'')||_0x198350['fullname']['toLowerCase']()>_0xf41d5b[_0x95ae('0x34')][_0x95ae('0x3a')]()?0x1:-0x1;}else{return(_0x198350[_0x95ae('0x39')]||'')<(_0xf41d5b[_0x95ae('0x39')]||'')||_0x198350['fullname']['toLowerCase']()>_0xf41d5b['fullname'][_0x95ae('0x3a')]()?-0x1:0x1;}}else{if(_0x39941f==='DESC'){return _0x198350['fullname'][_0x95ae('0x3a')]()<_0xf41d5b[_0x95ae('0x34')]['toLowerCase']()?0x1:-0x1;}else{return _0x198350[_0x95ae('0x34')][_0x95ae('0x3a')]()<_0xf41d5b[_0x95ae('0x34')][_0x95ae('0x3a')]()?-0x1:0x1;}}}else{if(_0x39941f==='DESC'){return _0x198350[_0x95ae('0x2d')]<_0xf41d5b[_0x95ae('0x2d')]?0x1:-0x1;}else{return _0x198350[_0x95ae('0x2d')]<_0xf41d5b['globalStatus']?-0x1:0x1;}}});return _0x29bba6;}exports[_0x95ae('0x3b')]=sortAgentsByStatus;function filterAgentAttributes(_0xe12c05){var _0x13b1d4=[_0x95ae('0x3c'),_0x95ae('0x3d'),_0x95ae('0x3e'),_0x95ae('0x3f'),_0x95ae('0x39'),_0x95ae('0x3f'),'internal',_0x95ae('0x40'),'chatPause',_0x95ae('0x5'),_0x95ae('0x4'),_0x95ae('0x6'),'whatsappPause',_0x95ae('0x3'),_0x95ae('0x7'),'chatCapacity',_0x95ae('0x41'),_0x95ae('0x42'),'smsCapacity',_0x95ae('0x43'),_0x95ae('0x44'),'chatCurrentCapacity',_0x95ae('0x45'),'mailCurrentCapacity',_0x95ae('0x46'),_0x95ae('0x47'),_0x95ae('0x48'),'chatStatus',_0x95ae('0x12'),_0x95ae('0x49'),'smsStatus',_0x95ae('0x4a'),_0x95ae('0x11'),'voiceStatus','chatStatusTime',_0x95ae('0x4b'),_0x95ae('0x4c'),'smsStatusTime','whatsappStatusTime','faxStatusTime',_0x95ae('0x4d'),_0x95ae('0x4e'),_0x95ae('0x4f'),_0x95ae('0x50'),_0x95ae('0x51'),'phoneBarEnableAutomaticScreenRecording'];var _0x38c5b0=[_0x95ae('0x2a'),_0x95ae('0x5'),_0x95ae('0x4'),'smsPause',_0x95ae('0x2b'),_0x95ae('0x3'),'voicePause',_0x95ae('0x3d')];var _0x56ebb4=_(_0xe12c05)[_0x95ae('0x52')](_0x38c5b0)[_0x95ae('0x53')](_0x13b1d4)[_0x95ae('0x25')]();return _0x56ebb4;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x95ae('0x29'),_0x95ae('0x34'),'role',_0x95ae('0x35'),_0x95ae('0x3d'),'globalStatus',_0x95ae('0x3c'),'lastLoginAt',_0x95ae('0x39'),_0x95ae('0x3f'),_0x95ae('0x3'),'chatPause',_0x95ae('0x4'),_0x95ae('0x5'),_0x95ae('0x6'),_0x95ae('0x7'),'whatsappPause','chatStatus',_0x95ae('0x11'),_0x95ae('0x49'),_0x95ae('0x12'),_0x95ae('0x13'),'voiceStatus','whatsappStatus','chatStatusTime','faxStatusTime',_0x95ae('0x4c'),_0x95ae('0x4b'),'smsStatusTime','voiceStatusTime',_0x95ae('0x54'),_0x95ae('0x55'),_0x95ae('0x44'),_0x95ae('0x42'),_0x95ae('0x41'),_0x95ae('0x56'),_0x95ae('0x43'),_0x95ae('0x57'),'faxCurrentCapacity',_0x95ae('0x58'),_0x95ae('0x45'),_0x95ae('0x46'),'whatsappCurrentCapacity',_0x95ae('0x51'),'phoneBarEnableAutomaticScreenRecording',_0x95ae('0x4f'),_0x95ae('0x59'),_0x95ae('0x4e'),_0x95ae('0x50')];}exports[_0x95ae('0x5a')]=getRealtimeAgentsQueryFields;
\ No newline at end of file
+var _0xf470=['split','order','startsWith','ASC','getUpdatedSortOptions','fullname,internal','fullname','internal','substring','indexOf','validateSortParameter','DESC','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','pick','filterAgentAttributes','name','whatsappStatusTime','chatCapacity','mailCurrentCapacity','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','request','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','merge','catch','getRealtimeAgents','*pause','isArray','startCase','Queue','map','getAgents','all','flatten','value','getAgentIdsByQueues','includes','busy','getAgentIdsByStatus','resolve','then','User','pauseType','globalStatus','getSortedAgentsIdsByStatus'];(function(_0x71cc1,_0x252833){var _0x16d5a4=function(_0x2c36fe){while(--_0x2c36fe){_0x71cc1['push'](_0x71cc1['shift']());}};_0x16d5a4(++_0x252833);}(_0xf470,0xfd));var _0x0f47=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xf470[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x0f47('0x0'));var jayson=require(_0x0f47('0x1'));var db=require(_0x0f47('0x2'))['db'];var amiClient=jayson[_0x0f47('0x3')][_0x0f47('0x4')]({'port':0x232a});var routingClient=jayson[_0x0f47('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x8fd765,_0x3e20a3){var _0x493828=[_0x8fd765[_0x0f47('0x5')],_0x8fd765[_0x0f47('0x6')],_0x8fd765[_0x0f47('0x7')],_0x8fd765[_0x0f47('0x8')],_0x8fd765[_0x0f47('0x9')],_0x8fd765[_0x0f47('0xa')],_0x8fd765[_0x0f47('0xb')]];if(!_0x3e20a3)return _[_0x0f47('0xc')](_0x493828);var _0x145344=_[_0x0f47('0xd')](_0x493828);return _0x145344[_0x0f47('0xe')]>0x0&&_0x145344[_0x0f47('0xe')]<_0x493828[_0x0f47('0xe')]?!![]:![];}function isIdle(_0x2256e5){return _0x2256e5===_0x0f47('0xf')||_0x2256e5===_0x0f47('0x10')||_0x2256e5===_0x0f47('0x11')||_0x2256e5===_0x0f47('0x12')||_[_0x0f47('0x13')](_0x2256e5);}function isAgentIdle(_0x4bfa8f){if(_0x4bfa8f[_0x0f47('0x14')]!==_0x0f47('0xf')&&_0x4bfa8f[_0x0f47('0xa')]){_0x4bfa8f[_0x0f47('0x14')]=_0x0f47('0x15');return![];}return _['every']([_0x4bfa8f['chatStatus'],_0x4bfa8f[_0x0f47('0x16')],_0x4bfa8f[_0x0f47('0x17')],_0x4bfa8f[_0x0f47('0x18')],_0x4bfa8f[_0x0f47('0x19')],_0x4bfa8f[_0x0f47('0x14')],_0x4bfa8f['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0x0f47('0x1a')]('Agents',{})['then'](function(_0x1e08f6){if(_0x1e08f6[_0x0f47('0x1b')]){throw new Error(_0x0f47('0x1c'));}var _0x1e84eb=_0x1e08f6[_0x0f47('0x1d')];return routingClient[_0x0f47('0x1a')](_0x0f47('0x1e'),{})['then'](function(_0x1d8fe5){if(_0x1d8fe5[_0x0f47('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x22c861=_0x1d8fe5[_0x0f47('0x1d')];return _[_0x0f47('0x1f')]({},_0x1e84eb,_0x22c861);});})[_0x0f47('0x20')](function(_0x22615b){throw _0x22615b;});}exports[_0x0f47('0x21')]=getRealtimeAgents;function getAgentStatus(_0x222831){var _0x160283=_0x0f47('0x10');if(isAgentPaused(_0x222831))_0x160283=_0x0f47('0x15');else if(isAgentPaused(_0x222831,!![]))_0x160283=_0x0f47('0x22');else if(isAgentIdle(_0x222831))_0x160283='idle';else _0x160283='busy';return _0x160283;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x1fe6ea,_0x5a0c8c){var _0x5f1830=_[_0x0f47('0x23')](_0x1fe6ea)?_0x1fe6ea:[_0x1fe6ea];var _0x19d346=_[_0x0f47('0x24')](_0x5a0c8c)+_0x0f47('0x25');var _0x28edc5=_[_0x0f47('0x26')](_0x5f1830,function(_0x2a7f9e){return db[_0x19d346]['findOne']({'where':{'id':_0x2a7f9e}})['then'](function(_0x165f4f){if(!_0x165f4f)return[];return _0x165f4f[_0x0f47('0x27')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x0f47('0x28')](_0x28edc5)['then'](function(_0x365482){var _0x41a31e=_(_0x365482)[_0x0f47('0x29')]()[_0x0f47('0x26')]('id')['uniq']()[_0x0f47('0x2a')]();return _0x41a31e;});}exports[_0x0f47('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x44c56d,_0x401aea,_0x19e916){try{if(_0x401aea[_0x0f47('0xe')]>0x0){_0x44c56d=_0x44c56d[_0x0f47('0xd')](function(_0xd47c98){return _0x401aea[_0x0f47('0x2c')](_0xd47c98['id']);});}var _0x2648f1=_0x44c56d[_0x0f47('0xd')](function(_0x3a3687){var _0x4ff1ef=_0x0f47('0x2d');if(isAgentIdle(_0x3a3687)){_0x4ff1ef=_0x0f47('0xf');}return _0x4ff1ef===_0x19e916;});return _[_0x0f47('0x26')](_0x2648f1,'id');}catch(_0x1a0d44){throw _0x1a0d44;}}exports[_0x0f47('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x49c679,_0x9970a5,_0x3e62a4){return Promise[_0x0f47('0x2f')]()['then'](function(){if(_0x9970a5[_0x0f47('0xe')]>0x0){_0x49c679=_0x49c679[_0x0f47('0xd')](function(_0x465b62){return _0x9970a5[_0x0f47('0x2c')](_0x465b62['id']);});}return _0x49c679;})[_0x0f47('0x30')](function(){return db[_0x0f47('0x31')]['findAll']({'attributes':['id','name','fullname',_0x0f47('0x5'),'faxPause',_0x0f47('0x7'),'openchannelPause',_0x0f47('0x9'),_0x0f47('0xa'),_0x0f47('0xb'),_0x0f47('0x32')],'where':{'id':{'$in':_['map'](_0x49c679,'id')}},'raw':!![]});})[_0x0f47('0x30')](function(_0xee9cd){return _0xee9cd[_0x0f47('0x26')](function(_0x164175){var _0x38a3ce=_['find'](_0x49c679,['id',_0x164175['id']]);var _0x1c4e1a=filterAgentAttributes(_0x38a3ce);_[_0x0f47('0x1f')](_0x164175,_0x1c4e1a);_0x164175[_0x0f47('0x33')]=getAgentStatus(_0x164175);return _0x164175;});})[_0x0f47('0x30')](function(_0x2fc8a3){var _0x47cf68=sortAgentsByStatus(_0x2fc8a3,_0x3e62a4);return _['map'](_0x47cf68,'id');})['catch'](function(_0x4081d2){throw _0x4081d2;});}exports[_0x0f47('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x419e5c){var _0x58c7bc={'fields':[],'order':null};var _0x124289=_0x419e5c[_0x0f47('0x35')](',');_0x58c7bc['fields']=_['filter'](_0x124289,function(_0x497833){if(!_0x497833[_0x0f47('0x2c')]('globalStatus')){return!![];}_0x58c7bc[_0x0f47('0x36')]=_[_0x0f47('0x37')](_0x497833,'-')?'DESC':_0x0f47('0x38');return![];});return _0x58c7bc;}exports[_0x0f47('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x13e77b){if(!_0x13e77b){_0x13e77b=_0x0f47('0x3a');}if(_0x13e77b[_0x0f47('0x2c')](_0x0f47('0x3b'))&&!_0x13e77b[_0x0f47('0x2c')](_0x0f47('0x3c'))){var _0x524ee3=_0x13e77b[_0x0f47('0x3d')](0x0,_0x13e77b[_0x0f47('0x3e')](_0x0f47('0x3b')));_0x13e77b+=','+_0x524ee3+_0x0f47('0x3c');}return _0x13e77b;}exports[_0x0f47('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x266e16,_0x5c85a7){var _0x339282=_0x266e16['sort'](function(_0x32eb09,_0x1753be){if(_0x32eb09['globalStatus']===_0x1753be[_0x0f47('0x33')]){if(_0x32eb09[_0x0f47('0x33')]===_0x0f47('0x15')){if(_0x5c85a7===_0x0f47('0x40')){return(_0x32eb09[_0x0f47('0x32')]||'')<(_0x1753be['pauseType']||'')||_0x32eb09['fullname'][_0x0f47('0x41')]()>_0x1753be[_0x0f47('0x3b')][_0x0f47('0x41')]()?0x1:-0x1;}else{return(_0x32eb09[_0x0f47('0x32')]||'')<(_0x1753be[_0x0f47('0x32')]||'')||_0x32eb09[_0x0f47('0x3b')][_0x0f47('0x41')]()>_0x1753be['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x5c85a7===_0x0f47('0x40')){return _0x32eb09[_0x0f47('0x3b')][_0x0f47('0x41')]()<_0x1753be['fullname'][_0x0f47('0x41')]()?0x1:-0x1;}else{return _0x32eb09[_0x0f47('0x3b')][_0x0f47('0x41')]()<_0x1753be[_0x0f47('0x3b')][_0x0f47('0x41')]()?-0x1:0x1;}}}else{if(_0x5c85a7===_0x0f47('0x40')){return _0x32eb09[_0x0f47('0x33')]<_0x1753be[_0x0f47('0x33')]?0x1:-0x1;}else{return _0x32eb09[_0x0f47('0x33')]<_0x1753be['globalStatus']?-0x1:0x1;}}});return _0x339282;}exports[_0x0f47('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x2e975c){var _0x2bddb2=[_0x0f47('0x43'),_0x0f47('0x44'),_0x0f47('0x45'),_0x0f47('0x46'),_0x0f47('0x32'),_0x0f47('0x46'),'internal','address',_0x0f47('0x5'),_0x0f47('0x8'),_0x0f47('0x7'),_0x0f47('0x9'),_0x0f47('0xb'),_0x0f47('0x6'),_0x0f47('0xa'),'chatCapacity',_0x0f47('0x47'),_0x0f47('0x48'),_0x0f47('0x49'),_0x0f47('0x4a'),_0x0f47('0x4b'),_0x0f47('0x4c'),_0x0f47('0x4d'),'mailCurrentCapacity',_0x0f47('0x4e'),_0x0f47('0x4f'),_0x0f47('0x50'),_0x0f47('0x51'),'openchannelStatus',_0x0f47('0x17'),_0x0f47('0x19'),_0x0f47('0x52'),_0x0f47('0x16'),_0x0f47('0x14'),_0x0f47('0x53'),_0x0f47('0x54'),_0x0f47('0x55'),_0x0f47('0x56'),'whatsappStatusTime',_0x0f47('0x57'),_0x0f47('0x58'),_0x0f47('0x59'),_0x0f47('0x5a'),_0x0f47('0x5b'),_0x0f47('0x5c'),_0x0f47('0x5d')];var _0x40eef6=[_0x0f47('0x5'),_0x0f47('0x8'),_0x0f47('0x7'),_0x0f47('0x9'),_0x0f47('0xb'),'faxPause',_0x0f47('0xa'),_0x0f47('0x44')];var _0x16f210=_(_0x2e975c)['omit'](_0x40eef6)[_0x0f47('0x5e')](_0x2bddb2)[_0x0f47('0x2a')]();return _0x16f210;}exports[_0x0f47('0x5f')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x0f47('0x60'),_0x0f47('0x3b'),'role',_0x0f47('0x3c'),'online',_0x0f47('0x33'),_0x0f47('0x43'),_0x0f47('0x45'),_0x0f47('0x32'),_0x0f47('0x46'),_0x0f47('0x6'),'chatPause','mailPause',_0x0f47('0x8'),'smsPause',_0x0f47('0xa'),_0x0f47('0xb'),_0x0f47('0x51'),'faxStatus','mailStatus','openchannelStatus','smsStatus','voiceStatus',_0x0f47('0x52'),_0x0f47('0x53'),_0x0f47('0x57'),_0x0f47('0x55'),'openchannelStatusTime',_0x0f47('0x56'),'voiceStatusTime',_0x0f47('0x61'),_0x0f47('0x62'),_0x0f47('0x4b'),_0x0f47('0x48'),_0x0f47('0x47'),_0x0f47('0x49'),_0x0f47('0x4a'),_0x0f47('0x4c'),_0x0f47('0x50'),_0x0f47('0x63'),_0x0f47('0x4d'),_0x0f47('0x4e'),_0x0f47('0x4f'),_0x0f47('0x5c'),'phoneBarEnableAutomaticScreenRecording',_0x0f47('0x5a'),_0x0f47('0x64'),_0x0f47('0x59'),_0x0f47('0x5b')];}exports[_0x0f47('0x65')]=getRealtimeAgentsQueryFields;
\ No newline at end of file