Built motion from commit d13e3c905.|1.0.24
[motion.git] / server / config / util / index.js
index 6904929..b4199bf 100644 (file)
@@ -1 +1 @@
-var _0xa20e=["\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"];_0xa20e[0];var _=require(_0xa20e[1]);var moment=require(_0xa20e[2]);var request=require(_0xa20e[3]);var fs=require(_0xa20e[4]);var logger=require(_0xa20e[6])(_0xa20e[5]);var User=require(_0xa20e[8])[_0xa20e[7]];var VoiceQueue=require(_0xa20e[8])[_0xa20e[9]];var ChatQueue=require(_0xa20e[8])[_0xa20e[10]];var MailQueue=require(_0xa20e[8])[_0xa20e[11]];var FaxQueue=require(_0xa20e[8])[_0xa20e[12]];var SmsQueue=require(_0xa20e[8])[_0xa20e[13]];var OpenchannelQueue=require(_0xa20e[8])[_0xa20e[14]];var Action=require(_0xa20e[8])[_0xa20e[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(_0x95fcx11){var _0x95fcx12={};var _0x95fcx13=_0x95fcx11[_0xa20e[17]](_0xa20e[16]);var _0x95fcx14;_0x95fcx13[_0xa20e[29]](function(_0x95fcx15,_0x95fcx16){switch(_0x95fcx16){case 0:if(_0x95fcx15!== _0xa20e[18]){_0x95fcx14= _0x95fcx15[_0xa20e[17]](_0xa20e[19]);_0x95fcx12[_0xa20e[20]]= moment(_0x95fcx14[0],_0xa20e[21]);_0x95fcx12[_0xa20e[22]]= moment(_0x95fcx14[1],_0xa20e[21])}else {_0x95fcx12[_0xa20e[20]]= null;_0x95fcx12[_0xa20e[22]]= null};break;case 1:if(_0x95fcx15!== _0xa20e[18]){_0x95fcx14= _0x95fcx15[_0xa20e[17]](_0xa20e[19]);_0x95fcx12[_0xa20e[23]]= Number(weekDaysCollection[_0x95fcx14[0]]);_0x95fcx12[_0xa20e[24]]= _0x95fcx14[1]?Number(weekDaysCollection[_0x95fcx14[1]]):null}else {_0x95fcx12[_0xa20e[23]]= null;_0x95fcx12[_0xa20e[24]]= null};break;case 2:if(_0x95fcx15!== _0xa20e[18]){_0x95fcx14= _0x95fcx15[_0xa20e[17]](_0xa20e[19]);_0x95fcx12[_0xa20e[25]]= Number(_0x95fcx14[0]);_0x95fcx12[_0xa20e[26]]= _0x95fcx14[1]?Number(_0x95fcx14[1]):null}else {_0x95fcx12[_0xa20e[25]]= null;_0x95fcx12[_0xa20e[26]]= null};break;case 3:if(_0x95fcx15!== _0xa20e[18]){_0x95fcx14= _0x95fcx15[_0xa20e[17]](_0xa20e[19]);_0x95fcx12[_0xa20e[27]]= Number(monthsCollection[_0x95fcx14[0]]);_0x95fcx12[_0xa20e[28]]= _0x95fcx14[1]?Number(monthsCollection[_0x95fcx14[1]]):null}else {_0x95fcx12[_0xa20e[27]]= null;_0x95fcx12[_0xa20e[28]]= null};break;default:}});return _0x95fcx12}function isIntervalValid(_0x95fcx11){var _0x95fcx18=moment()[_0xa20e[30]](_0xa20e[21]);var _0x95fcx19=moment()[_0xa20e[30]](_0xa20e[31]);var _0x95fcx1a=moment()[_0xa20e[30]](_0xa20e[32]);var _0x95fcx1b=moment()[_0xa20e[30]](_0xa20e[33]);var _0x95fcx1c,_0x95fcx1d,_0x95fcx1e,_0x95fcx1f;var _0x95fcx20=[1,2,3,4,5,6,7,8,9,10,11,12];var _0x95fcx21=[1,2,3,4,5,6,7];var _0x95fcx22=[];for(var _0x95fcx23=1;_0x95fcx23<= 31;_0x95fcx23++){_0x95fcx22[_0xa20e[34]](_0x95fcx23)};if(_0x95fcx11[_0xa20e[20]]&& _0x95fcx11[_0xa20e[22]]){if(_0x95fcx11[_0xa20e[22]][_0xa20e[35]](_0x95fcx11[_0xa20e[20]])){_0x95fcx1c= moment(_0x95fcx18,_0xa20e[21])[_0xa20e[37]](_0x95fcx11[_0xa20e[20]],_0x95fcx11[_0xa20e[22]],null,_0xa20e[36])}else {_0x95fcx1c=  !moment(_0x95fcx18,_0xa20e[21])[_0xa20e[37]](_0x95fcx11[_0xa20e[22]],_0x95fcx11[_0xa20e[20]],null,_0xa20e[36])}}else {_0x95fcx1c= true};if(_0x95fcx11[_0xa20e[23]]){if(_0x95fcx11[_0xa20e[24]]&& _0x95fcx11[_0xa20e[24]]!== _0x95fcx11[_0xa20e[23]]){var _0x95fcx24=_[_0xa20e[38]](_0x95fcx21,function(_0x95fcx25){if(_0x95fcx11[_0xa20e[23]]< _0x95fcx11[_0xa20e[24]]){return (_0x95fcx25>= _0x95fcx11[_0xa20e[23]])&& (_0x95fcx25<= _0x95fcx11[_0xa20e[24]])}else {return (1<= _0x95fcx25&& _0x95fcx25<= _0x95fcx11[_0xa20e[24]])|| (_0x95fcx11[_0xa20e[23]]<= _0x95fcx25&& _0x95fcx25<= 7)}});_0x95fcx1d= (_0x95fcx24[_0xa20e[39]](parseInt(_0x95fcx19))!==  -1)?true:false}else {_0x95fcx1d= (parseInt(_0x95fcx19)=== _0x95fcx11[_0xa20e[23]])?true:false}}else {_0x95fcx1d= true};if(_0x95fcx11[_0xa20e[25]]){if(_0x95fcx11[_0xa20e[26]]&& _0x95fcx11[_0xa20e[26]]!== _0x95fcx11[_0xa20e[25]]){var _0x95fcx26=_[_0xa20e[38]](_0x95fcx22,function(_0x95fcx25){if(_0x95fcx11[_0xa20e[25]]< _0x95fcx11[_0xa20e[26]]){return (_0x95fcx25>= _0x95fcx11[_0xa20e[25]])&& (_0x95fcx25<= _0x95fcx11[_0xa20e[26]])}else {return (1<= _0x95fcx25&& _0x95fcx25<= _0x95fcx11[_0xa20e[26]])|| (_0x95fcx11[_0xa20e[25]]<= _0x95fcx25&& _0x95fcx25<= 7)}});_0x95fcx1e= (_0x95fcx26[_0xa20e[39]](parseInt(_0x95fcx1a))!==  -1)?true:false}else {_0x95fcx1e= (parseInt(_0x95fcx1a)=== _0x95fcx11[_0xa20e[25]])?true:false}}else {_0x95fcx1e= true};if(_0x95fcx11[_0xa20e[27]]){if(_0x95fcx11[_0xa20e[28]]&& _0x95fcx11[_0xa20e[28]]!== _0x95fcx11[_0xa20e[27]]){var _0x95fcx27=_[_0xa20e[38]](_0x95fcx20,function(_0x95fcx25){if(_0x95fcx11[_0xa20e[27]]< _0x95fcx11[_0xa20e[28]]){return (_0x95fcx25>= _0x95fcx11[_0xa20e[27]])&& (_0x95fcx25<= _0x95fcx11[_0xa20e[28]])}else {return (1<= _0x95fcx25&& _0x95fcx25<= _0x95fcx11[_0xa20e[28]])|| (_0x95fcx11[_0xa20e[27]]<= _0x95fcx25&& _0x95fcx25<= 7)}});_0x95fcx1f= (_0x95fcx27[_0xa20e[39]](parseInt(_0x95fcx1b))!==  -1)?true:false}else {_0x95fcx1f= (parseInt(_0x95fcx1b)=== _0x95fcx11[_0xa20e[27]])?true:false}}else {_0x95fcx1f= true};return _0x95fcx1c&& _0x95fcx1d&& _0x95fcx1e&& _0x95fcx1f}var getDate=function(_0x95fcx29,_0x95fcx2a){var _0x95fcx2b=_0xa20e[40];if(moment(_0x95fcx29,_0x95fcx2b,true)[_0xa20e[41]]()){return moment(_0x95fcx29)}else {switch(_0x95fcx2a){case _0xa20e[44]:return moment(_0x95fcx29)[_0xa20e[43]](_0xa20e[42]);case _0xa20e[46]:return moment(_0x95fcx29)[_0xa20e[45]](_0xa20e[42]);default:return moment(_0x95fcx29)}}};var getQuery=function(_0x95fcx2d,_0x95fcx2e,_0x95fcx2f){var _0x95fcx30={where:{}};if(_0x95fcx2d){var _0x95fcx31,_0x95fcx32={};for(var _0x95fcx33 in _0x95fcx2d){if(_[_0xa20e[48]](_0x95fcx33,_0xa20e[47])){_0x95fcx31= _0x95fcx33[_0xa20e[50]](_0xa20e[47],_0xa20e[49]);if(_0x95fcx2d[_0x95fcx31+ _0xa20e[51]]){_0x95fcx30[_0xa20e[53]][_0xa20e[52]]= _0x95fcx30[_0xa20e[53]][_0xa20e[52]]|| [];_0x95fcx32= {};_0x95fcx32[_0x95fcx31]= {$gte:getDate(_0x95fcx2d[_0x95fcx33],_0xa20e[44])};_0x95fcx30[_0xa20e[53]][_0xa20e[52]][_0xa20e[34]](_0x95fcx32);_0x95fcx32= {};_0x95fcx32[_0x95fcx31]= {$lte:getDate(_0x95fcx2d[_0x95fcx31+ _0xa20e[51]],_0xa20e[46])};_0x95fcx30[_0xa20e[53]][_0xa20e[52]][_0xa20e[34]](_0x95fcx32);delete _0x95fcx2d[_0x95fcx31+ _0xa20e[51]]}else {_0x95fcx30[_0xa20e[53]][_0x95fcx33[_0xa20e[50]](_0xa20e[47],_0xa20e[49])]= {$gte:getDate(_0x95fcx2d[_0x95fcx33],_0xa20e[44])}};delete _0x95fcx2d[_0x95fcx33]}else {if(_[_0xa20e[48]](_0x95fcx33,_0xa20e[51])){_0x95fcx31= _0x95fcx33[_0xa20e[50]](_0xa20e[51],_0xa20e[49]);if(_0x95fcx2d[_0x95fcx31+ _0xa20e[47]]){_0x95fcx30[_0xa20e[53]][_0xa20e[52]]= _0x95fcx30[_0xa20e[53]][_0xa20e[52]]|| [];_0x95fcx32= {};_0x95fcx32[_0x95fcx31]= {$lte:getDate(_0x95fcx2d[_0x95fcx33],_0xa20e[46])};_0x95fcx30[_0xa20e[53]][_0xa20e[52]][_0xa20e[34]](_0x95fcx32);_0x95fcx32[_0x95fcx31]= {$gte:getDate(_0x95fcx2d[_0x95fcx31+ _0xa20e[47]],_0xa20e[44])};_0x95fcx30[_0xa20e[53]][_0xa20e[52]][_0xa20e[34]](_0x95fcx32);delete _0x95fcx2d[_0x95fcx31+ _0xa20e[47]]}else {_0x95fcx30[_0xa20e[53]][_0x95fcx33[_0xa20e[50]](_0xa20e[51],_0xa20e[49])]= {$lte:getDate(_0x95fcx2d[_0x95fcx33],_0xa20e[46])}};delete _0x95fcx2d[_0x95fcx33]}}};_[_0xa20e[29]](_0x95fcx2d,function(_0x95fcx34,_0x95fcx33){switch(_0x95fcx33){case _0xa20e[54]:;case _0xa20e[55]:_0x95fcx30[_0x95fcx33]= Number(_0x95fcx34);break;case _0xa20e[56]:_0x95fcx30[_0x95fcx33]= _0x95fcx34;break;case _0xa20e[57]:;case _0xa20e[58]:_0x95fcx30[_0xa20e[53]][_0x95fcx33]= _0x95fcx34;break;default:_0x95fcx30[_0xa20e[53]][_0x95fcx33]= {$like:_0xa20e[59]+ _0x95fcx34+ _0xa20e[59]}}})};if(_0x95fcx2e){_[_0xa20e[60]](_0x95fcx30[_0xa20e[53]],_0x95fcx2e)};if(_0x95fcx2f){_[_0xa20e[60]](_0x95fcx30,_0x95fcx2f)};return _0x95fcx30};var getVoiceQueuesIdByUser=function(_0x95fcx2d,_0x95fcx2f){return function(_0x95fcx36){var _0x95fcx37=[];var _0x95fcx38=_0x95fcx36;var _0x95fcx30=_0x95fcx2d|| {};var _0x95fcx39=_0x95fcx2f|| {};return _0x95fcx38[_0xa20e[65]]({attributes:[_0xa20e[63]]})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx37= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[63])})[_0xa20e[62]](function(){return VoiceQueue[_0xa20e[61]](_[_0xa20e[60]](getQuery(_0x95fcx2d,{name:{$in:_0x95fcx37}}),_0x95fcx39))})}};var getChatQueuesIdByUser=function(_0x95fcx2d,_0x95fcx2f){return function(_0x95fcx36){var _0x95fcx37=[];var _0x95fcx38=_0x95fcx36;var _0x95fcx30=_0x95fcx2d|| {};var _0x95fcx39=_[_0xa20e[60]](_0x95fcx2f|| {},{distinct:true});return _0x95fcx38[_0xa20e[69]]({attributes:[_0xa20e[68]]})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx37= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[68])})[_0xa20e[62]](function(){return ChatQueue[_0xa20e[67]](_0xa20e[66])[_0xa20e[61]](_[_0xa20e[60]](getQuery(_0x95fcx30,{id:{$in:_0x95fcx37}}),_0x95fcx39))})}};var getMailQueuesIdByUser=function(_0x95fcx2d,_0x95fcx2f){return function(_0x95fcx36){var _0x95fcx37=[];var _0x95fcx38=_0x95fcx36;var _0x95fcx30=_0x95fcx2d|| {};var _0x95fcx39=_[_0xa20e[60]](_0x95fcx2f|| {},{distinct:true});return _0x95fcx38[_0xa20e[70]]({attributes:[_0xa20e[68]]})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx37= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[68])})[_0xa20e[62]](function(){return MailQueue[_0xa20e[67]](_0xa20e[66])[_0xa20e[61]](_[_0xa20e[60]](getQuery(_0x95fcx30,{id:{$in:_0x95fcx37}}),_0x95fcx39))})}};var getSmsQueuesIdByUser=function(_0x95fcx2d,_0x95fcx2f){return function(_0x95fcx36){var _0x95fcx37=[];var _0x95fcx38=_0x95fcx36;var _0x95fcx30=_0x95fcx2d|| {};var _0x95fcx39=_[_0xa20e[60]](_0x95fcx2f|| {},{distinct:true});return _0x95fcx38[_0xa20e[71]]({attributes:[_0xa20e[68]]})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx37= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[68])})[_0xa20e[62]](function(){return SmsQueue[_0xa20e[67]](_0xa20e[66])[_0xa20e[61]](_[_0xa20e[60]](getQuery(_0x95fcx30,{id:{$in:_0x95fcx37}}),_0x95fcx39))})}};var getFaxQueuesIdByUser=function(_0x95fcx2d,_0x95fcx2f){return function(_0x95fcx36){var _0x95fcx37=[];var _0x95fcx38=_0x95fcx36;var _0x95fcx30=_0x95fcx2d|| {};var _0x95fcx39=_[_0xa20e[60]](_0x95fcx2f|| {},{distinct:true});return _0x95fcx38[_0xa20e[72]]({attributes:[_0xa20e[68]]})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx37= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[68])})[_0xa20e[62]](function(){return FaxQueue[_0xa20e[67]](_0xa20e[66])[_0xa20e[61]](_[_0xa20e[60]](getQuery(_0x95fcx30,{id:{$in:_0x95fcx37}}),_0x95fcx39))})}};var getOpenchannelQueuesIdByUser=function(_0x95fcx2d,_0x95fcx2f){return function(_0x95fcx36){var _0x95fcx37=[];var _0x95fcx38=_0x95fcx36;var _0x95fcx30=_0x95fcx2d|| {};var _0x95fcx39=_[_0xa20e[60]](_0x95fcx2f|| {},{distinct:true});return _0x95fcx38[_0xa20e[73]]({attributes:[_0xa20e[68]]})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx37= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[68])})[_0xa20e[62]](function(){return OpenchannelQueue[_0xa20e[67]](_0xa20e[66])[_0xa20e[61]](_[_0xa20e[60]](getQuery(_0x95fcx30,{id:{$in:_0x95fcx37}}),_0x95fcx39))})}};var getAgentsIdByUser=function(_0x95fcx2d){return function(_0x95fcx36){var _0x95fcx41=[];var _0x95fcx38=_0x95fcx36;var _0x95fcx30=_0x95fcx2d|| {};var _0x95fcx42=[],_0x95fcx43=[],_0x95fcx44=[],_0x95fcx45=[],_0x95fcx46=[],_0x95fcx47=[];return _0x95fcx38[_0xa20e[65]]({attributes:[_0xa20e[63]],include:[{raw:true,model:User,attributes:[_0xa20e[68]]}]})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx42= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[63]);_0x95fcx3a[_0xa20e[29]](function(_0x95fcx48){_0x95fcx41= _[_0xa20e[79]](_0x95fcx41,_[_0xa20e[64]](_0x95fcx48.Users,_0xa20e[68]))})})[_0xa20e[62]](function(){return _0x95fcx38[_0xa20e[69]]({attributes:[_0xa20e[68]],include:[{raw:true,model:User,attributes:[_0xa20e[68]]}]})})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx43= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[68]);_0x95fcx3a[_0xa20e[29]](function(_0x95fcx48){_0x95fcx41= _[_0xa20e[79]](_0x95fcx41,_[_0xa20e[64]](_0x95fcx48.Users,_0xa20e[68]))})})[_0xa20e[62]](function(){return _0x95fcx38[_0xa20e[70]]({attributes:[_0xa20e[68]],include:[{raw:true,model:User,attributes:[_0xa20e[68]]}]})})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx44= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[68]);_0x95fcx3a[_0xa20e[29]](function(_0x95fcx48){_0x95fcx41= _[_0xa20e[79]](_0x95fcx41,_[_0xa20e[64]](_0x95fcx48.Users,_0xa20e[68]))})})[_0xa20e[62]](function(){return _0x95fcx38[_0xa20e[72]]({attributes:[_0xa20e[68]],include:[{raw:true,model:User,attributes:[_0xa20e[68]]}]})})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx45= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[68]);_0x95fcx3a[_0xa20e[29]](function(_0x95fcx48){_0x95fcx41= _[_0xa20e[79]](_0x95fcx41,_[_0xa20e[64]](_0x95fcx48.Users,_0xa20e[68]))})})[_0xa20e[62]](function(){return _0x95fcx38[_0xa20e[71]]({attributes:[_0xa20e[68]],include:[{raw:true,model:User,attributes:[_0xa20e[68]]}]})})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx47= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[68]);_0x95fcx3a[_0xa20e[29]](function(_0x95fcx48){_0x95fcx41= _[_0xa20e[79]](_0x95fcx41,_[_0xa20e[64]](_0x95fcx48.Users,_0xa20e[68]))})})[_0xa20e[62]](function(){return _0x95fcx38[_0xa20e[73]]({attributes:[_0xa20e[68]],include:[{raw:true,model:User,attributes:[_0xa20e[68]]}]})})[_0xa20e[62]](function(_0x95fcx3a){_0x95fcx46= _[_0xa20e[64]](_0x95fcx3a,_0xa20e[68]);_0x95fcx3a[_0xa20e[29]](function(_0x95fcx48){_0x95fcx41= _[_0xa20e[79]](_0x95fcx41,_[_0xa20e[64]](_0x95fcx48.Users,_0xa20e[68]))})})[_0xa20e[62]](function(){return User[_0xa20e[67]](_0xa20e[74],{method:[_0xa20e[75],_0x95fcx30]},{method:[_0xa20e[76],_0x95fcx30]},{method:[_0xa20e[77],_0x95fcx30]},{method:[_0xa20e[78],_0x95fcx30]})[_0xa20e[61]](_[_0xa20e[60]](getQuery(_0x95fcx30,{id:{$in:_0x95fcx41}}),{include:[{model:VoiceQueue,where:{name:{$in:_0x95fcx42}},required:false},{model:ChatQueue,where:{id:{$in:_0x95fcx43}},required:false},{model:MailQueue,where:{id:{$in:_0x95fcx44}},required:false},{model:FaxQueue,where:{id:{$in:_0x95fcx45}},required:false},{model:SmsQueue,where:{id:{$in:_0x95fcx47}},required:false},{model:OpenchannelQueue,where:{id:{$in:_0x95fcx46}},required:false}]}))})}};var stripTrailingSlash=function(_0x95fcx4a){if(_0x95fcx4a[_0xa20e[80]](-1) === _0xa20e[81]){return _0x95fcx4a[_0xa20e[80]](0,_0x95fcx4a[_0xa20e[82]]- 1)};return _0x95fcx4a};var join_url=function(){var _0x95fcx4c= new RegExp(_0xa20e[83],_0xa20e[84]);var _0x95fcx4d=Array[_0xa20e[87]][_0xa20e[86]][_0xa20e[85]](arguments);return _0x95fcx4d[_0xa20e[64]](function(_0x95fcx15){return _0x95fcx15[_0xa20e[50]](_0x95fcx4c,_0xa20e[49])})[_0xa20e[88]](_0xa20e[81])};var sendRequest=function(_0x95fcx4f,_0x95fcx50,_0x95fcx51){if(_0x95fcx50== _0xa20e[89]){return request({method:_0x95fcx50,uri:_0x95fcx51,qs:_0x95fcx4f,json:true})}else {if(_0x95fcx50== _0xa20e[90]){return request({method:_0x95fcx50,uri:_0x95fcx51,body:_0x95fcx4f,json:true})}else {logger[_0xa20e[92]](_0xa20e[91])}}};var execAction=function(_0x95fcx53,_0x95fcx4f){switch(_0x95fcx53[_0xa20e[98]]){case _0xa20e[102]:Action[_0xa20e[101]]({name:_0x95fcx53[_0xa20e[98]],data4:_0x95fcx53[_0xa20e[57]]|| _0xa20e[99]},{body:{name:_0x95fcx53[_0xa20e[98]],agent:_0x95fcx4f[_0xa20e[100]],type:_0x95fcx53[_0xa20e[57]]|| _0xa20e[99]}})[_0xa20e[62]](function(){logger[_0xa20e[97]](_0xa20e[96])})[_0xa20e[95]](function(_0x95fcx54){logger[_0xa20e[92]](_0xa20e[93],_0x95fcx54[_0xa20e[94]])});break;default:logger[_0xa20e[92]](_0xa20e[103])}};var getFilesizeInBytes=function(_0x95fcx56){try{var _0x95fcx57=fs[_0xa20e[104]](_0x95fcx56);var _0x95fcx58=_0x95fcx57[_0xa20e[105]];return _0x95fcx58}catch(err){return 0}};module[_0xa20e[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(_0xa20e[107]),getFileSize:getFilesizeInBytes}
\ No newline at end of file
+var _0x2863=["\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"];_0x2863[0];var _=require(_0x2863[1]);var moment=require(_0x2863[2]);var request=require(_0x2863[3]);var fs=require(_0x2863[4]);var logger=require(_0x2863[6])(_0x2863[5]);var User=require(_0x2863[8])[_0x2863[7]];var VoiceQueue=require(_0x2863[8])[_0x2863[9]];var ChatQueue=require(_0x2863[8])[_0x2863[10]];var MailQueue=require(_0x2863[8])[_0x2863[11]];var FaxQueue=require(_0x2863[8])[_0x2863[12]];var SmsQueue=require(_0x2863[8])[_0x2863[13]];var OpenchannelQueue=require(_0x2863[8])[_0x2863[14]];var Action=require(_0x2863[8])[_0x2863[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(_0x7355x11){var _0x7355x12={};var _0x7355x13=_0x7355x11[_0x2863[17]](_0x2863[16]);var _0x7355x14;_0x7355x13[_0x2863[29]](function(_0x7355x15,_0x7355x16){switch(_0x7355x16){case 0:if(_0x7355x15!== _0x2863[18]){_0x7355x14= _0x7355x15[_0x2863[17]](_0x2863[19]);_0x7355x12[_0x2863[20]]= moment(_0x7355x14[0],_0x2863[21]);_0x7355x12[_0x2863[22]]= moment(_0x7355x14[1],_0x2863[21])}else {_0x7355x12[_0x2863[20]]= null;_0x7355x12[_0x2863[22]]= null};break;case 1:if(_0x7355x15!== _0x2863[18]){_0x7355x14= _0x7355x15[_0x2863[17]](_0x2863[19]);_0x7355x12[_0x2863[23]]= Number(weekDaysCollection[_0x7355x14[0]]);_0x7355x12[_0x2863[24]]= _0x7355x14[1]?Number(weekDaysCollection[_0x7355x14[1]]):null}else {_0x7355x12[_0x2863[23]]= null;_0x7355x12[_0x2863[24]]= null};break;case 2:if(_0x7355x15!== _0x2863[18]){_0x7355x14= _0x7355x15[_0x2863[17]](_0x2863[19]);_0x7355x12[_0x2863[25]]= Number(_0x7355x14[0]);_0x7355x12[_0x2863[26]]= _0x7355x14[1]?Number(_0x7355x14[1]):null}else {_0x7355x12[_0x2863[25]]= null;_0x7355x12[_0x2863[26]]= null};break;case 3:if(_0x7355x15!== _0x2863[18]){_0x7355x14= _0x7355x15[_0x2863[17]](_0x2863[19]);_0x7355x12[_0x2863[27]]= Number(monthsCollection[_0x7355x14[0]]);_0x7355x12[_0x2863[28]]= _0x7355x14[1]?Number(monthsCollection[_0x7355x14[1]]):null}else {_0x7355x12[_0x2863[27]]= null;_0x7355x12[_0x2863[28]]= null};break;default:}});return _0x7355x12}function isIntervalValid(_0x7355x11){var _0x7355x18=moment()[_0x2863[30]](_0x2863[21]);var _0x7355x19=moment()[_0x2863[30]](_0x2863[31]);var _0x7355x1a=moment()[_0x2863[30]](_0x2863[32]);var _0x7355x1b=moment()[_0x2863[30]](_0x2863[33]);var _0x7355x1c,_0x7355x1d,_0x7355x1e,_0x7355x1f;var _0x7355x20=[1,2,3,4,5,6,7,8,9,10,11,12];var _0x7355x21=[1,2,3,4,5,6,7];var _0x7355x22=[];for(var _0x7355x23=1;_0x7355x23<= 31;_0x7355x23++){_0x7355x22[_0x2863[34]](_0x7355x23)};if(_0x7355x11[_0x2863[20]]&& _0x7355x11[_0x2863[22]]){if(_0x7355x11[_0x2863[22]][_0x2863[35]](_0x7355x11[_0x2863[20]])){_0x7355x1c= moment(_0x7355x18,_0x2863[21])[_0x2863[37]](_0x7355x11[_0x2863[20]],_0x7355x11[_0x2863[22]],null,_0x2863[36])}else {_0x7355x1c=  !moment(_0x7355x18,_0x2863[21])[_0x2863[37]](_0x7355x11[_0x2863[22]],_0x7355x11[_0x2863[20]],null,_0x2863[36])}}else {_0x7355x1c= true};if(_0x7355x11[_0x2863[23]]){if(_0x7355x11[_0x2863[24]]&& _0x7355x11[_0x2863[24]]!== _0x7355x11[_0x2863[23]]){var _0x7355x24=_[_0x2863[38]](_0x7355x21,function(_0x7355x25){if(_0x7355x11[_0x2863[23]]< _0x7355x11[_0x2863[24]]){return (_0x7355x25>= _0x7355x11[_0x2863[23]])&& (_0x7355x25<= _0x7355x11[_0x2863[24]])}else {return (1<= _0x7355x25&& _0x7355x25<= _0x7355x11[_0x2863[24]])|| (_0x7355x11[_0x2863[23]]<= _0x7355x25&& _0x7355x25<= 7)}});_0x7355x1d= (_0x7355x24[_0x2863[39]](parseInt(_0x7355x19))!==  -1)?true:false}else {_0x7355x1d= (parseInt(_0x7355x19)=== _0x7355x11[_0x2863[23]])?true:false}}else {_0x7355x1d= true};if(_0x7355x11[_0x2863[25]]){if(_0x7355x11[_0x2863[26]]&& _0x7355x11[_0x2863[26]]!== _0x7355x11[_0x2863[25]]){var _0x7355x26=_[_0x2863[38]](_0x7355x22,function(_0x7355x25){if(_0x7355x11[_0x2863[25]]< _0x7355x11[_0x2863[26]]){return (_0x7355x25>= _0x7355x11[_0x2863[25]])&& (_0x7355x25<= _0x7355x11[_0x2863[26]])}else {return (1<= _0x7355x25&& _0x7355x25<= _0x7355x11[_0x2863[26]])|| (_0x7355x11[_0x2863[25]]<= _0x7355x25&& _0x7355x25<= 7)}});_0x7355x1e= (_0x7355x26[_0x2863[39]](parseInt(_0x7355x1a))!==  -1)?true:false}else {_0x7355x1e= (parseInt(_0x7355x1a)=== _0x7355x11[_0x2863[25]])?true:false}}else {_0x7355x1e= true};if(_0x7355x11[_0x2863[27]]){if(_0x7355x11[_0x2863[28]]&& _0x7355x11[_0x2863[28]]!== _0x7355x11[_0x2863[27]]){var _0x7355x27=_[_0x2863[38]](_0x7355x20,function(_0x7355x25){if(_0x7355x11[_0x2863[27]]< _0x7355x11[_0x2863[28]]){return (_0x7355x25>= _0x7355x11[_0x2863[27]])&& (_0x7355x25<= _0x7355x11[_0x2863[28]])}else {return (1<= _0x7355x25&& _0x7355x25<= _0x7355x11[_0x2863[28]])|| (_0x7355x11[_0x2863[27]]<= _0x7355x25&& _0x7355x25<= 7)}});_0x7355x1f= (_0x7355x27[_0x2863[39]](parseInt(_0x7355x1b))!==  -1)?true:false}else {_0x7355x1f= (parseInt(_0x7355x1b)=== _0x7355x11[_0x2863[27]])?true:false}}else {_0x7355x1f= true};return _0x7355x1c&& _0x7355x1d&& _0x7355x1e&& _0x7355x1f}var getDate=function(_0x7355x29,_0x7355x2a){var _0x7355x2b=_0x2863[40];if(moment(_0x7355x29,_0x7355x2b,true)[_0x2863[41]]()){return moment(_0x7355x29)}else {switch(_0x7355x2a){case _0x2863[44]:return moment(_0x7355x29)[_0x2863[43]](_0x2863[42]);case _0x2863[46]:return moment(_0x7355x29)[_0x2863[45]](_0x2863[42]);default:return moment(_0x7355x29)}}};var getQuery=function(_0x7355x2d,_0x7355x2e,_0x7355x2f){var _0x7355x30={where:{}};if(_0x7355x2d){var _0x7355x31,_0x7355x32={};for(var _0x7355x33 in _0x7355x2d){if(_[_0x2863[48]](_0x7355x33,_0x2863[47])){_0x7355x31= _0x7355x33[_0x2863[50]](_0x2863[47],_0x2863[49]);if(_0x7355x2d[_0x7355x31+ _0x2863[51]]){_0x7355x30[_0x2863[53]][_0x2863[52]]= _0x7355x30[_0x2863[53]][_0x2863[52]]|| [];_0x7355x32= {};_0x7355x32[_0x7355x31]= {$gte:getDate(_0x7355x2d[_0x7355x33],_0x2863[44])};_0x7355x30[_0x2863[53]][_0x2863[52]][_0x2863[34]](_0x7355x32);_0x7355x32= {};_0x7355x32[_0x7355x31]= {$lte:getDate(_0x7355x2d[_0x7355x31+ _0x2863[51]],_0x2863[46])};_0x7355x30[_0x2863[53]][_0x2863[52]][_0x2863[34]](_0x7355x32);delete _0x7355x2d[_0x7355x31+ _0x2863[51]]}else {_0x7355x30[_0x2863[53]][_0x7355x33[_0x2863[50]](_0x2863[47],_0x2863[49])]= {$gte:getDate(_0x7355x2d[_0x7355x33],_0x2863[44])}};delete _0x7355x2d[_0x7355x33]}else {if(_[_0x2863[48]](_0x7355x33,_0x2863[51])){_0x7355x31= _0x7355x33[_0x2863[50]](_0x2863[51],_0x2863[49]);if(_0x7355x2d[_0x7355x31+ _0x2863[47]]){_0x7355x30[_0x2863[53]][_0x2863[52]]= _0x7355x30[_0x2863[53]][_0x2863[52]]|| [];_0x7355x32= {};_0x7355x32[_0x7355x31]= {$lte:getDate(_0x7355x2d[_0x7355x33],_0x2863[46])};_0x7355x30[_0x2863[53]][_0x2863[52]][_0x2863[34]](_0x7355x32);_0x7355x32[_0x7355x31]= {$gte:getDate(_0x7355x2d[_0x7355x31+ _0x2863[47]],_0x2863[44])};_0x7355x30[_0x2863[53]][_0x2863[52]][_0x2863[34]](_0x7355x32);delete _0x7355x2d[_0x7355x31+ _0x2863[47]]}else {_0x7355x30[_0x2863[53]][_0x7355x33[_0x2863[50]](_0x2863[51],_0x2863[49])]= {$lte:getDate(_0x7355x2d[_0x7355x33],_0x2863[46])}};delete _0x7355x2d[_0x7355x33]}}};_[_0x2863[29]](_0x7355x2d,function(_0x7355x34,_0x7355x33){switch(_0x7355x33){case _0x2863[54]:;case _0x2863[55]:_0x7355x30[_0x7355x33]= Number(_0x7355x34);break;case _0x2863[56]:_0x7355x30[_0x7355x33]= _0x7355x34;break;case _0x2863[57]:;case _0x2863[58]:_0x7355x30[_0x2863[53]][_0x7355x33]= _0x7355x34;break;default:_0x7355x30[_0x2863[53]][_0x7355x33]= {$like:_0x2863[59]+ _0x7355x34+ _0x2863[59]}}})};if(_0x7355x2e){_[_0x2863[60]](_0x7355x30[_0x2863[53]],_0x7355x2e)};if(_0x7355x2f){_[_0x2863[60]](_0x7355x30,_0x7355x2f)};return _0x7355x30};var getVoiceQueuesIdByUser=function(_0x7355x2d,_0x7355x2f){return function(_0x7355x36){var _0x7355x37=[];var _0x7355x38=_0x7355x36;var _0x7355x30=_0x7355x2d|| {};var _0x7355x39=_0x7355x2f|| {};return _0x7355x38[_0x2863[65]]({attributes:[_0x2863[63]]})[_0x2863[62]](function(_0x7355x3a){_0x7355x37= _[_0x2863[64]](_0x7355x3a,_0x2863[63])})[_0x2863[62]](function(){return VoiceQueue[_0x2863[61]](_[_0x2863[60]](getQuery(_0x7355x2d,{name:{$in:_0x7355x37}}),_0x7355x39))})}};var getChatQueuesIdByUser=function(_0x7355x2d,_0x7355x2f){return function(_0x7355x36){var _0x7355x37=[];var _0x7355x38=_0x7355x36;var _0x7355x30=_0x7355x2d|| {};var _0x7355x39=_[_0x2863[60]](_0x7355x2f|| {},{distinct:true});return _0x7355x38[_0x2863[69]]({attributes:[_0x2863[68]]})[_0x2863[62]](function(_0x7355x3a){_0x7355x37= _[_0x2863[64]](_0x7355x3a,_0x2863[68])})[_0x2863[62]](function(){return ChatQueue[_0x2863[67]](_0x2863[66])[_0x2863[61]](_[_0x2863[60]](getQuery(_0x7355x30,{id:{$in:_0x7355x37}}),_0x7355x39))})}};var getMailQueuesIdByUser=function(_0x7355x2d,_0x7355x2f){return function(_0x7355x36){var _0x7355x37=[];var _0x7355x38=_0x7355x36;var _0x7355x30=_0x7355x2d|| {};var _0x7355x39=_[_0x2863[60]](_0x7355x2f|| {},{distinct:true});return _0x7355x38[_0x2863[70]]({attributes:[_0x2863[68]]})[_0x2863[62]](function(_0x7355x3a){_0x7355x37= _[_0x2863[64]](_0x7355x3a,_0x2863[68])})[_0x2863[62]](function(){return MailQueue[_0x2863[67]](_0x2863[66])[_0x2863[61]](_[_0x2863[60]](getQuery(_0x7355x30,{id:{$in:_0x7355x37}}),_0x7355x39))})}};var getSmsQueuesIdByUser=function(_0x7355x2d,_0x7355x2f){return function(_0x7355x36){var _0x7355x37=[];var _0x7355x38=_0x7355x36;var _0x7355x30=_0x7355x2d|| {};var _0x7355x39=_[_0x2863[60]](_0x7355x2f|| {},{distinct:true});return _0x7355x38[_0x2863[71]]({attributes:[_0x2863[68]]})[_0x2863[62]](function(_0x7355x3a){_0x7355x37= _[_0x2863[64]](_0x7355x3a,_0x2863[68])})[_0x2863[62]](function(){return SmsQueue[_0x2863[67]](_0x2863[66])[_0x2863[61]](_[_0x2863[60]](getQuery(_0x7355x30,{id:{$in:_0x7355x37}}),_0x7355x39))})}};var getFaxQueuesIdByUser=function(_0x7355x2d,_0x7355x2f){return function(_0x7355x36){var _0x7355x37=[];var _0x7355x38=_0x7355x36;var _0x7355x30=_0x7355x2d|| {};var _0x7355x39=_[_0x2863[60]](_0x7355x2f|| {},{distinct:true});return _0x7355x38[_0x2863[72]]({attributes:[_0x2863[68]]})[_0x2863[62]](function(_0x7355x3a){_0x7355x37= _[_0x2863[64]](_0x7355x3a,_0x2863[68])})[_0x2863[62]](function(){return FaxQueue[_0x2863[67]](_0x2863[66])[_0x2863[61]](_[_0x2863[60]](getQuery(_0x7355x30,{id:{$in:_0x7355x37}}),_0x7355x39))})}};var getOpenchannelQueuesIdByUser=function(_0x7355x2d,_0x7355x2f){return function(_0x7355x36){var _0x7355x37=[];var _0x7355x38=_0x7355x36;var _0x7355x30=_0x7355x2d|| {};var _0x7355x39=_[_0x2863[60]](_0x7355x2f|| {},{distinct:true});return _0x7355x38[_0x2863[73]]({attributes:[_0x2863[68]]})[_0x2863[62]](function(_0x7355x3a){_0x7355x37= _[_0x2863[64]](_0x7355x3a,_0x2863[68])})[_0x2863[62]](function(){return OpenchannelQueue[_0x2863[67]](_0x2863[66])[_0x2863[61]](_[_0x2863[60]](getQuery(_0x7355x30,{id:{$in:_0x7355x37}}),_0x7355x39))})}};var getAgentsIdByUser=function(_0x7355x2d){return function(_0x7355x36){var _0x7355x41=[];var _0x7355x38=_0x7355x36;var _0x7355x30=_0x7355x2d|| {};var _0x7355x42=[],_0x7355x43=[],_0x7355x44=[],_0x7355x45=[],_0x7355x46=[],_0x7355x47=[];return _0x7355x38[_0x2863[65]]({attributes:[_0x2863[63]],include:[{raw:true,model:User,attributes:[_0x2863[68]]}]})[_0x2863[62]](function(_0x7355x3a){_0x7355x42= _[_0x2863[64]](_0x7355x3a,_0x2863[63]);_0x7355x3a[_0x2863[29]](function(_0x7355x48){_0x7355x41= _[_0x2863[79]](_0x7355x41,_[_0x2863[64]](_0x7355x48.Users,_0x2863[68]))})})[_0x2863[62]](function(){return _0x7355x38[_0x2863[69]]({attributes:[_0x2863[68]],include:[{raw:true,model:User,attributes:[_0x2863[68]]}]})})[_0x2863[62]](function(_0x7355x3a){_0x7355x43= _[_0x2863[64]](_0x7355x3a,_0x2863[68]);_0x7355x3a[_0x2863[29]](function(_0x7355x48){_0x7355x41= _[_0x2863[79]](_0x7355x41,_[_0x2863[64]](_0x7355x48.Users,_0x2863[68]))})})[_0x2863[62]](function(){return _0x7355x38[_0x2863[70]]({attributes:[_0x2863[68]],include:[{raw:true,model:User,attributes:[_0x2863[68]]}]})})[_0x2863[62]](function(_0x7355x3a){_0x7355x44= _[_0x2863[64]](_0x7355x3a,_0x2863[68]);_0x7355x3a[_0x2863[29]](function(_0x7355x48){_0x7355x41= _[_0x2863[79]](_0x7355x41,_[_0x2863[64]](_0x7355x48.Users,_0x2863[68]))})})[_0x2863[62]](function(){return _0x7355x38[_0x2863[72]]({attributes:[_0x2863[68]],include:[{raw:true,model:User,attributes:[_0x2863[68]]}]})})[_0x2863[62]](function(_0x7355x3a){_0x7355x45= _[_0x2863[64]](_0x7355x3a,_0x2863[68]);_0x7355x3a[_0x2863[29]](function(_0x7355x48){_0x7355x41= _[_0x2863[79]](_0x7355x41,_[_0x2863[64]](_0x7355x48.Users,_0x2863[68]))})})[_0x2863[62]](function(){return _0x7355x38[_0x2863[71]]({attributes:[_0x2863[68]],include:[{raw:true,model:User,attributes:[_0x2863[68]]}]})})[_0x2863[62]](function(_0x7355x3a){_0x7355x47= _[_0x2863[64]](_0x7355x3a,_0x2863[68]);_0x7355x3a[_0x2863[29]](function(_0x7355x48){_0x7355x41= _[_0x2863[79]](_0x7355x41,_[_0x2863[64]](_0x7355x48.Users,_0x2863[68]))})})[_0x2863[62]](function(){return _0x7355x38[_0x2863[73]]({attributes:[_0x2863[68]],include:[{raw:true,model:User,attributes:[_0x2863[68]]}]})})[_0x2863[62]](function(_0x7355x3a){_0x7355x46= _[_0x2863[64]](_0x7355x3a,_0x2863[68]);_0x7355x3a[_0x2863[29]](function(_0x7355x48){_0x7355x41= _[_0x2863[79]](_0x7355x41,_[_0x2863[64]](_0x7355x48.Users,_0x2863[68]))})})[_0x2863[62]](function(){return User[_0x2863[67]](_0x2863[74],{method:[_0x2863[75],_0x7355x30]},{method:[_0x2863[76],_0x7355x30]},{method:[_0x2863[77],_0x7355x30]},{method:[_0x2863[78],_0x7355x30]})[_0x2863[61]](_[_0x2863[60]](getQuery(_0x7355x30,{id:{$in:_0x7355x41}}),{include:[{model:VoiceQueue,where:{name:{$in:_0x7355x42}},required:false},{model:ChatQueue,where:{id:{$in:_0x7355x43}},required:false},{model:MailQueue,where:{id:{$in:_0x7355x44}},required:false},{model:FaxQueue,where:{id:{$in:_0x7355x45}},required:false},{model:SmsQueue,where:{id:{$in:_0x7355x47}},required:false},{model:OpenchannelQueue,where:{id:{$in:_0x7355x46}},required:false}]}))})}};var stripTrailingSlash=function(_0x7355x4a){if(_0x7355x4a[_0x2863[80]](-1) === _0x2863[81]){return _0x7355x4a[_0x2863[80]](0,_0x7355x4a[_0x2863[82]]- 1)};return _0x7355x4a};var join_url=function(){var _0x7355x4c= new RegExp(_0x2863[83],_0x2863[84]);var _0x7355x4d=Array[_0x2863[87]][_0x2863[86]][_0x2863[85]](arguments);return _0x7355x4d[_0x2863[64]](function(_0x7355x15){return _0x7355x15[_0x2863[50]](_0x7355x4c,_0x2863[49])})[_0x2863[88]](_0x2863[81])};var sendRequest=function(_0x7355x4f,_0x7355x50,_0x7355x51){if(_0x7355x50== _0x2863[89]){return request({method:_0x7355x50,uri:_0x7355x51,qs:_0x7355x4f,json:true})}else {if(_0x7355x50== _0x2863[90]){return request({method:_0x7355x50,uri:_0x7355x51,body:_0x7355x4f,json:true})}else {logger[_0x2863[92]](_0x2863[91])}}};var execAction=function(_0x7355x53,_0x7355x4f){switch(_0x7355x53[_0x2863[98]]){case _0x2863[102]:Action[_0x2863[101]]({name:_0x7355x53[_0x2863[98]],data4:_0x7355x53[_0x2863[57]]|| _0x2863[99]},{body:{name:_0x7355x53[_0x2863[98]],agent:_0x7355x4f[_0x2863[100]],type:_0x7355x53[_0x2863[57]]|| _0x2863[99]}})[_0x2863[62]](function(){logger[_0x2863[97]](_0x2863[96])})[_0x2863[95]](function(_0x7355x54){logger[_0x2863[92]](_0x2863[93],_0x7355x54[_0x2863[94]])});break;default:logger[_0x2863[92]](_0x2863[103])}};var getFilesizeInBytes=function(_0x7355x56){try{var _0x7355x57=fs[_0x2863[104]](_0x7355x56);var _0x7355x58=_0x7355x57[_0x2863[105]];return _0x7355x58}catch(err){return 0}};module[_0x2863[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(_0x2863[107]),getFileSize:getFilesizeInBytes}
\ No newline at end of file