Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / services / routing / server / applications / strategy / util.js
index df6830b..1975dd2 100644 (file)
@@ -1 +1 @@
-const a1213_0x3084=['account','PAUSE','notificationSound','I\x20can\x27t\x20render\x20your\x20template','BUSY','Pause','notification:%s','Capacity','showNotification','\x20MAXCAPACITY','CurrentCapacity','notificationShake','user:%s','emit','info','online','../../../../../config/logger','body','undefined','../utils','error','msg','[%s][QUEUE]\x20%s','name','user:save','split','toUpperCase','remove','../../../../../rediscache','busy','format','isAgentAvailable','queue','OFFLINE','message','notificationTemplate'];(function(_0x368680,_0x3084ec){const _0xbd0924=function(_0x524de6){while(--_0x524de6){_0x368680['push'](_0x368680['shift']());}};_0xbd0924(++_0x3084ec);}(a1213_0x3084,0x90));const a1213_0xbd09=function(_0x368680,_0x3084ec){_0x368680=_0x368680-0x0;let _0xbd0924=a1213_0x3084[_0x368680];return _0xbd0924;};const _0x31c324=a1213_0xbd09;'use strict';const util=require('util'),utils=require(_0x31c324('0x13')),logger=require(_0x31c324('0x10'))('routing'),{getSocket}=require(_0x31c324('0x1c')),io=getSocket();function sendNotification(_0x524de6,_0x25711f,_0x28ed0d,_0x1af52a,_0x4bac53,_0x2c484d){const _0x4b737a=_0x31c324;io['to'](util[_0x4b737a('0x1e')](_0x4b737a('0xc'),_0x1af52a[_0x4b737a('0x17')]))[_0x4b737a('0xd')](_0x4b737a('0x18'),_0x1af52a);const _0x158295=_0x2c484d||{},_0x5c1d81=_0x28ed0d[_0x4b737a('0x19')]('.'),_0x79a4c7={'uniqueid':_0x25711f,'channel':_0x5c1d81[0x0],'id':_0x5c1d81[0x1],'title':_0x5c1d81[0x0]+'\x20interaction','interactionId':_0x5c1d81[0x2],'queue':_0x4bac53?_0x4bac53[_0x4b737a('0x17')]:null,'sound':_0x158295[_0x4b737a('0x0')][_0x4b737a('0x2')],'shake':_0x158295[_0x4b737a('0x0')][_0x4b737a('0xb')]};try{!_0x158295['body']&&(_0x158295[_0x4b737a('0x11')]={});if(_0x4bac53)_0x158295[_0x4b737a('0x11')]['queue']=_0x4bac53;else _0x158295[_0x4b737a('0x11')][_0x4b737a('0x20')]&&delete _0x158295['body'][_0x4b737a('0x20')];_0x79a4c7[_0x4b737a('0x15')]=utils['getMustacheRender'](_0x158295['account'][_0x4b737a('0x23')],_0x158295);}catch(_0xa5cb59){_0x79a4c7[_0x4b737a('0x15')]=_0x4b737a('0x3'),logger[_0x4b737a('0x14')](util[_0x4b737a('0x1e')](_0x4b737a('0x16'),_0x25711f,_0xa5cb59[_0x4b737a('0x22')]));}io['to'](util['format']('user:%s',_0x1af52a[_0x4b737a('0x17')]))[_0x4b737a('0xd')](util[_0x4b737a('0x1e')](_0x4b737a('0x6'),_0x524de6?'save':_0x4b737a('0x1b')),_0x79a4c7);}function writeLog(_0xde090e,_0x47ba28,_0x182549){const _0x2fa755=_0x31c324;return logger[_0x2fa755('0xe')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0xde090e,_0x47ba28[_0x2fa755('0x17')],_0x182549));}exports[_0x31c324('0x1f')]=function(_0x2318eb,_0x490550,_0xee10f3,_0x57af45){const _0x4001a5=_0x31c324;if(_0x490550[_0x4001a5('0x1d')])return writeLog(_0x2318eb,_0x490550,_0x4001a5('0x4')),![];if(!_0x490550[_0x4001a5('0xf')])return writeLog(_0x2318eb,_0x490550,_0x4001a5('0x21')),![];if(_0x490550[_0xee10f3+_0x4001a5('0x5')])return writeLog(_0x2318eb,_0x490550,_0x4001a5('0x1')),![];if(_0x57af45&&typeof _0x490550[_0xee10f3+_0x4001a5('0x7')]!==_0x4001a5('0x12')&&typeof _0x490550[_0xee10f3+_0x4001a5('0xa')]!==_0x4001a5('0x12')){if(_0x490550[_0xee10f3+_0x4001a5('0x7')]>0x0&&_0x490550[_0xee10f3+_0x4001a5('0xa')]>=_0x490550[_0xee10f3+_0x4001a5('0x7')])return writeLog(_0x2318eb,_0x490550,_0xee10f3[_0x4001a5('0x1a')]()+_0x4001a5('0x9')),![];}return!![];},exports[_0x31c324('0x8')]=function(_0x38fdd8,_0x57df61,_0x4522ed,_0x218dfa,_0x1013f8){return sendNotification(!![],_0x38fdd8,_0x57df61,_0x4522ed,_0x218dfa,_0x1013f8);},exports['hideNotification']=function(_0x311daa,_0x26b0b4,_0x42053f,_0x3c79e9,_0x4b9109){return sendNotification(![],_0x311daa,_0x26b0b4,_0x42053f,_0x3c79e9,_0x4b9109);},exports['writeLog']=writeLog;
\ No newline at end of file
+const a1213_0x2519=['toUpperCase','emit','save','I\x20can\x27t\x20render\x20your\x20template','../utils','PAUSE','[%s][QUEUE]\x20%s','getMustacheRender','user:save','notificationTemplate','info','user:%s','routing','undefined','account','notificationShake','body','CurrentCapacity','notification:%s','[%s][QUEUE][AGENT:%s][STATUS:%s]','\x20interaction','Capacity','../../../../../config/logger','queue','online','error','\x20MAXCAPACITY','../../../../../rediscache','format','name','remove','util','msg','Pause','hideNotification'];(function(_0x159e39,_0x2519c4){const _0x56342b=function(_0x306fc3){while(--_0x306fc3){_0x159e39['push'](_0x159e39['shift']());}};_0x56342b(++_0x2519c4);}(a1213_0x2519,0xd3));const a1213_0x5634=function(_0x159e39,_0x2519c4){_0x159e39=_0x159e39-0x0;let _0x56342b=a1213_0x2519[_0x159e39];return _0x56342b;};const _0x56219b=a1213_0x5634;'use strict';const util=require(_0x56219b('0x1e')),utils=require(_0x56219b('0x3')),logger=require(_0x56219b('0x15'))(_0x56219b('0xb')),{getSocket}=require(_0x56219b('0x1a')),io=getSocket();function sendNotification(_0x306fc3,_0xd601a4,_0x457689,_0x5ec779,_0x14ebba,_0x492e9b){const _0x40ac63=_0x56219b;io['to'](util['format'](_0x40ac63('0xa'),_0x5ec779['name']))[_0x40ac63('0x0')](_0x40ac63('0x7'),_0x5ec779);const _0x582b0a=_0x492e9b||{},_0x4af215=_0x457689['split']('.'),_0x2025e9={'uniqueid':_0xd601a4,'channel':_0x4af215[0x0],'id':_0x4af215[0x1],'title':_0x4af215[0x0]+_0x40ac63('0x13'),'interactionId':_0x4af215[0x2],'queue':_0x14ebba?_0x14ebba[_0x40ac63('0x1c')]:null,'sound':_0x582b0a[_0x40ac63('0xd')]['notificationSound'],'shake':_0x582b0a[_0x40ac63('0xd')][_0x40ac63('0xe')]};try{!_0x582b0a[_0x40ac63('0xf')]&&(_0x582b0a[_0x40ac63('0xf')]={});if(_0x14ebba)_0x582b0a[_0x40ac63('0xf')][_0x40ac63('0x16')]=_0x14ebba;else _0x582b0a['body'][_0x40ac63('0x16')]&&delete _0x582b0a['body'][_0x40ac63('0x16')];_0x2025e9[_0x40ac63('0x1f')]=utils[_0x40ac63('0x6')](_0x582b0a['account'][_0x40ac63('0x8')],_0x582b0a);}catch(_0x2a1a99){_0x2025e9[_0x40ac63('0x1f')]=_0x40ac63('0x2'),logger[_0x40ac63('0x18')](util[_0x40ac63('0x1b')](_0x40ac63('0x5'),_0xd601a4,_0x2a1a99['message']));}io['to'](util[_0x40ac63('0x1b')](_0x40ac63('0xa'),_0x5ec779['name']))['emit'](util[_0x40ac63('0x1b')](_0x40ac63('0x11'),_0x306fc3?_0x40ac63('0x1'):_0x40ac63('0x1d')),_0x2025e9);}function writeLog(_0x3bb1e2,_0x414f23,_0x274238){const _0x5bb97e=_0x56219b;return logger[_0x5bb97e('0x9')](util[_0x5bb97e('0x1b')](_0x5bb97e('0x12'),_0x3bb1e2,_0x414f23[_0x5bb97e('0x1c')],_0x274238));}exports['isAgentAvailable']=function(_0x9e1ac2,_0x3d450a,_0x5b1b17,_0x4fec74){const _0x25a9aa=_0x56219b;if(_0x3d450a['busy'])return writeLog(_0x9e1ac2,_0x3d450a,'BUSY'),![];if(!_0x3d450a[_0x25a9aa('0x17')])return writeLog(_0x9e1ac2,_0x3d450a,'OFFLINE'),![];if(_0x3d450a[_0x5b1b17+_0x25a9aa('0x20')])return writeLog(_0x9e1ac2,_0x3d450a,_0x25a9aa('0x4')),![];if(_0x4fec74&&typeof _0x3d450a[_0x5b1b17+_0x25a9aa('0x14')]!=='undefined'&&typeof _0x3d450a[_0x5b1b17+'CurrentCapacity']!==_0x25a9aa('0xc')){if(_0x3d450a[_0x5b1b17+_0x25a9aa('0x14')]>0x0&&_0x3d450a[_0x5b1b17+_0x25a9aa('0x10')]>=_0x3d450a[_0x5b1b17+_0x25a9aa('0x14')])return writeLog(_0x9e1ac2,_0x3d450a,_0x5b1b17[_0x25a9aa('0x22')]()+_0x25a9aa('0x19')),![];}return!![];},exports['showNotification']=function(_0x1666f9,_0x117064,_0x5b1c2c,_0x425e45,_0x131637){return sendNotification(!![],_0x1666f9,_0x117064,_0x5b1c2c,_0x425e45,_0x131637);},exports[_0x56219b('0x21')]=function(_0x41434f,_0x59e489,_0x4cf8a1,_0x3d1587,_0x2fad8f){return sendNotification(![],_0x41434f,_0x59e489,_0x4cf8a1,_0x3d1587,_0x2fad8f);},exports['writeLog']=writeLog;
\ No newline at end of file