Built motion from commit 943eae279.|1.0.24
[motion.git] / server / api / agent / agent.controller.js
index b3b0e5f..2a545c0 100644 (file)
@@ -1 +1 @@
-var _0x32e8=["\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","\x62\x6C\x75\x65\x62\x69\x72\x64","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x74\x6F\x6F\x6C\x73\x2F\x75\x73\x65\x72","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\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","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x53\x65\x74\x74\x69\x6E\x67","\x55\x73\x65\x72","\x54\x65\x61\x6D","\x4C\x69\x73\x74","\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\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","\x61\x64\x64\x51\x75\x65\x75\x65\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x76\x61\x6C\x75\x65\x73","\x62\x6F\x64\x79","\x53\x49\x50\x2F\x25\x73","\x6E\x61\x6D\x65","\x66\x6F\x72\x6D\x61\x74","\x70\x65\x6E\x61\x6C\x74\x79","\x61\x64\x64\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x76\x6F\x69\x63\x65","\x61\x64\x64\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x61\x6C\x6C","\x66\x69\x6E\x64\x41\x6C\x6C","\x63\x68\x61\x74","\x61\x64\x64\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x6D\x61\x69\x6C","\x61\x64\x64\x46\x61\x78\x51\x75\x65\x75\x65","\x66\x61\x78","\x61\x64\x64\x53\x6D\x73\x51\x75\x65\x75\x65","\x73\x6D\x73","\x61\x64\x64\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x63\x68\x61\x6E\x6E\x65\x6C","\x70\x61\x72\x61\x6D\x73","\x72\x65\x6D\x6F\x76\x65\x51\x75\x65\x75\x65\x73","\x69\x64\x73","\x72\x65\x6D\x6F\x76\x65\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x72\x65\x61\x6C\x74\x69\x6D\x65\x49\x6E\x64\x65\x78","\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","\x72\x65\x61\x6C\x74\x69\x6D\x65\x56\x6F\x69\x63\x65\x49\x6E\x64\x65\x78","\x72\x6F\x77\x73","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\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","\x71\x75\x65\x75\x65\x73","\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\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","\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","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x73\x65\x63\x75\x72\x65\x50\x61\x73\x73\x77\x6F\x72\x64","\x74\x65\x73\x74","\x57\x72\x6F\x6E\x67\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x66\x6F\x72\x6D\x61\x74\x21","\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","\x49\x6E\x76\x61\x6C\x69\x64\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x70\x61\x74\x74\x65\x72\x6E","\x73\x74\x61\x72\x74\x49\x6E\x64\x65\x78","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x69\x73\x4E\x75\x6D\x62\x65\x72","\x6D\x69\x6E\x49\x6E\x74\x65\x72\x6E\x61\x6C","\x61\x6D\x6F\x75\x6E\x74","\x63\x6C\x6F\x6E\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x40","\x73\x70\x6C\x69\x74","\x4E\x6F\x20\x61\x67\x65\x6E\x74\x73\x20\x61\x6D\x6F\x75\x6E\x74\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x21","\x75\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x55\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","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0x32e8[0];var _=require(_0x32e8[1]);var sequelize=require(_0x32e8[3])[_0x32e8[2]];var BPromise=require(_0x32e8[4]);var util=require(_0x32e8[5]);var Util=require(_0x32e8[6]);var userTools=require(_0x32e8[7]);var logger=require(_0x32e8[9])(_0x32e8[8]);var OpenchannelQueue=require(_0x32e8[3])[_0x32e8[10]];var VoiceQueue=require(_0x32e8[3])[_0x32e8[11]];var ChatQueue=require(_0x32e8[3])[_0x32e8[12]];var MailQueue=require(_0x32e8[3])[_0x32e8[13]];var FaxQueue=require(_0x32e8[3])[_0x32e8[14]];var SmsQueue=require(_0x32e8[3])[_0x32e8[15]];var MailRoom=require(_0x32e8[3])[_0x32e8[16]];var Setting=require(_0x32e8[3])[_0x32e8[17]];var Agent=require(_0x32e8[3])[_0x32e8[18]];var User=require(_0x32e8[3])[_0x32e8[18]];var Team=require(_0x32e8[3])[_0x32e8[19]];var List=require(_0x32e8[3])[_0x32e8[20]];exports[_0x32e8[21]]= function(_0x1158x14,_0x1158x15,_0x1158x16){switch(_0x1158x14[_0x32e8[29]][_0x32e8[35]]){case _0x32e8[29]:return User[_0x32e8[30]](_0x1158x14[_0x32e8[29]][_0x32e8[28]],{attributes:[_0x32e8[28]]})[_0x32e8[25]](Util[_0x32e8[27]](_0x1158x14[_0x32e8[26]]))[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)});default:return Agent[_0x32e8[34]](_0x32e8[33])[_0x32e8[32]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]]))[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})}};exports[_0x32e8[36]]= function(_0x1158x14,_0x1158x15,_0x1158x16){return Agent[_0x32e8[30]](_0x1158x14[_0x32e8[61]][_0x32e8[28]],{attributes:[_0x32e8[28],_0x32e8[41]]})[_0x32e8[25]](function(_0x1158x1a){if(!_0x1158x1a){return _0x1158x15[_0x32e8[37]](401)};switch(_0x1158x14[_0x32e8[61]][_0x32e8[60]]){case _0x32e8[45]:return _0x1158x1a[_0x32e8[44]](_0x1158x14[_0x32e8[39]][_0x32e8[38]],{interface:util[_0x32e8[42]](_0x32e8[40],_0x1158x1a[_0x32e8[41]]),stateinterface:util[_0x32e8[42]](_0x32e8[40],_0x1158x1a[_0x32e8[41]]),membername:_0x1158x1a[_0x32e8[41]],UserId:_0x1158x1a[_0x32e8[28]],penalty:_0x1158x14[_0x32e8[39]][_0x32e8[43]]});case _0x32e8[51]:return ChatQueue[_0x32e8[50]]({where:{id:_0x1158x14[_0x32e8[39]][_0x32e8[38]]},attributes:[_0x32e8[28],_0x32e8[41]],raw:true})[_0x32e8[25]](function(_0x1158x19){if(_0x1158x19){var _0x1158x1b=[];_[_0x32e8[48]](_0x1158x19,function(_0x1158x1c){_0x1158x1b[_0x32e8[47]](_0x1158x1a[_0x32e8[46]](_0x1158x1c[_0x32e8[28]],{queue:_0x1158x1c[_0x32e8[41]],penalty:_0x1158x14[_0x32e8[39]][_0x32e8[43]]}))});return BPromise[_0x32e8[49]](_0x1158x1b)}});case _0x32e8[53]:return MailQueue[_0x32e8[50]]({where:{id:_0x1158x14[_0x32e8[39]][_0x32e8[38]]},attributes:[_0x32e8[28],_0x32e8[41]],raw:true})[_0x32e8[25]](function(_0x1158x19){if(_0x1158x19){var _0x1158x1b=[];_[_0x32e8[48]](_0x1158x19,function(_0x1158x1c){_0x1158x1b[_0x32e8[47]](_0x1158x1a[_0x32e8[52]](_0x1158x1c[_0x32e8[28]],{queue:_0x1158x1c[_0x32e8[41]],penalty:_0x1158x14[_0x32e8[39]][_0x32e8[43]]}))});return BPromise[_0x32e8[49]](_0x1158x1b)}});case _0x32e8[55]:return FaxQueue[_0x32e8[50]]({where:{id:_0x1158x14[_0x32e8[39]][_0x32e8[38]]},attributes:[_0x32e8[28],_0x32e8[41]],raw:true})[_0x32e8[25]](function(_0x1158x19){if(_0x1158x19){var _0x1158x1b=[];_[_0x32e8[48]](_0x1158x19,function(_0x1158x1c){_0x1158x1b[_0x32e8[47]](_0x1158x1a[_0x32e8[54]](_0x1158x1c[_0x32e8[28]],{queue:_0x1158x1c[_0x32e8[41]],penalty:_0x1158x14[_0x32e8[39]][_0x32e8[43]]}))});return BPromise[_0x32e8[49]](_0x1158x1b)}});case _0x32e8[57]:return SmsQueue[_0x32e8[50]]({where:{id:_0x1158x14[_0x32e8[39]][_0x32e8[38]]},attributes:[_0x32e8[28],_0x32e8[41]],raw:true})[_0x32e8[25]](function(_0x1158x19){if(_0x1158x19){var _0x1158x1b=[];_[_0x32e8[48]](_0x1158x19,function(_0x1158x1c){_0x1158x1b[_0x32e8[47]](_0x1158x1a[_0x32e8[56]](_0x1158x1c[_0x32e8[28]],{queue:_0x1158x1c[_0x32e8[41]],penalty:_0x1158x14[_0x32e8[39]][_0x32e8[43]]}))});return BPromise[_0x32e8[49]](_0x1158x1b)}});case _0x32e8[59]:return OpenchannelQueue[_0x32e8[50]]({where:{id:_0x1158x14[_0x32e8[39]][_0x32e8[38]]},attributes:[_0x32e8[28],_0x32e8[41]],raw:true})[_0x32e8[25]](function(_0x1158x19){if(_0x1158x19){var _0x1158x1b=[];_[_0x32e8[48]](_0x1158x19,function(_0x1158x1c){_0x1158x1b[_0x32e8[47]](_0x1158x1a[_0x32e8[58]](_0x1158x1c[_0x32e8[28]],{queue:_0x1158x1c[_0x32e8[41]],penalty:_0x1158x14[_0x32e8[39]][_0x32e8[43]]}))});return BPromise[_0x32e8[49]](_0x1158x1b)}});default:return null}})[_0x32e8[25]](function(_0x1158x19){return _0x1158x15[_0x32e8[37]](_0x1158x19?200:401)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[62]]= function(_0x1158x14,_0x1158x15,_0x1158x16){return Agent[_0x32e8[30]](_0x1158x14[_0x32e8[61]][_0x32e8[28]],{attributes:[_0x32e8[28]]})[_0x32e8[25]](function(_0x1158x1a){if(!_0x1158x1a){return _0x1158x15[_0x32e8[37]](401)};switch(_0x1158x14[_0x32e8[61]][_0x32e8[60]]){case _0x32e8[45]:return _0x1158x1a[_0x32e8[64]](_0x1158x14[_0x32e8[26]][_0x32e8[63]]);case _0x32e8[51]:return _0x1158x1a[_0x32e8[65]](_0x1158x14[_0x32e8[26]][_0x32e8[63]]);case _0x32e8[53]:return _0x1158x1a[_0x32e8[66]](_0x1158x14[_0x32e8[26]][_0x32e8[63]]);case _0x32e8[57]:return _0x1158x1a[_0x32e8[67]](_0x1158x14[_0x32e8[26]][_0x32e8[63]]);case _0x32e8[55]:return _0x1158x1a[_0x32e8[68]](_0x1158x14[_0x32e8[26]][_0x32e8[63]]);case _0x32e8[59]:return _0x1158x1a[_0x32e8[69]](_0x1158x14[_0x32e8[26]][_0x32e8[63]]);default:return null}})[_0x32e8[25]](function(_0x1158x19){return _0x1158x15[_0x32e8[37]](_0x1158x19?200:401)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[70]]= function(_0x1158x14,_0x1158x15,_0x1158x16){switch(_0x1158x14[_0x32e8[29]][_0x32e8[35]]){case _0x32e8[29]:return User[_0x32e8[30]](_0x1158x14[_0x32e8[29]][_0x32e8[28]],{attributes:[_0x32e8[28]]})[_0x32e8[25]](Util[_0x32e8[27]](_0x1158x14[_0x32e8[26]]))[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)});default:return Agent[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]})[_0x32e8[32]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]]))[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})}};exports[_0x32e8[75]]= function(_0x1158x14,_0x1158x15,_0x1158x16){switch(_0x1158x14[_0x32e8[29]][_0x32e8[35]]){case _0x32e8[29]:var _0x1158x1d=[];return User[_0x32e8[30]](_0x1158x14[_0x32e8[29]][_0x32e8[28]],{attributes:[_0x32e8[28]]})[_0x32e8[25]](Util[_0x32e8[80]]({},{attributes:[_0x32e8[41]],include:[{raw:true,model:User,attributes:[_0x32e8[28]]}]}))[_0x32e8[25]](function(_0x1158x19){var _0x1158x1e=_[_0x32e8[77]](_0x1158x19[_0x32e8[76]],_0x32e8[41]);_0x1158x19[_0x32e8[76]][_0x32e8[48]](function(_0x1158x1c){_0x1158x1d= _[_0x32e8[78]](_0x1158x1d,_[_0x32e8[77]](_0x1158x1c.Users,_0x32e8[28]))});return User[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]})[_0x32e8[32]](_[_0x32e8[79]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]],{id:{$in:_0x1158x1d}}),{include:[{model:VoiceQueue,where:{name:{$in:_0x1158x1e}},required:false}]}))})[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)});default:return Agent[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]})[_0x32e8[32]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]]))[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})}};exports[_0x32e8[81]]= function(_0x1158x14,_0x1158x15,_0x1158x16){switch(_0x1158x14[_0x32e8[29]][_0x32e8[35]]){case _0x32e8[29]:var _0x1158x1d=[];return User[_0x32e8[30]](_0x1158x14[_0x32e8[29]][_0x32e8[28]],{attributes:[_0x32e8[28]]})[_0x32e8[25]](Util[_0x32e8[82]]({},{attributes:[_0x32e8[28]],include:[{raw:true,model:User,attributes:[_0x32e8[28]]}]}))[_0x32e8[25]](function(_0x1158x19){var _0x1158x1f=_[_0x32e8[77]](_0x1158x19[_0x32e8[76]],_0x32e8[28]);_0x1158x19[_0x32e8[76]][_0x32e8[48]](function(_0x1158x1c){_0x1158x1d= _[_0x32e8[78]](_0x1158x1d,_[_0x32e8[77]](_0x1158x1c.Users,_0x32e8[28]))});return User[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]})[_0x32e8[32]](_[_0x32e8[79]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]],{id:{$in:_0x1158x1d}}),{include:[{model:ChatQueue,where:{id:{$in:_0x1158x1f}},required:false}]}))})[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)});default:return Agent[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]},_0x32e8[83])[_0x32e8[32]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]]))[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})}};exports[_0x32e8[84]]= function(_0x1158x14,_0x1158x15,_0x1158x16){switch(_0x1158x14[_0x32e8[29]][_0x32e8[35]]){case _0x32e8[29]:var _0x1158x1d=[];return User[_0x32e8[30]](_0x1158x14[_0x32e8[29]][_0x32e8[28]],{attributes:[_0x32e8[28]]})[_0x32e8[25]](Util[_0x32e8[85]]({},{attributes:[_0x32e8[28]],include:[{raw:true,model:User,attributes:[_0x32e8[28]]}]}))[_0x32e8[25]](function(_0x1158x19){var _0x1158x20=_[_0x32e8[77]](_0x1158x19[_0x32e8[76]],_0x32e8[28]);_0x1158x19[_0x32e8[76]][_0x32e8[48]](function(_0x1158x1c){_0x1158x1d= _[_0x32e8[78]](_0x1158x1d,_[_0x32e8[77]](_0x1158x1c.Users,_0x32e8[28]))});return User[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]})[_0x32e8[32]](_[_0x32e8[79]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]],{id:{$in:_0x1158x1d}}),{include:[{model:MailQueue,where:{id:{$in:_0x1158x20}},required:false}]}))})[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)});default:return Agent[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]},_0x32e8[83])[_0x32e8[32]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]]))[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})}};exports[_0x32e8[86]]= function(_0x1158x14,_0x1158x15,_0x1158x16){switch(_0x1158x14[_0x32e8[29]][_0x32e8[35]]){case _0x32e8[29]:var _0x1158x1d=[];return User[_0x32e8[30]](_0x1158x14[_0x32e8[29]][_0x32e8[28]],{attributes:[_0x32e8[28]]})[_0x32e8[25]](Util[_0x32e8[87]]({},{attributes:[_0x32e8[28]],include:[{raw:true,model:User,attributes:[_0x32e8[28]]}]}))[_0x32e8[25]](function(_0x1158x19){var _0x1158x21=_[_0x32e8[77]](_0x1158x19[_0x32e8[76]],_0x32e8[28]);_0x1158x19[_0x32e8[76]][_0x32e8[48]](function(_0x1158x1c){_0x1158x1d= _[_0x32e8[78]](_0x1158x1d,_[_0x32e8[77]](_0x1158x1c.Users,_0x32e8[28]))});return User[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]})[_0x32e8[32]](_[_0x32e8[79]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]],{id:{$in:_0x1158x1d}}),{include:[{model:FaxQueue,where:{id:{$in:_0x1158x21}},required:false}]}))})[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)});default:return Agent[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]},_0x32e8[83])[_0x32e8[32]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]]))[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})}};exports[_0x32e8[88]]= function(_0x1158x14,_0x1158x15,_0x1158x16){switch(_0x1158x14[_0x32e8[29]][_0x32e8[35]]){case _0x32e8[29]:var _0x1158x1d=[];return User[_0x32e8[30]](_0x1158x14[_0x32e8[29]][_0x32e8[28]],{attributes:[_0x32e8[28]]})[_0x32e8[25]](Util[_0x32e8[89]]({},{attributes:[_0x32e8[28]],include:[{raw:true,model:User,attributes:[_0x32e8[28]]}]}))[_0x32e8[25]](function(_0x1158x19){var _0x1158x22=_[_0x32e8[77]](_0x1158x19[_0x32e8[76]],_0x32e8[28]);_0x1158x19[_0x32e8[76]][_0x32e8[48]](function(_0x1158x1c){_0x1158x1d= _[_0x32e8[78]](_0x1158x1d,_[_0x32e8[77]](_0x1158x1c.Users,_0x32e8[28]))});return User[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]})[_0x32e8[32]](_[_0x32e8[79]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]],{id:{$in:_0x1158x1d}}),{include:[{model:SmsQueue,where:{id:{$in:_0x1158x22}},required:false}]}))})[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)});default:return Agent[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]},_0x32e8[83])[_0x32e8[32]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]]))[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})}};exports[_0x32e8[90]]= function(_0x1158x14,_0x1158x15,_0x1158x16){switch(_0x1158x14[_0x32e8[29]][_0x32e8[35]]){case _0x32e8[29]:var _0x1158x1d=[];return User[_0x32e8[30]](_0x1158x14[_0x32e8[29]][_0x32e8[28]],{attributes:[_0x32e8[28]]})[_0x32e8[25]](Util[_0x32e8[91]]({},{attributes:[_0x32e8[28]],include:[{raw:true,model:User,attributes:[_0x32e8[28]]}]}))[_0x32e8[25]](function(_0x1158x19){var _0x1158x23=_[_0x32e8[77]](_0x1158x19[_0x32e8[76]],_0x32e8[28]);_0x1158x19[_0x32e8[76]][_0x32e8[48]](function(_0x1158x1c){_0x1158x1d= _[_0x32e8[78]](_0x1158x1d,_[_0x32e8[77]](_0x1158x1c.Users,_0x32e8[28]))});return User[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]})[_0x32e8[32]](_[_0x32e8[79]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]],{id:{$in:_0x1158x1d}}),{include:[{model:OpenchannelQueue,where:{id:{$in:_0x1158x23}},required:false}]}))})[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)});default:return Agent[_0x32e8[34]](_0x32e8[33],{method:[_0x32e8[71],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[72],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[73],_0x1158x14[_0x32e8[26]]]},{method:[_0x32e8[74],_0x1158x14[_0x32e8[26]]]},_0x32e8[83])[_0x32e8[32]](Util[_0x32e8[31]](_0x1158x14[_0x32e8[26]]))[_0x32e8[25]](function(_0x1158x18){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x18)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})}};exports[_0x32e8[92]]= function(_0x1158x14,_0x1158x15){return Agent[_0x32e8[34]](_0x32e8[33])[_0x32e8[30]](_0x1158x14[_0x32e8[61]][_0x32e8[28]])[_0x32e8[25]](function(_0x1158x1a){if(!_0x1158x1a){return _0x1158x15[_0x32e8[37]](404)};return _0x1158x15[_0x32e8[23]](_0x1158x1a)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[93]]= function(_0x1158x14,_0x1158x15){return Agent[_0x32e8[34]](_0x32e8[33])[_0x32e8[30]](_0x1158x14[_0x32e8[61]][_0x32e8[28]])[_0x32e8[25]](function(_0x1158x1a){if(!_0x1158x1a){return _0x1158x15[_0x32e8[37]](404)};return _0x1158x1a[_0x32e8[95]]({attributes:[_0x32e8[41]]})})[_0x32e8[25]](function(_0x1158x1e){return _0x1158x15[_0x32e8[23]]({count:_0x1158x1e[_0x32e8[94]],rows:_0x1158x1e})})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[96]]= function(_0x1158x14,_0x1158x15){return Agent[_0x32e8[34]](_0x32e8[33])[_0x32e8[30]](_0x1158x14[_0x32e8[61]][_0x32e8[28]])[_0x32e8[25]](function(_0x1158x1a){if(!_0x1158x1a){return _0x1158x15[_0x32e8[37]](404)};return _0x1158x1a[_0x32e8[97]]({attributes:[_0x32e8[28]]})})[_0x32e8[25]](function(_0x1158x1f){return _0x1158x15[_0x32e8[23]]({count:_0x1158x1f[_0x32e8[94]],rows:_0x1158x1f})})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[98]]= function(_0x1158x14,_0x1158x15){return Agent[_0x32e8[34]](_0x32e8[33])[_0x32e8[30]](_0x1158x14[_0x32e8[61]][_0x32e8[28]])[_0x32e8[25]](function(_0x1158x1a){if(!_0x1158x1a){return _0x1158x15[_0x32e8[37]](404)};return _0x1158x1a[_0x32e8[99]]({attributes:[_0x32e8[28]]})})[_0x32e8[25]](function(_0x1158x20){return _0x1158x15[_0x32e8[23]]({count:_0x1158x20[_0x32e8[94]],rows:_0x1158x20})})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[100]]= function(_0x1158x14,_0x1158x15){return Agent[_0x32e8[34]](_0x32e8[33])[_0x32e8[30]](_0x1158x14[_0x32e8[61]][_0x32e8[28]])[_0x32e8[25]](function(_0x1158x1a){if(!_0x1158x1a){return _0x1158x15[_0x32e8[37]](404)};return _0x1158x1a[_0x32e8[101]]({attributes:[_0x32e8[28]]})})[_0x32e8[25]](function(_0x1158x21){return _0x1158x15[_0x32e8[23]]({count:_0x1158x21[_0x32e8[94]],rows:_0x1158x21})})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[102]]= function(_0x1158x14,_0x1158x15){return Agent[_0x32e8[34]](_0x32e8[33])[_0x32e8[30]](_0x1158x14[_0x32e8[61]][_0x32e8[28]])[_0x32e8[25]](function(_0x1158x1a){if(!_0x1158x1a){return _0x1158x15[_0x32e8[37]](404)};return _0x1158x1a[_0x32e8[103]]({attributes:[_0x32e8[28]]})})[_0x32e8[25]](function(_0x1158x22){return _0x1158x15[_0x32e8[23]]({count:_0x1158x22[_0x32e8[94]],rows:_0x1158x22})})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[104]]= function(_0x1158x14,_0x1158x15){return Agent[_0x32e8[34]](_0x32e8[33])[_0x32e8[30]](_0x1158x14[_0x32e8[61]][_0x32e8[28]])[_0x32e8[25]](function(_0x1158x1a){if(!_0x1158x1a){return _0x1158x15[_0x32e8[37]](404)};return _0x1158x1a[_0x32e8[105]]({attributes:[_0x32e8[28]]})})[_0x32e8[25]](function(_0x1158x24){return _0x1158x15[_0x32e8[23]]({count:_0x1158x24[_0x32e8[94]],rows:_0x1158x24})})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[106]]= function(_0x1158x14,_0x1158x15){var _0x1158x25;_0x1158x14[_0x32e8[39]][_0x32e8[35]]= _0x32e8[33];return sequelize[_0x32e8[116]](function(_0x1158x26){return Setting[_0x32e8[30]](1)[_0x32e8[25]](function(_0x1158x28){var _0x1158x29=String(_0x1158x14[_0x32e8[39]][_0x32e8[112]]);var _0x1158x2a=_0x1158x28[_0x32e8[113]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0x1158x2a[_0x32e8[114]](_0x1158x29)){throw  new Error(_0x32e8[115])};return Agent[_0x32e8[34]](_0x32e8[33])[_0x32e8[106]](_0x1158x14[_0x32e8[39]],{transaction:_0x1158x26})})[_0x32e8[25]](userTools[_0x32e8[111]]({transaction:_0x1158x26}))[_0x32e8[25]](function(_0x1158x1a){_0x1158x25= _0x1158x1a;return Team[_0x32e8[110]]({where:{defaultEntry:true}})})[_0x32e8[25]](function(_0x1158x27){return _0x1158x27[_0x32e8[109]](_0x1158x25[_0x32e8[28]],{transaction:_0x1158x26})})})[_0x32e8[25]](function(){return _0x1158x15[_0x32e8[24]](201)[_0x32e8[23]](_0x1158x25)})[_0x32e8[22]](sequelize.UniqueConstraintError,function(_0x1158x17){return Util[_0x32e8[108]][_0x32e8[107]](_0x1158x15,_0x1158x17)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[117]]= function(_0x1158x14,_0x1158x15){var _0x1158x2b;var _0x1158x2c;var _0x1158x2d=[];var _0x1158x29=String(_0x1158x14[_0x32e8[39]][_0x32e8[112]]);return sequelize[_0x32e8[116]](function(_0x1158x26){return Setting[_0x32e8[30]](1)[_0x32e8[25]](function(_0x1158x28){_0x1158x2c= _0x1158x28;var _0x1158x2a=_0x1158x2c[_0x32e8[113]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^[a-zA-Z0-9]{6,}$/;if(!_0x1158x2a[_0x32e8[114]](_0x1158x29)){throw  new Error(_0x32e8[119])};var _0x1158x2e=0;if(_0x1158x14[_0x32e8[39]][_0x32e8[121]](_0x32e8[120])&& _[_0x32e8[122]](_0x1158x14[_0x32e8[39]][_0x32e8[120]])&& _0x1158x14[_0x32e8[39]][_0x32e8[120]]>= 0){_0x1158x2e= _0x1158x14[_0x32e8[39]][_0x32e8[120]];delete _0x1158x14[_0x32e8[39]][_0x32e8[120]]};var _0x1158x2f=_0x1158x14[_0x32e8[39]][_0x32e8[123]];delete _0x1158x14[_0x32e8[39]][_0x32e8[123]];if(_0x1158x14[_0x32e8[39]][_0x32e8[124]]){_0x1158x14[_0x32e8[39]][_0x32e8[35]]= _0x32e8[33];for(var _0x1158x30=_0x1158x2e;_0x1158x30< _0x1158x14[_0x32e8[39]][_0x32e8[124]]+ _0x1158x2e;_0x1158x30++,_0x1158x2f++){var _0x1158x31=_[_0x32e8[125]](_0x1158x14[_0x32e8[39]]);_0x1158x31[_0x32e8[126]]= _0x1158x2f;_0x1158x31[_0x32e8[41]]= _0x1158x31[_0x32e8[41]]+ _0x1158x30;_0x1158x31[_0x32e8[127]]= _0x1158x31[_0x32e8[127]]+ _0x1158x30;_0x1158x31[_0x32e8[128]]= _0x1158x31[_0x32e8[128]][_0x32e8[130]](_0x32e8[129])[0]+ _0x1158x30+ _0x32e8[129]+ _0x1158x31[_0x32e8[128]][_0x32e8[130]](_0x32e8[129])[1];_0x1158x2d[_0x32e8[47]](_0x1158x31)}}else {throw  new Error(_0x32e8[131])};return Agent[_0x32e8[117]](_0x1158x2d,{transaction:_0x1158x26,individualHooks:true})})[_0x32e8[25]](function(_0x1158x1d){_0x1158x2b= _0x1158x1d;return Team[_0x32e8[110]]({where:{defaultEntry:true}})})[_0x32e8[25]](function(_0x1158x27){return _0x1158x27[_0x32e8[118]](_[_0x32e8[77]](_0x1158x2b,_0x32e8[28]),{transaction:_0x1158x26})})})[_0x32e8[25]](function(){return _0x1158x15[_0x32e8[37]](201)})[_0x32e8[22]](sequelize.UniqueConstraintError,function(_0x1158x17){return Util[_0x32e8[108]][_0x32e8[107]](_0x1158x15,_0x1158x17)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[132]]= function(_0x1158x14,_0x1158x15){if(_0x1158x14[_0x32e8[39]][_0x32e8[28]]){delete _0x1158x14[_0x32e8[39]][_0x32e8[28]]};delete _0x1158x14[_0x32e8[39]][_0x32e8[126]];delete _0x1158x14[_0x32e8[39]][_0x32e8[35]];delete _0x1158x14[_0x32e8[39]][_0x32e8[41]];delete _0x1158x14[_0x32e8[39]][_0x32e8[112]];var _0x1158x25;return sequelize[_0x32e8[116]](function(_0x1158x26){return Agent[_0x32e8[30]](_0x1158x14[_0x32e8[61]][_0x32e8[28]])[_0x32e8[25]](function(_0x1158x1a){if(!_0x1158x1a){return _0x1158x15[_0x32e8[37]](404)};var _0x1158x32=_[_0x32e8[79]](_0x1158x1a,_0x1158x14[_0x32e8[39]]);return _0x1158x32[_0x32e8[134]]({transaction:_0x1158x26})})[_0x32e8[25]](function(_0x1158x1a){_0x1158x25= _0x1158x1a;return _0x1158x1a})[_0x32e8[25]](userTools[_0x32e8[133]]({transaction:_0x1158x26}))[_0x32e8[25]](function(){return _0x1158x15[_0x32e8[24]](200)[_0x32e8[23]](_0x1158x25)})})[_0x32e8[22]](sequelize.UniqueConstraintError,function(_0x1158x17){return Util[_0x32e8[108]][_0x32e8[107]](_0x1158x15,_0x1158x17)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[135]]= function(_0x1158x14,_0x1158x15){var _0x1158x25;return Agent[_0x32e8[30]](_0x1158x14[_0x32e8[61]][_0x32e8[28]])[_0x32e8[25]](function(_0x1158x1a){_0x1158x25= _0x1158x1a;if(!_0x1158x1a){return _0x1158x15[_0x32e8[37]](404)};return _0x1158x1a[_0x32e8[135]]()})[_0x32e8[25]](function(){return _0x1158x15[_0x32e8[37]](204)})[_0x32e8[22]](sequelize.ForeignKeyConstraintError,function(_0x1158x17){return Util[_0x32e8[108]][_0x32e8[136]](_0x1158x15,_0x32e8[33],_0x1158x25[_0x32e8[41]],_0x1158x17)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};exports[_0x32e8[137]]= function(_0x1158x14,_0x1158x15){return Agent[_0x32e8[135]]({where:{id:_0x1158x14[_0x32e8[26]][_0x32e8[63]]},individualHooks:true})[_0x32e8[25]](function(){return _0x1158x15[_0x32e8[37]](204)})[_0x32e8[22]](function(_0x1158x17){return handleError(_0x1158x15,_0x1158x17)})};function handleError(_0x1158x15,_0x1158x17){logger[_0x32e8[139]](_0x1158x17[_0x32e8[138]]);return _0x1158x15[_0x32e8[24]](500)[_0x32e8[23]](_0x1158x17)}
\ No newline at end of file
+var _0xdc87=["\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","\x62\x6C\x75\x65\x62\x69\x72\x64","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x74\x6F\x6F\x6C\x73\x2F\x75\x73\x65\x72","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\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","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x53\x65\x74\x74\x69\x6E\x67","\x55\x73\x65\x72","\x54\x65\x61\x6D","\x4C\x69\x73\x74","\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\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","\x61\x64\x64\x51\x75\x65\x75\x65\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x76\x61\x6C\x75\x65\x73","\x62\x6F\x64\x79","\x53\x49\x50\x2F\x25\x73","\x6E\x61\x6D\x65","\x66\x6F\x72\x6D\x61\x74","\x70\x65\x6E\x61\x6C\x74\x79","\x61\x64\x64\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x76\x6F\x69\x63\x65","\x61\x64\x64\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x61\x6C\x6C","\x66\x69\x6E\x64\x41\x6C\x6C","\x63\x68\x61\x74","\x61\x64\x64\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x6D\x61\x69\x6C","\x61\x64\x64\x46\x61\x78\x51\x75\x65\x75\x65","\x66\x61\x78","\x61\x64\x64\x53\x6D\x73\x51\x75\x65\x75\x65","\x73\x6D\x73","\x61\x64\x64\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x63\x68\x61\x6E\x6E\x65\x6C","\x70\x61\x72\x61\x6D\x73","\x72\x65\x6D\x6F\x76\x65\x51\x75\x65\x75\x65\x73","\x69\x64\x73","\x72\x65\x6D\x6F\x76\x65\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x72\x65\x61\x6C\x74\x69\x6D\x65\x49\x6E\x64\x65\x78","\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","\x72\x65\x61\x6C\x74\x69\x6D\x65\x56\x6F\x69\x63\x65\x49\x6E\x64\x65\x78","\x72\x6F\x77\x73","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\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","\x71\x75\x65\x75\x65\x73","\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\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","\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","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x73\x65\x63\x75\x72\x65\x50\x61\x73\x73\x77\x6F\x72\x64","\x74\x65\x73\x74","\x57\x72\x6F\x6E\x67\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x66\x6F\x72\x6D\x61\x74\x21","\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","\x49\x6E\x76\x61\x6C\x69\x64\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x70\x61\x74\x74\x65\x72\x6E","\x73\x74\x61\x72\x74\x49\x6E\x64\x65\x78","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x69\x73\x4E\x75\x6D\x62\x65\x72","\x6D\x69\x6E\x49\x6E\x74\x65\x72\x6E\x61\x6C","\x61\x6D\x6F\x75\x6E\x74","\x63\x6C\x6F\x6E\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x40","\x73\x70\x6C\x69\x74","\x4E\x6F\x20\x61\x67\x65\x6E\x74\x73\x20\x61\x6D\x6F\x75\x6E\x74\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x21","\x75\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x55\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","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0xdc87[0];var _=require(_0xdc87[1]);var sequelize=require(_0xdc87[3])[_0xdc87[2]];var BPromise=require(_0xdc87[4]);var util=require(_0xdc87[5]);var Util=require(_0xdc87[6]);var userTools=require(_0xdc87[7]);var logger=require(_0xdc87[9])(_0xdc87[8]);var OpenchannelQueue=require(_0xdc87[3])[_0xdc87[10]];var VoiceQueue=require(_0xdc87[3])[_0xdc87[11]];var ChatQueue=require(_0xdc87[3])[_0xdc87[12]];var MailQueue=require(_0xdc87[3])[_0xdc87[13]];var FaxQueue=require(_0xdc87[3])[_0xdc87[14]];var SmsQueue=require(_0xdc87[3])[_0xdc87[15]];var MailRoom=require(_0xdc87[3])[_0xdc87[16]];var Setting=require(_0xdc87[3])[_0xdc87[17]];var Agent=require(_0xdc87[3])[_0xdc87[18]];var User=require(_0xdc87[3])[_0xdc87[18]];var Team=require(_0xdc87[3])[_0xdc87[19]];var List=require(_0xdc87[3])[_0xdc87[20]];exports[_0xdc87[21]]= function(_0x144dx14,_0x144dx15,_0x144dx16){switch(_0x144dx14[_0xdc87[29]][_0xdc87[35]]){case _0xdc87[29]:return User[_0xdc87[30]](_0x144dx14[_0xdc87[29]][_0xdc87[28]],{attributes:[_0xdc87[28]]})[_0xdc87[25]](Util[_0xdc87[27]](_0x144dx14[_0xdc87[26]]))[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)});default:return Agent[_0xdc87[34]](_0xdc87[33])[_0xdc87[32]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]]))[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})}};exports[_0xdc87[36]]= function(_0x144dx14,_0x144dx15,_0x144dx16){return Agent[_0xdc87[30]](_0x144dx14[_0xdc87[61]][_0xdc87[28]],{attributes:[_0xdc87[28],_0xdc87[41]]})[_0xdc87[25]](function(_0x144dx1a){if(!_0x144dx1a){return _0x144dx15[_0xdc87[37]](401)};switch(_0x144dx14[_0xdc87[61]][_0xdc87[60]]){case _0xdc87[45]:return _0x144dx1a[_0xdc87[44]](_0x144dx14[_0xdc87[39]][_0xdc87[38]],{interface:util[_0xdc87[42]](_0xdc87[40],_0x144dx1a[_0xdc87[41]]),stateinterface:util[_0xdc87[42]](_0xdc87[40],_0x144dx1a[_0xdc87[41]]),membername:_0x144dx1a[_0xdc87[41]],UserId:_0x144dx1a[_0xdc87[28]],penalty:_0x144dx14[_0xdc87[39]][_0xdc87[43]]});case _0xdc87[51]:return ChatQueue[_0xdc87[50]]({where:{id:_0x144dx14[_0xdc87[39]][_0xdc87[38]]},attributes:[_0xdc87[28],_0xdc87[41]],raw:true})[_0xdc87[25]](function(_0x144dx19){if(_0x144dx19){var _0x144dx1b=[];_[_0xdc87[48]](_0x144dx19,function(_0x144dx1c){_0x144dx1b[_0xdc87[47]](_0x144dx1a[_0xdc87[46]](_0x144dx1c[_0xdc87[28]],{queue:_0x144dx1c[_0xdc87[41]],penalty:_0x144dx14[_0xdc87[39]][_0xdc87[43]]}))});return BPromise[_0xdc87[49]](_0x144dx1b)}});case _0xdc87[53]:return MailQueue[_0xdc87[50]]({where:{id:_0x144dx14[_0xdc87[39]][_0xdc87[38]]},attributes:[_0xdc87[28],_0xdc87[41]],raw:true})[_0xdc87[25]](function(_0x144dx19){if(_0x144dx19){var _0x144dx1b=[];_[_0xdc87[48]](_0x144dx19,function(_0x144dx1c){_0x144dx1b[_0xdc87[47]](_0x144dx1a[_0xdc87[52]](_0x144dx1c[_0xdc87[28]],{queue:_0x144dx1c[_0xdc87[41]],penalty:_0x144dx14[_0xdc87[39]][_0xdc87[43]]}))});return BPromise[_0xdc87[49]](_0x144dx1b)}});case _0xdc87[55]:return FaxQueue[_0xdc87[50]]({where:{id:_0x144dx14[_0xdc87[39]][_0xdc87[38]]},attributes:[_0xdc87[28],_0xdc87[41]],raw:true})[_0xdc87[25]](function(_0x144dx19){if(_0x144dx19){var _0x144dx1b=[];_[_0xdc87[48]](_0x144dx19,function(_0x144dx1c){_0x144dx1b[_0xdc87[47]](_0x144dx1a[_0xdc87[54]](_0x144dx1c[_0xdc87[28]],{queue:_0x144dx1c[_0xdc87[41]],penalty:_0x144dx14[_0xdc87[39]][_0xdc87[43]]}))});return BPromise[_0xdc87[49]](_0x144dx1b)}});case _0xdc87[57]:return SmsQueue[_0xdc87[50]]({where:{id:_0x144dx14[_0xdc87[39]][_0xdc87[38]]},attributes:[_0xdc87[28],_0xdc87[41]],raw:true})[_0xdc87[25]](function(_0x144dx19){if(_0x144dx19){var _0x144dx1b=[];_[_0xdc87[48]](_0x144dx19,function(_0x144dx1c){_0x144dx1b[_0xdc87[47]](_0x144dx1a[_0xdc87[56]](_0x144dx1c[_0xdc87[28]],{queue:_0x144dx1c[_0xdc87[41]],penalty:_0x144dx14[_0xdc87[39]][_0xdc87[43]]}))});return BPromise[_0xdc87[49]](_0x144dx1b)}});case _0xdc87[59]:return OpenchannelQueue[_0xdc87[50]]({where:{id:_0x144dx14[_0xdc87[39]][_0xdc87[38]]},attributes:[_0xdc87[28],_0xdc87[41]],raw:true})[_0xdc87[25]](function(_0x144dx19){if(_0x144dx19){var _0x144dx1b=[];_[_0xdc87[48]](_0x144dx19,function(_0x144dx1c){_0x144dx1b[_0xdc87[47]](_0x144dx1a[_0xdc87[58]](_0x144dx1c[_0xdc87[28]],{queue:_0x144dx1c[_0xdc87[41]],penalty:_0x144dx14[_0xdc87[39]][_0xdc87[43]]}))});return BPromise[_0xdc87[49]](_0x144dx1b)}});default:return null}})[_0xdc87[25]](function(_0x144dx19){return _0x144dx15[_0xdc87[37]](_0x144dx19?200:401)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[62]]= function(_0x144dx14,_0x144dx15,_0x144dx16){return Agent[_0xdc87[30]](_0x144dx14[_0xdc87[61]][_0xdc87[28]],{attributes:[_0xdc87[28]]})[_0xdc87[25]](function(_0x144dx1a){if(!_0x144dx1a){return _0x144dx15[_0xdc87[37]](401)};switch(_0x144dx14[_0xdc87[61]][_0xdc87[60]]){case _0xdc87[45]:return _0x144dx1a[_0xdc87[64]](_0x144dx14[_0xdc87[26]][_0xdc87[63]]);case _0xdc87[51]:return _0x144dx1a[_0xdc87[65]](_0x144dx14[_0xdc87[26]][_0xdc87[63]]);case _0xdc87[53]:return _0x144dx1a[_0xdc87[66]](_0x144dx14[_0xdc87[26]][_0xdc87[63]]);case _0xdc87[57]:return _0x144dx1a[_0xdc87[67]](_0x144dx14[_0xdc87[26]][_0xdc87[63]]);case _0xdc87[55]:return _0x144dx1a[_0xdc87[68]](_0x144dx14[_0xdc87[26]][_0xdc87[63]]);case _0xdc87[59]:return _0x144dx1a[_0xdc87[69]](_0x144dx14[_0xdc87[26]][_0xdc87[63]]);default:return null}})[_0xdc87[25]](function(_0x144dx19){return _0x144dx15[_0xdc87[37]](_0x144dx19?200:401)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[70]]= function(_0x144dx14,_0x144dx15,_0x144dx16){switch(_0x144dx14[_0xdc87[29]][_0xdc87[35]]){case _0xdc87[29]:return User[_0xdc87[30]](_0x144dx14[_0xdc87[29]][_0xdc87[28]],{attributes:[_0xdc87[28]]})[_0xdc87[25]](Util[_0xdc87[27]](_0x144dx14[_0xdc87[26]]))[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)});default:return Agent[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]})[_0xdc87[32]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]]))[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})}};exports[_0xdc87[75]]= function(_0x144dx14,_0x144dx15,_0x144dx16){switch(_0x144dx14[_0xdc87[29]][_0xdc87[35]]){case _0xdc87[29]:var _0x144dx1d=[];return User[_0xdc87[30]](_0x144dx14[_0xdc87[29]][_0xdc87[28]],{attributes:[_0xdc87[28]]})[_0xdc87[25]](Util[_0xdc87[80]]({},{attributes:[_0xdc87[41]],include:[{raw:true,model:User,attributes:[_0xdc87[28]]}]}))[_0xdc87[25]](function(_0x144dx19){var _0x144dx1e=_[_0xdc87[77]](_0x144dx19[_0xdc87[76]],_0xdc87[41]);_0x144dx19[_0xdc87[76]][_0xdc87[48]](function(_0x144dx1c){_0x144dx1d= _[_0xdc87[78]](_0x144dx1d,_[_0xdc87[77]](_0x144dx1c.Users,_0xdc87[28]))});return User[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]})[_0xdc87[32]](_[_0xdc87[79]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]],{id:{$in:_0x144dx1d}}),{include:[{model:VoiceQueue,where:{name:{$in:_0x144dx1e}},required:false}]}))})[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)});default:return Agent[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]})[_0xdc87[32]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]]))[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})}};exports[_0xdc87[81]]= function(_0x144dx14,_0x144dx15,_0x144dx16){switch(_0x144dx14[_0xdc87[29]][_0xdc87[35]]){case _0xdc87[29]:var _0x144dx1d=[];return User[_0xdc87[30]](_0x144dx14[_0xdc87[29]][_0xdc87[28]],{attributes:[_0xdc87[28]]})[_0xdc87[25]](Util[_0xdc87[82]]({},{attributes:[_0xdc87[28]],include:[{raw:true,model:User,attributes:[_0xdc87[28]]}]}))[_0xdc87[25]](function(_0x144dx19){var _0x144dx1f=_[_0xdc87[77]](_0x144dx19[_0xdc87[76]],_0xdc87[28]);_0x144dx19[_0xdc87[76]][_0xdc87[48]](function(_0x144dx1c){_0x144dx1d= _[_0xdc87[78]](_0x144dx1d,_[_0xdc87[77]](_0x144dx1c.Users,_0xdc87[28]))});return User[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]})[_0xdc87[32]](_[_0xdc87[79]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]],{id:{$in:_0x144dx1d}}),{include:[{model:ChatQueue,where:{id:{$in:_0x144dx1f}},required:false}]}))})[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)});default:return Agent[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]},_0xdc87[83])[_0xdc87[32]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]]))[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})}};exports[_0xdc87[84]]= function(_0x144dx14,_0x144dx15,_0x144dx16){switch(_0x144dx14[_0xdc87[29]][_0xdc87[35]]){case _0xdc87[29]:var _0x144dx1d=[];return User[_0xdc87[30]](_0x144dx14[_0xdc87[29]][_0xdc87[28]],{attributes:[_0xdc87[28]]})[_0xdc87[25]](Util[_0xdc87[85]]({},{attributes:[_0xdc87[28]],include:[{raw:true,model:User,attributes:[_0xdc87[28]]}]}))[_0xdc87[25]](function(_0x144dx19){var _0x144dx20=_[_0xdc87[77]](_0x144dx19[_0xdc87[76]],_0xdc87[28]);_0x144dx19[_0xdc87[76]][_0xdc87[48]](function(_0x144dx1c){_0x144dx1d= _[_0xdc87[78]](_0x144dx1d,_[_0xdc87[77]](_0x144dx1c.Users,_0xdc87[28]))});return User[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]})[_0xdc87[32]](_[_0xdc87[79]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]],{id:{$in:_0x144dx1d}}),{include:[{model:MailQueue,where:{id:{$in:_0x144dx20}},required:false}]}))})[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)});default:return Agent[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]},_0xdc87[83])[_0xdc87[32]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]]))[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})}};exports[_0xdc87[86]]= function(_0x144dx14,_0x144dx15,_0x144dx16){switch(_0x144dx14[_0xdc87[29]][_0xdc87[35]]){case _0xdc87[29]:var _0x144dx1d=[];return User[_0xdc87[30]](_0x144dx14[_0xdc87[29]][_0xdc87[28]],{attributes:[_0xdc87[28]]})[_0xdc87[25]](Util[_0xdc87[87]]({},{attributes:[_0xdc87[28]],include:[{raw:true,model:User,attributes:[_0xdc87[28]]}]}))[_0xdc87[25]](function(_0x144dx19){var _0x144dx21=_[_0xdc87[77]](_0x144dx19[_0xdc87[76]],_0xdc87[28]);_0x144dx19[_0xdc87[76]][_0xdc87[48]](function(_0x144dx1c){_0x144dx1d= _[_0xdc87[78]](_0x144dx1d,_[_0xdc87[77]](_0x144dx1c.Users,_0xdc87[28]))});return User[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]})[_0xdc87[32]](_[_0xdc87[79]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]],{id:{$in:_0x144dx1d}}),{include:[{model:FaxQueue,where:{id:{$in:_0x144dx21}},required:false}]}))})[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)});default:return Agent[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]},_0xdc87[83])[_0xdc87[32]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]]))[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})}};exports[_0xdc87[88]]= function(_0x144dx14,_0x144dx15,_0x144dx16){switch(_0x144dx14[_0xdc87[29]][_0xdc87[35]]){case _0xdc87[29]:var _0x144dx1d=[];return User[_0xdc87[30]](_0x144dx14[_0xdc87[29]][_0xdc87[28]],{attributes:[_0xdc87[28]]})[_0xdc87[25]](Util[_0xdc87[89]]({},{attributes:[_0xdc87[28]],include:[{raw:true,model:User,attributes:[_0xdc87[28]]}]}))[_0xdc87[25]](function(_0x144dx19){var _0x144dx22=_[_0xdc87[77]](_0x144dx19[_0xdc87[76]],_0xdc87[28]);_0x144dx19[_0xdc87[76]][_0xdc87[48]](function(_0x144dx1c){_0x144dx1d= _[_0xdc87[78]](_0x144dx1d,_[_0xdc87[77]](_0x144dx1c.Users,_0xdc87[28]))});return User[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]})[_0xdc87[32]](_[_0xdc87[79]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]],{id:{$in:_0x144dx1d}}),{include:[{model:SmsQueue,where:{id:{$in:_0x144dx22}},required:false}]}))})[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)});default:return Agent[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]},_0xdc87[83])[_0xdc87[32]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]]))[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})}};exports[_0xdc87[90]]= function(_0x144dx14,_0x144dx15,_0x144dx16){switch(_0x144dx14[_0xdc87[29]][_0xdc87[35]]){case _0xdc87[29]:var _0x144dx1d=[];return User[_0xdc87[30]](_0x144dx14[_0xdc87[29]][_0xdc87[28]],{attributes:[_0xdc87[28]]})[_0xdc87[25]](Util[_0xdc87[91]]({},{attributes:[_0xdc87[28]],include:[{raw:true,model:User,attributes:[_0xdc87[28]]}]}))[_0xdc87[25]](function(_0x144dx19){var _0x144dx23=_[_0xdc87[77]](_0x144dx19[_0xdc87[76]],_0xdc87[28]);_0x144dx19[_0xdc87[76]][_0xdc87[48]](function(_0x144dx1c){_0x144dx1d= _[_0xdc87[78]](_0x144dx1d,_[_0xdc87[77]](_0x144dx1c.Users,_0xdc87[28]))});return User[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]})[_0xdc87[32]](_[_0xdc87[79]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]],{id:{$in:_0x144dx1d}}),{include:[{model:OpenchannelQueue,where:{id:{$in:_0x144dx23}},required:false}]}))})[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)});default:return Agent[_0xdc87[34]](_0xdc87[33],{method:[_0xdc87[71],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[72],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[73],_0x144dx14[_0xdc87[26]]]},{method:[_0xdc87[74],_0x144dx14[_0xdc87[26]]]},_0xdc87[83])[_0xdc87[32]](Util[_0xdc87[31]](_0x144dx14[_0xdc87[26]]))[_0xdc87[25]](function(_0x144dx18){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx18)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})}};exports[_0xdc87[92]]= function(_0x144dx14,_0x144dx15){return Agent[_0xdc87[34]](_0xdc87[33])[_0xdc87[30]](_0x144dx14[_0xdc87[61]][_0xdc87[28]])[_0xdc87[25]](function(_0x144dx1a){if(!_0x144dx1a){return _0x144dx15[_0xdc87[37]](404)};return _0x144dx15[_0xdc87[23]](_0x144dx1a)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[93]]= function(_0x144dx14,_0x144dx15){return Agent[_0xdc87[34]](_0xdc87[33])[_0xdc87[30]](_0x144dx14[_0xdc87[61]][_0xdc87[28]])[_0xdc87[25]](function(_0x144dx1a){if(!_0x144dx1a){return _0x144dx15[_0xdc87[37]](404)};return _0x144dx1a[_0xdc87[95]]({attributes:[_0xdc87[41]]})})[_0xdc87[25]](function(_0x144dx1e){return _0x144dx15[_0xdc87[23]]({count:_0x144dx1e[_0xdc87[94]],rows:_0x144dx1e})})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[96]]= function(_0x144dx14,_0x144dx15){return Agent[_0xdc87[34]](_0xdc87[33])[_0xdc87[30]](_0x144dx14[_0xdc87[61]][_0xdc87[28]])[_0xdc87[25]](function(_0x144dx1a){if(!_0x144dx1a){return _0x144dx15[_0xdc87[37]](404)};return _0x144dx1a[_0xdc87[97]]({attributes:[_0xdc87[28]]})})[_0xdc87[25]](function(_0x144dx1f){return _0x144dx15[_0xdc87[23]]({count:_0x144dx1f[_0xdc87[94]],rows:_0x144dx1f})})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[98]]= function(_0x144dx14,_0x144dx15){return Agent[_0xdc87[34]](_0xdc87[33])[_0xdc87[30]](_0x144dx14[_0xdc87[61]][_0xdc87[28]])[_0xdc87[25]](function(_0x144dx1a){if(!_0x144dx1a){return _0x144dx15[_0xdc87[37]](404)};return _0x144dx1a[_0xdc87[99]]({attributes:[_0xdc87[28]]})})[_0xdc87[25]](function(_0x144dx20){return _0x144dx15[_0xdc87[23]]({count:_0x144dx20[_0xdc87[94]],rows:_0x144dx20})})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[100]]= function(_0x144dx14,_0x144dx15){return Agent[_0xdc87[34]](_0xdc87[33])[_0xdc87[30]](_0x144dx14[_0xdc87[61]][_0xdc87[28]])[_0xdc87[25]](function(_0x144dx1a){if(!_0x144dx1a){return _0x144dx15[_0xdc87[37]](404)};return _0x144dx1a[_0xdc87[101]]({attributes:[_0xdc87[28]]})})[_0xdc87[25]](function(_0x144dx21){return _0x144dx15[_0xdc87[23]]({count:_0x144dx21[_0xdc87[94]],rows:_0x144dx21})})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[102]]= function(_0x144dx14,_0x144dx15){return Agent[_0xdc87[34]](_0xdc87[33])[_0xdc87[30]](_0x144dx14[_0xdc87[61]][_0xdc87[28]])[_0xdc87[25]](function(_0x144dx1a){if(!_0x144dx1a){return _0x144dx15[_0xdc87[37]](404)};return _0x144dx1a[_0xdc87[103]]({attributes:[_0xdc87[28]]})})[_0xdc87[25]](function(_0x144dx22){return _0x144dx15[_0xdc87[23]]({count:_0x144dx22[_0xdc87[94]],rows:_0x144dx22})})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[104]]= function(_0x144dx14,_0x144dx15){return Agent[_0xdc87[34]](_0xdc87[33])[_0xdc87[30]](_0x144dx14[_0xdc87[61]][_0xdc87[28]])[_0xdc87[25]](function(_0x144dx1a){if(!_0x144dx1a){return _0x144dx15[_0xdc87[37]](404)};return _0x144dx1a[_0xdc87[105]]({attributes:[_0xdc87[28]]})})[_0xdc87[25]](function(_0x144dx24){return _0x144dx15[_0xdc87[23]]({count:_0x144dx24[_0xdc87[94]],rows:_0x144dx24})})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[106]]= function(_0x144dx14,_0x144dx15){var _0x144dx25;_0x144dx14[_0xdc87[39]][_0xdc87[35]]= _0xdc87[33];return sequelize[_0xdc87[116]](function(_0x144dx26){return Setting[_0xdc87[30]](1)[_0xdc87[25]](function(_0x144dx28){var _0x144dx29=String(_0x144dx14[_0xdc87[39]][_0xdc87[112]]);var _0x144dx2a=_0x144dx28[_0xdc87[113]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0x144dx2a[_0xdc87[114]](_0x144dx29)){throw  new Error(_0xdc87[115])};return Agent[_0xdc87[34]](_0xdc87[33])[_0xdc87[106]](_0x144dx14[_0xdc87[39]],{transaction:_0x144dx26})})[_0xdc87[25]](userTools[_0xdc87[111]]({transaction:_0x144dx26}))[_0xdc87[25]](function(_0x144dx1a){_0x144dx25= _0x144dx1a;return Team[_0xdc87[110]]({where:{defaultEntry:true}})})[_0xdc87[25]](function(_0x144dx27){return _0x144dx27[_0xdc87[109]](_0x144dx25[_0xdc87[28]],{transaction:_0x144dx26})})})[_0xdc87[25]](function(){return _0x144dx15[_0xdc87[24]](201)[_0xdc87[23]](_0x144dx25)})[_0xdc87[22]](sequelize.UniqueConstraintError,function(_0x144dx17){return Util[_0xdc87[108]][_0xdc87[107]](_0x144dx15,_0x144dx17)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[117]]= function(_0x144dx14,_0x144dx15){var _0x144dx2b;var _0x144dx2c;var _0x144dx2d=[];var _0x144dx29=String(_0x144dx14[_0xdc87[39]][_0xdc87[112]]);return sequelize[_0xdc87[116]](function(_0x144dx26){return Setting[_0xdc87[30]](1)[_0xdc87[25]](function(_0x144dx28){_0x144dx2c= _0x144dx28;var _0x144dx2a=_0x144dx2c[_0xdc87[113]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^[a-zA-Z0-9]{6,}$/;if(!_0x144dx2a[_0xdc87[114]](_0x144dx29)){throw  new Error(_0xdc87[119])};var _0x144dx2e=0;if(_0x144dx14[_0xdc87[39]][_0xdc87[121]](_0xdc87[120])&& _[_0xdc87[122]](_0x144dx14[_0xdc87[39]][_0xdc87[120]])&& _0x144dx14[_0xdc87[39]][_0xdc87[120]]>= 0){_0x144dx2e= _0x144dx14[_0xdc87[39]][_0xdc87[120]];delete _0x144dx14[_0xdc87[39]][_0xdc87[120]]};var _0x144dx2f=_0x144dx14[_0xdc87[39]][_0xdc87[123]];delete _0x144dx14[_0xdc87[39]][_0xdc87[123]];if(_0x144dx14[_0xdc87[39]][_0xdc87[124]]){_0x144dx14[_0xdc87[39]][_0xdc87[35]]= _0xdc87[33];for(var _0x144dx30=_0x144dx2e;_0x144dx30< _0x144dx14[_0xdc87[39]][_0xdc87[124]]+ _0x144dx2e;_0x144dx30++,_0x144dx2f++){var _0x144dx31=_[_0xdc87[125]](_0x144dx14[_0xdc87[39]]);_0x144dx31[_0xdc87[126]]= _0x144dx2f;_0x144dx31[_0xdc87[41]]= _0x144dx31[_0xdc87[41]]+ _0x144dx30;_0x144dx31[_0xdc87[127]]= _0x144dx31[_0xdc87[127]]+ _0x144dx30;_0x144dx31[_0xdc87[128]]= _0x144dx31[_0xdc87[128]][_0xdc87[130]](_0xdc87[129])[0]+ _0x144dx30+ _0xdc87[129]+ _0x144dx31[_0xdc87[128]][_0xdc87[130]](_0xdc87[129])[1];_0x144dx2d[_0xdc87[47]](_0x144dx31)}}else {throw  new Error(_0xdc87[131])};return Agent[_0xdc87[117]](_0x144dx2d,{transaction:_0x144dx26,individualHooks:true})})[_0xdc87[25]](function(_0x144dx1d){_0x144dx2b= _0x144dx1d;return Team[_0xdc87[110]]({where:{defaultEntry:true}})})[_0xdc87[25]](function(_0x144dx27){return _0x144dx27[_0xdc87[118]](_[_0xdc87[77]](_0x144dx2b,_0xdc87[28]),{transaction:_0x144dx26})})})[_0xdc87[25]](function(){return _0x144dx15[_0xdc87[37]](201)})[_0xdc87[22]](sequelize.UniqueConstraintError,function(_0x144dx17){return Util[_0xdc87[108]][_0xdc87[107]](_0x144dx15,_0x144dx17)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[132]]= function(_0x144dx14,_0x144dx15){if(_0x144dx14[_0xdc87[39]][_0xdc87[28]]){delete _0x144dx14[_0xdc87[39]][_0xdc87[28]]};delete _0x144dx14[_0xdc87[39]][_0xdc87[126]];delete _0x144dx14[_0xdc87[39]][_0xdc87[35]];delete _0x144dx14[_0xdc87[39]][_0xdc87[41]];delete _0x144dx14[_0xdc87[39]][_0xdc87[112]];var _0x144dx25;return sequelize[_0xdc87[116]](function(_0x144dx26){return Agent[_0xdc87[30]](_0x144dx14[_0xdc87[61]][_0xdc87[28]])[_0xdc87[25]](function(_0x144dx1a){if(!_0x144dx1a){return _0x144dx15[_0xdc87[37]](404)};var _0x144dx32=_[_0xdc87[79]](_0x144dx1a,_0x144dx14[_0xdc87[39]]);return _0x144dx32[_0xdc87[134]]({transaction:_0x144dx26})})[_0xdc87[25]](function(_0x144dx1a){_0x144dx25= _0x144dx1a;return _0x144dx1a})[_0xdc87[25]](userTools[_0xdc87[133]]({transaction:_0x144dx26}))[_0xdc87[25]](function(){return _0x144dx15[_0xdc87[24]](200)[_0xdc87[23]](_0x144dx25)})})[_0xdc87[22]](sequelize.UniqueConstraintError,function(_0x144dx17){return Util[_0xdc87[108]][_0xdc87[107]](_0x144dx15,_0x144dx17)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[135]]= function(_0x144dx14,_0x144dx15){var _0x144dx25;return Agent[_0xdc87[30]](_0x144dx14[_0xdc87[61]][_0xdc87[28]])[_0xdc87[25]](function(_0x144dx1a){_0x144dx25= _0x144dx1a;if(!_0x144dx1a){return _0x144dx15[_0xdc87[37]](404)};return _0x144dx1a[_0xdc87[135]]()})[_0xdc87[25]](function(){return _0x144dx15[_0xdc87[37]](204)})[_0xdc87[22]](sequelize.ForeignKeyConstraintError,function(_0x144dx17){return Util[_0xdc87[108]][_0xdc87[136]](_0x144dx15,_0xdc87[33],_0x144dx25[_0xdc87[41]],_0x144dx17)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};exports[_0xdc87[137]]= function(_0x144dx14,_0x144dx15){return Agent[_0xdc87[135]]({where:{id:_0x144dx14[_0xdc87[26]][_0xdc87[63]]},individualHooks:true})[_0xdc87[25]](function(){return _0x144dx15[_0xdc87[37]](204)})[_0xdc87[22]](function(_0x144dx17){return handleError(_0x144dx15,_0x144dx17)})};function handleError(_0x144dx15,_0x144dx17){logger[_0xdc87[139]](_0x144dx17[_0xdc87[138]]);return _0x144dx15[_0xdc87[24]](500)[_0xdc87[23]](_0x144dx17)}
\ No newline at end of file