Built motion from commit 0adc88d.|0.0.117
[motion.git] / server / api / agent / agent.controller.js
1 var _0x67ee=["\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","\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","\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"];_0x67ee[0];var _=require(_0x67ee[1]);var sequelize=require(_0x67ee[3])[_0x67ee[2]];var Util=require(_0x67ee[4]);var Agent=require(_0x67ee[3])[_0x67ee[5]];var VoiceQueue=require(_0x67ee[3])[_0x67ee[6]];var ChatQueue=require(_0x67ee[3])[_0x67ee[7]];var MailQueue=require(_0x67ee[3])[_0x67ee[8]];var FaxQueue=require(_0x67ee[3])[_0x67ee[9]];var SmsQueue=require(_0x67ee[3])[_0x67ee[10]];var User=require(_0x67ee[3])[_0x67ee[5]];var Team=require(_0x67ee[3])[_0x67ee[11]];var MailRoom=require(_0x67ee[3])[_0x67ee[12]];var List=require(_0x67ee[3])[_0x67ee[13]];exports[_0x67ee[14]]= function(_0x9866xe,_0x9866xf,_0x9866x10){switch(_0x9866xe[_0x67ee[23]][_0x67ee[29]]){case _0x67ee[23]:return User[_0x67ee[24]](_0x9866xe[_0x67ee[23]][_0x67ee[22]],{attributes:[_0x67ee[22]]})[_0x67ee[19]](Util[_0x67ee[21]](_0x9866xe[_0x67ee[20]]))[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[15]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)});default:return Agent[_0x67ee[28]](_0x67ee[27])[_0x67ee[26]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]]))[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){return handleError(_0x9866xf,_0x9866x11)})}};exports[_0x67ee[30]]= function(_0x9866xe,_0x9866xf,_0x9866x10){switch(_0x9866xe[_0x67ee[23]][_0x67ee[29]]){case _0x67ee[23]:return User[_0x67ee[24]](_0x9866xe[_0x67ee[23]][_0x67ee[22]],{attributes:[_0x67ee[22]]})[_0x67ee[19]](Util[_0x67ee[21]](_0x9866xe[_0x67ee[20]]))[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)});default:return Agent[_0x67ee[28]](_0x67ee[27],{method:[_0x67ee[32],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[33],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[34],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[35],_0x9866xe[_0x67ee[20]]]},_0x67ee[36])[_0x67ee[26]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]]))[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)})}};exports[_0x67ee[37]]= function(_0x9866xe,_0x9866xf,_0x9866x10){switch(_0x9866xe[_0x67ee[23]][_0x67ee[29]]){case _0x67ee[23]:var _0x9866x13=[];return User[_0x67ee[24]](_0x9866xe[_0x67ee[23]][_0x67ee[22]],{attributes:[_0x67ee[22]]})[_0x67ee[19]](Util[_0x67ee[44]]({},{attributes:[_0x67ee[39]],include:[{raw:true,model:User,attributes:[_0x67ee[22]]}]}))[_0x67ee[19]](function(_0x9866x14){var _0x9866x15=_[_0x67ee[40]](_0x9866x14[_0x67ee[38]],_0x67ee[39]);_0x9866x14[_0x67ee[38]][_0x67ee[42]](function(_0x9866x16){_0x9866x13= _[_0x67ee[41]](_0x9866x13,_[_0x67ee[40]](_0x9866x16.Users,_0x67ee[22]))});return User[_0x67ee[28]](_0x67ee[27],{method:[_0x67ee[32],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[33],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[34],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[35],_0x9866xe[_0x67ee[20]]]})[_0x67ee[26]](_[_0x67ee[43]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]],{id:{$in:_0x9866x13}}),{include:[{model:VoiceQueue,where:{name:{$in:_0x9866x15}},required:false}]}))})[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)});default:return Agent[_0x67ee[28]](_0x67ee[27],{method:[_0x67ee[32],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[33],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[34],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[35],_0x9866xe[_0x67ee[20]]]},_0x67ee[36])[_0x67ee[26]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]]))[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)})}};exports[_0x67ee[45]]= function(_0x9866xe,_0x9866xf,_0x9866x10){switch(_0x9866xe[_0x67ee[23]][_0x67ee[29]]){case _0x67ee[23]:var _0x9866x13=[];return User[_0x67ee[24]](_0x9866xe[_0x67ee[23]][_0x67ee[22]],{attributes:[_0x67ee[22]]})[_0x67ee[19]](Util[_0x67ee[46]]({},{attributes:[_0x67ee[22]],include:[{raw:true,model:User,attributes:[_0x67ee[22]]}]}))[_0x67ee[19]](function(_0x9866x14){var _0x9866x17=_[_0x67ee[40]](_0x9866x14[_0x67ee[38]],_0x67ee[22]);_0x9866x14[_0x67ee[38]][_0x67ee[42]](function(_0x9866x16){_0x9866x13= _[_0x67ee[41]](_0x9866x13,_[_0x67ee[40]](_0x9866x16.Users,_0x67ee[22]))});return User[_0x67ee[28]](_0x67ee[27],{method:[_0x67ee[32],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[33],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[34],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[35],_0x9866xe[_0x67ee[20]]]})[_0x67ee[26]](_[_0x67ee[43]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]],{id:{$in:_0x9866x13}}),{include:[{model:ChatQueue,where:{id:{$in:_0x9866x17}},required:false}]}))})[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)});default:return Agent[_0x67ee[28]](_0x67ee[27],{method:[_0x67ee[32],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[33],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[34],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[35],_0x9866xe[_0x67ee[20]]]},_0x67ee[36])[_0x67ee[26]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]]))[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)})}};exports[_0x67ee[47]]= function(_0x9866xe,_0x9866xf,_0x9866x10){switch(_0x9866xe[_0x67ee[23]][_0x67ee[29]]){case _0x67ee[23]:var _0x9866x13=[];return User[_0x67ee[24]](_0x9866xe[_0x67ee[23]][_0x67ee[22]],{attributes:[_0x67ee[22]]})[_0x67ee[19]](Util[_0x67ee[48]]({},{attributes:[_0x67ee[22]],include:[{raw:true,model:User,attributes:[_0x67ee[22]]}]}))[_0x67ee[19]](function(_0x9866x14){var _0x9866x18=_[_0x67ee[40]](_0x9866x14[_0x67ee[38]],_0x67ee[22]);_0x9866x14[_0x67ee[38]][_0x67ee[42]](function(_0x9866x16){_0x9866x13= _[_0x67ee[41]](_0x9866x13,_[_0x67ee[40]](_0x9866x16.Users,_0x67ee[22]))});return User[_0x67ee[28]](_0x67ee[27],{method:[_0x67ee[32],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[33],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[34],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[35],_0x9866xe[_0x67ee[20]]]})[_0x67ee[26]](_[_0x67ee[43]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]],{id:{$in:_0x9866x13}}),{include:[{model:MailQueue,where:{id:{$in:_0x9866x18}},required:false}]}))})[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)});default:return Agent[_0x67ee[28]](_0x67ee[27],{method:[_0x67ee[32],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[33],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[34],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[35],_0x9866xe[_0x67ee[20]]]},_0x67ee[36])[_0x67ee[26]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]]))[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)})}};exports[_0x67ee[49]]= function(_0x9866xe,_0x9866xf,_0x9866x10){switch(_0x9866xe[_0x67ee[23]][_0x67ee[29]]){case _0x67ee[23]:var _0x9866x13=[];return User[_0x67ee[24]](_0x9866xe[_0x67ee[23]][_0x67ee[22]],{attributes:[_0x67ee[22]]})[_0x67ee[19]](Util[_0x67ee[50]]({},{attributes:[_0x67ee[22]],include:[{raw:true,model:User,attributes:[_0x67ee[22]]}]}))[_0x67ee[19]](function(_0x9866x14){var _0x9866x19=_[_0x67ee[40]](_0x9866x14[_0x67ee[38]],_0x67ee[22]);_0x9866x14[_0x67ee[38]][_0x67ee[42]](function(_0x9866x16){_0x9866x13= _[_0x67ee[41]](_0x9866x13,_[_0x67ee[40]](_0x9866x16.Users,_0x67ee[22]))});return User[_0x67ee[28]](_0x67ee[27],{method:[_0x67ee[32],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[33],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[34],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[35],_0x9866xe[_0x67ee[20]]]})[_0x67ee[26]](_[_0x67ee[43]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]],{id:{$in:_0x9866x13}}),{include:[{model:FaxQueue,where:{id:{$in:_0x9866x19}},required:false}]}))})[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)});default:return Agent[_0x67ee[28]](_0x67ee[27],{method:[_0x67ee[32],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[33],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[34],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[35],_0x9866xe[_0x67ee[20]]]},_0x67ee[36])[_0x67ee[26]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]]))[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)})}};exports[_0x67ee[51]]= function(_0x9866xe,_0x9866xf,_0x9866x10){switch(_0x9866xe[_0x67ee[23]][_0x67ee[29]]){case _0x67ee[23]:var _0x9866x13=[];return User[_0x67ee[24]](_0x9866xe[_0x67ee[23]][_0x67ee[22]],{attributes:[_0x67ee[22]]})[_0x67ee[19]](Util[_0x67ee[52]]({},{attributes:[_0x67ee[22]],include:[{raw:true,model:User,attributes:[_0x67ee[22]]}]}))[_0x67ee[19]](function(_0x9866x14){var _0x9866x1a=_[_0x67ee[40]](_0x9866x14[_0x67ee[38]],_0x67ee[22]);_0x9866x14[_0x67ee[38]][_0x67ee[42]](function(_0x9866x16){_0x9866x13= _[_0x67ee[41]](_0x9866x13,_[_0x67ee[40]](_0x9866x16.Users,_0x67ee[22]))});return User[_0x67ee[28]](_0x67ee[27],{method:[_0x67ee[32],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[33],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[34],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[35],_0x9866xe[_0x67ee[20]]]})[_0x67ee[26]](_[_0x67ee[43]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]],{id:{$in:_0x9866x13}}),{include:[{model:SmsQueue,where:{id:{$in:_0x9866x1a}},required:false}]}))})[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)});default:return Agent[_0x67ee[28]](_0x67ee[27],{method:[_0x67ee[32],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[33],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[34],_0x9866xe[_0x67ee[20]]]},{method:[_0x67ee[35],_0x9866xe[_0x67ee[20]]]},_0x67ee[36])[_0x67ee[26]](Util[_0x67ee[25]](_0x9866xe[_0x67ee[20]]))[_0x67ee[19]](function(_0x9866x12){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x12)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)})}};exports[_0x67ee[53]]= function(_0x9866xe,_0x9866xf){return Agent[_0x67ee[28]](_0x67ee[27])[_0x67ee[24]](_0x9866xe[_0x67ee[55]][_0x67ee[22]])[_0x67ee[19]](function(_0x9866x1b){if(!_0x9866x1b){return _0x9866xf[_0x67ee[54]](404)};return _0x9866xf[_0x67ee[17]](_0x9866x1b)})[_0x67ee[16]](function(_0x9866x11){return handleError(_0x9866xf,_0x9866x11)})};exports[_0x67ee[56]]= function(_0x9866xe,_0x9866xf){return Agent[_0x67ee[28]](_0x67ee[27])[_0x67ee[24]](_0x9866xe[_0x67ee[55]][_0x67ee[22]])[_0x67ee[19]](function(_0x9866x1b){if(!_0x9866x1b){return _0x9866xf[_0x67ee[54]](404)};return _0x9866x1b[_0x67ee[58]]({attributes:[_0x67ee[39]]})})[_0x67ee[19]](function(_0x9866x15){return _0x9866xf[_0x67ee[17]]({count:_0x9866x15[_0x67ee[57]],rows:_0x9866x15})})[_0x67ee[16]](function(_0x9866x11){return handleError(_0x9866xf,_0x9866x11)})};exports[_0x67ee[59]]= function(_0x9866xe,_0x9866xf){return Agent[_0x67ee[28]](_0x67ee[27])[_0x67ee[24]](_0x9866xe[_0x67ee[55]][_0x67ee[22]])[_0x67ee[19]](function(_0x9866x1b){if(!_0x9866x1b){return _0x9866xf[_0x67ee[54]](404)};return _0x9866x1b[_0x67ee[60]]({attributes:[_0x67ee[22]]})})[_0x67ee[19]](function(_0x9866x17){return _0x9866xf[_0x67ee[17]]({count:_0x9866x17[_0x67ee[57]],rows:_0x9866x17})})[_0x67ee[16]](function(_0x9866x11){return handleError(_0x9866xf,_0x9866x11)})};exports[_0x67ee[61]]= function(_0x9866xe,_0x9866xf){return Agent[_0x67ee[28]](_0x67ee[27])[_0x67ee[24]](_0x9866xe[_0x67ee[55]][_0x67ee[22]])[_0x67ee[19]](function(_0x9866x1b){if(!_0x9866x1b){return _0x9866xf[_0x67ee[54]](404)};return _0x9866x1b[_0x67ee[62]]({attributes:[_0x67ee[22]]})})[_0x67ee[19]](function(_0x9866x18){return _0x9866xf[_0x67ee[17]]({count:_0x9866x18[_0x67ee[57]],rows:_0x9866x18})})[_0x67ee[16]](function(_0x9866x11){return handleError(_0x9866xf,_0x9866x11)})};exports[_0x67ee[63]]= function(_0x9866xe,_0x9866xf){return Agent[_0x67ee[28]](_0x67ee[27])[_0x67ee[24]](_0x9866xe[_0x67ee[55]][_0x67ee[22]])[_0x67ee[19]](function(_0x9866x1b){if(!_0x9866x1b){return _0x9866xf[_0x67ee[54]](404)};return _0x9866x1b[_0x67ee[64]]({attributes:[_0x67ee[22]]})})[_0x67ee[19]](function(_0x9866x19){return _0x9866xf[_0x67ee[17]]({count:_0x9866x19[_0x67ee[57]],rows:_0x9866x19})})[_0x67ee[16]](function(_0x9866x11){return handleError(_0x9866xf,_0x9866x11)})};exports[_0x67ee[65]]= function(_0x9866xe,_0x9866xf){return Agent[_0x67ee[28]](_0x67ee[27])[_0x67ee[24]](_0x9866xe[_0x67ee[55]][_0x67ee[22]])[_0x67ee[19]](function(_0x9866x1b){if(!_0x9866x1b){return _0x9866xf[_0x67ee[54]](404)};return _0x9866x1b[_0x67ee[66]]({attributes:[_0x67ee[22]]})})[_0x67ee[19]](function(_0x9866x1a){return _0x9866xf[_0x67ee[17]]({count:_0x9866x1a[_0x67ee[57]],rows:_0x9866x1a})})[_0x67ee[16]](function(_0x9866x11){return handleError(_0x9866xf,_0x9866x11)})};exports[_0x67ee[67]]= function(_0x9866xe,_0x9866xf){var _0x9866x1c;_0x9866xe[_0x67ee[68]][_0x67ee[29]]= _0x67ee[27];return sequelize[_0x67ee[73]](function(_0x9866x1d){return Agent[_0x67ee[28]](_0x67ee[27])[_0x67ee[67]](_0x9866xe[_0x67ee[68]],{transaction:_0x9866x1d})[_0x67ee[19]](function(_0x9866x1b){_0x9866x1c= _0x9866x1b;return Team[_0x67ee[72]]({where:{defaultEntry:true}})})[_0x67ee[19]](function(_0x9866x1f){return _0x9866x1f[_0x67ee[71]](_0x9866x1c[_0x67ee[22]],{transaction:_0x9866x1d})})[_0x67ee[19]](function(){return List[_0x67ee[72]]({where:{defaultEntry:true}})})[_0x67ee[19]](function(_0x9866x1e){return _0x9866x1e[_0x67ee[71]](_0x9866x1c[_0x67ee[22]],{transaction:_0x9866x1d})})})[_0x67ee[19]](function(){return _0x9866xf[_0x67ee[18]](201)[_0x67ee[17]](_0x9866x1c)})[_0x67ee[16]](sequelize.UniqueConstraintError,function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return Util[_0x67ee[70]][_0x67ee[69]](_0x9866xf,_0x9866x11)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)})};exports[_0x67ee[74]]= function(_0x9866xe,_0x9866xf){var _0x9866x20;if(_0x9866xe[_0x67ee[68]]&& _0x9866xe[_0x67ee[68]][_0x67ee[57]]){_0x9866xe[_0x67ee[68]][_0x67ee[42]](function(_0x9866x1b){_0x9866x1b[_0x67ee[29]]= _0x67ee[27]})};return sequelize[_0x67ee[73]](function(_0x9866x1d){return Agent[_0x67ee[74]](_0x9866xe[_0x67ee[68]],{transaction:_0x9866x1d,individualHooks:true})[_0x67ee[19]](function(_0x9866x21){_0x9866x20= _0x9866x21;return Team[_0x67ee[72]]({where:{defaultEntry:true}})})[_0x67ee[19]](function(_0x9866x1f){return _0x9866x1f[_0x67ee[75]](_[_0x67ee[40]](_0x9866x20,_0x67ee[22]),{transaction:_0x9866x1d})})})[_0x67ee[19]](function(){return _0x9866xf[_0x67ee[54]](201)})[_0x67ee[16]](sequelize.UniqueConstraintError,function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return Util[_0x67ee[70]][_0x67ee[69]](_0x9866xf,_0x9866x11)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)})};exports[_0x67ee[76]]= function(_0x9866xe,_0x9866xf){if(_0x9866xe[_0x67ee[68]][_0x67ee[22]]){delete _0x9866xe[_0x67ee[68]][_0x67ee[22]];delete _0x9866xe[_0x67ee[68]][_0x67ee[29]]};return sequelize[_0x67ee[73]](function(_0x9866x1d){return Agent[_0x67ee[24]](_0x9866xe[_0x67ee[55]][_0x67ee[22]])[_0x67ee[19]](function(_0x9866x1b){if(!_0x9866x1b){return _0x9866xf[_0x67ee[54]](404)};var _0x9866x22=_[_0x67ee[43]](_0x9866x1b,_0x9866xe[_0x67ee[68]]);return _0x9866x22[_0x67ee[77]]({transaction:_0x9866x1d})})[_0x67ee[19]](function(_0x9866x1b){return _0x9866xf[_0x67ee[18]](200)[_0x67ee[17]](_0x9866x1b)})})[_0x67ee[16]](sequelize.UniqueConstraintError,function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return Util[_0x67ee[70]][_0x67ee[69]](_0x9866xf,_0x9866x11)})[_0x67ee[16]](function(_0x9866x11){console[_0x67ee[31]](_0x9866x11);return handleError(_0x9866xf,_0x9866x11)})};exports[_0x67ee[78]]= function(_0x9866xe,_0x9866xf){var _0x9866x1c;return Agent[_0x67ee[24]](_0x9866xe[_0x67ee[55]][_0x67ee[22]])[_0x67ee[19]](function(_0x9866x1b){_0x9866x1c= _0x9866x1b;if(!_0x9866x1b){return _0x9866xf[_0x67ee[54]](404)};return _0x9866x1b[_0x67ee[78]]()})[_0x67ee[19]](function(){return _0x9866xf[_0x67ee[54]](204)})[_0x67ee[16]](sequelize.ForeignKeyConstraintError,function(_0x9866x11){return Util[_0x67ee[70]][_0x67ee[79]](_0x9866xf,_0x67ee[27],_0x9866x1c[_0x67ee[39]],_0x9866x11)})[_0x67ee[16]](function(_0x9866x11){return handleError(_0x9866xf,_0x9866x11)})};exports[_0x67ee[80]]= function(_0x9866xe,_0x9866xf){return Agent[_0x67ee[78]]({where:{id:_0x9866xe[_0x67ee[20]][_0x67ee[81]]},individualHooks:true})[_0x67ee[19]](function(){return _0x9866xf[_0x67ee[54]](204)})[_0x67ee[16]](function(_0x9866x11){return handleError(_0x9866xf,_0x9866x11)})};exports[_0x67ee[82]]= function(_0x9866xe,_0x9866xf,_0x9866x10){var _0x9866x23=_0x9866xe[_0x67ee[23]][_0x67ee[22]];var _0x9866x24=String(_0x9866xe[_0x67ee[68]][_0x67ee[83]]);var _0x9866x25=String(_0x9866xe[_0x67ee[68]][_0x67ee[84]]);return Agent[_0x67ee[24]](_0x9866x23)[_0x67ee[19]](function(_0x9866x26){if(_0x9866x26[_0x67ee[85]](_0x9866x24)){_0x9866x26[_0x67ee[86]]= _0x9866x25;_0x9866x26[_0x67ee[77]]()[_0x67ee[19]](function(){return _0x9866xf[_0x67ee[54]](200)})[_0x67ee[16]](function(_0x9866x11){return handleError(_0x9866xf,_0x9866x11)})}else {return _0x9866xf[_0x67ee[54]](403)}})};exports[_0x67ee[87]]= function(_0x9866xe,_0x9866xf,_0x9866x10){var _0x9866x23=_0x9866xe[_0x67ee[55]][_0x67ee[22]];var _0x9866x25=String(_0x9866xe[_0x67ee[68]][_0x67ee[84]]);return Agent[_0x67ee[24]](_0x9866x23)[_0x67ee[19]](function(_0x9866x26){_0x9866x26[_0x67ee[86]]= _0x9866x25;return _0x9866x26[_0x67ee[77]]()})[_0x67ee[19]](function(){return _0x9866xf[_0x67ee[54]](200)})[_0x67ee[16]](function(_0x9866x11){return handleError(_0x9866xf,_0x9866x11)})};function handleError(_0x9866xf,_0x9866x11){return _0x9866xf[_0x67ee[18]](500)[_0x67ee[17]](_0x9866x11)}