Built motion from commit d3d6ca497.|1.0.32
[motion.git] / server / config / util / index.js
index f37994e..6f7a7b3 100644 (file)
@@ -1 +1 @@
-var _0x538c=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x46\x61\x78\x51\x75\x65\x75\x65","\x53\x6D\x73\x51\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x41\x63\x74\x69\x6F\x6E","\x73\x75\x6E","\x6D\x6F\x6E","\x74\x75\x65","\x77\x65\x64","\x74\x68\x75","\x66\x72\x69","\x73\x61\x74","\x6A\x61\x6E","\x66\x65\x62","\x6D\x61\x72","\x61\x70\x72","\x6D\x61\x79","\x6A\x75\x6E","\x6A\x75\x6C","\x61\x75\x67","\x73\x65\x70","\x6F\x63\x74","\x6E\x6F\x76","\x64\x65\x63","\x2C","\x73\x70\x6C\x69\x74","\x2A","\x48\x48\x3A\x6D\x6D","\x66\x6F\x72\x6D\x61\x74","\x2D","\x54\x52\x41\x4E\x47\x45\x20\x4B\x4F","\x6C\x6F\x67","\x64\x61\x79","\x69\x6E\x64\x65\x78\x4F\x66","\x73\x68\x69\x66\x74","\x70\x75\x73\x68","\x73\x6C\x69\x63\x65","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x44\x57\x52\x41\x4E\x47\x45\x20\x4B\x4F","\x64\x61\x74\x65","\x44\x4D\x52\x41\x4E\x47\x45\x20\x4B\x4F","\x6D\x6F\x6E\x74\x68","\x4D\x52\x41\x4E\x47\x45\x20\x4B\x4F","\x49\x4E\x54\x45\x52\x56\x41\x4C\x20\x4F\x4B","\x69\x73\x4F\x62\x6A\x65\x63\x74","\x6C\x65\x6E\x67\x74\x68","\x53\x75\x62\x49\x6E\x74\x65\x72\x76\x61\x6C\x73","\x69\x6E\x74\x65\x72\x76\x61\x6C","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D","\x69\x73\x56\x61\x6C\x69\x64","\x73\x74\x61\x72\x74\x4F\x66","\x64\x61\x79\x53\x74\x61\x72\x74","\x65\x6E\x64\x4F\x66","\x64\x61\x79\x45\x6E\x64","\x5F\x75\x69\x46\x72\x6F\x6D","","\x72\x65\x70\x6C\x61\x63\x65","\x5F\x75\x69\x54\x6F","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x6F\x66\x66\x73\x65\x74","\x6C\x69\x6D\x69\x74","\x6F\x72\x64\x65\x72","\x74\x79\x70\x65","\x70\x61\x72\x65\x6E\x74","\x25","\x66\x6F\x72\x45\x61\x63\x68","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x74\x68\x65\x6E","\x6E\x61\x6D\x65","\x6D\x61\x70","\x67\x65\x74\x50\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x69\x64","\x67\x65\x74\x50\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x63\x68\x65\x63\x6B\x50\x61\x75\x73\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x51\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x4F\x6E\x6C\x69\x6E\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x53\x69\x70\x53\x74\x61\x74\x75\x73","\x75\x6E\x69\x6F\x6E","\x73\x75\x62\x73\x74\x72","\x2F","\x47\x45\x54","\x50\x4F\x53\x54","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x4D\x65\x74\x68\x6F\x64","\x41\x63\x74\x69\x6F\x6E\x20\x46\x61\x69\x6C\x65\x64","\x63\x61\x74\x63\x68","\x41\x63\x74\x69\x6F\x6E\x20\x53\x75\x63\x63\x65\x73\x73\x66\x75\x6C","\x61\x63\x74\x69\x6F\x6E","\x44\x45\x46\x41\x55\x4C\x54\x20\x50\x41\x55\x53\x45","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x63\x72\x65\x61\x74\x65","\x70\x61\x75\x73\x65","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x41\x63\x74\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x73","\x2E\x2F\x65\x72\x72\x6F\x72"];_0x538c[0];var _=require(_0x538c[1]);var moment=require(_0x538c[2]);var request=require(_0x538c[3]);var User=require(_0x538c[5])[_0x538c[4]];var VoiceQueue=require(_0x538c[5])[_0x538c[6]];var ChatQueue=require(_0x538c[5])[_0x538c[7]];var MailQueue=require(_0x538c[5])[_0x538c[8]];var FaxQueue=require(_0x538c[5])[_0x538c[9]];var SmsQueue=require(_0x538c[5])[_0x538c[10]];var OpenchannelQueue=require(_0x538c[5])[_0x538c[11]];var Action=require(_0x538c[5])[_0x538c[12]];var checkInterval=function(_0xf39dxd){var _0xf39dxe=[_0x538c[13],_0x538c[14],_0x538c[15],_0x538c[16],_0x538c[17],_0x538c[18],_0x538c[19]];var _0xf39dxf=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];var _0xf39dx10=[_0x538c[20],_0x538c[21],_0x538c[22],_0x538c[23],_0x538c[24],_0x538c[25],_0x538c[26],_0x538c[27],_0x538c[28],_0x538c[29],_0x538c[30],_0x538c[31]];var _0xf39dx11,_0xf39dx12;var _0xf39dx13=_0xf39dxd[_0x538c[33]](_0x538c[32])[0];var _0xf39dx14=_0xf39dxd[_0x538c[33]](_0x538c[32])[1];var _0xf39dx15=_0xf39dxd[_0x538c[33]](_0x538c[32])[2];var _0xf39dx16=_0xf39dxd[_0x538c[33]](_0x538c[32])[3];if(_0xf39dx13!== _0x538c[34]){var _0xf39dx17=moment()[_0x538c[36]](_0x538c[35]);var _0xf39dx18=_0xf39dx13[_0x538c[33]](_0x538c[37])[0];var _0xf39dx19=_0xf39dx13[_0x538c[33]](_0x538c[37])[1];if((_0xf39dx17< _0xf39dx18)|| (_0xf39dx17> _0xf39dx19)){console[_0x538c[39]](_0x538c[38]);return false}};if(_0xf39dx14!== _0x538c[34]){var _0xf39dx1a=_0xf39dxe[moment()[_0x538c[40]]()];var _0xf39dx1b=_[_0x538c[41]](_0xf39dxe,_0xf39dx14[_0x538c[33]](_0x538c[37])[0]);var _0xf39dx1c=_[_0x538c[41]](_0xf39dxe,_0xf39dx14[_0x538c[33]](_0x538c[37])[1]);for(_0xf39dx11= 0;_0xf39dx11< _0xf39dx1b;_0xf39dx11++){_0xf39dx12= _0xf39dxe[_0x538c[42]]();_0xf39dxe[_0x538c[43]](_0xf39dx12)};_0xf39dx1b= _[_0x538c[41]](_0xf39dxe,_0xf39dx14[_0x538c[33]](_0x538c[37])[0]);_0xf39dx1c= _[_0x538c[41]](_0xf39dxe,_0xf39dx14[_0x538c[33]](_0x538c[37])[1])+ 1;_0xf39dxe= _0xf39dxe[_0x538c[44]](_0xf39dx1b,_0xf39dx1c);if(!_[_0x538c[45]](_0xf39dxe,_0xf39dx1a)){console[_0x538c[39]](_0x538c[46]);return false}};if(_0xf39dx15!== _0x538c[34]){var _0xf39dx1d=moment()[_0x538c[47]]();var _0xf39dx1e=_[_0x538c[41]](_0xf39dxf,parseInt(_0xf39dx15[_0x538c[33]](_0x538c[37])[0],10));var _0xf39dx1f=_[_0x538c[41]](_0xf39dxf,parseInt(_0xf39dx15[_0x538c[33]](_0x538c[37])[1]));for(_0xf39dx11= 0;_0xf39dx11< _0xf39dx1e;_0xf39dx11++){_0xf39dx12= _0xf39dxf[_0x538c[42]]();_0xf39dxf[_0x538c[43]](_0xf39dx12)};_0xf39dx1e= _[_0x538c[41]](_0xf39dxf,parseInt(_0xf39dx15[_0x538c[33]](_0x538c[37])[0],10));_0xf39dx1f= _[_0x538c[41]](_0xf39dxf,parseInt(_0xf39dx15[_0x538c[33]](_0x538c[37])[1]),10)+ 1;_0xf39dxf= _0xf39dxf[_0x538c[44]](_0xf39dx1e,_0xf39dx1f);if(!_[_0x538c[45]](_0xf39dxf,_0xf39dx1d)){console[_0x538c[39]](_0x538c[48]);return false}};if(_0xf39dx16!== _0x538c[34]){var _0xf39dx20=_0xf39dx10[moment()[_0x538c[49]]()];var _0xf39dx21=_[_0x538c[41]](_0xf39dx10,_0xf39dx16[_0x538c[33]](_0x538c[37])[0]);var _0xf39dx22=_[_0x538c[41]](_0xf39dx10,_0xf39dx16[_0x538c[33]](_0x538c[37])[1]);for(_0xf39dx11= 0;_0xf39dx11< _0xf39dx21;_0xf39dx11++){_0xf39dx12= _0xf39dx10[_0x538c[42]]();_0xf39dx10[_0x538c[43]](_0xf39dx12)};_0xf39dx21= _[_0x538c[41]](_0xf39dx10,_0xf39dx16[_0x538c[33]](_0x538c[37])[0]);_0xf39dx22= _[_0x538c[41]](_0xf39dx10,_0xf39dx16[_0x538c[33]](_0x538c[37])[1])+ 1;_0xf39dx10= _0xf39dx10[_0x538c[44]](_0xf39dx21,_0xf39dx22);if(!_[_0x538c[45]](_0xf39dx10,_0xf39dx20)){console[_0x538c[39]](_0x538c[50]);return false}};console[_0x538c[39]](_0x538c[51]);return true};var isValidInterval=function(_0xf39dxd){if(_[_0x538c[52]](_0xf39dxd)){for(var _0xf39dx11=0;_0xf39dx11< _0xf39dxd[_0x538c[54]][_0x538c[53]];_0xf39dx11++){if(!checkInterval(_0xf39dxd[_0x538c[54]][_0xf39dx11][_0x538c[55]])){return false}};return true}else {return checkInterval(_0xf39dxd)}};var getDate=function(_0xf39dx25,_0xf39dx26){var _0xf39dx27=_0x538c[56];if(moment(_0xf39dx25,_0xf39dx27,true)[_0x538c[57]]()){return moment(_0xf39dx25)}else {switch(_0xf39dx26){case _0x538c[59]:return moment(_0xf39dx25)[_0x538c[58]](_0x538c[40]);case _0x538c[61]:return moment(_0xf39dx25)[_0x538c[60]](_0x538c[40]);default:return moment(_0xf39dx25)}}};var getQuery=function(_0xf39dx29,_0xf39dx2a){var _0xf39dx2b={where:{}};if(_0xf39dx29){var _0xf39dx2c,_0xf39dx2d={};for(var _0xf39dx2e in _0xf39dx29){if(_[_0x538c[45]](_0xf39dx2e,_0x538c[62])){_0xf39dx2c= _0xf39dx2e[_0x538c[64]](_0x538c[62],_0x538c[63]);if(_0xf39dx29[_0xf39dx2c+ _0x538c[65]]){_0xf39dx2b[_0x538c[67]][_0x538c[66]]= _0xf39dx2b[_0x538c[67]][_0x538c[66]]|| [];_0xf39dx2d= {};_0xf39dx2d[_0xf39dx2c]= {$gte:getDate(_0xf39dx29[_0xf39dx2e],_0x538c[59])};_0xf39dx2b[_0x538c[67]][_0x538c[66]][_0x538c[43]](_0xf39dx2d);_0xf39dx2d= {};_0xf39dx2d[_0xf39dx2c]= {$lte:getDate(_0xf39dx29[_0xf39dx2c+ _0x538c[65]],_0x538c[61])};_0xf39dx2b[_0x538c[67]][_0x538c[66]][_0x538c[43]](_0xf39dx2d);delete _0xf39dx29[_0xf39dx2c+ _0x538c[65]]}else {_0xf39dx2b[_0x538c[67]][_0xf39dx2e[_0x538c[64]](_0x538c[62],_0x538c[63])]= {$gte:getDate(_0xf39dx29[_0xf39dx2e],_0x538c[59])}};delete _0xf39dx29[_0xf39dx2e]}else {if(_[_0x538c[45]](_0xf39dx2e,_0x538c[65])){_0xf39dx2c= _0xf39dx2e[_0x538c[64]](_0x538c[65],_0x538c[63]);if(_0xf39dx29[_0xf39dx2c+ _0x538c[62]]){_0xf39dx2b[_0x538c[67]][_0x538c[66]]= _0xf39dx2b[_0x538c[67]][_0x538c[66]]|| [];_0xf39dx2d= {};_0xf39dx2d[_0xf39dx2c]= {$lte:getDate(_0xf39dx29[_0xf39dx2e],_0x538c[61])};_0xf39dx2b[_0x538c[67]][_0x538c[66]][_0x538c[43]](_0xf39dx2d);_0xf39dx2d[_0xf39dx2c]= {$gte:getDate(_0xf39dx29[_0xf39dx2c+ _0x538c[62]],_0x538c[59])};_0xf39dx2b[_0x538c[67]][_0x538c[66]][_0x538c[43]](_0xf39dx2d);delete _0xf39dx29[_0xf39dx2c+ _0x538c[62]]}else {_0xf39dx2b[_0x538c[67]][_0xf39dx2e[_0x538c[64]](_0x538c[65],_0x538c[63])]= {$lte:getDate(_0xf39dx29[_0xf39dx2e],_0x538c[61])}};delete _0xf39dx29[_0xf39dx2e]}}};_[_0x538c[74]](_0xf39dx29,function(_0xf39dx2f,_0xf39dx2e){switch(_0xf39dx2e){case _0x538c[68]:;case _0x538c[69]:_0xf39dx2b[_0xf39dx2e]= Number(_0xf39dx2f);break;case _0x538c[70]:_0xf39dx2b[_0xf39dx2e]= _0xf39dx2f;break;case _0x538c[71]:;case _0x538c[72]:_0xf39dx2b[_0x538c[67]][_0xf39dx2e]= _0xf39dx2f;break;default:_0xf39dx2b[_0x538c[67]][_0xf39dx2e]= {$like:_0x538c[73]+ _0xf39dx2f+ _0x538c[73]}}})};if(_0xf39dx2a){_[_0x538c[75]](_0xf39dx2b[_0x538c[67]],_0xf39dx2a)};return _0xf39dx2b};var getVoiceQueuesIdByUser=function(_0xf39dx29,_0xf39dx31){return function(_0xf39dx32){var _0xf39dx33=[];var _0xf39dx34=_0xf39dx32;var _0xf39dx2b=_0xf39dx29|| {};var _0xf39dx35=_0xf39dx31|| {};return _0xf39dx34[_0x538c[80]]({attributes:[_0x538c[78]]})[_0x538c[77]](function(_0xf39dx36){_0xf39dx33= _[_0x538c[79]](_0xf39dx36,_0x538c[78])})[_0x538c[77]](function(){return VoiceQueue[_0x538c[76]](_[_0x538c[75]](getQuery(_0xf39dx29,{name:{$in:_0xf39dx33}}),_0xf39dx35))})}};var getChatQueuesIdByUser=function(_0xf39dx29,_0xf39dx31){return function(_0xf39dx32){var _0xf39dx33=[];var _0xf39dx34=_0xf39dx32;var _0xf39dx2b=_0xf39dx29|| {};var _0xf39dx35=_0xf39dx31|| {};return _0xf39dx34[_0x538c[84]]({attributes:[_0x538c[83]]})[_0x538c[77]](function(_0xf39dx36){_0xf39dx33= _[_0x538c[79]](_0xf39dx36,_0x538c[83])})[_0x538c[77]](function(){return ChatQueue[_0x538c[82]](_0x538c[81])[_0x538c[76]](_[_0x538c[75]](getQuery(_0xf39dx2b,{id:{$in:_0xf39dx33}}),_0xf39dx35))})}};var getMailQueuesIdByUser=function(_0xf39dx29,_0xf39dx31){return function(_0xf39dx32){var _0xf39dx33=[];var _0xf39dx34=_0xf39dx32;var _0xf39dx2b=_0xf39dx29|| {};var _0xf39dx35=_0xf39dx31|| {};return _0xf39dx34[_0x538c[85]]({attributes:[_0x538c[83]]})[_0x538c[77]](function(_0xf39dx36){_0xf39dx33= _[_0x538c[79]](_0xf39dx36,_0x538c[83])})[_0x538c[77]](function(){return MailQueue[_0x538c[76]](_[_0x538c[75]](getQuery(_0xf39dx2b,{id:{$in:_0xf39dx33}}),_0xf39dx35))})}};var getSmsQueuesIdByUser=function(_0xf39dx29,_0xf39dx31){return function(_0xf39dx32){var _0xf39dx33=[];var _0xf39dx34=_0xf39dx32;var _0xf39dx2b=_0xf39dx29|| {};var _0xf39dx35=_0xf39dx31|| {};return _0xf39dx34[_0x538c[86]]({attributes:[_0x538c[83]]})[_0x538c[77]](function(_0xf39dx36){_0xf39dx33= _[_0x538c[79]](_0xf39dx36,_0x538c[83])})[_0x538c[77]](function(){return SmsQueue[_0x538c[76]](_[_0x538c[75]](getQuery(_0xf39dx2b,{id:{$in:_0xf39dx33}}),_0xf39dx35))})}};var getFaxQueuesIdByUser=function(_0xf39dx29,_0xf39dx31){return function(_0xf39dx32){var _0xf39dx33=[];var _0xf39dx34=_0xf39dx32;var _0xf39dx2b=_0xf39dx29|| {};var _0xf39dx35=_0xf39dx31|| {};return _0xf39dx34[_0x538c[87]]({attributes:[_0x538c[83]]})[_0x538c[77]](function(_0xf39dx36){_0xf39dx33= _[_0x538c[79]](_0xf39dx36,_0x538c[83])})[_0x538c[77]](function(){return FaxQueue[_0x538c[76]](_[_0x538c[75]](getQuery(_0xf39dx2b,{id:{$in:_0xf39dx33}}),_0xf39dx35))})}};var getOpenchannelQueuesIdByUser=function(_0xf39dx29,_0xf39dx31){return function(_0xf39dx32){var _0xf39dx33=[];var _0xf39dx34=_0xf39dx32;var _0xf39dx2b=_0xf39dx29|| {};var _0xf39dx35=_0xf39dx31|| {};return _0xf39dx34[_0x538c[88]]({attributes:[_0x538c[83]]})[_0x538c[77]](function(_0xf39dx36){_0xf39dx33= _[_0x538c[79]](_0xf39dx36,_0x538c[83])})[_0x538c[77]](function(){return OpenchannelQueue[_0x538c[76]](_[_0x538c[75]](getQuery(_0xf39dx2b,{id:{$in:_0xf39dx33}}),_0xf39dx35))})}};var getAgentsIdByUser=function(_0xf39dx29){return function(_0xf39dx32){var _0xf39dx3d=[];var _0xf39dx34=_0xf39dx32;var _0xf39dx2b=_0xf39dx29|| {};var _0xf39dx3e=[],_0xf39dx3f=[],_0xf39dx40=[],_0xf39dx41=[],_0xf39dx42=[],_0xf39dx43=[];return _0xf39dx34[_0x538c[80]]({attributes:[_0x538c[78]],include:[{raw:true,model:User,attributes:[_0x538c[83]]}]})[_0x538c[77]](function(_0xf39dx36){_0xf39dx3e= _[_0x538c[79]](_0xf39dx36,_0x538c[78]);_0xf39dx36[_0x538c[74]](function(_0xf39dx44){_0xf39dx3d= _[_0x538c[94]](_0xf39dx3d,_[_0x538c[79]](_0xf39dx44.Users,_0x538c[83]))})})[_0x538c[77]](function(){return _0xf39dx34[_0x538c[84]]({attributes:[_0x538c[83]],include:[{raw:true,model:User,attributes:[_0x538c[83]]}]})})[_0x538c[77]](function(_0xf39dx36){_0xf39dx3f= _[_0x538c[79]](_0xf39dx36,_0x538c[83]);_0xf39dx36[_0x538c[74]](function(_0xf39dx44){_0xf39dx3d= _[_0x538c[94]](_0xf39dx3d,_[_0x538c[79]](_0xf39dx44.Users,_0x538c[83]))})})[_0x538c[77]](function(){return _0xf39dx34[_0x538c[85]]({attributes:[_0x538c[83]],include:[{raw:true,model:User,attributes:[_0x538c[83]]}]})})[_0x538c[77]](function(_0xf39dx36){_0xf39dx40= _[_0x538c[79]](_0xf39dx36,_0x538c[83]);_0xf39dx36[_0x538c[74]](function(_0xf39dx44){_0xf39dx3d= _[_0x538c[94]](_0xf39dx3d,_[_0x538c[79]](_0xf39dx44.Users,_0x538c[83]))})})[_0x538c[77]](function(){return _0xf39dx34[_0x538c[87]]({attributes:[_0x538c[83]],include:[{raw:true,model:User,attributes:[_0x538c[83]]}]})})[_0x538c[77]](function(_0xf39dx36){_0xf39dx41= _[_0x538c[79]](_0xf39dx36,_0x538c[83]);_0xf39dx36[_0x538c[74]](function(_0xf39dx44){_0xf39dx3d= _[_0x538c[94]](_0xf39dx3d,_[_0x538c[79]](_0xf39dx44.Users,_0x538c[83]))})})[_0x538c[77]](function(){return _0xf39dx34[_0x538c[86]]({attributes:[_0x538c[83]],include:[{raw:true,model:User,attributes:[_0x538c[83]]}]})})[_0x538c[77]](function(_0xf39dx36){_0xf39dx43= _[_0x538c[79]](_0xf39dx36,_0x538c[83]);_0xf39dx36[_0x538c[74]](function(_0xf39dx44){_0xf39dx3d= _[_0x538c[94]](_0xf39dx3d,_[_0x538c[79]](_0xf39dx44.Users,_0x538c[83]))})})[_0x538c[77]](function(){return _0xf39dx34[_0x538c[88]]({attributes:[_0x538c[83]],include:[{raw:true,model:User,attributes:[_0x538c[83]]}]})})[_0x538c[77]](function(_0xf39dx36){_0xf39dx42= _[_0x538c[79]](_0xf39dx36,_0x538c[83]);_0xf39dx36[_0x538c[74]](function(_0xf39dx44){_0xf39dx3d= _[_0x538c[94]](_0xf39dx3d,_[_0x538c[79]](_0xf39dx44.Users,_0x538c[83]))})})[_0x538c[77]](function(){return User[_0x538c[82]](_0x538c[89],{method:[_0x538c[90],_0xf39dx2b]},{method:[_0x538c[91],_0xf39dx2b]},{method:[_0x538c[92],_0xf39dx2b]},{method:[_0x538c[93],_0xf39dx2b]})[_0x538c[76]](_[_0x538c[75]](getQuery(_0xf39dx2b,{id:{$in:_0xf39dx3d}}),{include:[{model:VoiceQueue,where:{name:{$in:_0xf39dx3e}},required:false},{model:ChatQueue,where:{id:{$in:_0xf39dx3f}},required:false},{model:MailQueue,where:{id:{$in:_0xf39dx40}},required:false},{model:FaxQueue,where:{id:{$in:_0xf39dx41}},required:false},{model:SmsQueue,where:{id:{$in:_0xf39dx43}},required:false},{model:OpenchannelQueue,where:{id:{$in:_0xf39dx42}},required:false}]}))})}};var stripTrailingSlash=function(_0xf39dx46){if(_0xf39dx46[_0x538c[95]](-1) === _0x538c[96]){return _0xf39dx46[_0x538c[95]](0,_0xf39dx46[_0x538c[53]]- 1)};return _0xf39dx46};var sendRequest=function(_0xf39dx48,_0xf39dx49,_0xf39dx4a){if(_0xf39dx49== _0x538c[97]|| _0xf39dx49== _0x538c[98]){var _0xf39dx4b={method:_0xf39dx49,uri:_0xf39dx4a,body:_0xf39dx48,json:true};return request(_0xf39dx4b)}else {console[_0x538c[39]](_0x538c[99])}};var execAction=function(_0xf39dx4d,_0xf39dx48){switch(_0xf39dx4d[_0x538c[103]]){case _0x538c[107]:Action[_0x538c[106]]({name:_0xf39dx4d[_0x538c[103]],data4:_0xf39dx4d[_0x538c[71]]|| _0x538c[104]},{body:{name:_0xf39dx4d[_0x538c[103]],agent:_0xf39dx48[_0x538c[105]],type:_0xf39dx4d[_0x538c[71]]|| _0x538c[104]}})[_0x538c[77]](function(){console[_0x538c[39]](_0x538c[102])})[_0x538c[101]](function(_0xf39dx4e){console[_0x538c[39]](_0x538c[100],_0xf39dx4e)});break;default:console[_0x538c[39]](_0x538c[108])}};module[_0x538c[109]]= {getQuery:getQuery,getVoiceQueuesIdByUser:getVoiceQueuesIdByUser,getChatQueuesIdByUser:getChatQueuesIdByUser,getMailQueuesIdByUser:getMailQueuesIdByUser,getFaxQueuesIdByUser:getFaxQueuesIdByUser,getOpenchannelQueuesIdByUser:getOpenchannelQueuesIdByUser,getAgentsIdByUser:getAgentsIdByUser,stripTrailingSlash:stripTrailingSlash,isValidInterval:isValidInterval,sendRequest:sendRequest,execAction:execAction,errorManager:require(_0x538c[110])}
\ No newline at end of file
+var _0xc617=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x66\x73\x2D\x65\x78\x74\x72\x61","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x46\x61\x78\x51\x75\x65\x75\x65","\x53\x6D\x73\x51\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x41\x63\x74\x69\x6F\x6E","\x2C","\x73\x70\x6C\x69\x74","\x2A","\x2D","\x74\x5F\x66\x72\x6F\x6D","\x48\x48\x3A\x6D\x6D","\x74\x5F\x74\x6F","\x77\x64\x5F\x66\x72\x6F\x6D","\x77\x64\x5F\x74\x6F","\x6D\x64\x5F\x66\x72\x6F\x6D","\x6D\x64\x5F\x74\x6F","\x6D\x5F\x66\x72\x6F\x6D","\x6D\x5F\x74\x6F","\x66\x6F\x72\x45\x61\x63\x68","\x66\x6F\x72\x6D\x61\x74","\x45","\x44","\x4D","\x70\x75\x73\x68","\x69\x73\x41\x66\x74\x65\x72","\x5B\x5D","\x69\x73\x42\x65\x74\x77\x65\x65\x6E","\x66\x69\x6C\x74\x65\x72","\x69\x6E\x64\x65\x78\x4F\x66","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D","\x69\x73\x56\x61\x6C\x69\x64","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x64\x61\x79\x53\x74\x61\x72\x74","\x65\x6E\x64\x4F\x66","\x64\x61\x79\x45\x6E\x64","\x5F\x75\x69\x46\x72\x6F\x6D","\x69\x6E\x63\x6C\x75\x64\x65\x73","","\x72\x65\x70\x6C\x61\x63\x65","\x5F\x75\x69\x54\x6F","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x6F\x66\x66\x73\x65\x74","\x6C\x69\x6D\x69\x74","\x6F\x72\x64\x65\x72","\x74\x79\x70\x65","\x70\x61\x72\x65\x6E\x74","\x25","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x74\x68\x65\x6E","\x6E\x61\x6D\x65","\x6D\x61\x70","\x67\x65\x74\x50\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x69\x64","\x67\x65\x74\x50\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x63\x68\x65\x63\x6B\x50\x61\x75\x73\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x51\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x4F\x6E\x6C\x69\x6E\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x53\x69\x70\x53\x74\x61\x74\x75\x73","\x75\x6E\x69\x6F\x6E","\x73\x75\x62\x73\x74\x72","\x2F","\x6C\x65\x6E\x67\x74\x68","\x5E\x5C\x2F\x7C\x5C\x2F\x24","\x67","\x63\x61\x6C\x6C","\x73\x6C\x69\x63\x65","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x6A\x6F\x69\x6E","\x47\x45\x54","\x50\x4F\x53\x54","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x4D\x65\x74\x68\x6F\x64","\x65\x72\x72\x6F\x72","\x41\x63\x74\x69\x6F\x6E\x20\x46\x61\x69\x6C\x65\x64","\x73\x74\x61\x63\x6B","\x63\x61\x74\x63\x68","\x41\x63\x74\x69\x6F\x6E\x20\x53\x75\x63\x63\x65\x73\x73\x66\x75\x6C","\x64\x65\x62\x75\x67","\x61\x63\x74\x69\x6F\x6E","\x44\x45\x46\x41\x55\x4C\x54\x20\x50\x41\x55\x53\x45","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x63\x72\x65\x61\x74\x65","\x70\x61\x75\x73\x65","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x41\x63\x74\x69\x6F\x6E","\x73\x74\x61\x74\x53\x79\x6E\x63","\x73\x69\x7A\x65","\x65\x78\x70\x6F\x72\x74\x73","\x2E\x2F\x65\x72\x72\x6F\x72"];_0xc617[0];var _=require(_0xc617[1]);var moment=require(_0xc617[2]);var request=require(_0xc617[3]);var fs=require(_0xc617[4]);var logger=require(_0xc617[6])(_0xc617[5]);var User=require(_0xc617[8])[_0xc617[7]];var VoiceQueue=require(_0xc617[8])[_0xc617[9]];var ChatQueue=require(_0xc617[8])[_0xc617[10]];var MailQueue=require(_0xc617[8])[_0xc617[11]];var FaxQueue=require(_0xc617[8])[_0xc617[12]];var SmsQueue=require(_0xc617[8])[_0xc617[13]];var OpenchannelQueue=require(_0xc617[8])[_0xc617[14]];var Action=require(_0xc617[8])[_0xc617[15]];var weekDaysCollection={mon:1,tue:2,wed:3,thu:4,fri:5,sat:6,sun:7};var monthsCollection={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12};function splitInterval(_0xf795x11){var _0xf795x12={};var _0xf795x13=_0xf795x11[_0xc617[17]](_0xc617[16]);var _0xf795x14;_0xf795x13[_0xc617[29]](function(_0xf795x15,_0xf795x16){switch(_0xf795x16){case 0:if(_0xf795x15!== _0xc617[18]){_0xf795x14= _0xf795x15[_0xc617[17]](_0xc617[19]);_0xf795x12[_0xc617[20]]= moment(_0xf795x14[0],_0xc617[21]);_0xf795x12[_0xc617[22]]= moment(_0xf795x14[1],_0xc617[21])}else {_0xf795x12[_0xc617[20]]= null;_0xf795x12[_0xc617[22]]= null};break;case 1:if(_0xf795x15!== _0xc617[18]){_0xf795x14= _0xf795x15[_0xc617[17]](_0xc617[19]);_0xf795x12[_0xc617[23]]= Number(weekDaysCollection[_0xf795x14[0]]);_0xf795x12[_0xc617[24]]= _0xf795x14[1]?Number(weekDaysCollection[_0xf795x14[1]]):null}else {_0xf795x12[_0xc617[23]]= null;_0xf795x12[_0xc617[24]]= null};break;case 2:if(_0xf795x15!== _0xc617[18]){_0xf795x14= _0xf795x15[_0xc617[17]](_0xc617[19]);_0xf795x12[_0xc617[25]]= Number(_0xf795x14[0]);_0xf795x12[_0xc617[26]]= _0xf795x14[1]?Number(_0xf795x14[1]):null}else {_0xf795x12[_0xc617[25]]= null;_0xf795x12[_0xc617[26]]= null};break;case 3:if(_0xf795x15!== _0xc617[18]){_0xf795x14= _0xf795x15[_0xc617[17]](_0xc617[19]);_0xf795x12[_0xc617[27]]= Number(monthsCollection[_0xf795x14[0]]);_0xf795x12[_0xc617[28]]= _0xf795x14[1]?Number(monthsCollection[_0xf795x14[1]]):null}else {_0xf795x12[_0xc617[27]]= null;_0xf795x12[_0xc617[28]]= null};break;default:}});return _0xf795x12}function isIntervalValid(_0xf795x11){var _0xf795x18=moment()[_0xc617[30]](_0xc617[21]);var _0xf795x19=moment()[_0xc617[30]](_0xc617[31]);var _0xf795x1a=moment()[_0xc617[30]](_0xc617[32]);var _0xf795x1b=moment()[_0xc617[30]](_0xc617[33]);var _0xf795x1c,_0xf795x1d,_0xf795x1e,_0xf795x1f;var _0xf795x20=[1,2,3,4,5,6,7,8,9,10,11,12];var _0xf795x21=[1,2,3,4,5,6,7];var _0xf795x22=[];for(var _0xf795x23=1;_0xf795x23<= 31;_0xf795x23++){_0xf795x22[_0xc617[34]](_0xf795x23)};if(_0xf795x11[_0xc617[20]]&& _0xf795x11[_0xc617[22]]){if(_0xf795x11[_0xc617[22]][_0xc617[35]](_0xf795x11[_0xc617[20]])){_0xf795x1c= moment(_0xf795x18,_0xc617[21])[_0xc617[37]](_0xf795x11[_0xc617[20]],_0xf795x11[_0xc617[22]],null,_0xc617[36])}else {_0xf795x1c=  !moment(_0xf795x18,_0xc617[21])[_0xc617[37]](_0xf795x11[_0xc617[22]],_0xf795x11[_0xc617[20]],null,_0xc617[36])}}else {_0xf795x1c= true};if(_0xf795x11[_0xc617[23]]){if(_0xf795x11[_0xc617[24]]&& _0xf795x11[_0xc617[24]]!== _0xf795x11[_0xc617[23]]){var _0xf795x24=_[_0xc617[38]](_0xf795x21,function(_0xf795x25){if(_0xf795x11[_0xc617[23]]< _0xf795x11[_0xc617[24]]){return (_0xf795x25>= _0xf795x11[_0xc617[23]])&& (_0xf795x25<= _0xf795x11[_0xc617[24]])}else {return (1<= _0xf795x25&& _0xf795x25<= _0xf795x11[_0xc617[24]])|| (_0xf795x11[_0xc617[23]]<= _0xf795x25&& _0xf795x25<= 7)}});_0xf795x1d= (_0xf795x24[_0xc617[39]](parseInt(_0xf795x19))!==  -1)?true:false}else {_0xf795x1d= (parseInt(_0xf795x19)=== _0xf795x11[_0xc617[23]])?true:false}}else {_0xf795x1d= true};if(_0xf795x11[_0xc617[25]]){if(_0xf795x11[_0xc617[26]]&& _0xf795x11[_0xc617[26]]!== _0xf795x11[_0xc617[25]]){var _0xf795x26=_[_0xc617[38]](_0xf795x22,function(_0xf795x25){if(_0xf795x11[_0xc617[25]]< _0xf795x11[_0xc617[26]]){return (_0xf795x25>= _0xf795x11[_0xc617[25]])&& (_0xf795x25<= _0xf795x11[_0xc617[26]])}else {return (1<= _0xf795x25&& _0xf795x25<= _0xf795x11[_0xc617[26]])|| (_0xf795x11[_0xc617[25]]<= _0xf795x25&& _0xf795x25<= 7)}});_0xf795x1e= (_0xf795x26[_0xc617[39]](parseInt(_0xf795x1a))!==  -1)?true:false}else {_0xf795x1e= (parseInt(_0xf795x1a)=== _0xf795x11[_0xc617[25]])?true:false}}else {_0xf795x1e= true};if(_0xf795x11[_0xc617[27]]){if(_0xf795x11[_0xc617[28]]&& _0xf795x11[_0xc617[28]]!== _0xf795x11[_0xc617[27]]){var _0xf795x27=_[_0xc617[38]](_0xf795x20,function(_0xf795x25){if(_0xf795x11[_0xc617[27]]< _0xf795x11[_0xc617[28]]){return (_0xf795x25>= _0xf795x11[_0xc617[27]])&& (_0xf795x25<= _0xf795x11[_0xc617[28]])}else {return (1<= _0xf795x25&& _0xf795x25<= _0xf795x11[_0xc617[28]])|| (_0xf795x11[_0xc617[27]]<= _0xf795x25&& _0xf795x25<= 7)}});_0xf795x1f= (_0xf795x27[_0xc617[39]](parseInt(_0xf795x1b))!==  -1)?true:false}else {_0xf795x1f= (parseInt(_0xf795x1b)=== _0xf795x11[_0xc617[27]])?true:false}}else {_0xf795x1f= true};return _0xf795x1c&& _0xf795x1d&& _0xf795x1e&& _0xf795x1f}var getDate=function(_0xf795x29,_0xf795x2a){var _0xf795x2b=_0xc617[40];if(moment(_0xf795x29,_0xf795x2b,true)[_0xc617[41]]()){return moment(_0xf795x29)}else {switch(_0xf795x2a){case _0xc617[44]:return moment(_0xf795x29)[_0xc617[43]](_0xc617[42]);case _0xc617[46]:return moment(_0xf795x29)[_0xc617[45]](_0xc617[42]);default:return moment(_0xf795x29)}}};var getQuery=function(_0xf795x2d,_0xf795x2e,_0xf795x2f){var _0xf795x30={where:{}};if(_0xf795x2d){var _0xf795x31,_0xf795x32={};for(var _0xf795x33 in _0xf795x2d){if(_[_0xc617[48]](_0xf795x33,_0xc617[47])){_0xf795x31= _0xf795x33[_0xc617[50]](_0xc617[47],_0xc617[49]);if(_0xf795x2d[_0xf795x31+ _0xc617[51]]){_0xf795x30[_0xc617[53]][_0xc617[52]]= _0xf795x30[_0xc617[53]][_0xc617[52]]|| [];_0xf795x32= {};_0xf795x32[_0xf795x31]= {$gte:getDate(_0xf795x2d[_0xf795x33],_0xc617[44])};_0xf795x30[_0xc617[53]][_0xc617[52]][_0xc617[34]](_0xf795x32);_0xf795x32= {};_0xf795x32[_0xf795x31]= {$lte:getDate(_0xf795x2d[_0xf795x31+ _0xc617[51]],_0xc617[46])};_0xf795x30[_0xc617[53]][_0xc617[52]][_0xc617[34]](_0xf795x32);delete _0xf795x2d[_0xf795x31+ _0xc617[51]]}else {_0xf795x30[_0xc617[53]][_0xf795x33[_0xc617[50]](_0xc617[47],_0xc617[49])]= {$gte:getDate(_0xf795x2d[_0xf795x33],_0xc617[44])}};delete _0xf795x2d[_0xf795x33]}else {if(_[_0xc617[48]](_0xf795x33,_0xc617[51])){_0xf795x31= _0xf795x33[_0xc617[50]](_0xc617[51],_0xc617[49]);if(_0xf795x2d[_0xf795x31+ _0xc617[47]]){_0xf795x30[_0xc617[53]][_0xc617[52]]= _0xf795x30[_0xc617[53]][_0xc617[52]]|| [];_0xf795x32= {};_0xf795x32[_0xf795x31]= {$lte:getDate(_0xf795x2d[_0xf795x33],_0xc617[46])};_0xf795x30[_0xc617[53]][_0xc617[52]][_0xc617[34]](_0xf795x32);_0xf795x32[_0xf795x31]= {$gte:getDate(_0xf795x2d[_0xf795x31+ _0xc617[47]],_0xc617[44])};_0xf795x30[_0xc617[53]][_0xc617[52]][_0xc617[34]](_0xf795x32);delete _0xf795x2d[_0xf795x31+ _0xc617[47]]}else {_0xf795x30[_0xc617[53]][_0xf795x33[_0xc617[50]](_0xc617[51],_0xc617[49])]= {$lte:getDate(_0xf795x2d[_0xf795x33],_0xc617[46])}};delete _0xf795x2d[_0xf795x33]}}};_[_0xc617[29]](_0xf795x2d,function(_0xf795x34,_0xf795x33){switch(_0xf795x33){case _0xc617[54]:;case _0xc617[55]:_0xf795x30[_0xf795x33]= Number(_0xf795x34);break;case _0xc617[56]:_0xf795x30[_0xf795x33]= _0xf795x34;break;case _0xc617[57]:;case _0xc617[58]:_0xf795x30[_0xc617[53]][_0xf795x33]= _0xf795x34;break;default:_0xf795x30[_0xc617[53]][_0xf795x33]= {$like:_0xc617[59]+ _0xf795x34+ _0xc617[59]}}})};if(_0xf795x2e){_[_0xc617[60]](_0xf795x30[_0xc617[53]],_0xf795x2e)};if(_0xf795x2f){_[_0xc617[60]](_0xf795x30,_0xf795x2f)};return _0xf795x30};var getVoiceQueuesIdByUser=function(_0xf795x2d,_0xf795x2f){return function(_0xf795x36){var _0xf795x37=[];var _0xf795x38=_0xf795x36;var _0xf795x30=_0xf795x2d|| {};var _0xf795x39=_0xf795x2f|| {};return _0xf795x38[_0xc617[65]]({attributes:[_0xc617[63]]})[_0xc617[62]](function(_0xf795x3a){_0xf795x37= _[_0xc617[64]](_0xf795x3a,_0xc617[63])})[_0xc617[62]](function(){return VoiceQueue[_0xc617[61]](_[_0xc617[60]](getQuery(_0xf795x2d,{name:{$in:_0xf795x37}}),_0xf795x39))})}};var getChatQueuesIdByUser=function(_0xf795x2d,_0xf795x2f){return function(_0xf795x36){var _0xf795x37=[];var _0xf795x38=_0xf795x36;var _0xf795x30=_0xf795x2d|| {};var _0xf795x39=_[_0xc617[60]](_0xf795x2f|| {},{distinct:true});return _0xf795x38[_0xc617[69]]({attributes:[_0xc617[68]]})[_0xc617[62]](function(_0xf795x3a){_0xf795x37= _[_0xc617[64]](_0xf795x3a,_0xc617[68])})[_0xc617[62]](function(){return ChatQueue[_0xc617[67]](_0xc617[66])[_0xc617[61]](_[_0xc617[60]](getQuery(_0xf795x30,{id:{$in:_0xf795x37}}),_0xf795x39))})}};var getMailQueuesIdByUser=function(_0xf795x2d,_0xf795x2f){return function(_0xf795x36){var _0xf795x37=[];var _0xf795x38=_0xf795x36;var _0xf795x30=_0xf795x2d|| {};var _0xf795x39=_[_0xc617[60]](_0xf795x2f|| {},{distinct:true});return _0xf795x38[_0xc617[70]]({attributes:[_0xc617[68]]})[_0xc617[62]](function(_0xf795x3a){_0xf795x37= _[_0xc617[64]](_0xf795x3a,_0xc617[68])})[_0xc617[62]](function(){return MailQueue[_0xc617[67]](_0xc617[66])[_0xc617[61]](_[_0xc617[60]](getQuery(_0xf795x30,{id:{$in:_0xf795x37}}),_0xf795x39))})}};var getSmsQueuesIdByUser=function(_0xf795x2d,_0xf795x2f){return function(_0xf795x36){var _0xf795x37=[];var _0xf795x38=_0xf795x36;var _0xf795x30=_0xf795x2d|| {};var _0xf795x39=_[_0xc617[60]](_0xf795x2f|| {},{distinct:true});return _0xf795x38[_0xc617[71]]({attributes:[_0xc617[68]]})[_0xc617[62]](function(_0xf795x3a){_0xf795x37= _[_0xc617[64]](_0xf795x3a,_0xc617[68])})[_0xc617[62]](function(){return SmsQueue[_0xc617[67]](_0xc617[66])[_0xc617[61]](_[_0xc617[60]](getQuery(_0xf795x30,{id:{$in:_0xf795x37}}),_0xf795x39))})}};var getFaxQueuesIdByUser=function(_0xf795x2d,_0xf795x2f){return function(_0xf795x36){var _0xf795x37=[];var _0xf795x38=_0xf795x36;var _0xf795x30=_0xf795x2d|| {};var _0xf795x39=_[_0xc617[60]](_0xf795x2f|| {},{distinct:true});return _0xf795x38[_0xc617[72]]({attributes:[_0xc617[68]]})[_0xc617[62]](function(_0xf795x3a){_0xf795x37= _[_0xc617[64]](_0xf795x3a,_0xc617[68])})[_0xc617[62]](function(){return FaxQueue[_0xc617[67]](_0xc617[66])[_0xc617[61]](_[_0xc617[60]](getQuery(_0xf795x30,{id:{$in:_0xf795x37}}),_0xf795x39))})}};var getOpenchannelQueuesIdByUser=function(_0xf795x2d,_0xf795x2f){return function(_0xf795x36){var _0xf795x37=[];var _0xf795x38=_0xf795x36;var _0xf795x30=_0xf795x2d|| {};var _0xf795x39=_[_0xc617[60]](_0xf795x2f|| {},{distinct:true});return _0xf795x38[_0xc617[73]]({attributes:[_0xc617[68]]})[_0xc617[62]](function(_0xf795x3a){_0xf795x37= _[_0xc617[64]](_0xf795x3a,_0xc617[68])})[_0xc617[62]](function(){return OpenchannelQueue[_0xc617[67]](_0xc617[66])[_0xc617[61]](_[_0xc617[60]](getQuery(_0xf795x30,{id:{$in:_0xf795x37}}),_0xf795x39))})}};var getAgentsIdByUser=function(_0xf795x2d){return function(_0xf795x36){var _0xf795x41=[];var _0xf795x38=_0xf795x36;var _0xf795x30=_0xf795x2d|| {};var _0xf795x42=[],_0xf795x43=[],_0xf795x44=[],_0xf795x45=[],_0xf795x46=[],_0xf795x47=[];return _0xf795x38[_0xc617[65]]({attributes:[_0xc617[63]],include:[{raw:true,model:User,attributes:[_0xc617[68]]}]})[_0xc617[62]](function(_0xf795x3a){_0xf795x42= _[_0xc617[64]](_0xf795x3a,_0xc617[63]);_0xf795x3a[_0xc617[29]](function(_0xf795x48){_0xf795x41= _[_0xc617[79]](_0xf795x41,_[_0xc617[64]](_0xf795x48.Users,_0xc617[68]))})})[_0xc617[62]](function(){return _0xf795x38[_0xc617[69]]({attributes:[_0xc617[68]],include:[{raw:true,model:User,attributes:[_0xc617[68]]}]})})[_0xc617[62]](function(_0xf795x3a){_0xf795x43= _[_0xc617[64]](_0xf795x3a,_0xc617[68]);_0xf795x3a[_0xc617[29]](function(_0xf795x48){_0xf795x41= _[_0xc617[79]](_0xf795x41,_[_0xc617[64]](_0xf795x48.Users,_0xc617[68]))})})[_0xc617[62]](function(){return _0xf795x38[_0xc617[70]]({attributes:[_0xc617[68]],include:[{raw:true,model:User,attributes:[_0xc617[68]]}]})})[_0xc617[62]](function(_0xf795x3a){_0xf795x44= _[_0xc617[64]](_0xf795x3a,_0xc617[68]);_0xf795x3a[_0xc617[29]](function(_0xf795x48){_0xf795x41= _[_0xc617[79]](_0xf795x41,_[_0xc617[64]](_0xf795x48.Users,_0xc617[68]))})})[_0xc617[62]](function(){return _0xf795x38[_0xc617[72]]({attributes:[_0xc617[68]],include:[{raw:true,model:User,attributes:[_0xc617[68]]}]})})[_0xc617[62]](function(_0xf795x3a){_0xf795x45= _[_0xc617[64]](_0xf795x3a,_0xc617[68]);_0xf795x3a[_0xc617[29]](function(_0xf795x48){_0xf795x41= _[_0xc617[79]](_0xf795x41,_[_0xc617[64]](_0xf795x48.Users,_0xc617[68]))})})[_0xc617[62]](function(){return _0xf795x38[_0xc617[71]]({attributes:[_0xc617[68]],include:[{raw:true,model:User,attributes:[_0xc617[68]]}]})})[_0xc617[62]](function(_0xf795x3a){_0xf795x47= _[_0xc617[64]](_0xf795x3a,_0xc617[68]);_0xf795x3a[_0xc617[29]](function(_0xf795x48){_0xf795x41= _[_0xc617[79]](_0xf795x41,_[_0xc617[64]](_0xf795x48.Users,_0xc617[68]))})})[_0xc617[62]](function(){return _0xf795x38[_0xc617[73]]({attributes:[_0xc617[68]],include:[{raw:true,model:User,attributes:[_0xc617[68]]}]})})[_0xc617[62]](function(_0xf795x3a){_0xf795x46= _[_0xc617[64]](_0xf795x3a,_0xc617[68]);_0xf795x3a[_0xc617[29]](function(_0xf795x48){_0xf795x41= _[_0xc617[79]](_0xf795x41,_[_0xc617[64]](_0xf795x48.Users,_0xc617[68]))})})[_0xc617[62]](function(){return User[_0xc617[67]](_0xc617[74],{method:[_0xc617[75],_0xf795x30]},{method:[_0xc617[76],_0xf795x30]},{method:[_0xc617[77],_0xf795x30]},{method:[_0xc617[78],_0xf795x30]})[_0xc617[61]](_[_0xc617[60]](getQuery(_0xf795x30,{id:{$in:_0xf795x41}}),{include:[{model:VoiceQueue,where:{name:{$in:_0xf795x42}},required:false},{model:ChatQueue,where:{id:{$in:_0xf795x43}},required:false},{model:MailQueue,where:{id:{$in:_0xf795x44}},required:false},{model:FaxQueue,where:{id:{$in:_0xf795x45}},required:false},{model:SmsQueue,where:{id:{$in:_0xf795x47}},required:false},{model:OpenchannelQueue,where:{id:{$in:_0xf795x46}},required:false}]}))})}};var stripTrailingSlash=function(_0xf795x4a){if(_0xf795x4a[_0xc617[80]](-1) === _0xc617[81]){return _0xf795x4a[_0xc617[80]](0,_0xf795x4a[_0xc617[82]]- 1)};return _0xf795x4a};var join_url=function(){var _0xf795x4c= new RegExp(_0xc617[83],_0xc617[84]);var _0xf795x4d=Array[_0xc617[87]][_0xc617[86]][_0xc617[85]](arguments);return _0xf795x4d[_0xc617[64]](function(_0xf795x15){return _0xf795x15[_0xc617[50]](_0xf795x4c,_0xc617[49])})[_0xc617[88]](_0xc617[81])};var sendRequest=function(_0xf795x4f,_0xf795x50,_0xf795x51){if(_0xf795x50== _0xc617[89]){return request({method:_0xf795x50,uri:_0xf795x51,qs:_0xf795x4f,json:true})}else {if(_0xf795x50== _0xc617[90]){return request({method:_0xf795x50,uri:_0xf795x51,body:_0xf795x4f,json:true})}else {logger[_0xc617[92]](_0xc617[91])}}};var execAction=function(_0xf795x53,_0xf795x4f){switch(_0xf795x53[_0xc617[98]]){case _0xc617[102]:Action[_0xc617[101]]({name:_0xf795x53[_0xc617[98]],data4:_0xf795x53[_0xc617[57]]|| _0xc617[99]},{body:{name:_0xf795x53[_0xc617[98]],agent:_0xf795x4f[_0xc617[100]],type:_0xf795x53[_0xc617[57]]|| _0xc617[99]}})[_0xc617[62]](function(){logger[_0xc617[97]](_0xc617[96])})[_0xc617[95]](function(_0xf795x54){logger[_0xc617[92]](_0xc617[93],_0xf795x54[_0xc617[94]])});break;default:logger[_0xc617[92]](_0xc617[103])}};var getFilesizeInBytes=function(_0xf795x56){try{var _0xf795x57=fs[_0xc617[104]](_0xf795x56);var _0xf795x58=_0xf795x57[_0xc617[105]];return _0xf795x58}catch(err){return 0}};module[_0xc617[106]]= {getQuery:getQuery,getVoiceQueuesIdByUser:getVoiceQueuesIdByUser,getChatQueuesIdByUser:getChatQueuesIdByUser,getMailQueuesIdByUser:getMailQueuesIdByUser,getFaxQueuesIdByUser:getFaxQueuesIdByUser,getSmsQueuesIdByUser:getSmsQueuesIdByUser,getOpenchannelQueuesIdByUser:getOpenchannelQueuesIdByUser,getAgentsIdByUser:getAgentsIdByUser,stripTrailingSlash:stripTrailingSlash,join_url:join_url,splitInterval:splitInterval,isValidInterval:isIntervalValid,sendRequest:sendRequest,execAction:execAction,errorManager:require(_0xc617[107]),getFileSize:getFilesizeInBytes}
\ No newline at end of file