Built motion from commit efa66e19.|2.6.22
[motion2.git] / server / components / realtime / agents.js
index ab02769..45c5a67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0x46ed=['map','findOne','getAgents','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','pauseType','find','globalStatus','split','order','startsWith','DESC','ASC','fullname,internal','fullname','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastPauseAt','internal','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','role','lastLoginAt','faxStatus','mailCurrentCapacity','smsCurrentCapacity','onhold','queue','routealias','lodash','jayson/promise','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','chatStatus','openchannelStatus','smsStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','pause','*pause','idle','busy','isArray','startCase','Queue'];(function(_0x40c187,_0x4aa42a){var _0x2619b8=function(_0x1a0cd0){while(--_0x1a0cd0){_0x40c187['push'](_0x40c187['shift']());}};_0x2619b8(++_0x4aa42a);}(_0x46ed,0x168));var _0xd46e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46ed[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xd46e('0x0'));var jayson=require(_0xd46e('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xd46e('0x2')][_0xd46e('0x3')]({'port':0x232a});var routingClient=jayson[_0xd46e('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x2e6b84,_0x4518b8){var _0x54ef98=[_0x2e6b84[_0xd46e('0x4')],_0x2e6b84[_0xd46e('0x5')],_0x2e6b84[_0xd46e('0x6')],_0x2e6b84[_0xd46e('0x7')],_0x2e6b84[_0xd46e('0x8')],_0x2e6b84[_0xd46e('0x9')],_0x2e6b84[_0xd46e('0xa')]];if(!_0x4518b8)return _[_0xd46e('0xb')](_0x54ef98);var _0x31259b=_[_0xd46e('0xc')](_0x54ef98);return _0x31259b[_0xd46e('0xd')]>0x0&&_0x31259b['length']<_0x54ef98[_0xd46e('0xd')]?!![]:![];}function isIdle(_0x81235b){return _0x81235b==='idle'||_0x81235b===_0xd46e('0xe')||_0x81235b===_0xd46e('0xf')||_0x81235b===_0xd46e('0x10')||_[_0xd46e('0x11')](_0x81235b);}function isAgentIdle(_0x1ad723){if(_0x1ad723[_0xd46e('0x12')]!=='idle'&&_0x1ad723[_0xd46e('0x9')]){_0x1ad723['voiceStatus']='pause';return![];}return _[_0xd46e('0xb')]([_0x1ad723[_0xd46e('0x13')],_0x1ad723['faxStatus'],_0x1ad723['mailStatus'],_0x1ad723[_0xd46e('0x14')],_0x1ad723[_0xd46e('0x15')],_0x1ad723[_0xd46e('0x12')],_0x1ad723[_0xd46e('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xd46e('0x17'),{})[_0xd46e('0x18')](function(_0x417402){if(_0x417402[_0xd46e('0x19')]){throw new Error(_0xd46e('0x1a'));}var _0x47fa8f=_0x417402[_0xd46e('0x1b')];return routingClient[_0xd46e('0x1c')](_0xd46e('0x17'),{})['then'](function(_0x5ddd04){if(_0x5ddd04[_0xd46e('0x19')]){throw new Error(_0xd46e('0x1d'));}var _0x488690=_0x5ddd04['result'];return _[_0xd46e('0x1e')]({},_0x47fa8f,_0x488690);});})[_0xd46e('0x1f')](function(_0x362885){throw _0x362885;});}exports[_0xd46e('0x20')]=getRealtimeAgents;function getAgentStatus(_0x409010){var _0x312d6f=_0xd46e('0xe');if(isAgentPaused(_0x409010))_0x312d6f=_0xd46e('0x21');else if(isAgentPaused(_0x409010,!![]))_0x312d6f=_0xd46e('0x22');else if(isAgentIdle(_0x409010))_0x312d6f=_0xd46e('0x23');else _0x312d6f=_0xd46e('0x24');return _0x312d6f;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x259072,_0x1c83fa){var _0x79aa51=_[_0xd46e('0x25')](_0x259072)?_0x259072:[_0x259072];var _0x128246=_[_0xd46e('0x26')](_0x1c83fa)+_0xd46e('0x27');var _0x8a1be=_[_0xd46e('0x28')](_0x79aa51,function(_0x4cf899){return db[_0x128246][_0xd46e('0x29')]({'where':{'id':_0x4cf899}})['then'](function(_0x4b8f6a){if(!_0x4b8f6a)return[];return _0x4b8f6a[_0xd46e('0x2a')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xd46e('0x2b')](_0x8a1be)[_0xd46e('0x18')](function(_0x42afc7){var _0x247b9f=_(_0x42afc7)[_0xd46e('0x2c')]()[_0xd46e('0x28')]('id')['uniq']()[_0xd46e('0x2d')]();return _0x247b9f;});}exports[_0xd46e('0x2e')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0xddbce9,_0x17db79,_0x96f15c){try{if(_0x17db79[_0xd46e('0xd')]>0x0){_0xddbce9=_0xddbce9['filter'](function(_0x465d54){return _0x17db79[_0xd46e('0x2f')](_0x465d54['id']);});}var _0x2d1afe=_0xddbce9[_0xd46e('0xc')](function(_0x106edc){var _0x423ea3=_0xd46e('0x24');if(isAgentIdle(_0x106edc)){_0x423ea3=_0xd46e('0x23');}return _0x423ea3===_0x96f15c;});return _[_0xd46e('0x28')](_0x2d1afe,'id');}catch(_0x45ea47){throw _0x45ea47;}}exports[_0xd46e('0x30')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x504324,_0x2f4a1b,_0x5ed8dc){return Promise[_0xd46e('0x31')]()[_0xd46e('0x18')](function(){if(_0x2f4a1b[_0xd46e('0xd')]>0x0){_0x504324=_0x504324[_0xd46e('0xc')](function(_0x5ef248){return _0x2f4a1b[_0xd46e('0x2f')](_0x5ef248['id']);});}return _0x504324;})[_0xd46e('0x18')](function(){return db['User'][_0xd46e('0x32')]({'attributes':['id',_0xd46e('0x33'),'fullname',_0xd46e('0x4'),_0xd46e('0x5'),_0xd46e('0x6'),'openchannelPause','smsPause',_0xd46e('0x9'),_0xd46e('0xa'),_0xd46e('0x34')],'where':{'id':{'$in':_[_0xd46e('0x28')](_0x504324,'id')}},'raw':!![]});})[_0xd46e('0x18')](function(_0x423de9){return _0x423de9[_0xd46e('0x28')](function(_0xf8b746){var _0x527a2f=_[_0xd46e('0x35')](_0x504324,['id',_0xf8b746['id']]);var _0x1a1181=filterAgentAttributes(_0x527a2f);_[_0xd46e('0x1e')](_0xf8b746,_0x1a1181);_0xf8b746[_0xd46e('0x36')]=getAgentStatus(_0xf8b746);return _0xf8b746;});})[_0xd46e('0x18')](function(_0x1e0897){var _0x42ddde=sortAgentsByStatus(_0x1e0897,_0x5ed8dc);return _['map'](_0x42ddde,'id');})[_0xd46e('0x1f')](function(_0x357212){throw _0x357212;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x14447e){var _0x96b0f9={'fields':[],'order':null};var _0x12ccf8=_0x14447e[_0xd46e('0x37')](',');_0x96b0f9['fields']=_[_0xd46e('0xc')](_0x12ccf8,function(_0x3ecf34){if(!_0x3ecf34[_0xd46e('0x2f')](_0xd46e('0x36'))){return!![];}_0x96b0f9[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x3ecf34,'-')?_0xd46e('0x3a'):_0xd46e('0x3b');return![];});return _0x96b0f9;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x232e6f){if(!_0x232e6f){_0x232e6f=_0xd46e('0x3c');}if(_0x232e6f[_0xd46e('0x2f')](_0xd46e('0x3d'))&&!_0x232e6f[_0xd46e('0x2f')]('internal')){var _0x964c66=_0x232e6f['substring'](0x0,_0x232e6f['indexOf']('fullname'));_0x232e6f+=','+_0x964c66+'internal';}return _0x232e6f;}exports[_0xd46e('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x54949f,_0x3b76e0){var _0x40720e=_0x54949f['sort'](function(_0x462477,_0x4114e6){if(_0x462477[_0xd46e('0x36')]===_0x4114e6[_0xd46e('0x36')]){if(_0x462477[_0xd46e('0x36')]===_0xd46e('0x21')){if(_0x3b76e0===_0xd46e('0x3a')){return(_0x462477[_0xd46e('0x34')]||'')<(_0x4114e6[_0xd46e('0x34')]||'')||_0x462477[_0xd46e('0x3d')][_0xd46e('0x3f')]()>_0x4114e6['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x462477['pauseType']||'')<(_0x4114e6[_0xd46e('0x34')]||'')||_0x462477['fullname'][_0xd46e('0x3f')]()>_0x4114e6[_0xd46e('0x3d')][_0xd46e('0x3f')]()?-0x1:0x1;}}else{if(_0x3b76e0===_0xd46e('0x3a')){return _0x462477[_0xd46e('0x3d')][_0xd46e('0x3f')]()<_0x4114e6[_0xd46e('0x3d')][_0xd46e('0x3f')]()?0x1:-0x1;}else{return _0x462477['fullname'][_0xd46e('0x3f')]()<_0x4114e6['fullname'][_0xd46e('0x3f')]()?-0x1:0x1;}}}else{if(_0x3b76e0===_0xd46e('0x3a')){return _0x462477[_0xd46e('0x36')]<_0x4114e6[_0xd46e('0x36')]?0x1:-0x1;}else{return _0x462477[_0xd46e('0x36')]<_0x4114e6['globalStatus']?-0x1:0x1;}}});return _0x40720e;}exports[_0xd46e('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0xfcd7f9){var _0x2acb83=[_0xd46e('0x41'),_0xd46e('0x42'),'lastLoginAt',_0xd46e('0x43'),_0xd46e('0x34'),_0xd46e('0x43'),_0xd46e('0x44'),_0xd46e('0x45'),'chatPause',_0xd46e('0x7'),_0xd46e('0x6'),_0xd46e('0x8'),_0xd46e('0xa'),_0xd46e('0x5'),_0xd46e('0x9'),_0xd46e('0x46'),_0xd46e('0x47'),'mailCapacity',_0xd46e('0x48'),_0xd46e('0x49'),_0xd46e('0x4a'),_0xd46e('0x4b'),_0xd46e('0x4c'),'mailCurrentCapacity','smsCurrentCapacity',_0xd46e('0x4d'),_0xd46e('0x4e'),_0xd46e('0x13'),'openchannelStatus','mailStatus',_0xd46e('0x15'),_0xd46e('0x16'),'faxStatus',_0xd46e('0x12'),_0xd46e('0x4f'),_0xd46e('0x50'),_0xd46e('0x51'),_0xd46e('0x52'),_0xd46e('0x53'),_0xd46e('0x54'),_0xd46e('0x55'),'queue',_0xd46e('0x56'),_0xd46e('0x57'),_0xd46e('0x58'),_0xd46e('0x59'),'routealias'];var _0x56dd9a=[_0xd46e('0x4'),'openchannelPause',_0xd46e('0x6'),_0xd46e('0x8'),_0xd46e('0xa'),_0xd46e('0x5'),_0xd46e('0x9'),_0xd46e('0x42')];var _0x492329=_(_0xfcd7f9)[_0xd46e('0x5a')](_0x56dd9a)[_0xd46e('0x5b')](_0x2acb83)[_0xd46e('0x2d')]();return _0x492329;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xd46e('0x33'),_0xd46e('0x3d'),_0xd46e('0x5c'),_0xd46e('0x44'),_0xd46e('0x42'),_0xd46e('0x36'),_0xd46e('0x41'),_0xd46e('0x5d'),_0xd46e('0x34'),_0xd46e('0x43'),_0xd46e('0x5'),_0xd46e('0x4'),_0xd46e('0x6'),_0xd46e('0x7'),'smsPause',_0xd46e('0x9'),_0xd46e('0xa'),_0xd46e('0x13'),_0xd46e('0x5e'),'mailStatus',_0xd46e('0x14'),_0xd46e('0x15'),_0xd46e('0x12'),_0xd46e('0x16'),'chatStatusTime',_0xd46e('0x54'),_0xd46e('0x51'),'openchannelStatusTime','smsStatusTime',_0xd46e('0x55'),_0xd46e('0x53'),_0xd46e('0x46'),'faxCapacity','mailCapacity',_0xd46e('0x47'),_0xd46e('0x48'),_0xd46e('0x49'),_0xd46e('0x4b'),_0xd46e('0x4e'),_0xd46e('0x5f'),_0xd46e('0x4c'),_0xd46e('0x60'),_0xd46e('0x4d'),_0xd46e('0x58'),_0xd46e('0x59'),_0xd46e('0x56'),_0xd46e('0x61'),_0xd46e('0x62'),_0xd46e('0x63'),_0xd46e('0x57')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields;
\ No newline at end of file