37469587334000ca2ae24416750c14ed6e6f5c3d
[motion.git] / server / api / report_queue / report_queue.controller.js
1 var _0x4806=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x77\x61\x69\x74\x69\x6E\x67","\x63\x6F\x75\x6E\x74","\x75\x73\x65\x72","\x61\x6C\x6C","\x72\x6F\x77\x73","\x6E\x61\x6D\x65","\x6D\x61\x70","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x69\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x66\x69\x6E\x64\x41\x6C\x6C","\x72\x6F\x6C\x65","\x71\x75\x65\x75\x65\x50\x61\x72\x61\x6D\x65\x74\x65\x72\x73","\x6C\x69\x6D\x69\x74","\x6F\x66\x66\x73\x65\x74","\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x75\x69\x46\x72\x6F\x6D","\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x75\x69\x54\x6F","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x5F\x75\x69\x46\x72\x6F\x6D","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x5F\x75\x69\x54\x6F","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x5F\x75\x69\x46\x72\x6F\x6D","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x5F\x75\x69\x54\x6F","\x6C\x6F\x67","\x73\x70\x72\x65\x61\x64","\x66\x69\x6E\x64","\x74\x6F\x74\x61\x6C\x63\x61\x6C\x6C\x73","\x66\x6F\x72\x45\x61\x63\x68","\x5F\x61\x6E\x73\x77\x65\x72\x65\x64\x46\x72\x6F\x6D","\x61\x6E\x73\x77\x65\x72\x65\x64","\x5F\x61\x6E\x73\x77\x65\x72\x65\x64\x54\x6F","\x5F\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x46\x72\x6F\x6D","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x5F\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x54\x6F","\x5F\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x46\x72\x6F\x6D","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x5F\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x54\x6F","\x72\x65\x64\x75\x63\x65","\x66\x69\x6C\x74\x65\x72","\x5F\x6C\x69\x6D\x69\x74","\x76\x61\x6C\x75\x65","\x74\x61\x6B\x65","\x73\x6C\x69\x63\x65","\x6C\x65\x6E\x67\x74\x68","\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x30\x30\x3A\x30\x30\x3A\x30\x30","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x43\x4F\x55\x4E\x54\x28\x64\x69\x73\x74\x69\x6E\x63\x74\x20\x75\x6E\x69\x71\x75\x65\x69\x64\x29\x20\x61\x73\x20\x74\x6F\x74\x61\x6C\x63\x61\x6C\x6C\x73\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x27\x2C\x27","\x6A\x6F\x69\x6E","\x27\x29\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x71\x75\x65\x75\x65","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x74\x61\x6C\x6B\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x74\x61\x6C\x6B\x74\x69\x6D\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x68\x6F\x6C\x64\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x68\x6F\x6C\x64\x74\x69\x6D\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x71\x75\x65\x75\x65","\x43\x4F\x55\x4E\x54","\x63\x6F\x6C","\x66\x6E","\x61\x63\x74\x69\x76\x65","\x77\x61\x69\x74\x69\x6E\x67\x43\x61\x6C\x6C\x73","\x77\x61\x69\x74\x69\x6E\x67\x4C\x69\x73\x74","\x73\x63\x6F\x70\x65","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x61\x76\x67\x61\x6E\x73\x77\x65\x72\x74\x69\x6D\x65","\x53\x45\x4C\x45\x43\x54\x20\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x68\x6F\x6C\x64\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x27\x29","\x61\x76\x67\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x53\x45\x4C\x45\x43\x54\x20\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x74\x61\x6C\x6B\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x61\x6E\x73\x77\x65\x72\x72\x61\x74\x65","\x53\x45\x4C\x45\x43\x54\x20\x52\x4F\x55\x4E\x44\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2F\x20\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2B\x20\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x29\x20\x2A\x20\x31\x30\x30\x2C\x20\x31\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x61\x62\x61\x6E\x64\x6F\x6E\x72\x61\x74\x65","\x53\x45\x4C\x45\x43\x54\x20\x52\x4F\x55\x4E\x44\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x20\x2F\x20\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2B\x20\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x29\x20\x2A\x20\x31\x30\x30\x2C\x20\x31\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x74\x6F\x74\x61\x6C\x6F\x66\x66\x65\x72\x65\x64","\x53\x45\x4C\x45\x43\x54\x20\x43\x4F\x55\x4E\x54\x28\x64\x69\x73\x74\x69\x6E\x63\x74\x20\x75\x6E\x69\x71\x75\x65\x69\x64\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x70\x61\x72\x61\x6D\x73"];_0x4806[0];var _=require(_0x4806[1]);var sequelize=require(_0x4806[3])[_0x4806[2]];var Agent=require(_0x4806[3])[_0x4806[4]];var ReportQueue=require(_0x4806[3])[_0x4806[5]];var VoiceQueue=require(_0x4806[3])[_0x4806[6]];var ReportQueueHistory=require(_0x4806[3])[_0x4806[8]][_0x4806[7]];var Util=require(_0x4806[9]);var Promise=require(_0x4806[10]);exports[_0x4806[11]]=function(_0x8a2cx9,_0x8a2cxa,_0x8a2cxb){return ReportQueue[_0x4806[18]](Util[_0x4806[17]](_0x8a2cx9[_0x4806[16]]))[_0x4806[15]](function(_0x8a2cxd){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]](_0x8a2cxd)})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[19]]=function(_0x8a2cx9,_0x8a2cxa){return ReportQueueHistory[_0x4806[19]]()[_0x4806[15]](function(_0x8a2cxe){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]](_0x8a2cxe)})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[20]]=function(_0x8a2cx9,_0x8a2cxa){return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){return ReportQueue[_0x4806[21]]({where:{queuecallerleaveAt:null,queue:_0x8a2cx10}})})[_0x4806[15]](function(_0x8a2cxf){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({value:_0x8a2cxf})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};function getVoiceQueues(_0x8a2cx12){return function(){switch(_0x8a2cx12[_0x4806[31]]){case _0x4806[22]:return Agent[_0x4806[29]](_0x8a2cx12[_0x4806[28]],{attributes:[_0x4806[28]]})[_0x4806[15]](Util[_0x4806[27]]())[_0x4806[15]](function(_0x8a2cx10){return _[_0x4806[26]](_0x8a2cx10[_0x4806[24]],_0x4806[25])});default:return VoiceQueue[_0x4806[30]]()[_0x4806[15]](function(_0x8a2cx13){return {rows:_0x8a2cx13}})[_0x4806[15]](function(_0x8a2cx10){return _[_0x4806[26]](_0x8a2cx10[_0x4806[24]],_0x4806[25])})}}}exports[_0x4806[32]]=function(_0x8a2cx9,_0x8a2cxa){var _0x8a2cx14={_limit:_0x8a2cx9[_0x4806[16]][_0x4806[33]]?_0x8a2cx9[_0x4806[16]][_0x4806[33]]:null,_offset:_0x8a2cx9[_0x4806[16]][_0x4806[34]]?_0x8a2cx9[_0x4806[16]][_0x4806[34]]:0,_answeredFrom:_0x8a2cx9[_0x4806[16]][_0x4806[35]]||_0x8a2cx9[_0x4806[16]][_0x4806[35]]===0?_0x8a2cx9[_0x4806[16]][_0x4806[35]]:undefined,_answeredTo:_0x8a2cx9[_0x4806[16]][_0x4806[36]]||_0x8a2cx9[_0x4806[16]][_0x4806[36]]===0?_0x8a2cx9[_0x4806[16]][_0x4806[36]]:undefined,_abandonedFrom:_0x8a2cx9[_0x4806[16]][_0x4806[37]]||_0x8a2cx9[_0x4806[16]][_0x4806[37]]===0?_0x8a2cx9[_0x4806[16]][_0x4806[37]]:undefined,_abandonedTo:_0x8a2cx9[_0x4806[16]][_0x4806[38]]||_0x8a2cx9[_0x4806[16]][_0x4806[38]]===0?_0x8a2cx9[_0x4806[16]][_0x4806[38]]:undefined,_unmanagedFrom:_0x8a2cx9[_0x4806[16]][_0x4806[39]]||_0x8a2cx9[_0x4806[16]][_0x4806[39]]===0?_0x8a2cx9[_0x4806[16]][_0x4806[39]]:undefined,_unmanagedTo:_0x8a2cx9[_0x4806[16]][_0x4806[40]]||_0x8a2cx9[_0x4806[16]][_0x4806[40]]===0?_0x8a2cx9[_0x4806[16]][_0x4806[40]]:undefined};var _0x8a2cx15,_0x8a2cx16,_0x8a2cx17,_0x8a2cx18;delete _0x8a2cx9[_0x4806[16]][_0x4806[33]];delete _0x8a2cx9[_0x4806[16]][_0x4806[34]];delete _0x8a2cx9[_0x4806[16]][_0x4806[35]];delete _0x8a2cx9[_0x4806[16]][_0x4806[36]];delete _0x8a2cx9[_0x4806[16]][_0x4806[37]];delete _0x8a2cx9[_0x4806[16]][_0x4806[38]];delete _0x8a2cx9[_0x4806[16]][_0x4806[39]];delete _0x8a2cx9[_0x4806[16]][_0x4806[40]];return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){_0x8a2cx16=_0x8a2cx10;_0x8a2cx15=_[_0x4806[26]](_0x8a2cx10,function(_0x8a2cx1c){return {name:_0x8a2cx1c}});return ReportQueue[_0x4806[30]]({where:{queuecallerleaveAt:null,queue:_0x8a2cx16},group:_0x4806[74],attributes:[[_0x4806[74],_0x4806[25]],[sequelize[_0x4806[77]](_0x4806[75],sequelize[_0x4806[76]](_0x4806[28])),_0x4806[20]]]})})[_0x4806[15]](function(_0x8a2cx2d){_0x8a2cx2d=_[_0x4806[26]](_0x8a2cx2d,_0x4806[72]);_0x8a2cx15[_0x4806[45]](function(_0x8a2cx1c,_0x8a2cx2e){var _0x8a2cx1d=_[_0x4806[43]](_0x8a2cx2d,{name:_0x8a2cx1c[_0x4806[25]]});_0x8a2cx1c[_0x4806[20]]=_0x8a2cx1d?_0x8a2cx1d[_0x4806[20]]:0});return ReportQueue[_0x4806[30]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_0x8a2cx16},group:_0x4806[74],attributes:[[_0x4806[74],_0x4806[25]],[sequelize[_0x4806[77]](_0x4806[75],sequelize[_0x4806[76]](_0x4806[28])),_0x4806[78]]]})})[_0x4806[15]](function(_0x8a2cx2c){_0x8a2cx2c=_[_0x4806[26]](_0x8a2cx2c,_0x4806[72]);_0x8a2cx15[_0x4806[45]](function(_0x8a2cx1c){var _0x8a2cx1d=_[_0x4806[43]](_0x8a2cx2c,{name:_0x8a2cx1c[_0x4806[25]]});_0x8a2cx1c[_0x4806[78]]=_0x8a2cx1d?_0x8a2cx1d[_0x4806[78]]:0});return ReportQueue[_0x4806[30]]({where:{queuecallercomplete:true,queue:_0x8a2cx16},group:_0x4806[74],attributes:[[_0x4806[74],_0x4806[25]],[sequelize[_0x4806[77]](_0x4806[75],sequelize[_0x4806[76]](_0x4806[28])),_0x4806[47]]]})})[_0x4806[15]](function(_0x8a2cx2b){_0x8a2cx2b=_[_0x4806[26]](_0x8a2cx2b,_0x4806[72]);_0x8a2cx15[_0x4806[45]](function(_0x8a2cx1c){var _0x8a2cx1d=_[_0x4806[43]](_0x8a2cx2b,{name:_0x8a2cx1c[_0x4806[25]]});_0x8a2cx1c[_0x4806[47]]=_0x8a2cx1d?_0x8a2cx1d[_0x4806[47]]:0});return ReportQueue[_0x4806[30]]({where:{queuecallerabandon:true,queue:_0x8a2cx16},group:_0x4806[74],attributes:[[_0x4806[74],_0x4806[25]],[sequelize[_0x4806[77]](_0x4806[75],sequelize[_0x4806[76]](_0x4806[28])),_0x4806[50]]]})})[_0x4806[15]](function(_0x8a2cx2a){_0x8a2cx2a=_[_0x4806[26]](_0x8a2cx2a,_0x4806[72]);_0x8a2cx15[_0x4806[45]](function(_0x8a2cx1c){var _0x8a2cx1d=_[_0x4806[43]](_0x8a2cx2a,{name:_0x8a2cx1c[_0x4806[25]]});_0x8a2cx1c[_0x4806[50]]=_0x8a2cx1d?_0x8a2cx1d[_0x4806[50]]:0});return ReportQueue[_0x4806[30]]({where:{queuecallerexit:true,queue:_0x8a2cx16},group:_0x4806[74],attributes:[[_0x4806[74],_0x4806[25]],[sequelize[_0x4806[77]](_0x4806[75],sequelize[_0x4806[76]](_0x4806[28])),_0x4806[53]]]})})[_0x4806[15]](function(_0x8a2cx29){_0x8a2cx29=_[_0x4806[26]](_0x8a2cx29,_0x4806[72]);_0x8a2cx15[_0x4806[45]](function(_0x8a2cx1c){var _0x8a2cx1d=_[_0x4806[43]](_0x8a2cx29,{name:_0x8a2cx1c[_0x4806[25]]});_0x8a2cx1c[_0x4806[53]]=_0x8a2cx1d?_0x8a2cx1d[_0x4806[53]]:0});return sequelize[_0x4806[16]](_0x4806[73]+_0x8a2cx16[_0x4806[66]](_0x4806[65])+_0x4806[67],{type:sequelize[_0x4806[69]][_0x4806[68]]})})[_0x4806[15]](function(_0x8a2cx28){_0x8a2cx15[_0x4806[45]](function(_0x8a2cx1c){var _0x8a2cx1d=_[_0x4806[43]](_0x8a2cx28,{name:_0x8a2cx1c[_0x4806[25]]});_0x8a2cx1c[_0x4806[70]]=_0x8a2cx1d?_0x8a2cx1d[_0x4806[70]]:_0x4806[63]});return sequelize[_0x4806[16]](_0x4806[71]+_0x8a2cx16[_0x4806[66]](_0x4806[65])+_0x4806[67],{type:sequelize[_0x4806[69]][_0x4806[68]]})})[_0x4806[15]](function(_0x8a2cx27){_0x8a2cx15[_0x4806[45]](function(_0x8a2cx1c){var _0x8a2cx1d=_[_0x4806[43]](_0x8a2cx27,{name:_0x8a2cx1c[_0x4806[25]]});_0x8a2cx1c[_0x4806[62]]=_0x8a2cx1d?_0x8a2cx1d[_0x4806[62]]:_0x4806[63]});return sequelize[_0x4806[16]](_0x4806[64]+_0x8a2cx16[_0x4806[66]](_0x4806[65])+_0x4806[67],{type:sequelize[_0x4806[69]][_0x4806[68]]})})[_0x4806[15]](function(_0x8a2cx1b){_0x8a2cx15[_0x4806[45]](function(_0x8a2cx1c){var _0x8a2cx1d=_[_0x4806[43]](_0x8a2cx1b,{name:_0x8a2cx1c[_0x4806[25]]});_0x8a2cx1c[_0x4806[44]]=_0x8a2cx1d?_0x8a2cx1d[_0x4806[44]]:0});var _0x8a2cx1e=_(_[_0x4806[56]](_0x8a2cx15,function(_0x8a2cx1c){var _0x8a2cx1f=_0x8a2cx14[_0x4806[46]]?(_0x8a2cx1c[_0x4806[47]]>=Number(_0x8a2cx14._answeredFrom)):true;var _0x8a2cx20=_0x8a2cx14[_0x4806[48]]?(_0x8a2cx1c[_0x4806[47]]<=Number(_0x8a2cx14._answeredTo)):true;var _0x8a2cx21=_0x8a2cx14[_0x4806[49]]?(_0x8a2cx1c[_0x4806[50]]>=Number(_0x8a2cx14._abandonedFrom)):true;var _0x8a2cx22=_0x8a2cx14[_0x4806[51]]?(_0x8a2cx1c[_0x4806[50]]>=Number(_0x8a2cx14._abandonedTo)):true;var _0x8a2cx23=_0x8a2cx14[_0x4806[52]]?(_0x8a2cx1c[_0x4806[53]]>=Number(_0x8a2cx14._unmanagedFrom)):true;var _0x8a2cx24=_0x8a2cx14[_0x4806[54]]?(_0x8a2cx1c[_0x4806[53]]<=Number(_0x8a2cx14._unmanagedTo)):true;return _[_0x4806[55]]([_0x8a2cx1f,_0x8a2cx20,_0x8a2cx21,_0x8a2cx22,_0x8a2cx23,_0x8a2cx24],function(_0x8a2cx25,_0x8a2cx26){return _0x8a2cx25&&_0x8a2cx26})}));if(_0x8a2cx14[_0x4806[57]]){_0x8a2cx1e=_0x8a2cx1e[_0x4806[60]](_0x8a2cx14._offset)[_0x4806[59]](_0x8a2cx14._limit)[_0x4806[58]]()};return [_0x8a2cx15[_0x4806[61]],_0x8a2cx1e]})[_0x4806[42]](function(_0x8a2cx19,_0x8a2cx1a){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({rows:_0x8a2cx1a,count:_0x8a2cx19})})[_0x4806[12]](function(_0x8a2cxc){console[_0x4806[41]](_0x8a2cxc);return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[79]]=function(_0x8a2cx9,_0x8a2cxa){return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){return ReportQueue[_0x4806[30]](Util[_0x4806[17]](_0x8a2cx9[_0x4806[16]],{queuecallerleaveAt:null,queue:_0x8a2cx10}))})[_0x4806[15]](function(_0x8a2cxf){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({rows:_0x8a2cxf})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[80]]=function(_0x8a2cx9,_0x8a2cxa){return Agent[_0x4806[29]](_0x8a2cx9[_0x4806[22]][_0x4806[28]])[_0x4806[15]](function(_0x8a2cx30){return _0x8a2cx30[_0x4806[82]]({attributes:[_0x4806[25]]})})[_0x4806[15]](function(_0x8a2cx13){return ReportQueue[_0x4806[81]](_0x4806[20],{method:[_0x8a2cx9[_0x4806[22]][_0x4806[31]],_[_0x4806[26]](_0x8a2cx13,_0x4806[25])]})[_0x4806[30]]()})[_0x4806[15]](function(_0x8a2cx2f){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({count:_0x8a2cx2f[_0x4806[61]],rows:_0x8a2cx2f})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[78]]=function(_0x8a2cx9,_0x8a2cxa){return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){return ReportQueue[_0x4806[21]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_0x8a2cx10}})})[_0x4806[15]](function(_0x8a2cxf){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({value:_0x8a2cxf})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[47]]=function(_0x8a2cx9,_0x8a2cxa){return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){return ReportQueue[_0x4806[21]]({where:{queuecallercomplete:true,queue:_0x8a2cx10}})})[_0x4806[15]](function(_0x8a2cxf){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({value:_0x8a2cxf})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[50]]=function(_0x8a2cx9,_0x8a2cxa){return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){return ReportQueue[_0x4806[21]]({where:{queuecallerabandon:true,queue:_0x8a2cx10}})})[_0x4806[15]](function(_0x8a2cxf){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({value:_0x8a2cxf})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[83]]=function(_0x8a2cx9,_0x8a2cxa){return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){return sequelize[_0x4806[16]](_0x4806[84]+_0x8a2cx10[_0x4806[66]](_0x4806[65])+_0x4806[85],{type:sequelize[_0x4806[69]][_0x4806[68]]})})[_0x4806[15]](function(_0x8a2cxf){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({value:_0x8a2cxf[0][_0x4806[58]]})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[86]]=function(_0x8a2cx9,_0x8a2cxa){return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){return sequelize[_0x4806[16]](_0x4806[87]+_0x8a2cx10[_0x4806[66]](_0x4806[65])+_0x4806[85],{type:sequelize[_0x4806[69]][_0x4806[68]]})})[_0x4806[15]](function(_0x8a2cxf){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({value:_0x8a2cxf[0][_0x4806[58]]})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[88]]=function(_0x8a2cx9,_0x8a2cxa){return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){return sequelize[_0x4806[16]](_0x4806[89]+_0x8a2cx10[_0x4806[66]](_0x4806[65])+_0x4806[85],{type:sequelize[_0x4806[69]][_0x4806[68]]})})[_0x4806[15]](function(_0x8a2cxf){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({value:_0x8a2cxf[0][_0x4806[58]]})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[90]]=function(_0x8a2cx9,_0x8a2cxa){return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){return sequelize[_0x4806[16]](_0x4806[91]+_0x8a2cx10[_0x4806[66]](_0x4806[65])+_0x4806[85],{type:sequelize[_0x4806[69]][_0x4806[68]]})})[_0x4806[15]](function(_0x8a2cxf){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({value:_0x8a2cxf[0][_0x4806[58]]})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[92]]=function(_0x8a2cx9,_0x8a2cxa){return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){return sequelize[_0x4806[16]](_0x4806[93]+_0x8a2cx10[_0x4806[66]](_0x4806[65])+_0x4806[85],{type:sequelize[_0x4806[69]][_0x4806[68]]})})[_0x4806[15]](function(_0x8a2cxf){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({value:_0x8a2cxf[0][_0x4806[58]]})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[53]]=function(_0x8a2cx9,_0x8a2cxa){return Promise[_0x4806[23]]([])[_0x4806[15]](getVoiceQueues(_0x8a2cx9[_0x4806[22]]))[_0x4806[15]](function(_0x8a2cx10){return ReportQueue[_0x4806[21]]({where:{queuecallerexit:true,queue:_0x8a2cx10}})})[_0x4806[15]](function(_0x8a2cxf){return _0x8a2cxa[_0x4806[14]](200)[_0x4806[13]]({value:_0x8a2cxf})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};exports[_0x4806[94]]=function(_0x8a2cx9,_0x8a2cxa){return ReportQueue[_0x4806[30]]({where:{queue:_0x8a2cx9[_0x4806[96]][_0x4806[74]]}})[_0x4806[15]](function(_0x8a2cx31){if(!_0x8a2cx31){return _0x8a2cxa[_0x4806[95]](404)};return _0x8a2cxa[_0x4806[13]]({count:_0x8a2cx31[_0x4806[61]],rows:_0x8a2cx31})})[_0x4806[12]](function(_0x8a2cxc){return handleError(_0x8a2cxa,_0x8a2cxc)})};function handleError(_0x8a2cxa,_0x8a2cxc){return _0x8a2cxa[_0x4806[14]](500)[_0x4806[13]](_0x8a2cxc)}