Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / components / realtime / agents.js
index beb6f3a..5a64ee6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dd7=['lastLoginAt','lastPauseAt','internal','address','chatCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','faxStatus','voiceStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','faxPause','openchannelPause','smsPause','every','filter','length','idle','unknown','unavailable','isNil','voicePause','pause','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','User','findAll','name','fullname','chatPause','mailPause','whatsappPause','pauseType','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','DESC','ASC','substring','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic'];(function(_0x111d0c,_0x43ff14){var _0x4b93a5=function(_0x42a0e2){while(--_0x42a0e2){_0x111d0c['push'](_0x111d0c['shift']());}};_0x4b93a5(++_0x43ff14);}(_0x7dd7,0x141));var _0x77dd=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0x7dd7[_0x4605dc];return _0x5d3e81;};'use strict';var _=require(_0x77dd('0x0'));var jayson=require(_0x77dd('0x1'));var db=require(_0x77dd('0x2'))['db'];var amiClient=jayson[_0x77dd('0x3')][_0x77dd('0x4')]({'port':0x232a});var routingClient=jayson[_0x77dd('0x3')][_0x77dd('0x4')]({'port':0x232c});function isAgentPaused(_0x4eb52c,_0x2feef0){var _0x40ffd0=[_0x4eb52c['chatPause'],_0x4eb52c[_0x77dd('0x5')],_0x4eb52c['mailPause'],_0x4eb52c[_0x77dd('0x6')],_0x4eb52c[_0x77dd('0x7')],_0x4eb52c['voicePause'],_0x4eb52c['whatsappPause']];if(!_0x2feef0)return _[_0x77dd('0x8')](_0x40ffd0);var _0x385a45=_[_0x77dd('0x9')](_0x40ffd0);return _0x385a45[_0x77dd('0xa')]>0x0&&_0x385a45[_0x77dd('0xa')]<_0x40ffd0[_0x77dd('0xa')]?!![]:![];}function isIdle(_0x48e31b){return _0x48e31b===_0x77dd('0xb')||_0x48e31b===_0x77dd('0xc')||_0x48e31b===_0x77dd('0xd')||_0x48e31b==='ringing'||_[_0x77dd('0xe')](_0x48e31b);}function isAgentIdle(_0x3d42f2){if(_0x3d42f2['voiceStatus']!==_0x77dd('0xb')&&_0x3d42f2[_0x77dd('0xf')]){_0x3d42f2['voiceStatus']=_0x77dd('0x10');return![];}return _[_0x77dd('0x8')]([_0x3d42f2['chatStatus'],_0x3d42f2['faxStatus'],_0x3d42f2[_0x77dd('0x11')],_0x3d42f2[_0x77dd('0x12')],_0x3d42f2[_0x77dd('0x13')],_0x3d42f2['voiceStatus'],_0x3d42f2[_0x77dd('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x77dd('0x15')]('Agents',{})[_0x77dd('0x16')](function(_0x169014){if(_0x169014[_0x77dd('0x17')]){throw new Error(_0x77dd('0x18'));}var _0x5d66b3=_0x169014[_0x77dd('0x19')];return routingClient[_0x77dd('0x15')](_0x77dd('0x1a'),{})[_0x77dd('0x16')](function(_0x478ddc){if(_0x478ddc[_0x77dd('0x17')]){throw new Error(_0x77dd('0x1b'));}var _0x329734=_0x478ddc['result'];return _[_0x77dd('0x1c')]({},_0x5d66b3,_0x329734);});})[_0x77dd('0x1d')](function(_0x38ab61){throw _0x38ab61;});}exports[_0x77dd('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x28240c){var _0x41c9fd='unknown';if(isAgentPaused(_0x28240c))_0x41c9fd='pause';else if(isAgentPaused(_0x28240c,!![]))_0x41c9fd=_0x77dd('0x1f');else if(isAgentIdle(_0x28240c))_0x41c9fd=_0x77dd('0xb');else _0x41c9fd=_0x77dd('0x20');return _0x41c9fd;}exports[_0x77dd('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x1cbee0,_0x11fe39){var _0x1f5811=_[_0x77dd('0x22')](_0x1cbee0)?_0x1cbee0:[_0x1cbee0];var _0x4578f9=_[_0x77dd('0x23')](_0x11fe39)+_0x77dd('0x24');var _0x2f087e=_[_0x77dd('0x25')](_0x1f5811,function(_0x247ce6){return db[_0x4578f9]['findOne']({'where':{'id':_0x247ce6}})[_0x77dd('0x16')](function(_0x2402e8){if(!_0x2402e8)return[];return _0x2402e8[_0x77dd('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x77dd('0x27')](_0x2f087e)[_0x77dd('0x16')](function(_0x39278c){var _0xe6c483=_(_0x39278c)[_0x77dd('0x28')]()[_0x77dd('0x25')]('id')[_0x77dd('0x29')]()[_0x77dd('0x2a')]();return _0xe6c483;});}exports[_0x77dd('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x36ed29,_0x26f52c,_0x319197){try{if(_0x26f52c[_0x77dd('0xa')]>0x0){_0x36ed29=_0x36ed29[_0x77dd('0x9')](function(_0x30843a){return _0x26f52c[_0x77dd('0x2c')](_0x30843a['id']);});}var _0x3036b8=_0x36ed29['filter'](function(_0x241b00){var _0x2888bc=_0x77dd('0x20');if(isAgentIdle(_0x241b00)){_0x2888bc='idle';}return _0x2888bc===_0x319197;});return _['map'](_0x3036b8,'id');}catch(_0x174b09){throw _0x174b09;}}exports[_0x77dd('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4f6daf,_0x16c60f,_0x570760){return Promise['resolve']()[_0x77dd('0x16')](function(){if(_0x16c60f['length']>0x0){_0x4f6daf=_0x4f6daf[_0x77dd('0x9')](function(_0x4f4e9d){return _0x16c60f[_0x77dd('0x2c')](_0x4f4e9d['id']);});}return _0x4f6daf;})[_0x77dd('0x16')](function(){return db[_0x77dd('0x2e')][_0x77dd('0x2f')]({'attributes':['id',_0x77dd('0x30'),_0x77dd('0x31'),_0x77dd('0x32'),_0x77dd('0x5'),_0x77dd('0x33'),_0x77dd('0x6'),_0x77dd('0x7'),'voicePause',_0x77dd('0x34'),_0x77dd('0x35')],'where':{'id':{'$in':_['map'](_0x4f6daf,'id')}},'raw':!![]});})[_0x77dd('0x16')](function(_0x1bf9ff){return _0x1bf9ff[_0x77dd('0x25')](function(_0x442f6e){var _0x31a853=_['find'](_0x4f6daf,['id',_0x442f6e['id']]);var _0x2a09f6=filterAgentAttributes(_0x31a853);_['merge'](_0x442f6e,_0x2a09f6);_0x442f6e[_0x77dd('0x36')]=getAgentStatus(_0x442f6e);return _0x442f6e;});})['then'](function(_0x410795){var _0x5e7db8=sortAgentsByStatus(_0x410795,_0x570760);return _[_0x77dd('0x25')](_0x5e7db8,'id');})[_0x77dd('0x1d')](function(_0x1a955b){throw _0x1a955b;});}exports[_0x77dd('0x37')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x13d8f3){var _0x481dd4={'fields':[],'order':null};var _0x22302d=_0x13d8f3[_0x77dd('0x38')](',');_0x481dd4[_0x77dd('0x39')]=_[_0x77dd('0x9')](_0x22302d,function(_0x1a9d40){if(!_0x1a9d40[_0x77dd('0x2c')](_0x77dd('0x36'))){return!![];}_0x481dd4[_0x77dd('0x3a')]=_['startsWith'](_0x1a9d40,'-')?_0x77dd('0x3b'):_0x77dd('0x3c');return![];});return _0x481dd4;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x461dc3){if(_0x461dc3[_0x77dd('0x2c')](_0x77dd('0x31'))&&!_0x461dc3[_0x77dd('0x2c')]('internal')){var _0x11e105=_0x461dc3[_0x77dd('0x3d')](0x0,_0x461dc3['indexOf'](_0x77dd('0x31')));_0x461dc3+=','+_0x11e105+'internal';}return _0x461dc3;}exports[_0x77dd('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x4d0b62,_0x246703){var _0x4a749a=_0x4d0b62[_0x77dd('0x3f')](function(_0x5eb0dd,_0x198092){if(_0x5eb0dd[_0x77dd('0x36')]===_0x198092[_0x77dd('0x36')]){if(_0x5eb0dd[_0x77dd('0x36')]===_0x77dd('0x10')){if(_0x246703==='DESC'){return(_0x5eb0dd[_0x77dd('0x35')]||'')<(_0x198092[_0x77dd('0x35')]||'')||_0x5eb0dd[_0x77dd('0x31')][_0x77dd('0x40')]()>_0x198092['fullname'][_0x77dd('0x40')]()?0x1:-0x1;}else{return(_0x5eb0dd[_0x77dd('0x35')]||'')<(_0x198092[_0x77dd('0x35')]||'')||_0x5eb0dd[_0x77dd('0x31')][_0x77dd('0x40')]()>_0x198092['fullname'][_0x77dd('0x40')]()?-0x1:0x1;}}else{if(_0x246703==='DESC'){return _0x5eb0dd[_0x77dd('0x31')][_0x77dd('0x40')]()<_0x198092[_0x77dd('0x31')][_0x77dd('0x40')]()?0x1:-0x1;}else{return _0x5eb0dd[_0x77dd('0x31')][_0x77dd('0x40')]()<_0x198092[_0x77dd('0x31')][_0x77dd('0x40')]()?-0x1:0x1;}}}else{if(_0x246703==='DESC'){return _0x5eb0dd['globalStatus']<_0x198092[_0x77dd('0x36')]?0x1:-0x1;}else{return _0x5eb0dd[_0x77dd('0x36')]<_0x198092['globalStatus']?-0x1:0x1;}}});return _0x4a749a;}exports[_0x77dd('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0x4f45e5){var _0x3e01cd=[_0x77dd('0x42'),'online',_0x77dd('0x43'),_0x77dd('0x44'),_0x77dd('0x35'),_0x77dd('0x44'),_0x77dd('0x45'),_0x77dd('0x46'),_0x77dd('0x32'),'openchannelPause',_0x77dd('0x33'),_0x77dd('0x7'),_0x77dd('0x34'),'faxPause',_0x77dd('0xf'),_0x77dd('0x47'),'openchannelCapacity','mailCapacity',_0x77dd('0x48'),_0x77dd('0x49'),_0x77dd('0x4a'),_0x77dd('0x4b'),_0x77dd('0x4c'),'mailCurrentCapacity',_0x77dd('0x4d'),'whatsappCurrentCapacity',_0x77dd('0x4e'),'chatStatus','openchannelStatus','mailStatus',_0x77dd('0x13'),_0x77dd('0x14'),_0x77dd('0x4f'),_0x77dd('0x50'),_0x77dd('0x51'),_0x77dd('0x52'),'mailStatusTime',_0x77dd('0x53'),_0x77dd('0x54'),_0x77dd('0x55'),_0x77dd('0x56'),_0x77dd('0x57'),_0x77dd('0x58'),_0x77dd('0x59'),_0x77dd('0x5a'),_0x77dd('0x5b'),_0x77dd('0x5c')];var _0x3ed4f1=[_0x77dd('0x32'),_0x77dd('0x6'),'mailPause','smsPause',_0x77dd('0x34'),_0x77dd('0x5'),_0x77dd('0xf'),_0x77dd('0x5d')];var _0x2d8555=_(_0x4f45e5)[_0x77dd('0x5e')](_0x3ed4f1)[_0x77dd('0x5f')](_0x3e01cd)[_0x77dd('0x2a')]();return _0x2d8555;}exports[_0x77dd('0x60')]=filterAgentAttributes;
\ No newline at end of file
+var _0xd0fb=['map','findOne','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','mailPause','pauseType','globalStatus','getSortedAgentsIdsByStatus','fields','order','DESC','ASC','getUpdatedSortOptions','internal','substring','sort','fullname','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','smsPause','chatCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','mailStatusTime','smsStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','openchannelPause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','voicePause','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','Queue'];(function(_0x16e63c,_0x562b85){var _0x104a9f=function(_0x36cb31){while(--_0x36cb31){_0x16e63c['push'](_0x16e63c['shift']());}};_0x104a9f(++_0x562b85);}(_0xd0fb,0x8a));var _0xbd0f=function(_0x488a30,_0x182644){_0x488a30=_0x488a30-0x0;var _0x2e0ef5=_0xd0fb[_0x488a30];return _0x2e0ef5;};'use strict';var _=require(_0xbd0f('0x0'));var jayson=require(_0xbd0f('0x1'));var db=require(_0xbd0f('0x2'))['db'];var amiClient=jayson[_0xbd0f('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0xbd0f('0x3')][_0xbd0f('0x4')]({'port':0x232c});function isAgentPaused(_0x51e1fa,_0x3c6034){var _0x27f482=[_0x51e1fa[_0xbd0f('0x5')],_0x51e1fa[_0xbd0f('0x6')],_0x51e1fa['mailPause'],_0x51e1fa[_0xbd0f('0x7')],_0x51e1fa['smsPause'],_0x51e1fa['voicePause'],_0x51e1fa[_0xbd0f('0x8')]];if(!_0x3c6034)return _['every'](_0x27f482);var _0x5472c3=_[_0xbd0f('0x9')](_0x27f482);return _0x5472c3[_0xbd0f('0xa')]>0x0&&_0x5472c3[_0xbd0f('0xa')]<_0x27f482[_0xbd0f('0xa')]?!![]:![];}function isIdle(_0x1b7064){return _0x1b7064===_0xbd0f('0xb')||_0x1b7064===_0xbd0f('0xc')||_0x1b7064===_0xbd0f('0xd')||_0x1b7064===_0xbd0f('0xe')||_[_0xbd0f('0xf')](_0x1b7064);}function isAgentIdle(_0x3eb1c5){if(_0x3eb1c5[_0xbd0f('0x10')]!==_0xbd0f('0xb')&&_0x3eb1c5[_0xbd0f('0x11')]){_0x3eb1c5['voiceStatus']=_0xbd0f('0x12');return![];}return _['every']([_0x3eb1c5[_0xbd0f('0x13')],_0x3eb1c5[_0xbd0f('0x14')],_0x3eb1c5[_0xbd0f('0x15')],_0x3eb1c5[_0xbd0f('0x16')],_0x3eb1c5[_0xbd0f('0x17')],_0x3eb1c5[_0xbd0f('0x10')],_0x3eb1c5[_0xbd0f('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xbd0f('0x19')](_0xbd0f('0x1a'),{})[_0xbd0f('0x1b')](function(_0x2bbf83){if(_0x2bbf83['error']){throw new Error(_0xbd0f('0x1c'));}var _0xb0c318=_0x2bbf83[_0xbd0f('0x1d')];return routingClient[_0xbd0f('0x19')](_0xbd0f('0x1a'),{})[_0xbd0f('0x1b')](function(_0x5a34ca){if(_0x5a34ca[_0xbd0f('0x1e')]){throw new Error(_0xbd0f('0x1f'));}var _0x1c0211=_0x5a34ca[_0xbd0f('0x1d')];return _[_0xbd0f('0x20')]({},_0xb0c318,_0x1c0211);});})[_0xbd0f('0x21')](function(_0xeab4e){throw _0xeab4e;});}exports[_0xbd0f('0x22')]=getRealtimeAgents;function getAgentStatus(_0x5612f3){var _0x50f694=_0xbd0f('0xc');if(isAgentPaused(_0x5612f3))_0x50f694=_0xbd0f('0x12');else if(isAgentPaused(_0x5612f3,!![]))_0x50f694='*pause';else if(isAgentIdle(_0x5612f3))_0x50f694=_0xbd0f('0xb');else _0x50f694=_0xbd0f('0x23');return _0x50f694;}exports[_0xbd0f('0x24')]=getAgentStatus;function getAgentIdsByQueues(_0x162a08,_0x261da0){var _0x2cefcc=_[_0xbd0f('0x25')](_0x162a08)?_0x162a08:[_0x162a08];var _0x135dab=_[_0xbd0f('0x26')](_0x261da0)+_0xbd0f('0x27');var _0x409d68=_[_0xbd0f('0x28')](_0x2cefcc,function(_0x5e0a12){return db[_0x135dab][_0xbd0f('0x29')]({'where':{'id':_0x5e0a12}})[_0xbd0f('0x1b')](function(_0x14af69){if(!_0x14af69)return[];return _0x14af69['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xbd0f('0x2a')](_0x409d68)[_0xbd0f('0x1b')](function(_0x1910c2){var _0x2362cd=_(_0x1910c2)[_0xbd0f('0x2b')]()[_0xbd0f('0x28')]('id')['uniq']()[_0xbd0f('0x2c')]();return _0x2362cd;});}exports[_0xbd0f('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x4df061,_0x5d2aeb,_0x5b0e86){try{if(_0x5d2aeb[_0xbd0f('0xa')]>0x0){_0x4df061=_0x4df061[_0xbd0f('0x9')](function(_0x3a9c7a){return _0x5d2aeb[_0xbd0f('0x2e')](_0x3a9c7a['id']);});}var _0x3d4968=_0x4df061[_0xbd0f('0x9')](function(_0x21be0c){var _0x3cf8ab=_0xbd0f('0x23');if(isAgentIdle(_0x21be0c)){_0x3cf8ab=_0xbd0f('0xb');}return _0x3cf8ab===_0x5b0e86;});return _['map'](_0x3d4968,'id');}catch(_0xa20d44){throw _0xa20d44;}}exports[_0xbd0f('0x2f')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x39493e,_0xd77c08,_0x1b546f){return Promise[_0xbd0f('0x30')]()[_0xbd0f('0x1b')](function(){if(_0xd77c08[_0xbd0f('0xa')]>0x0){_0x39493e=_0x39493e[_0xbd0f('0x9')](function(_0x3149a1){return _0xd77c08[_0xbd0f('0x2e')](_0x3149a1['id']);});}return _0x39493e;})['then'](function(){return db[_0xbd0f('0x31')]['findAll']({'attributes':['id','name','fullname',_0xbd0f('0x5'),_0xbd0f('0x6'),_0xbd0f('0x32'),_0xbd0f('0x7'),'smsPause',_0xbd0f('0x11'),_0xbd0f('0x8'),_0xbd0f('0x33')],'where':{'id':{'$in':_['map'](_0x39493e,'id')}},'raw':!![]});})[_0xbd0f('0x1b')](function(_0x3b3f7f){return _0x3b3f7f[_0xbd0f('0x28')](function(_0x1e411a){var _0x16636e=_['find'](_0x39493e,['id',_0x1e411a['id']]);var _0x4b9a17=filterAgentAttributes(_0x16636e);_['merge'](_0x1e411a,_0x4b9a17);_0x1e411a[_0xbd0f('0x34')]=getAgentStatus(_0x1e411a);return _0x1e411a;});})[_0xbd0f('0x1b')](function(_0xac02ca){var _0xcd90cc=sortAgentsByStatus(_0xac02ca,_0x1b546f);return _[_0xbd0f('0x28')](_0xcd90cc,'id');})[_0xbd0f('0x21')](function(_0x3afd2b){throw _0x3afd2b;});}exports[_0xbd0f('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x12f9f3){var _0x4b152f={'fields':[],'order':null};var _0x4ead4c=_0x12f9f3['split'](',');_0x4b152f[_0xbd0f('0x36')]=_['filter'](_0x4ead4c,function(_0x1792cb){if(!_0x1792cb['includes'](_0xbd0f('0x34'))){return!![];}_0x4b152f[_0xbd0f('0x37')]=_['startsWith'](_0x1792cb,'-')?_0xbd0f('0x38'):_0xbd0f('0x39');return![];});return _0x4b152f;}exports[_0xbd0f('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x34bad2){if(_0x34bad2[_0xbd0f('0x2e')]('fullname')&&!_0x34bad2[_0xbd0f('0x2e')](_0xbd0f('0x3b'))){var _0x4b8b85=_0x34bad2[_0xbd0f('0x3c')](0x0,_0x34bad2['indexOf']('fullname'));_0x34bad2+=','+_0x4b8b85+_0xbd0f('0x3b');}return _0x34bad2;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x18e9c6,_0x390f9f){var _0x481002=_0x18e9c6[_0xbd0f('0x3d')](function(_0x385be4,_0x245d27){if(_0x385be4[_0xbd0f('0x34')]===_0x245d27[_0xbd0f('0x34')]){if(_0x385be4['globalStatus']===_0xbd0f('0x12')){if(_0x390f9f===_0xbd0f('0x38')){return(_0x385be4[_0xbd0f('0x33')]||'')<(_0x245d27[_0xbd0f('0x33')]||'')||_0x385be4[_0xbd0f('0x3e')][_0xbd0f('0x3f')]()>_0x245d27['fullname'][_0xbd0f('0x3f')]()?0x1:-0x1;}else{return(_0x385be4['pauseType']||'')<(_0x245d27[_0xbd0f('0x33')]||'')||_0x385be4[_0xbd0f('0x3e')]['toLowerCase']()>_0x245d27[_0xbd0f('0x3e')][_0xbd0f('0x3f')]()?-0x1:0x1;}}else{if(_0x390f9f===_0xbd0f('0x38')){return _0x385be4[_0xbd0f('0x3e')][_0xbd0f('0x3f')]()<_0x245d27['fullname'][_0xbd0f('0x3f')]()?0x1:-0x1;}else{return _0x385be4['fullname'][_0xbd0f('0x3f')]()<_0x245d27[_0xbd0f('0x3e')][_0xbd0f('0x3f')]()?-0x1:0x1;}}}else{if(_0x390f9f===_0xbd0f('0x38')){return _0x385be4['globalStatus']<_0x245d27[_0xbd0f('0x34')]?0x1:-0x1;}else{return _0x385be4[_0xbd0f('0x34')]<_0x245d27[_0xbd0f('0x34')]?-0x1:0x1;}}});return _0x481002;}exports[_0xbd0f('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x29de86){var _0x329dd8=[_0xbd0f('0x41'),_0xbd0f('0x42'),_0xbd0f('0x43'),_0xbd0f('0x44'),_0xbd0f('0x33'),_0xbd0f('0x44'),'internal',_0xbd0f('0x45'),_0xbd0f('0x5'),_0xbd0f('0x7'),'mailPause',_0xbd0f('0x46'),_0xbd0f('0x8'),_0xbd0f('0x6'),_0xbd0f('0x11'),_0xbd0f('0x47'),'openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity',_0xbd0f('0x48'),_0xbd0f('0x49'),_0xbd0f('0x4a'),_0xbd0f('0x4b'),'smsCurrentCapacity',_0xbd0f('0x4c'),'faxCurrentCapacity','chatStatus',_0xbd0f('0x16'),_0xbd0f('0x15'),_0xbd0f('0x17'),_0xbd0f('0x18'),_0xbd0f('0x14'),_0xbd0f('0x10'),_0xbd0f('0x4d'),'openchannelStatusTime',_0xbd0f('0x4e'),_0xbd0f('0x4f'),'whatsappStatusTime','faxStatusTime',_0xbd0f('0x50'),_0xbd0f('0x51'),_0xbd0f('0x52'),_0xbd0f('0x53'),_0xbd0f('0x54'),_0xbd0f('0x55'),_0xbd0f('0x56')];var _0x2ff120=[_0xbd0f('0x5'),_0xbd0f('0x7'),_0xbd0f('0x32'),'smsPause',_0xbd0f('0x8'),_0xbd0f('0x6'),'voicePause',_0xbd0f('0x42')];var _0x5357b5=_(_0x29de86)[_0xbd0f('0x57')](_0x2ff120)[_0xbd0f('0x58')](_0x329dd8)['value']();return _0x5357b5;}exports['filterAgentAttributes']=filterAgentAttributes;
\ No newline at end of file