Built motion from commit a9fb64cc6defd8fb3a5cc199221f878e91c0e969. Version 3.0.0...
[motion-next.git] / server / services / routing / server / applications / strategy / util.js
1 const a1213_0x1b86=['message','util','body','notificationSound','PAUSE','OFFLINE','busy','undefined','split','online','account','msg','name','notificationShake','error','I\x20can\x27t\x20render\x20your\x20template','user:%s','format','BUSY','notification:%s','showNotification','emit','info','notificationTemplate','[%s][QUEUE][AGENT:%s][STATUS:%s]','hideNotification','queue','save','../utils','Capacity','CurrentCapacity','\x20interaction','isAgentAvailable'];(function(_0x93dc55,_0x1b86fb){const _0x128ffb=function(_0x33d0c3){while(--_0x33d0c3){_0x93dc55['push'](_0x93dc55['shift']());}};_0x128ffb(++_0x1b86fb);}(a1213_0x1b86,0x183));const a1213_0x128f=function(_0x93dc55,_0x1b86fb){_0x93dc55=_0x93dc55-0x0;let _0x128ffb=a1213_0x1b86[_0x93dc55];return _0x128ffb;};const _0x1491d1=a1213_0x128f;'use strict';const util=require(_0x1491d1('0xa')),utils=require(_0x1491d1('0x4')),logger=require('../../../../../config/logger')('routing'),{getSocket}=require('../../../../../rediscache'),io=getSocket();function sendNotification(_0x33d0c3,_0x533665,_0x1c694f,_0x59e43c,_0x21e343,_0x1ab83){const _0x4c6adb=_0x1491d1;io['to'](util['format'](_0x4c6adb('0x19'),_0x59e43c['name']))[_0x4c6adb('0x1e')]('user:save',_0x59e43c);const _0x556a05=_0x1ab83||{},_0x5d396c=_0x1c694f[_0x4c6adb('0x11')]('.'),_0x24d4b1={'uniqueid':_0x533665,'channel':_0x5d396c[0x0],'id':_0x5d396c[0x1],'title':_0x5d396c[0x0]+_0x4c6adb('0x7'),'interactionId':_0x5d396c[0x2],'queue':_0x21e343?_0x21e343[_0x4c6adb('0x15')]:null,'sound':_0x556a05[_0x4c6adb('0x13')][_0x4c6adb('0xc')],'shake':_0x556a05[_0x4c6adb('0x13')][_0x4c6adb('0x16')]};try{!_0x556a05[_0x4c6adb('0xb')]&&(_0x556a05[_0x4c6adb('0xb')]={});if(_0x21e343)_0x556a05[_0x4c6adb('0xb')][_0x4c6adb('0x2')]=_0x21e343;else _0x556a05['body'][_0x4c6adb('0x2')]&&delete _0x556a05['body'][_0x4c6adb('0x2')];_0x24d4b1[_0x4c6adb('0x14')]=utils['getMustacheRender'](_0x556a05[_0x4c6adb('0x13')][_0x4c6adb('0x20')],_0x556a05);}catch(_0x26a271){_0x24d4b1[_0x4c6adb('0x14')]=_0x4c6adb('0x18'),logger[_0x4c6adb('0x17')](util['format']('[%s][QUEUE]\x20%s',_0x533665,_0x26a271[_0x4c6adb('0x9')]));}io['to'](util[_0x4c6adb('0x1a')]('user:%s',_0x59e43c['name']))[_0x4c6adb('0x1e')](util[_0x4c6adb('0x1a')](_0x4c6adb('0x1c'),_0x33d0c3?_0x4c6adb('0x3'):'remove'),_0x24d4b1);}function writeLog(_0x7e69f7,_0x851c4a,_0x1bc1a3){const _0x12a7ff=_0x1491d1;return logger[_0x12a7ff('0x1f')](util[_0x12a7ff('0x1a')](_0x12a7ff('0x0'),_0x7e69f7,_0x851c4a['name'],_0x1bc1a3));}exports[_0x1491d1('0x8')]=function(_0x4e63ab,_0xaa566a,_0x35d408,_0x5d9eb3){const _0x5315eb=_0x1491d1;if(_0xaa566a[_0x5315eb('0xf')])return writeLog(_0x4e63ab,_0xaa566a,_0x5315eb('0x1b')),![];if(!_0xaa566a[_0x5315eb('0x12')])return writeLog(_0x4e63ab,_0xaa566a,_0x5315eb('0xe')),![];if(_0xaa566a[_0x35d408+'Pause'])return writeLog(_0x4e63ab,_0xaa566a,_0x5315eb('0xd')),![];if(_0x5d9eb3&&typeof _0xaa566a[_0x35d408+_0x5315eb('0x5')]!==_0x5315eb('0x10')&&typeof _0xaa566a[_0x35d408+_0x5315eb('0x6')]!==_0x5315eb('0x10')){if(_0xaa566a[_0x35d408+_0x5315eb('0x5')]>0x0&&_0xaa566a[_0x35d408+_0x5315eb('0x6')]>=_0xaa566a[_0x35d408+_0x5315eb('0x5')])return writeLog(_0x4e63ab,_0xaa566a,_0x35d408['toUpperCase']()+'\x20MAXCAPACITY'),![];}return!![];},exports[_0x1491d1('0x1d')]=function(_0x12ba08,_0x4dac41,_0x2f56eb,_0x2e681d,_0x160728){return sendNotification(!![],_0x12ba08,_0x4dac41,_0x2f56eb,_0x2e681d,_0x160728);},exports[_0x1491d1('0x1')]=function(_0x504954,_0x23a391,_0x756ca5,_0x3d9913,_0x286433){return sendNotification(![],_0x504954,_0x23a391,_0x756ca5,_0x3d9913,_0x286433);},exports['writeLog']=writeLog;