Built motion from commit d3a776a.|0.0.126
[motion.git] / server / api / agent / agent.controller.js
1 var _0x6c03=["\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","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x55\x73\x65\x72","\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","\x54\x65\x61\x6D","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4C\x69\x73\x74","\x69\x6E\x64\x65\x78","\x65\x72\x72\x6F\x72","\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\x41\x67\x65\x6E\x74\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x69\x64","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x61\x67\x65\x6E\x74","\x73\x63\x6F\x70\x65","\x72\x6F\x6C\x65","\x72\x65\x61\x6C\x74\x69\x6D\x65\x49\x6E\x64\x65\x78","\x6C\x6F\x67","\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","\x71\x75\x65\x75\x65\x73","\x72\x65\x61\x6C\x74\x69\x6D\x65\x56\x6F\x69\x63\x65\x49\x6E\x64\x65\x78","\x72\x6F\x77\x73","\x6E\x61\x6D\x65","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x6D\x65\x72\x67\x65","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x43\x68\x61\x74\x49\x6E\x64\x65\x78","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x4D\x61\x69\x6C\x49\x6E\x64\x65\x78","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x46\x61\x78\x49\x6E\x64\x65\x78","\x67\x65\x74\x46\x61\x78\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x53\x6D\x73\x49\x6E\x64\x65\x78","\x67\x65\x74\x53\x6D\x73\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x49\x6E\x64\x65\x78","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x70\x61\x72\x61\x6D\x73","\x73\x68\x6F\x77\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x6C\x65\x6E\x67\x74\x68","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x68\x61\x6E\x64\x6C\x65\x55\x6E\x69\x71\x75\x65\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x4D\x61\x6E\x61\x67\x65\x72","\x61\x64\x64\x55\x73\x65\x72","\x66\x69\x6E\x64\x4F\x6E\x65","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x61\x64\x64\x55\x73\x65\x72\x73","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x68\x61\x6E\x64\x6C\x65\x46\x6F\x72\x65\x69\x67\x6E\x4B\x65\x79\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x63\x68\x61\x6E\x67\x65\x50\x61\x73\x73\x77\x6F\x72\x64","\x6F\x6C\x64\x50\x61\x73\x73\x77\x6F\x72\x64","\x6E\x65\x77\x50\x61\x73\x73\x77\x6F\x72\x64","\x61\x75\x74\x68\x65\x6E\x74\x69\x63\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x72\x65\x73\x65\x74\x50\x61\x73\x73\x77\x6F\x72\x64"];_0x6c03[0];var _=require(_0x6c03[1]);var sequelize=require(_0x6c03[3])[_0x6c03[2]];var Util=require(_0x6c03[4]);var Agent=require(_0x6c03[3])[_0x6c03[5]];var VoiceQueue=require(_0x6c03[3])[_0x6c03[6]];var ChatQueue=require(_0x6c03[3])[_0x6c03[7]];var MailQueue=require(_0x6c03[3])[_0x6c03[8]];var FaxQueue=require(_0x6c03[3])[_0x6c03[9]];var SmsQueue=require(_0x6c03[3])[_0x6c03[10]];var User=require(_0x6c03[3])[_0x6c03[5]];var Team=require(_0x6c03[3])[_0x6c03[11]];var MailRoom=require(_0x6c03[3])[_0x6c03[12]];var List=require(_0x6c03[3])[_0x6c03[13]];exports[_0x6c03[14]]= function(_0x8941xe,_0x8941xf,_0x8941x10){switch(_0x8941xe[_0x6c03[23]][_0x6c03[29]]){case _0x6c03[23]:return User[_0x6c03[24]](_0x8941xe[_0x6c03[23]][_0x6c03[22]],{attributes:[_0x6c03[22]]})[_0x6c03[19]](Util[_0x6c03[21]](_0x8941xe[_0x6c03[20]]))[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[15]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)});default:return Agent[_0x6c03[28]](_0x6c03[27])[_0x6c03[26]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]]))[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})}};exports[_0x6c03[30]]= function(_0x8941xe,_0x8941xf,_0x8941x10){switch(_0x8941xe[_0x6c03[23]][_0x6c03[29]]){case _0x6c03[23]:return User[_0x6c03[24]](_0x8941xe[_0x6c03[23]][_0x6c03[22]],{attributes:[_0x6c03[22]]})[_0x6c03[19]](Util[_0x6c03[21]](_0x8941xe[_0x6c03[20]]))[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)});default:return Agent[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]},_0x6c03[36])[_0x6c03[26]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]]))[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)})}};exports[_0x6c03[37]]= function(_0x8941xe,_0x8941xf,_0x8941x10){switch(_0x8941xe[_0x6c03[23]][_0x6c03[29]]){case _0x6c03[23]:var _0x8941x13=[];return User[_0x6c03[24]](_0x8941xe[_0x6c03[23]][_0x6c03[22]],{attributes:[_0x6c03[22]]})[_0x6c03[19]](Util[_0x6c03[44]]({},{attributes:[_0x6c03[39]],include:[{raw:true,model:User,attributes:[_0x6c03[22]]}]}))[_0x6c03[19]](function(_0x8941x14){var _0x8941x15=_[_0x6c03[40]](_0x8941x14[_0x6c03[38]],_0x6c03[39]);_0x8941x14[_0x6c03[38]][_0x6c03[42]](function(_0x8941x16){_0x8941x13= _[_0x6c03[41]](_0x8941x13,_[_0x6c03[40]](_0x8941x16.Users,_0x6c03[22]))});return User[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]})[_0x6c03[26]](_[_0x6c03[43]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]],{id:{$in:_0x8941x13}}),{include:[{model:VoiceQueue,where:{name:{$in:_0x8941x15}},required:false}]}))})[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)});default:return Agent[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]},_0x6c03[36])[_0x6c03[26]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]]))[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)})}};exports[_0x6c03[45]]= function(_0x8941xe,_0x8941xf,_0x8941x10){switch(_0x8941xe[_0x6c03[23]][_0x6c03[29]]){case _0x6c03[23]:var _0x8941x13=[];return User[_0x6c03[24]](_0x8941xe[_0x6c03[23]][_0x6c03[22]],{attributes:[_0x6c03[22]]})[_0x6c03[19]](Util[_0x6c03[46]]({},{attributes:[_0x6c03[22]],include:[{raw:true,model:User,attributes:[_0x6c03[22]]}]}))[_0x6c03[19]](function(_0x8941x14){var _0x8941x17=_[_0x6c03[40]](_0x8941x14[_0x6c03[38]],_0x6c03[22]);_0x8941x14[_0x6c03[38]][_0x6c03[42]](function(_0x8941x16){_0x8941x13= _[_0x6c03[41]](_0x8941x13,_[_0x6c03[40]](_0x8941x16.Users,_0x6c03[22]))});return User[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]})[_0x6c03[26]](_[_0x6c03[43]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]],{id:{$in:_0x8941x13}}),{include:[{model:ChatQueue,where:{id:{$in:_0x8941x17}},required:false}]}))})[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)});default:return Agent[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]},_0x6c03[36])[_0x6c03[26]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]]))[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)})}};exports[_0x6c03[47]]= function(_0x8941xe,_0x8941xf,_0x8941x10){switch(_0x8941xe[_0x6c03[23]][_0x6c03[29]]){case _0x6c03[23]:var _0x8941x13=[];return User[_0x6c03[24]](_0x8941xe[_0x6c03[23]][_0x6c03[22]],{attributes:[_0x6c03[22]]})[_0x6c03[19]](Util[_0x6c03[48]]({},{attributes:[_0x6c03[22]],include:[{raw:true,model:User,attributes:[_0x6c03[22]]}]}))[_0x6c03[19]](function(_0x8941x14){var _0x8941x18=_[_0x6c03[40]](_0x8941x14[_0x6c03[38]],_0x6c03[22]);_0x8941x14[_0x6c03[38]][_0x6c03[42]](function(_0x8941x16){_0x8941x13= _[_0x6c03[41]](_0x8941x13,_[_0x6c03[40]](_0x8941x16.Users,_0x6c03[22]))});return User[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]})[_0x6c03[26]](_[_0x6c03[43]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]],{id:{$in:_0x8941x13}}),{include:[{model:MailQueue,where:{id:{$in:_0x8941x18}},required:false}]}))})[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)});default:return Agent[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]},_0x6c03[36])[_0x6c03[26]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]]))[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)})}};exports[_0x6c03[49]]= function(_0x8941xe,_0x8941xf,_0x8941x10){switch(_0x8941xe[_0x6c03[23]][_0x6c03[29]]){case _0x6c03[23]:var _0x8941x13=[];return User[_0x6c03[24]](_0x8941xe[_0x6c03[23]][_0x6c03[22]],{attributes:[_0x6c03[22]]})[_0x6c03[19]](Util[_0x6c03[50]]({},{attributes:[_0x6c03[22]],include:[{raw:true,model:User,attributes:[_0x6c03[22]]}]}))[_0x6c03[19]](function(_0x8941x14){var _0x8941x19=_[_0x6c03[40]](_0x8941x14[_0x6c03[38]],_0x6c03[22]);_0x8941x14[_0x6c03[38]][_0x6c03[42]](function(_0x8941x16){_0x8941x13= _[_0x6c03[41]](_0x8941x13,_[_0x6c03[40]](_0x8941x16.Users,_0x6c03[22]))});return User[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]})[_0x6c03[26]](_[_0x6c03[43]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]],{id:{$in:_0x8941x13}}),{include:[{model:FaxQueue,where:{id:{$in:_0x8941x19}},required:false}]}))})[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)});default:return Agent[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]},_0x6c03[36])[_0x6c03[26]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]]))[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)})}};exports[_0x6c03[51]]= function(_0x8941xe,_0x8941xf,_0x8941x10){switch(_0x8941xe[_0x6c03[23]][_0x6c03[29]]){case _0x6c03[23]:var _0x8941x13=[];return User[_0x6c03[24]](_0x8941xe[_0x6c03[23]][_0x6c03[22]],{attributes:[_0x6c03[22]]})[_0x6c03[19]](Util[_0x6c03[52]]({},{attributes:[_0x6c03[22]],include:[{raw:true,model:User,attributes:[_0x6c03[22]]}]}))[_0x6c03[19]](function(_0x8941x14){var _0x8941x1a=_[_0x6c03[40]](_0x8941x14[_0x6c03[38]],_0x6c03[22]);_0x8941x14[_0x6c03[38]][_0x6c03[42]](function(_0x8941x16){_0x8941x13= _[_0x6c03[41]](_0x8941x13,_[_0x6c03[40]](_0x8941x16.Users,_0x6c03[22]))});return User[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]})[_0x6c03[26]](_[_0x6c03[43]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]],{id:{$in:_0x8941x13}}),{include:[{model:SmsQueue,where:{id:{$in:_0x8941x1a}},required:false}]}))})[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)});default:return Agent[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]},_0x6c03[36])[_0x6c03[26]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]]))[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)})}};exports[_0x6c03[53]]= function(_0x8941xe,_0x8941xf,_0x8941x10){switch(_0x8941xe[_0x6c03[23]][_0x6c03[29]]){case _0x6c03[23]:var _0x8941x13=[];return User[_0x6c03[24]](_0x8941xe[_0x6c03[23]][_0x6c03[22]],{attributes:[_0x6c03[22]]})[_0x6c03[19]](Util[_0x6c03[54]]({},{attributes:[_0x6c03[22]],include:[{raw:true,model:User,attributes:[_0x6c03[22]]}]}))[_0x6c03[19]](function(_0x8941x14){var _0x8941x1b=_[_0x6c03[40]](_0x8941x14[_0x6c03[38]],_0x6c03[22]);_0x8941x14[_0x6c03[38]][_0x6c03[42]](function(_0x8941x16){_0x8941x13= _[_0x6c03[41]](_0x8941x13,_[_0x6c03[40]](_0x8941x16.Users,_0x6c03[22]))});return User[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]})[_0x6c03[26]](_[_0x6c03[43]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]],{id:{$in:_0x8941x13}}),{include:[{model:OpenchannelQueue,where:{id:{$in:_0x8941x1b}},required:false}]}))})[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)});default:return Agent[_0x6c03[28]](_0x6c03[27],{method:[_0x6c03[32],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[33],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[34],_0x8941xe[_0x6c03[20]]]},{method:[_0x6c03[35],_0x8941xe[_0x6c03[20]]]},_0x6c03[36])[_0x6c03[26]](Util[_0x6c03[25]](_0x8941xe[_0x6c03[20]]))[_0x6c03[19]](function(_0x8941x12){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x12)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)})}};exports[_0x6c03[55]]= function(_0x8941xe,_0x8941xf){return Agent[_0x6c03[28]](_0x6c03[27])[_0x6c03[24]](_0x8941xe[_0x6c03[57]][_0x6c03[22]])[_0x6c03[19]](function(_0x8941x1c){if(!_0x8941x1c){return _0x8941xf[_0x6c03[56]](404)};return _0x8941xf[_0x6c03[17]](_0x8941x1c)})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[58]]= function(_0x8941xe,_0x8941xf){return Agent[_0x6c03[28]](_0x6c03[27])[_0x6c03[24]](_0x8941xe[_0x6c03[57]][_0x6c03[22]])[_0x6c03[19]](function(_0x8941x1c){if(!_0x8941x1c){return _0x8941xf[_0x6c03[56]](404)};return _0x8941x1c[_0x6c03[60]]({attributes:[_0x6c03[39]]})})[_0x6c03[19]](function(_0x8941x15){return _0x8941xf[_0x6c03[17]]({count:_0x8941x15[_0x6c03[59]],rows:_0x8941x15})})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[61]]= function(_0x8941xe,_0x8941xf){return Agent[_0x6c03[28]](_0x6c03[27])[_0x6c03[24]](_0x8941xe[_0x6c03[57]][_0x6c03[22]])[_0x6c03[19]](function(_0x8941x1c){if(!_0x8941x1c){return _0x8941xf[_0x6c03[56]](404)};return _0x8941x1c[_0x6c03[62]]({attributes:[_0x6c03[22]]})})[_0x6c03[19]](function(_0x8941x17){return _0x8941xf[_0x6c03[17]]({count:_0x8941x17[_0x6c03[59]],rows:_0x8941x17})})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[63]]= function(_0x8941xe,_0x8941xf){return Agent[_0x6c03[28]](_0x6c03[27])[_0x6c03[24]](_0x8941xe[_0x6c03[57]][_0x6c03[22]])[_0x6c03[19]](function(_0x8941x1c){if(!_0x8941x1c){return _0x8941xf[_0x6c03[56]](404)};return _0x8941x1c[_0x6c03[64]]({attributes:[_0x6c03[22]]})})[_0x6c03[19]](function(_0x8941x18){return _0x8941xf[_0x6c03[17]]({count:_0x8941x18[_0x6c03[59]],rows:_0x8941x18})})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[65]]= function(_0x8941xe,_0x8941xf){return Agent[_0x6c03[28]](_0x6c03[27])[_0x6c03[24]](_0x8941xe[_0x6c03[57]][_0x6c03[22]])[_0x6c03[19]](function(_0x8941x1c){if(!_0x8941x1c){return _0x8941xf[_0x6c03[56]](404)};return _0x8941x1c[_0x6c03[66]]({attributes:[_0x6c03[22]]})})[_0x6c03[19]](function(_0x8941x19){return _0x8941xf[_0x6c03[17]]({count:_0x8941x19[_0x6c03[59]],rows:_0x8941x19})})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[67]]= function(_0x8941xe,_0x8941xf){return Agent[_0x6c03[28]](_0x6c03[27])[_0x6c03[24]](_0x8941xe[_0x6c03[57]][_0x6c03[22]])[_0x6c03[19]](function(_0x8941x1c){if(!_0x8941x1c){return _0x8941xf[_0x6c03[56]](404)};return _0x8941x1c[_0x6c03[68]]({attributes:[_0x6c03[22]]})})[_0x6c03[19]](function(_0x8941x1a){return _0x8941xf[_0x6c03[17]]({count:_0x8941x1a[_0x6c03[59]],rows:_0x8941x1a})})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[69]]= function(_0x8941xe,_0x8941xf){return Agent[_0x6c03[28]](_0x6c03[27])[_0x6c03[24]](_0x8941xe[_0x6c03[57]][_0x6c03[22]])[_0x6c03[19]](function(_0x8941x1c){if(!_0x8941x1c){return _0x8941xf[_0x6c03[56]](404)};return _0x8941x1c[_0x6c03[70]]({attributes:[_0x6c03[22]]})})[_0x6c03[19]](function(_0x8941x1d){return _0x8941xf[_0x6c03[17]]({count:_0x8941x1d[_0x6c03[59]],rows:_0x8941x1d})})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[71]]= function(_0x8941xe,_0x8941xf){var _0x8941x1e;_0x8941xe[_0x6c03[72]][_0x6c03[29]]= _0x6c03[27];return sequelize[_0x6c03[77]](function(_0x8941x1f){return Agent[_0x6c03[28]](_0x6c03[27])[_0x6c03[71]](_0x8941xe[_0x6c03[72]],{transaction:_0x8941x1f})[_0x6c03[19]](function(_0x8941x1c){_0x8941x1e= _0x8941x1c;return Team[_0x6c03[76]]({where:{defaultEntry:true}})})[_0x6c03[19]](function(_0x8941x21){return _0x8941x21[_0x6c03[75]](_0x8941x1e[_0x6c03[22]],{transaction:_0x8941x1f})})[_0x6c03[19]](function(){return List[_0x6c03[76]]({where:{defaultEntry:true}})})[_0x6c03[19]](function(_0x8941x20){return _0x8941x20[_0x6c03[75]](_0x8941x1e[_0x6c03[22]],{transaction:_0x8941x1f})})})[_0x6c03[19]](function(){return _0x8941xf[_0x6c03[18]](201)[_0x6c03[17]](_0x8941x1e)})[_0x6c03[16]](sequelize.UniqueConstraintError,function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return Util[_0x6c03[74]][_0x6c03[73]](_0x8941xf,_0x8941x11)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[78]]= function(_0x8941xe,_0x8941xf){var _0x8941x22;if(_0x8941xe[_0x6c03[72]]&& _0x8941xe[_0x6c03[72]][_0x6c03[59]]){_0x8941xe[_0x6c03[72]][_0x6c03[42]](function(_0x8941x1c){_0x8941x1c[_0x6c03[29]]= _0x6c03[27]})};return sequelize[_0x6c03[77]](function(_0x8941x1f){return Agent[_0x6c03[78]](_0x8941xe[_0x6c03[72]],{transaction:_0x8941x1f,individualHooks:true})[_0x6c03[19]](function(_0x8941x23){_0x8941x22= _0x8941x23;return Team[_0x6c03[76]]({where:{defaultEntry:true}})})[_0x6c03[19]](function(_0x8941x21){return _0x8941x21[_0x6c03[79]](_[_0x6c03[40]](_0x8941x22,_0x6c03[22]),{transaction:_0x8941x1f})})})[_0x6c03[19]](function(){return _0x8941xf[_0x6c03[56]](201)})[_0x6c03[16]](sequelize.UniqueConstraintError,function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return Util[_0x6c03[74]][_0x6c03[73]](_0x8941xf,_0x8941x11)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[80]]= function(_0x8941xe,_0x8941xf){if(_0x8941xe[_0x6c03[72]][_0x6c03[22]]){delete _0x8941xe[_0x6c03[72]][_0x6c03[22]];delete _0x8941xe[_0x6c03[72]][_0x6c03[29]]};return sequelize[_0x6c03[77]](function(_0x8941x1f){return Agent[_0x6c03[24]](_0x8941xe[_0x6c03[57]][_0x6c03[22]])[_0x6c03[19]](function(_0x8941x1c){if(!_0x8941x1c){return _0x8941xf[_0x6c03[56]](404)};var _0x8941x24=_[_0x6c03[43]](_0x8941x1c,_0x8941xe[_0x6c03[72]]);return _0x8941x24[_0x6c03[81]]({transaction:_0x8941x1f})})[_0x6c03[19]](function(_0x8941x1c){return _0x8941xf[_0x6c03[18]](200)[_0x6c03[17]](_0x8941x1c)})})[_0x6c03[16]](sequelize.UniqueConstraintError,function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return Util[_0x6c03[74]][_0x6c03[73]](_0x8941xf,_0x8941x11)})[_0x6c03[16]](function(_0x8941x11){console[_0x6c03[31]](_0x8941x11);return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[82]]= function(_0x8941xe,_0x8941xf){var _0x8941x1e;return Agent[_0x6c03[24]](_0x8941xe[_0x6c03[57]][_0x6c03[22]])[_0x6c03[19]](function(_0x8941x1c){_0x8941x1e= _0x8941x1c;if(!_0x8941x1c){return _0x8941xf[_0x6c03[56]](404)};return _0x8941x1c[_0x6c03[82]]()})[_0x6c03[19]](function(){return _0x8941xf[_0x6c03[56]](204)})[_0x6c03[16]](sequelize.ForeignKeyConstraintError,function(_0x8941x11){return Util[_0x6c03[74]][_0x6c03[83]](_0x8941xf,_0x6c03[27],_0x8941x1e[_0x6c03[39]],_0x8941x11)})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[84]]= function(_0x8941xe,_0x8941xf){return Agent[_0x6c03[82]]({where:{id:_0x8941xe[_0x6c03[20]][_0x6c03[85]]},individualHooks:true})[_0x6c03[19]](function(){return _0x8941xf[_0x6c03[56]](204)})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})};exports[_0x6c03[86]]= function(_0x8941xe,_0x8941xf,_0x8941x10){var _0x8941x25=_0x8941xe[_0x6c03[23]][_0x6c03[22]];var _0x8941x26=String(_0x8941xe[_0x6c03[72]][_0x6c03[87]]);var _0x8941x27=String(_0x8941xe[_0x6c03[72]][_0x6c03[88]]);return Agent[_0x6c03[24]](_0x8941x25)[_0x6c03[19]](function(_0x8941x28){if(_0x8941x28[_0x6c03[89]](_0x8941x26)){_0x8941x28[_0x6c03[90]]= _0x8941x27;_0x8941x28[_0x6c03[81]]()[_0x6c03[19]](function(){return _0x8941xf[_0x6c03[56]](200)})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})}else {return _0x8941xf[_0x6c03[56]](403)}})};exports[_0x6c03[91]]= function(_0x8941xe,_0x8941xf,_0x8941x10){var _0x8941x25=_0x8941xe[_0x6c03[57]][_0x6c03[22]];var _0x8941x27=String(_0x8941xe[_0x6c03[72]][_0x6c03[88]]);return Agent[_0x6c03[24]](_0x8941x25)[_0x6c03[19]](function(_0x8941x28){_0x8941x28[_0x6c03[90]]= _0x8941x27;return _0x8941x28[_0x6c03[81]]()})[_0x6c03[19]](function(){return _0x8941xf[_0x6c03[56]](200)})[_0x6c03[16]](function(_0x8941x11){return handleError(_0x8941xf,_0x8941x11)})};function handleError(_0x8941xf,_0x8941x11){return _0x8941xf[_0x6c03[18]](500)[_0x6c03[17]](_0x8941x11)}