Built motion from commit 420f8c692.|1.0.30
[motion.git] / server / api / agent / agent.controller.js
index de053f0..21427cf 100644 (file)
@@ -1 +1 @@
-var _0xec8b=["\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"];_0xec8b[0];var _=require(_0xec8b[1]);var sequelize=require(_0xec8b[3])[_0xec8b[2]];var BPromise=require(_0xec8b[4]);var util=require(_0xec8b[5]);var Util=require(_0xec8b[6]);var userTools=require(_0xec8b[7]);var logger=require(_0xec8b[9])(_0xec8b[8]);var OpenchannelQueue=require(_0xec8b[3])[_0xec8b[10]];var VoiceQueue=require(_0xec8b[3])[_0xec8b[11]];var ChatQueue=require(_0xec8b[3])[_0xec8b[12]];var MailQueue=require(_0xec8b[3])[_0xec8b[13]];var FaxQueue=require(_0xec8b[3])[_0xec8b[14]];var SmsQueue=require(_0xec8b[3])[_0xec8b[15]];var MailRoom=require(_0xec8b[3])[_0xec8b[16]];var Setting=require(_0xec8b[3])[_0xec8b[17]];var Agent=require(_0xec8b[3])[_0xec8b[18]];var User=require(_0xec8b[3])[_0xec8b[18]];var Team=require(_0xec8b[3])[_0xec8b[19]];var List=require(_0xec8b[3])[_0xec8b[20]];exports[_0xec8b[21]]= function(_0xc3a4x14,_0xc3a4x15,_0xc3a4x16){switch(_0xc3a4x14[_0xec8b[29]][_0xec8b[35]]){case _0xec8b[29]:return User[_0xec8b[30]](_0xc3a4x14[_0xec8b[29]][_0xec8b[28]],{attributes:[_0xec8b[28]]})[_0xec8b[25]](Util[_0xec8b[27]](_0xc3a4x14[_0xec8b[26]]))[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)});default:return Agent[_0xec8b[34]](_0xec8b[33])[_0xec8b[32]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]]))[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})}};exports[_0xec8b[36]]= function(_0xc3a4x14,_0xc3a4x15,_0xc3a4x16){return Agent[_0xec8b[30]](_0xc3a4x14[_0xec8b[61]][_0xec8b[28]],{attributes:[_0xec8b[28],_0xec8b[41]]})[_0xec8b[25]](function(_0xc3a4x1a){if(!_0xc3a4x1a){return _0xc3a4x15[_0xec8b[37]](401)};switch(_0xc3a4x14[_0xec8b[61]][_0xec8b[60]]){case _0xec8b[45]:return _0xc3a4x1a[_0xec8b[44]](_0xc3a4x14[_0xec8b[39]][_0xec8b[38]],{interface:util[_0xec8b[42]](_0xec8b[40],_0xc3a4x1a[_0xec8b[41]]),stateinterface:util[_0xec8b[42]](_0xec8b[40],_0xc3a4x1a[_0xec8b[41]]),membername:_0xc3a4x1a[_0xec8b[41]],UserId:_0xc3a4x1a[_0xec8b[28]],penalty:_0xc3a4x14[_0xec8b[39]][_0xec8b[43]]});case _0xec8b[51]:return ChatQueue[_0xec8b[50]]({where:{id:_0xc3a4x14[_0xec8b[39]][_0xec8b[38]]},attributes:[_0xec8b[28],_0xec8b[41]],raw:true})[_0xec8b[25]](function(_0xc3a4x19){if(_0xc3a4x19){var _0xc3a4x1b=[];_[_0xec8b[48]](_0xc3a4x19,function(_0xc3a4x1c){_0xc3a4x1b[_0xec8b[47]](_0xc3a4x1a[_0xec8b[46]](_0xc3a4x1c[_0xec8b[28]],{queue:_0xc3a4x1c[_0xec8b[41]],penalty:_0xc3a4x14[_0xec8b[39]][_0xec8b[43]]}))});return BPromise[_0xec8b[49]](_0xc3a4x1b)}});case _0xec8b[53]:return MailQueue[_0xec8b[50]]({where:{id:_0xc3a4x14[_0xec8b[39]][_0xec8b[38]]},attributes:[_0xec8b[28],_0xec8b[41]],raw:true})[_0xec8b[25]](function(_0xc3a4x19){if(_0xc3a4x19){var _0xc3a4x1b=[];_[_0xec8b[48]](_0xc3a4x19,function(_0xc3a4x1c){_0xc3a4x1b[_0xec8b[47]](_0xc3a4x1a[_0xec8b[52]](_0xc3a4x1c[_0xec8b[28]],{queue:_0xc3a4x1c[_0xec8b[41]],penalty:_0xc3a4x14[_0xec8b[39]][_0xec8b[43]]}))});return BPromise[_0xec8b[49]](_0xc3a4x1b)}});case _0xec8b[55]:return FaxQueue[_0xec8b[50]]({where:{id:_0xc3a4x14[_0xec8b[39]][_0xec8b[38]]},attributes:[_0xec8b[28],_0xec8b[41]],raw:true})[_0xec8b[25]](function(_0xc3a4x19){if(_0xc3a4x19){var _0xc3a4x1b=[];_[_0xec8b[48]](_0xc3a4x19,function(_0xc3a4x1c){_0xc3a4x1b[_0xec8b[47]](_0xc3a4x1a[_0xec8b[54]](_0xc3a4x1c[_0xec8b[28]],{queue:_0xc3a4x1c[_0xec8b[41]],penalty:_0xc3a4x14[_0xec8b[39]][_0xec8b[43]]}))});return BPromise[_0xec8b[49]](_0xc3a4x1b)}});case _0xec8b[57]:return SmsQueue[_0xec8b[50]]({where:{id:_0xc3a4x14[_0xec8b[39]][_0xec8b[38]]},attributes:[_0xec8b[28],_0xec8b[41]],raw:true})[_0xec8b[25]](function(_0xc3a4x19){if(_0xc3a4x19){var _0xc3a4x1b=[];_[_0xec8b[48]](_0xc3a4x19,function(_0xc3a4x1c){_0xc3a4x1b[_0xec8b[47]](_0xc3a4x1a[_0xec8b[56]](_0xc3a4x1c[_0xec8b[28]],{queue:_0xc3a4x1c[_0xec8b[41]],penalty:_0xc3a4x14[_0xec8b[39]][_0xec8b[43]]}))});return BPromise[_0xec8b[49]](_0xc3a4x1b)}});case _0xec8b[59]:return OpenchannelQueue[_0xec8b[50]]({where:{id:_0xc3a4x14[_0xec8b[39]][_0xec8b[38]]},attributes:[_0xec8b[28],_0xec8b[41]],raw:true})[_0xec8b[25]](function(_0xc3a4x19){if(_0xc3a4x19){var _0xc3a4x1b=[];_[_0xec8b[48]](_0xc3a4x19,function(_0xc3a4x1c){_0xc3a4x1b[_0xec8b[47]](_0xc3a4x1a[_0xec8b[58]](_0xc3a4x1c[_0xec8b[28]],{queue:_0xc3a4x1c[_0xec8b[41]],penalty:_0xc3a4x14[_0xec8b[39]][_0xec8b[43]]}))});return BPromise[_0xec8b[49]](_0xc3a4x1b)}});default:return null}})[_0xec8b[25]](function(_0xc3a4x19){return _0xc3a4x15[_0xec8b[37]](_0xc3a4x19?200:401)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[62]]= function(_0xc3a4x14,_0xc3a4x15,_0xc3a4x16){return Agent[_0xec8b[30]](_0xc3a4x14[_0xec8b[61]][_0xec8b[28]],{attributes:[_0xec8b[28]]})[_0xec8b[25]](function(_0xc3a4x1a){if(!_0xc3a4x1a){return _0xc3a4x15[_0xec8b[37]](401)};switch(_0xc3a4x14[_0xec8b[61]][_0xec8b[60]]){case _0xec8b[45]:return _0xc3a4x1a[_0xec8b[64]](_0xc3a4x14[_0xec8b[26]][_0xec8b[63]]);case _0xec8b[51]:return _0xc3a4x1a[_0xec8b[65]](_0xc3a4x14[_0xec8b[26]][_0xec8b[63]]);case _0xec8b[53]:return _0xc3a4x1a[_0xec8b[66]](_0xc3a4x14[_0xec8b[26]][_0xec8b[63]]);case _0xec8b[57]:return _0xc3a4x1a[_0xec8b[67]](_0xc3a4x14[_0xec8b[26]][_0xec8b[63]]);case _0xec8b[55]:return _0xc3a4x1a[_0xec8b[68]](_0xc3a4x14[_0xec8b[26]][_0xec8b[63]]);case _0xec8b[59]:return _0xc3a4x1a[_0xec8b[69]](_0xc3a4x14[_0xec8b[26]][_0xec8b[63]]);default:return null}})[_0xec8b[25]](function(_0xc3a4x19){return _0xc3a4x15[_0xec8b[37]](_0xc3a4x19?200:401)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[70]]= function(_0xc3a4x14,_0xc3a4x15,_0xc3a4x16){switch(_0xc3a4x14[_0xec8b[29]][_0xec8b[35]]){case _0xec8b[29]:return User[_0xec8b[30]](_0xc3a4x14[_0xec8b[29]][_0xec8b[28]],{attributes:[_0xec8b[28]]})[_0xec8b[25]](Util[_0xec8b[27]](_0xc3a4x14[_0xec8b[26]]))[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)});default:return Agent[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]})[_0xec8b[32]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]]))[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})}};exports[_0xec8b[75]]= function(_0xc3a4x14,_0xc3a4x15,_0xc3a4x16){switch(_0xc3a4x14[_0xec8b[29]][_0xec8b[35]]){case _0xec8b[29]:var _0xc3a4x1d=[];return User[_0xec8b[30]](_0xc3a4x14[_0xec8b[29]][_0xec8b[28]],{attributes:[_0xec8b[28]]})[_0xec8b[25]](Util[_0xec8b[80]]({},{attributes:[_0xec8b[41]],include:[{raw:true,model:User,attributes:[_0xec8b[28]]}]}))[_0xec8b[25]](function(_0xc3a4x19){var _0xc3a4x1e=_[_0xec8b[77]](_0xc3a4x19[_0xec8b[76]],_0xec8b[41]);_0xc3a4x19[_0xec8b[76]][_0xec8b[48]](function(_0xc3a4x1c){_0xc3a4x1d= _[_0xec8b[78]](_0xc3a4x1d,_[_0xec8b[77]](_0xc3a4x1c.Users,_0xec8b[28]))});return User[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]})[_0xec8b[32]](_[_0xec8b[79]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]],{id:{$in:_0xc3a4x1d}}),{include:[{model:VoiceQueue,where:{name:{$in:_0xc3a4x1e}},required:false}]}))})[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)});default:return Agent[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]})[_0xec8b[32]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]]))[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})}};exports[_0xec8b[81]]= function(_0xc3a4x14,_0xc3a4x15,_0xc3a4x16){switch(_0xc3a4x14[_0xec8b[29]][_0xec8b[35]]){case _0xec8b[29]:var _0xc3a4x1d=[];return User[_0xec8b[30]](_0xc3a4x14[_0xec8b[29]][_0xec8b[28]],{attributes:[_0xec8b[28]]})[_0xec8b[25]](Util[_0xec8b[82]]({},{attributes:[_0xec8b[28]],include:[{raw:true,model:User,attributes:[_0xec8b[28]]}]}))[_0xec8b[25]](function(_0xc3a4x19){var _0xc3a4x1f=_[_0xec8b[77]](_0xc3a4x19[_0xec8b[76]],_0xec8b[28]);_0xc3a4x19[_0xec8b[76]][_0xec8b[48]](function(_0xc3a4x1c){_0xc3a4x1d= _[_0xec8b[78]](_0xc3a4x1d,_[_0xec8b[77]](_0xc3a4x1c.Users,_0xec8b[28]))});return User[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]})[_0xec8b[32]](_[_0xec8b[79]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]],{id:{$in:_0xc3a4x1d}}),{include:[{model:ChatQueue,where:{id:{$in:_0xc3a4x1f}},required:false}]}))})[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)});default:return Agent[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]},_0xec8b[83])[_0xec8b[32]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]]))[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})}};exports[_0xec8b[84]]= function(_0xc3a4x14,_0xc3a4x15,_0xc3a4x16){switch(_0xc3a4x14[_0xec8b[29]][_0xec8b[35]]){case _0xec8b[29]:var _0xc3a4x1d=[];return User[_0xec8b[30]](_0xc3a4x14[_0xec8b[29]][_0xec8b[28]],{attributes:[_0xec8b[28]]})[_0xec8b[25]](Util[_0xec8b[85]]({},{attributes:[_0xec8b[28]],include:[{raw:true,model:User,attributes:[_0xec8b[28]]}]}))[_0xec8b[25]](function(_0xc3a4x19){var _0xc3a4x20=_[_0xec8b[77]](_0xc3a4x19[_0xec8b[76]],_0xec8b[28]);_0xc3a4x19[_0xec8b[76]][_0xec8b[48]](function(_0xc3a4x1c){_0xc3a4x1d= _[_0xec8b[78]](_0xc3a4x1d,_[_0xec8b[77]](_0xc3a4x1c.Users,_0xec8b[28]))});return User[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]})[_0xec8b[32]](_[_0xec8b[79]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]],{id:{$in:_0xc3a4x1d}}),{include:[{model:MailQueue,where:{id:{$in:_0xc3a4x20}},required:false}]}))})[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)});default:return Agent[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]},_0xec8b[83])[_0xec8b[32]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]]))[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})}};exports[_0xec8b[86]]= function(_0xc3a4x14,_0xc3a4x15,_0xc3a4x16){switch(_0xc3a4x14[_0xec8b[29]][_0xec8b[35]]){case _0xec8b[29]:var _0xc3a4x1d=[];return User[_0xec8b[30]](_0xc3a4x14[_0xec8b[29]][_0xec8b[28]],{attributes:[_0xec8b[28]]})[_0xec8b[25]](Util[_0xec8b[87]]({},{attributes:[_0xec8b[28]],include:[{raw:true,model:User,attributes:[_0xec8b[28]]}]}))[_0xec8b[25]](function(_0xc3a4x19){var _0xc3a4x21=_[_0xec8b[77]](_0xc3a4x19[_0xec8b[76]],_0xec8b[28]);_0xc3a4x19[_0xec8b[76]][_0xec8b[48]](function(_0xc3a4x1c){_0xc3a4x1d= _[_0xec8b[78]](_0xc3a4x1d,_[_0xec8b[77]](_0xc3a4x1c.Users,_0xec8b[28]))});return User[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]})[_0xec8b[32]](_[_0xec8b[79]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]],{id:{$in:_0xc3a4x1d}}),{include:[{model:FaxQueue,where:{id:{$in:_0xc3a4x21}},required:false}]}))})[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)});default:return Agent[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]},_0xec8b[83])[_0xec8b[32]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]]))[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})}};exports[_0xec8b[88]]= function(_0xc3a4x14,_0xc3a4x15,_0xc3a4x16){switch(_0xc3a4x14[_0xec8b[29]][_0xec8b[35]]){case _0xec8b[29]:var _0xc3a4x1d=[];return User[_0xec8b[30]](_0xc3a4x14[_0xec8b[29]][_0xec8b[28]],{attributes:[_0xec8b[28]]})[_0xec8b[25]](Util[_0xec8b[89]]({},{attributes:[_0xec8b[28]],include:[{raw:true,model:User,attributes:[_0xec8b[28]]}]}))[_0xec8b[25]](function(_0xc3a4x19){var _0xc3a4x22=_[_0xec8b[77]](_0xc3a4x19[_0xec8b[76]],_0xec8b[28]);_0xc3a4x19[_0xec8b[76]][_0xec8b[48]](function(_0xc3a4x1c){_0xc3a4x1d= _[_0xec8b[78]](_0xc3a4x1d,_[_0xec8b[77]](_0xc3a4x1c.Users,_0xec8b[28]))});return User[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]})[_0xec8b[32]](_[_0xec8b[79]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]],{id:{$in:_0xc3a4x1d}}),{include:[{model:SmsQueue,where:{id:{$in:_0xc3a4x22}},required:false}]}))})[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)});default:return Agent[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]},_0xec8b[83])[_0xec8b[32]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]]))[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})}};exports[_0xec8b[90]]= function(_0xc3a4x14,_0xc3a4x15,_0xc3a4x16){switch(_0xc3a4x14[_0xec8b[29]][_0xec8b[35]]){case _0xec8b[29]:var _0xc3a4x1d=[];return User[_0xec8b[30]](_0xc3a4x14[_0xec8b[29]][_0xec8b[28]],{attributes:[_0xec8b[28]]})[_0xec8b[25]](Util[_0xec8b[91]]({},{attributes:[_0xec8b[28]],include:[{raw:true,model:User,attributes:[_0xec8b[28]]}]}))[_0xec8b[25]](function(_0xc3a4x19){var _0xc3a4x23=_[_0xec8b[77]](_0xc3a4x19[_0xec8b[76]],_0xec8b[28]);_0xc3a4x19[_0xec8b[76]][_0xec8b[48]](function(_0xc3a4x1c){_0xc3a4x1d= _[_0xec8b[78]](_0xc3a4x1d,_[_0xec8b[77]](_0xc3a4x1c.Users,_0xec8b[28]))});return User[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]})[_0xec8b[32]](_[_0xec8b[79]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]],{id:{$in:_0xc3a4x1d}}),{include:[{model:OpenchannelQueue,where:{id:{$in:_0xc3a4x23}},required:false}]}))})[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)});default:return Agent[_0xec8b[34]](_0xec8b[33],{method:[_0xec8b[71],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[72],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[73],_0xc3a4x14[_0xec8b[26]]]},{method:[_0xec8b[74],_0xc3a4x14[_0xec8b[26]]]},_0xec8b[83])[_0xec8b[32]](Util[_0xec8b[31]](_0xc3a4x14[_0xec8b[26]]))[_0xec8b[25]](function(_0xc3a4x18){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x18)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})}};exports[_0xec8b[92]]= function(_0xc3a4x14,_0xc3a4x15){return Agent[_0xec8b[34]](_0xec8b[33])[_0xec8b[30]](_0xc3a4x14[_0xec8b[61]][_0xec8b[28]])[_0xec8b[25]](function(_0xc3a4x1a){if(!_0xc3a4x1a){return _0xc3a4x15[_0xec8b[37]](404)};return _0xc3a4x15[_0xec8b[23]](_0xc3a4x1a)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[93]]= function(_0xc3a4x14,_0xc3a4x15){return Agent[_0xec8b[34]](_0xec8b[33])[_0xec8b[30]](_0xc3a4x14[_0xec8b[61]][_0xec8b[28]])[_0xec8b[25]](function(_0xc3a4x1a){if(!_0xc3a4x1a){return _0xc3a4x15[_0xec8b[37]](404)};return _0xc3a4x1a[_0xec8b[95]]({attributes:[_0xec8b[41]]})})[_0xec8b[25]](function(_0xc3a4x1e){return _0xc3a4x15[_0xec8b[23]]({count:_0xc3a4x1e[_0xec8b[94]],rows:_0xc3a4x1e})})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[96]]= function(_0xc3a4x14,_0xc3a4x15){return Agent[_0xec8b[34]](_0xec8b[33])[_0xec8b[30]](_0xc3a4x14[_0xec8b[61]][_0xec8b[28]])[_0xec8b[25]](function(_0xc3a4x1a){if(!_0xc3a4x1a){return _0xc3a4x15[_0xec8b[37]](404)};return _0xc3a4x1a[_0xec8b[97]]({attributes:[_0xec8b[28]]})})[_0xec8b[25]](function(_0xc3a4x1f){return _0xc3a4x15[_0xec8b[23]]({count:_0xc3a4x1f[_0xec8b[94]],rows:_0xc3a4x1f})})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[98]]= function(_0xc3a4x14,_0xc3a4x15){return Agent[_0xec8b[34]](_0xec8b[33])[_0xec8b[30]](_0xc3a4x14[_0xec8b[61]][_0xec8b[28]])[_0xec8b[25]](function(_0xc3a4x1a){if(!_0xc3a4x1a){return _0xc3a4x15[_0xec8b[37]](404)};return _0xc3a4x1a[_0xec8b[99]]({attributes:[_0xec8b[28]]})})[_0xec8b[25]](function(_0xc3a4x20){return _0xc3a4x15[_0xec8b[23]]({count:_0xc3a4x20[_0xec8b[94]],rows:_0xc3a4x20})})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[100]]= function(_0xc3a4x14,_0xc3a4x15){return Agent[_0xec8b[34]](_0xec8b[33])[_0xec8b[30]](_0xc3a4x14[_0xec8b[61]][_0xec8b[28]])[_0xec8b[25]](function(_0xc3a4x1a){if(!_0xc3a4x1a){return _0xc3a4x15[_0xec8b[37]](404)};return _0xc3a4x1a[_0xec8b[101]]({attributes:[_0xec8b[28]]})})[_0xec8b[25]](function(_0xc3a4x21){return _0xc3a4x15[_0xec8b[23]]({count:_0xc3a4x21[_0xec8b[94]],rows:_0xc3a4x21})})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[102]]= function(_0xc3a4x14,_0xc3a4x15){return Agent[_0xec8b[34]](_0xec8b[33])[_0xec8b[30]](_0xc3a4x14[_0xec8b[61]][_0xec8b[28]])[_0xec8b[25]](function(_0xc3a4x1a){if(!_0xc3a4x1a){return _0xc3a4x15[_0xec8b[37]](404)};return _0xc3a4x1a[_0xec8b[103]]({attributes:[_0xec8b[28]]})})[_0xec8b[25]](function(_0xc3a4x22){return _0xc3a4x15[_0xec8b[23]]({count:_0xc3a4x22[_0xec8b[94]],rows:_0xc3a4x22})})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[104]]= function(_0xc3a4x14,_0xc3a4x15){return Agent[_0xec8b[34]](_0xec8b[33])[_0xec8b[30]](_0xc3a4x14[_0xec8b[61]][_0xec8b[28]])[_0xec8b[25]](function(_0xc3a4x1a){if(!_0xc3a4x1a){return _0xc3a4x15[_0xec8b[37]](404)};return _0xc3a4x1a[_0xec8b[105]]({attributes:[_0xec8b[28]]})})[_0xec8b[25]](function(_0xc3a4x24){return _0xc3a4x15[_0xec8b[23]]({count:_0xc3a4x24[_0xec8b[94]],rows:_0xc3a4x24})})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[106]]= function(_0xc3a4x14,_0xc3a4x15){var _0xc3a4x25;_0xc3a4x14[_0xec8b[39]][_0xec8b[35]]= _0xec8b[33];return sequelize[_0xec8b[116]](function(_0xc3a4x26){return Setting[_0xec8b[30]](1)[_0xec8b[25]](function(_0xc3a4x28){var _0xc3a4x29=String(_0xc3a4x14[_0xec8b[39]][_0xec8b[112]]);var _0xc3a4x2a=_0xc3a4x28[_0xec8b[113]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0xc3a4x2a[_0xec8b[114]](_0xc3a4x29)){throw  new Error(_0xec8b[115])};return Agent[_0xec8b[34]](_0xec8b[33])[_0xec8b[106]](_0xc3a4x14[_0xec8b[39]],{transaction:_0xc3a4x26})})[_0xec8b[25]](userTools[_0xec8b[111]]({transaction:_0xc3a4x26}))[_0xec8b[25]](function(_0xc3a4x1a){_0xc3a4x25= _0xc3a4x1a;return Team[_0xec8b[110]]({where:{defaultEntry:true}})})[_0xec8b[25]](function(_0xc3a4x27){return _0xc3a4x27[_0xec8b[109]](_0xc3a4x25[_0xec8b[28]],{transaction:_0xc3a4x26})})})[_0xec8b[25]](function(){return _0xc3a4x15[_0xec8b[24]](201)[_0xec8b[23]](_0xc3a4x25)})[_0xec8b[22]](sequelize.UniqueConstraintError,function(_0xc3a4x17){return Util[_0xec8b[108]][_0xec8b[107]](_0xc3a4x15,_0xc3a4x17)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[117]]= function(_0xc3a4x14,_0xc3a4x15){var _0xc3a4x2b;var _0xc3a4x2c;var _0xc3a4x2d=[];var _0xc3a4x29=String(_0xc3a4x14[_0xec8b[39]][_0xec8b[112]]);return sequelize[_0xec8b[116]](function(_0xc3a4x26){return Setting[_0xec8b[30]](1)[_0xec8b[25]](function(_0xc3a4x28){_0xc3a4x2c= _0xc3a4x28;var _0xc3a4x2a=_0xc3a4x2c[_0xec8b[113]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^[a-zA-Z0-9]{6,}$/;if(!_0xc3a4x2a[_0xec8b[114]](_0xc3a4x29)){throw  new Error(_0xec8b[119])};var _0xc3a4x2e=0;if(_0xc3a4x14[_0xec8b[39]][_0xec8b[121]](_0xec8b[120])&& _[_0xec8b[122]](_0xc3a4x14[_0xec8b[39]][_0xec8b[120]])&& _0xc3a4x14[_0xec8b[39]][_0xec8b[120]]>= 0){_0xc3a4x2e= _0xc3a4x14[_0xec8b[39]][_0xec8b[120]];delete _0xc3a4x14[_0xec8b[39]][_0xec8b[120]]};var _0xc3a4x2f=_0xc3a4x14[_0xec8b[39]][_0xec8b[123]];delete _0xc3a4x14[_0xec8b[39]][_0xec8b[123]];if(_0xc3a4x14[_0xec8b[39]][_0xec8b[124]]){_0xc3a4x14[_0xec8b[39]][_0xec8b[35]]= _0xec8b[33];for(var _0xc3a4x30=_0xc3a4x2e;_0xc3a4x30< _0xc3a4x14[_0xec8b[39]][_0xec8b[124]]+ _0xc3a4x2e;_0xc3a4x30++,_0xc3a4x2f++){var _0xc3a4x31=_[_0xec8b[125]](_0xc3a4x14[_0xec8b[39]]);_0xc3a4x31[_0xec8b[126]]= _0xc3a4x2f;_0xc3a4x31[_0xec8b[41]]= _0xc3a4x31[_0xec8b[41]]+ _0xc3a4x30;_0xc3a4x31[_0xec8b[127]]= _0xc3a4x31[_0xec8b[127]]+ _0xc3a4x30;_0xc3a4x31[_0xec8b[128]]= _0xc3a4x31[_0xec8b[128]][_0xec8b[130]](_0xec8b[129])[0]+ _0xc3a4x30+ _0xec8b[129]+ _0xc3a4x31[_0xec8b[128]][_0xec8b[130]](_0xec8b[129])[1];_0xc3a4x2d[_0xec8b[47]](_0xc3a4x31)}}else {throw  new Error(_0xec8b[131])};return Agent[_0xec8b[117]](_0xc3a4x2d,{transaction:_0xc3a4x26,individualHooks:true})})[_0xec8b[25]](function(_0xc3a4x1d){_0xc3a4x2b= _0xc3a4x1d;return Team[_0xec8b[110]]({where:{defaultEntry:true}})})[_0xec8b[25]](function(_0xc3a4x27){return _0xc3a4x27[_0xec8b[118]](_[_0xec8b[77]](_0xc3a4x2b,_0xec8b[28]),{transaction:_0xc3a4x26})})})[_0xec8b[25]](function(){return _0xc3a4x15[_0xec8b[37]](201)})[_0xec8b[22]](sequelize.UniqueConstraintError,function(_0xc3a4x17){return Util[_0xec8b[108]][_0xec8b[107]](_0xc3a4x15,_0xc3a4x17)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[132]]= function(_0xc3a4x14,_0xc3a4x15){if(_0xc3a4x14[_0xec8b[39]][_0xec8b[28]]){delete _0xc3a4x14[_0xec8b[39]][_0xec8b[28]]};delete _0xc3a4x14[_0xec8b[39]][_0xec8b[126]];delete _0xc3a4x14[_0xec8b[39]][_0xec8b[35]];delete _0xc3a4x14[_0xec8b[39]][_0xec8b[41]];delete _0xc3a4x14[_0xec8b[39]][_0xec8b[112]];var _0xc3a4x25;return sequelize[_0xec8b[116]](function(_0xc3a4x26){return Agent[_0xec8b[30]](_0xc3a4x14[_0xec8b[61]][_0xec8b[28]])[_0xec8b[25]](function(_0xc3a4x1a){if(!_0xc3a4x1a){return _0xc3a4x15[_0xec8b[37]](404)};var _0xc3a4x32=_[_0xec8b[79]](_0xc3a4x1a,_0xc3a4x14[_0xec8b[39]]);return _0xc3a4x32[_0xec8b[134]]({transaction:_0xc3a4x26})})[_0xec8b[25]](function(_0xc3a4x1a){_0xc3a4x25= _0xc3a4x1a;return _0xc3a4x1a})[_0xec8b[25]](userTools[_0xec8b[133]]({transaction:_0xc3a4x26}))[_0xec8b[25]](function(){return _0xc3a4x15[_0xec8b[24]](200)[_0xec8b[23]](_0xc3a4x25)})})[_0xec8b[22]](sequelize.UniqueConstraintError,function(_0xc3a4x17){return Util[_0xec8b[108]][_0xec8b[107]](_0xc3a4x15,_0xc3a4x17)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[135]]= function(_0xc3a4x14,_0xc3a4x15){var _0xc3a4x25;return Agent[_0xec8b[30]](_0xc3a4x14[_0xec8b[61]][_0xec8b[28]])[_0xec8b[25]](function(_0xc3a4x1a){_0xc3a4x25= _0xc3a4x1a;if(!_0xc3a4x1a){return _0xc3a4x15[_0xec8b[37]](404)};return _0xc3a4x1a[_0xec8b[135]]()})[_0xec8b[25]](function(){return _0xc3a4x15[_0xec8b[37]](204)})[_0xec8b[22]](sequelize.ForeignKeyConstraintError,function(_0xc3a4x17){return Util[_0xec8b[108]][_0xec8b[136]](_0xc3a4x15,_0xec8b[33],_0xc3a4x25[_0xec8b[41]],_0xc3a4x17)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};exports[_0xec8b[137]]= function(_0xc3a4x14,_0xc3a4x15){return Agent[_0xec8b[135]]({where:{id:_0xc3a4x14[_0xec8b[26]][_0xec8b[63]]},individualHooks:true})[_0xec8b[25]](function(){return _0xc3a4x15[_0xec8b[37]](204)})[_0xec8b[22]](function(_0xc3a4x17){return handleError(_0xc3a4x15,_0xc3a4x17)})};function handleError(_0xc3a4x15,_0xc3a4x17){logger[_0xec8b[139]](_0xc3a4x17[_0xec8b[138]]);return _0xc3a4x15[_0xec8b[24]](500)[_0xec8b[23]](_0xc3a4x17)}
\ No newline at end of file
+var _0x389e=["\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"];_0x389e[0];var _=require(_0x389e[1]);var sequelize=require(_0x389e[3])[_0x389e[2]];var BPromise=require(_0x389e[4]);var util=require(_0x389e[5]);var Util=require(_0x389e[6]);var userTools=require(_0x389e[7]);var logger=require(_0x389e[9])(_0x389e[8]);var OpenchannelQueue=require(_0x389e[3])[_0x389e[10]];var VoiceQueue=require(_0x389e[3])[_0x389e[11]];var ChatQueue=require(_0x389e[3])[_0x389e[12]];var MailQueue=require(_0x389e[3])[_0x389e[13]];var FaxQueue=require(_0x389e[3])[_0x389e[14]];var SmsQueue=require(_0x389e[3])[_0x389e[15]];var MailRoom=require(_0x389e[3])[_0x389e[16]];var Setting=require(_0x389e[3])[_0x389e[17]];var Agent=require(_0x389e[3])[_0x389e[18]];var User=require(_0x389e[3])[_0x389e[18]];var Team=require(_0x389e[3])[_0x389e[19]];var List=require(_0x389e[3])[_0x389e[20]];exports[_0x389e[21]]= function(_0xfa13x14,_0xfa13x15,_0xfa13x16){switch(_0xfa13x14[_0x389e[29]][_0x389e[35]]){case _0x389e[29]:return User[_0x389e[30]](_0xfa13x14[_0x389e[29]][_0x389e[28]],{attributes:[_0x389e[28]]})[_0x389e[25]](Util[_0x389e[27]](_0xfa13x14[_0x389e[26]]))[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)});default:return Agent[_0x389e[34]](_0x389e[33])[_0x389e[32]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]]))[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})}};exports[_0x389e[36]]= function(_0xfa13x14,_0xfa13x15,_0xfa13x16){return Agent[_0x389e[30]](_0xfa13x14[_0x389e[61]][_0x389e[28]],{attributes:[_0x389e[28],_0x389e[41]]})[_0x389e[25]](function(_0xfa13x1a){if(!_0xfa13x1a){return _0xfa13x15[_0x389e[37]](401)};switch(_0xfa13x14[_0x389e[61]][_0x389e[60]]){case _0x389e[45]:return _0xfa13x1a[_0x389e[44]](_0xfa13x14[_0x389e[39]][_0x389e[38]],{interface:util[_0x389e[42]](_0x389e[40],_0xfa13x1a[_0x389e[41]]),stateinterface:util[_0x389e[42]](_0x389e[40],_0xfa13x1a[_0x389e[41]]),membername:_0xfa13x1a[_0x389e[41]],UserId:_0xfa13x1a[_0x389e[28]],penalty:_0xfa13x14[_0x389e[39]][_0x389e[43]]});case _0x389e[51]:return ChatQueue[_0x389e[50]]({where:{id:_0xfa13x14[_0x389e[39]][_0x389e[38]]},attributes:[_0x389e[28],_0x389e[41]],raw:true})[_0x389e[25]](function(_0xfa13x19){if(_0xfa13x19){var _0xfa13x1b=[];_[_0x389e[48]](_0xfa13x19,function(_0xfa13x1c){_0xfa13x1b[_0x389e[47]](_0xfa13x1a[_0x389e[46]](_0xfa13x1c[_0x389e[28]],{queue:_0xfa13x1c[_0x389e[41]],penalty:_0xfa13x14[_0x389e[39]][_0x389e[43]]}))});return BPromise[_0x389e[49]](_0xfa13x1b)}});case _0x389e[53]:return MailQueue[_0x389e[50]]({where:{id:_0xfa13x14[_0x389e[39]][_0x389e[38]]},attributes:[_0x389e[28],_0x389e[41]],raw:true})[_0x389e[25]](function(_0xfa13x19){if(_0xfa13x19){var _0xfa13x1b=[];_[_0x389e[48]](_0xfa13x19,function(_0xfa13x1c){_0xfa13x1b[_0x389e[47]](_0xfa13x1a[_0x389e[52]](_0xfa13x1c[_0x389e[28]],{queue:_0xfa13x1c[_0x389e[41]],penalty:_0xfa13x14[_0x389e[39]][_0x389e[43]]}))});return BPromise[_0x389e[49]](_0xfa13x1b)}});case _0x389e[55]:return FaxQueue[_0x389e[50]]({where:{id:_0xfa13x14[_0x389e[39]][_0x389e[38]]},attributes:[_0x389e[28],_0x389e[41]],raw:true})[_0x389e[25]](function(_0xfa13x19){if(_0xfa13x19){var _0xfa13x1b=[];_[_0x389e[48]](_0xfa13x19,function(_0xfa13x1c){_0xfa13x1b[_0x389e[47]](_0xfa13x1a[_0x389e[54]](_0xfa13x1c[_0x389e[28]],{queue:_0xfa13x1c[_0x389e[41]],penalty:_0xfa13x14[_0x389e[39]][_0x389e[43]]}))});return BPromise[_0x389e[49]](_0xfa13x1b)}});case _0x389e[57]:return SmsQueue[_0x389e[50]]({where:{id:_0xfa13x14[_0x389e[39]][_0x389e[38]]},attributes:[_0x389e[28],_0x389e[41]],raw:true})[_0x389e[25]](function(_0xfa13x19){if(_0xfa13x19){var _0xfa13x1b=[];_[_0x389e[48]](_0xfa13x19,function(_0xfa13x1c){_0xfa13x1b[_0x389e[47]](_0xfa13x1a[_0x389e[56]](_0xfa13x1c[_0x389e[28]],{queue:_0xfa13x1c[_0x389e[41]],penalty:_0xfa13x14[_0x389e[39]][_0x389e[43]]}))});return BPromise[_0x389e[49]](_0xfa13x1b)}});case _0x389e[59]:return OpenchannelQueue[_0x389e[50]]({where:{id:_0xfa13x14[_0x389e[39]][_0x389e[38]]},attributes:[_0x389e[28],_0x389e[41]],raw:true})[_0x389e[25]](function(_0xfa13x19){if(_0xfa13x19){var _0xfa13x1b=[];_[_0x389e[48]](_0xfa13x19,function(_0xfa13x1c){_0xfa13x1b[_0x389e[47]](_0xfa13x1a[_0x389e[58]](_0xfa13x1c[_0x389e[28]],{queue:_0xfa13x1c[_0x389e[41]],penalty:_0xfa13x14[_0x389e[39]][_0x389e[43]]}))});return BPromise[_0x389e[49]](_0xfa13x1b)}});default:return null}})[_0x389e[25]](function(_0xfa13x19){return _0xfa13x15[_0x389e[37]](_0xfa13x19?200:401)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[62]]= function(_0xfa13x14,_0xfa13x15,_0xfa13x16){return Agent[_0x389e[30]](_0xfa13x14[_0x389e[61]][_0x389e[28]],{attributes:[_0x389e[28]]})[_0x389e[25]](function(_0xfa13x1a){if(!_0xfa13x1a){return _0xfa13x15[_0x389e[37]](401)};switch(_0xfa13x14[_0x389e[61]][_0x389e[60]]){case _0x389e[45]:return _0xfa13x1a[_0x389e[64]](_0xfa13x14[_0x389e[26]][_0x389e[63]]);case _0x389e[51]:return _0xfa13x1a[_0x389e[65]](_0xfa13x14[_0x389e[26]][_0x389e[63]]);case _0x389e[53]:return _0xfa13x1a[_0x389e[66]](_0xfa13x14[_0x389e[26]][_0x389e[63]]);case _0x389e[57]:return _0xfa13x1a[_0x389e[67]](_0xfa13x14[_0x389e[26]][_0x389e[63]]);case _0x389e[55]:return _0xfa13x1a[_0x389e[68]](_0xfa13x14[_0x389e[26]][_0x389e[63]]);case _0x389e[59]:return _0xfa13x1a[_0x389e[69]](_0xfa13x14[_0x389e[26]][_0x389e[63]]);default:return null}})[_0x389e[25]](function(_0xfa13x19){return _0xfa13x15[_0x389e[37]](_0xfa13x19?200:401)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[70]]= function(_0xfa13x14,_0xfa13x15,_0xfa13x16){switch(_0xfa13x14[_0x389e[29]][_0x389e[35]]){case _0x389e[29]:return User[_0x389e[30]](_0xfa13x14[_0x389e[29]][_0x389e[28]],{attributes:[_0x389e[28]]})[_0x389e[25]](Util[_0x389e[27]](_0xfa13x14[_0x389e[26]]))[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)});default:return Agent[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]})[_0x389e[32]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]]))[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})}};exports[_0x389e[75]]= function(_0xfa13x14,_0xfa13x15,_0xfa13x16){switch(_0xfa13x14[_0x389e[29]][_0x389e[35]]){case _0x389e[29]:var _0xfa13x1d=[];return User[_0x389e[30]](_0xfa13x14[_0x389e[29]][_0x389e[28]],{attributes:[_0x389e[28]]})[_0x389e[25]](Util[_0x389e[80]]({},{attributes:[_0x389e[41]],include:[{raw:true,model:User,attributes:[_0x389e[28]]}]}))[_0x389e[25]](function(_0xfa13x19){var _0xfa13x1e=_[_0x389e[77]](_0xfa13x19[_0x389e[76]],_0x389e[41]);_0xfa13x19[_0x389e[76]][_0x389e[48]](function(_0xfa13x1c){_0xfa13x1d= _[_0x389e[78]](_0xfa13x1d,_[_0x389e[77]](_0xfa13x1c.Users,_0x389e[28]))});return User[_0x389e[34]](_0x389e[33],{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]})[_0x389e[32]](_[_0x389e[79]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]],{id:{$in:_0xfa13x1d}}),{include:[{model:VoiceQueue,where:{name:{$in:_0xfa13x1e}},required:false}]}))})[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)});default:return Agent[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]})[_0x389e[32]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]]))[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})}};exports[_0x389e[81]]= function(_0xfa13x14,_0xfa13x15,_0xfa13x16){switch(_0xfa13x14[_0x389e[29]][_0x389e[35]]){case _0x389e[29]:var _0xfa13x1d=[];return User[_0x389e[30]](_0xfa13x14[_0x389e[29]][_0x389e[28]],{attributes:[_0x389e[28]]})[_0x389e[25]](Util[_0x389e[82]]({},{attributes:[_0x389e[28]],include:[{raw:true,model:User,attributes:[_0x389e[28]]}]}))[_0x389e[25]](function(_0xfa13x19){var _0xfa13x1f=_[_0x389e[77]](_0xfa13x19[_0x389e[76]],_0x389e[28]);_0xfa13x19[_0x389e[76]][_0x389e[48]](function(_0xfa13x1c){_0xfa13x1d= _[_0x389e[78]](_0xfa13x1d,_[_0x389e[77]](_0xfa13x1c.Users,_0x389e[28]))});return User[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]})[_0x389e[32]](_[_0x389e[79]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]],{id:{$in:_0xfa13x1d}}),{include:[{model:ChatQueue,where:{id:{$in:_0xfa13x1f}},required:false}]}))})[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)});default:return Agent[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]},_0x389e[83])[_0x389e[32]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]]))[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})}};exports[_0x389e[84]]= function(_0xfa13x14,_0xfa13x15,_0xfa13x16){switch(_0xfa13x14[_0x389e[29]][_0x389e[35]]){case _0x389e[29]:var _0xfa13x1d=[];return User[_0x389e[30]](_0xfa13x14[_0x389e[29]][_0x389e[28]],{attributes:[_0x389e[28]]})[_0x389e[25]](Util[_0x389e[85]]({},{attributes:[_0x389e[28]],include:[{raw:true,model:User,attributes:[_0x389e[28]]}]}))[_0x389e[25]](function(_0xfa13x19){var _0xfa13x20=_[_0x389e[77]](_0xfa13x19[_0x389e[76]],_0x389e[28]);_0xfa13x19[_0x389e[76]][_0x389e[48]](function(_0xfa13x1c){_0xfa13x1d= _[_0x389e[78]](_0xfa13x1d,_[_0x389e[77]](_0xfa13x1c.Users,_0x389e[28]))});return User[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]})[_0x389e[32]](_[_0x389e[79]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]],{id:{$in:_0xfa13x1d}}),{include:[{model:MailQueue,where:{id:{$in:_0xfa13x20}},required:false}]}))})[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)});default:return Agent[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]},_0x389e[83])[_0x389e[32]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]]))[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})}};exports[_0x389e[86]]= function(_0xfa13x14,_0xfa13x15,_0xfa13x16){switch(_0xfa13x14[_0x389e[29]][_0x389e[35]]){case _0x389e[29]:var _0xfa13x1d=[];return User[_0x389e[30]](_0xfa13x14[_0x389e[29]][_0x389e[28]],{attributes:[_0x389e[28]]})[_0x389e[25]](Util[_0x389e[87]]({},{attributes:[_0x389e[28]],include:[{raw:true,model:User,attributes:[_0x389e[28]]}]}))[_0x389e[25]](function(_0xfa13x19){var _0xfa13x21=_[_0x389e[77]](_0xfa13x19[_0x389e[76]],_0x389e[28]);_0xfa13x19[_0x389e[76]][_0x389e[48]](function(_0xfa13x1c){_0xfa13x1d= _[_0x389e[78]](_0xfa13x1d,_[_0x389e[77]](_0xfa13x1c.Users,_0x389e[28]))});return User[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]})[_0x389e[32]](_[_0x389e[79]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]],{id:{$in:_0xfa13x1d}}),{include:[{model:FaxQueue,where:{id:{$in:_0xfa13x21}},required:false}]}))})[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)});default:return Agent[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]},_0x389e[83])[_0x389e[32]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]]))[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})}};exports[_0x389e[88]]= function(_0xfa13x14,_0xfa13x15,_0xfa13x16){switch(_0xfa13x14[_0x389e[29]][_0x389e[35]]){case _0x389e[29]:var _0xfa13x1d=[];return User[_0x389e[30]](_0xfa13x14[_0x389e[29]][_0x389e[28]],{attributes:[_0x389e[28]]})[_0x389e[25]](Util[_0x389e[89]]({},{attributes:[_0x389e[28]],include:[{raw:true,model:User,attributes:[_0x389e[28]]}]}))[_0x389e[25]](function(_0xfa13x19){var _0xfa13x22=_[_0x389e[77]](_0xfa13x19[_0x389e[76]],_0x389e[28]);_0xfa13x19[_0x389e[76]][_0x389e[48]](function(_0xfa13x1c){_0xfa13x1d= _[_0x389e[78]](_0xfa13x1d,_[_0x389e[77]](_0xfa13x1c.Users,_0x389e[28]))});return User[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]})[_0x389e[32]](_[_0x389e[79]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]],{id:{$in:_0xfa13x1d}}),{include:[{model:SmsQueue,where:{id:{$in:_0xfa13x22}},required:false}]}))})[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)});default:return Agent[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]},_0x389e[83])[_0x389e[32]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]]))[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})}};exports[_0x389e[90]]= function(_0xfa13x14,_0xfa13x15,_0xfa13x16){switch(_0xfa13x14[_0x389e[29]][_0x389e[35]]){case _0x389e[29]:var _0xfa13x1d=[];return User[_0x389e[30]](_0xfa13x14[_0x389e[29]][_0x389e[28]],{attributes:[_0x389e[28]]})[_0x389e[25]](Util[_0x389e[91]]({},{attributes:[_0x389e[28]],include:[{raw:true,model:User,attributes:[_0x389e[28]]}]}))[_0x389e[25]](function(_0xfa13x19){var _0xfa13x23=_[_0x389e[77]](_0xfa13x19[_0x389e[76]],_0x389e[28]);_0xfa13x19[_0x389e[76]][_0x389e[48]](function(_0xfa13x1c){_0xfa13x1d= _[_0x389e[78]](_0xfa13x1d,_[_0x389e[77]](_0xfa13x1c.Users,_0x389e[28]))});return User[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]})[_0x389e[32]](_[_0x389e[79]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]],{id:{$in:_0xfa13x1d}}),{include:[{model:OpenchannelQueue,where:{id:{$in:_0xfa13x23}},required:false}]}))})[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)});default:return Agent[_0x389e[34]](_0x389e[33],{method:[_0x389e[71],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[72],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[73],_0xfa13x14[_0x389e[26]]]},{method:[_0x389e[74],_0xfa13x14[_0x389e[26]]]},_0x389e[83])[_0x389e[32]](Util[_0x389e[31]](_0xfa13x14[_0x389e[26]]))[_0x389e[25]](function(_0xfa13x18){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x18)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})}};exports[_0x389e[92]]= function(_0xfa13x14,_0xfa13x15){return Agent[_0x389e[34]](_0x389e[33])[_0x389e[30]](_0xfa13x14[_0x389e[61]][_0x389e[28]])[_0x389e[25]](function(_0xfa13x1a){if(!_0xfa13x1a){return _0xfa13x15[_0x389e[37]](404)};return _0xfa13x15[_0x389e[23]](_0xfa13x1a)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[93]]= function(_0xfa13x14,_0xfa13x15){return Agent[_0x389e[34]](_0x389e[33])[_0x389e[30]](_0xfa13x14[_0x389e[61]][_0x389e[28]])[_0x389e[25]](function(_0xfa13x1a){if(!_0xfa13x1a){return _0xfa13x15[_0x389e[37]](404)};return _0xfa13x1a[_0x389e[95]]({attributes:[_0x389e[41]]})})[_0x389e[25]](function(_0xfa13x1e){return _0xfa13x15[_0x389e[23]]({count:_0xfa13x1e[_0x389e[94]],rows:_0xfa13x1e})})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[96]]= function(_0xfa13x14,_0xfa13x15){return Agent[_0x389e[34]](_0x389e[33])[_0x389e[30]](_0xfa13x14[_0x389e[61]][_0x389e[28]])[_0x389e[25]](function(_0xfa13x1a){if(!_0xfa13x1a){return _0xfa13x15[_0x389e[37]](404)};return _0xfa13x1a[_0x389e[97]]({attributes:[_0x389e[28]]})})[_0x389e[25]](function(_0xfa13x1f){return _0xfa13x15[_0x389e[23]]({count:_0xfa13x1f[_0x389e[94]],rows:_0xfa13x1f})})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[98]]= function(_0xfa13x14,_0xfa13x15){return Agent[_0x389e[34]](_0x389e[33])[_0x389e[30]](_0xfa13x14[_0x389e[61]][_0x389e[28]])[_0x389e[25]](function(_0xfa13x1a){if(!_0xfa13x1a){return _0xfa13x15[_0x389e[37]](404)};return _0xfa13x1a[_0x389e[99]]({attributes:[_0x389e[28]]})})[_0x389e[25]](function(_0xfa13x20){return _0xfa13x15[_0x389e[23]]({count:_0xfa13x20[_0x389e[94]],rows:_0xfa13x20})})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[100]]= function(_0xfa13x14,_0xfa13x15){return Agent[_0x389e[34]](_0x389e[33])[_0x389e[30]](_0xfa13x14[_0x389e[61]][_0x389e[28]])[_0x389e[25]](function(_0xfa13x1a){if(!_0xfa13x1a){return _0xfa13x15[_0x389e[37]](404)};return _0xfa13x1a[_0x389e[101]]({attributes:[_0x389e[28]]})})[_0x389e[25]](function(_0xfa13x21){return _0xfa13x15[_0x389e[23]]({count:_0xfa13x21[_0x389e[94]],rows:_0xfa13x21})})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[102]]= function(_0xfa13x14,_0xfa13x15){return Agent[_0x389e[34]](_0x389e[33])[_0x389e[30]](_0xfa13x14[_0x389e[61]][_0x389e[28]])[_0x389e[25]](function(_0xfa13x1a){if(!_0xfa13x1a){return _0xfa13x15[_0x389e[37]](404)};return _0xfa13x1a[_0x389e[103]]({attributes:[_0x389e[28]]})})[_0x389e[25]](function(_0xfa13x22){return _0xfa13x15[_0x389e[23]]({count:_0xfa13x22[_0x389e[94]],rows:_0xfa13x22})})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[104]]= function(_0xfa13x14,_0xfa13x15){return Agent[_0x389e[34]](_0x389e[33])[_0x389e[30]](_0xfa13x14[_0x389e[61]][_0x389e[28]])[_0x389e[25]](function(_0xfa13x1a){if(!_0xfa13x1a){return _0xfa13x15[_0x389e[37]](404)};return _0xfa13x1a[_0x389e[105]]({attributes:[_0x389e[28]]})})[_0x389e[25]](function(_0xfa13x24){return _0xfa13x15[_0x389e[23]]({count:_0xfa13x24[_0x389e[94]],rows:_0xfa13x24})})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[106]]= function(_0xfa13x14,_0xfa13x15){var _0xfa13x25;_0xfa13x14[_0x389e[39]][_0x389e[35]]= _0x389e[33];return sequelize[_0x389e[116]](function(_0xfa13x26){return Setting[_0x389e[30]](1)[_0x389e[25]](function(_0xfa13x28){var _0xfa13x29=String(_0xfa13x14[_0x389e[39]][_0x389e[112]]);var _0xfa13x2a=_0xfa13x28[_0x389e[113]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0xfa13x2a[_0x389e[114]](_0xfa13x29)){throw  new Error(_0x389e[115])};return Agent[_0x389e[34]](_0x389e[33])[_0x389e[106]](_0xfa13x14[_0x389e[39]],{transaction:_0xfa13x26})})[_0x389e[25]](userTools[_0x389e[111]]({transaction:_0xfa13x26}))[_0x389e[25]](function(_0xfa13x1a){_0xfa13x25= _0xfa13x1a;return Team[_0x389e[110]]({where:{defaultEntry:true}})})[_0x389e[25]](function(_0xfa13x27){return _0xfa13x27[_0x389e[109]](_0xfa13x25[_0x389e[28]],{transaction:_0xfa13x26})})})[_0x389e[25]](function(){return _0xfa13x15[_0x389e[24]](201)[_0x389e[23]](_0xfa13x25)})[_0x389e[22]](sequelize.UniqueConstraintError,function(_0xfa13x17){return Util[_0x389e[108]][_0x389e[107]](_0xfa13x15,_0xfa13x17)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[117]]= function(_0xfa13x14,_0xfa13x15){var _0xfa13x2b;var _0xfa13x2c;var _0xfa13x2d=[];var _0xfa13x29=String(_0xfa13x14[_0x389e[39]][_0x389e[112]]);return sequelize[_0x389e[116]](function(_0xfa13x26){return Setting[_0x389e[30]](1)[_0x389e[25]](function(_0xfa13x28){_0xfa13x2c= _0xfa13x28;var _0xfa13x2a=_0xfa13x2c[_0x389e[113]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^[a-zA-Z0-9]{6,}$/;if(!_0xfa13x2a[_0x389e[114]](_0xfa13x29)){throw  new Error(_0x389e[119])};var _0xfa13x2e=0;if(_0xfa13x14[_0x389e[39]][_0x389e[121]](_0x389e[120])&& _[_0x389e[122]](_0xfa13x14[_0x389e[39]][_0x389e[120]])&& _0xfa13x14[_0x389e[39]][_0x389e[120]]>= 0){_0xfa13x2e= _0xfa13x14[_0x389e[39]][_0x389e[120]];delete _0xfa13x14[_0x389e[39]][_0x389e[120]]};var _0xfa13x2f=_0xfa13x14[_0x389e[39]][_0x389e[123]];delete _0xfa13x14[_0x389e[39]][_0x389e[123]];if(_0xfa13x14[_0x389e[39]][_0x389e[124]]){_0xfa13x14[_0x389e[39]][_0x389e[35]]= _0x389e[33];for(var _0xfa13x30=_0xfa13x2e;_0xfa13x30< _0xfa13x14[_0x389e[39]][_0x389e[124]]+ _0xfa13x2e;_0xfa13x30++,_0xfa13x2f++){var _0xfa13x31=_[_0x389e[125]](_0xfa13x14[_0x389e[39]]);_0xfa13x31[_0x389e[126]]= _0xfa13x2f;_0xfa13x31[_0x389e[41]]= _0xfa13x31[_0x389e[41]]+ _0xfa13x30;_0xfa13x31[_0x389e[127]]= _0xfa13x31[_0x389e[127]]+ _0xfa13x30;_0xfa13x31[_0x389e[128]]= _0xfa13x31[_0x389e[128]][_0x389e[130]](_0x389e[129])[0]+ _0xfa13x30+ _0x389e[129]+ _0xfa13x31[_0x389e[128]][_0x389e[130]](_0x389e[129])[1];_0xfa13x2d[_0x389e[47]](_0xfa13x31)}}else {throw  new Error(_0x389e[131])};return Agent[_0x389e[117]](_0xfa13x2d,{transaction:_0xfa13x26,individualHooks:true})})[_0x389e[25]](function(_0xfa13x1d){_0xfa13x2b= _0xfa13x1d;return Team[_0x389e[110]]({where:{defaultEntry:true}})})[_0x389e[25]](function(_0xfa13x27){return _0xfa13x27[_0x389e[118]](_[_0x389e[77]](_0xfa13x2b,_0x389e[28]),{transaction:_0xfa13x26})})})[_0x389e[25]](function(){return _0xfa13x15[_0x389e[37]](201)})[_0x389e[22]](sequelize.UniqueConstraintError,function(_0xfa13x17){return Util[_0x389e[108]][_0x389e[107]](_0xfa13x15,_0xfa13x17)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[132]]= function(_0xfa13x14,_0xfa13x15){if(_0xfa13x14[_0x389e[39]][_0x389e[28]]){delete _0xfa13x14[_0x389e[39]][_0x389e[28]]};delete _0xfa13x14[_0x389e[39]][_0x389e[126]];delete _0xfa13x14[_0x389e[39]][_0x389e[35]];delete _0xfa13x14[_0x389e[39]][_0x389e[41]];delete _0xfa13x14[_0x389e[39]][_0x389e[112]];var _0xfa13x25;return sequelize[_0x389e[116]](function(_0xfa13x26){return Agent[_0x389e[30]](_0xfa13x14[_0x389e[61]][_0x389e[28]])[_0x389e[25]](function(_0xfa13x1a){if(!_0xfa13x1a){return _0xfa13x15[_0x389e[37]](404)};var _0xfa13x32=_[_0x389e[79]](_0xfa13x1a,_0xfa13x14[_0x389e[39]]);return _0xfa13x32[_0x389e[134]]({transaction:_0xfa13x26})})[_0x389e[25]](function(_0xfa13x1a){_0xfa13x25= _0xfa13x1a;return _0xfa13x1a})[_0x389e[25]](userTools[_0x389e[133]]({transaction:_0xfa13x26}))[_0x389e[25]](function(){return _0xfa13x15[_0x389e[24]](200)[_0x389e[23]](_0xfa13x25)})})[_0x389e[22]](sequelize.UniqueConstraintError,function(_0xfa13x17){return Util[_0x389e[108]][_0x389e[107]](_0xfa13x15,_0xfa13x17)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[135]]= function(_0xfa13x14,_0xfa13x15){var _0xfa13x25;return Agent[_0x389e[30]](_0xfa13x14[_0x389e[61]][_0x389e[28]])[_0x389e[25]](function(_0xfa13x1a){_0xfa13x25= _0xfa13x1a;if(!_0xfa13x1a){return _0xfa13x15[_0x389e[37]](404)};return _0xfa13x1a[_0x389e[135]]()})[_0x389e[25]](function(){return _0xfa13x15[_0x389e[37]](204)})[_0x389e[22]](sequelize.ForeignKeyConstraintError,function(_0xfa13x17){return Util[_0x389e[108]][_0x389e[136]](_0xfa13x15,_0x389e[33],_0xfa13x25[_0x389e[41]],_0xfa13x17)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};exports[_0x389e[137]]= function(_0xfa13x14,_0xfa13x15){return Agent[_0x389e[135]]({where:{id:_0xfa13x14[_0x389e[26]][_0x389e[63]]},individualHooks:true})[_0x389e[25]](function(){return _0xfa13x15[_0x389e[37]](204)})[_0x389e[22]](function(_0xfa13x17){return handleError(_0xfa13x15,_0xfa13x17)})};function handleError(_0xfa13x15,_0xfa13x17){logger[_0x389e[139]](_0xfa13x17[_0x389e[138]]);return _0xfa13x15[_0x389e[24]](500)[_0x389e[23]](_0xfa13x17)}
\ No newline at end of file