Built motion from commit 15a6d846f.|1.0.20
[motion.git] / server / api / contact_manager / contact_manager.controller.js
index 3a059c7..76496b6 100644 (file)
@@ -1 +1 @@
-var _0x28f3=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74\x50\x68\x6F\x6E\x65","\x43\x6F\x6E\x74\x61\x63\x74\x45\x6D\x61\x69\x6C","\x43\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x48\x69\x73\x74\x6F\x72\x79","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x46\x61\x78\x52\x6F\x6F\x6D","\x53\x6D\x73\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x4C\x69\x73\x74","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C\x48\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x54\x61\x67","\x54\x64\x55\x70\x64\x61\x74\x65","\x73\x74\x72\x65\x61\x6D","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x61\x73\x79\x6E\x63","\x62\x6C\x75\x65\x62\x69\x72\x64","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x72\x65\x73\x6F\x6C\x76\x65","\x65\x78\x74\x72\x61\x63\x74\x41\x6C\x6C","\x69\x64","\x66\x69\x72\x73\x74\x4E\x61\x6D\x65","\x46\x69\x72\x73\x74\x20\x4E\x61\x6D\x65","\x6C\x61\x73\x74\x4E\x61\x6D\x65","\x4C\x61\x73\x74\x20\x4E\x61\x6D\x65","\x74\x61\x67\x73","\x54\x61\x67\x73","\x73\x74\x72\x65\x65\x74","\x53\x74\x72\x65\x65\x74","\x70\x6F\x73\x74\x61\x6C\x43\x6F\x64\x65","\x50\x6F\x73\x74\x61\x6C\x20\x43\x6F\x64\x65","\x63\x69\x74\x79","\x43\x69\x74\x79","\x63\x6F\x75\x6E\x74\x72\x79","\x43\x6F\x75\x6E\x74\x72\x79","\x64\x61\x74\x65\x4F\x66\x42\x69\x72\x74\x68","\x44\x61\x74\x65\x20\x6F\x66\x20\x62\x69\x72\x74\x68","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x70\x68\x6F\x6E\x65","\x50\x68\x6F\x6E\x65","\x6D\x6F\x62\x69\x6C\x65","\x4D\x6F\x62\x69\x6C\x65","\x66\x61\x78","\x46\x61\x78","\x65\x6D\x61\x69\x6C","\x45\x6D\x61\x69\x6C","\x75\x72\x6C","\x55\x52\x4C","\x72\x6F\x77\x73","\x6D\x65\x72\x67\x65","\x43\x6F\x6D\x70\x61\x6E\x79","\x6E\x61\x6D\x65","\x66\x6F\x72\x45\x61\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x2C","\x6A\x6F\x69\x6E","\x20\x61\x73\x20\x27","\x61\x6C\x69\x61\x73","\x27","\x6D\x61\x70","\x53\x45\x4C\x45\x43\x54\x20\x69\x64\x2C\x25\x73\x20\x46\x52\x4F\x4D\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x20\x49\x4E\x20\x28\x27","\x27\x2C\x27","\x27\x29\x20\x4F\x52\x44\x45\x52\x20\x42\x59\x20\x25\x73","\x6F\x72\x64\x65\x72","\x71\x75\x65\x72\x79","\x69\x64\x20\x41\x53\x43","\x66\x6F\x72\x6D\x61\x74","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x6B\x65\x79\x73","\x63\x66\x5F","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x66\x69\x6C\x74\x65\x72","\x4C\x69\x73\x74\x49\x64","\x24\x6F\x72","\x77\x68\x65\x72\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x64\x65\x73\x63\x72\x69\x62\x65","\x43\x6F\x6D\x70\x61\x6E\x79\x49\x64","\x63\x6F\x6E\x63\x61\x74","\x6D\x65\x72\x67\x65\x63\x6F\x6E\x74\x61\x63\x74","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x6C\x69\x73\x74","\x63\x6F\x6D\x70\x61\x6E\x79","\x63\x6F\x6D\x70\x61\x6E\x79\x5F\x6C\x69\x73\x74\x5F\x66\x69\x6C\x74\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x4C\x69\x73\x74\x73","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x67\x65\x6E\x74","\x63\x6F\x75\x6E\x74","\x72\x6F\x6C\x65","\x67\x65\x74\x4C\x6F\x67","\x64\x65\x74\x61\x69\x6C","\x67\x65\x6E\x65\x72\x61\x6C","\x73\x68\x6F\x77","\x6C\x6F\x67\x54\x79\x70\x65","\x6A\x6F\x75\x72\x6E\x61\x6C","\x74\x79\x70\x65","\x69\x6E\x62\x6F\x75\x6E\x64","\x6C\x6F\x67","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x64\x65\x73\x74\x69\x6E\x61\x74\x69\x6F\x6E","\x73\x6F\x75\x72\x63\x65","\x66\x72\x6F\x6D","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x63\x6F\x6E\x74\x61\x63\x74","\x63\x68\x61\x74","\x73\x6D\x73","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x71\x75\x65\x75\x65","\x70\x61\x72\x61\x6D\x73","\x6E\x75\x6C\x6C","\x53\x45\x4C\x45\x43\x54\x20\x25\x73\x20\x46\x52\x4F\x4D\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x67\x65\x74\x43\x6F\x6E\x74\x61\x63\x74\x73","\x73\x75\x62\x74\x79\x70\x65\x43\x68\x61\x6E\x6E\x65\x6C","\x62\x6F\x64\x79","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x76\x6F\x69\x63\x65","\x6D\x61\x69\x6C","\x65\x76\x65\x6E\x74\x43\x68\x61\x6E\x6E\x65\x6C","\x70\x75\x73\x68","\x66\x69\x6E\x64\x4F\x6E\x65","\x63\x72\x65\x61\x74\x65","\x4E\x61\x6D\x65\x20\x6F\x72\x20\x4C\x69\x73\x74\x49\x64\x20\x6D\x69\x73\x73\x69\x6E\x67\x20\x6F\x72\x20\x69\x6E\x76\x61\x6C\x69\x64\x21","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x55\x73\x65\x72\x49\x64","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x3B","\x3B\x27","\x69\x73\x53\x74\x72\x69\x6E\x67","\x66\x6F\x72\x4F\x77\x6E","\x65\x72\x72\x6F\x72","\x69\x6E\x73\x65\x72\x74\x49\x64","\x49\x4E\x53\x45\x52\x54\x20\x49\x4E\x54\x4F\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x28\x25\x73\x29\x20\x56\x41\x4C\x55\x45\x53\x20\x28\x25\x73\x29","\x63\x6F\x70\x79","\x25\x73\x3D\x27\x25\x73\x27","\x55\x50\x44\x41\x54\x45\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x53\x45\x54\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x63\x6C\x6F\x6E\x65","\x73\x70\x6C\x69\x74","\x70\x6F\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x73\x74\x61\x63\x6B","\x61\x6C\x6C","\x63\x6F\x6E\x74\x61\x63\x74\x73","\x75\x6E\x69\x6F\x6E","\x6B\x6F","\x66\x61\x69\x6C\x65\x64","\x6F\x6B","\x66\x6F\x72\x45\x61\x63\x68\x4F\x66","\x75\x70\x64\x61\x74\x65","\x6F\x6C\x64\x43\x6F\x6E\x74\x61\x63\x74","\x64\x65\x73\x74\x72\x6F\x79","\x63\x6F\x6E\x74\x61\x63\x74\x2F\x75\x70\x64\x61\x74\x65","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x63\x6F\x6E\x74\x61\x63\x74\x2F\x64\x65\x6C\x65\x74\x65","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0x28f3[0];var _=require(_0x28f3[1]);var moment=require(_0x28f3[2]);var Contact=require(_0x28f3[4])[_0x28f3[3]];var User=require(_0x28f3[4])[_0x28f3[5]];var ContactPhone=require(_0x28f3[4])[_0x28f3[6]];var ContactEmail=require(_0x28f3[4])[_0x28f3[7]];var CustomField=require(_0x28f3[4])[_0x28f3[8]];var ReportCall=require(_0x28f3[4])[_0x28f3[9]];var ReportQueue=require(_0x28f3[4])[_0x28f3[10]];var ReportQueueHistory=require(_0x28f3[4])[_0x28f3[12]][_0x28f3[11]];var ReportChatRoom=require(_0x28f3[4])[_0x28f3[13]];var ReportChatRoomHistory=require(_0x28f3[4])[_0x28f3[12]][_0x28f3[14]];var ChatRoom=require(_0x28f3[4])[_0x28f3[15]];var FaxRoom=require(_0x28f3[4])[_0x28f3[16]];var SmsRoom=require(_0x28f3[4])[_0x28f3[17]];var ReportIntegration=require(_0x28f3[4])[_0x28f3[18]];var List=require(_0x28f3[4])[_0x28f3[19]];var ReportCallHistory=require(_0x28f3[4])[_0x28f3[12]][_0x28f3[20]];var ReportMailSession=require(_0x28f3[4])[_0x28f3[21]];var MailRoom=require(_0x28f3[4])[_0x28f3[22]];var ReportMailSessionHistory=require(_0x28f3[4])[_0x28f3[12]][_0x28f3[23]];var Tag=require(_0x28f3[4])[_0x28f3[24]];var TdUpdate=require(_0x28f3[4])[_0x28f3[25]];var stream=require(_0x28f3[26]);var sequelize=require(_0x28f3[4])[_0x28f3[27]];var util=require(_0x28f3[28]);var Util=require(_0x28f3[29]);var Async=require(_0x28f3[30]);var Promise=require(_0x28f3[31]);exports[_0x28f3[32]]= function(_0x5559x1e,_0x5559x1f,_0x5559x20){return Promise[_0x28f3[37]]()[_0x28f3[36]](getContacts(_0x5559x1e))[_0x28f3[36]](function(_0x5559x22){_0x5559x1f[_0x28f3[35]](200)[_0x28f3[34]](_0x5559x22)})[_0x28f3[33]](function(_0x5559x21){return handleError(_0x5559x1f,_0x5559x21)})};exports[_0x28f3[38]]= function(_0x5559x1e,_0x5559x1f,_0x5559x20){var _0x5559x23=[_0x28f3[39],[_0x28f3[40],_0x28f3[41]],[_0x28f3[42],_0x28f3[43]],[_0x28f3[44],_0x28f3[45]],[_0x28f3[46],_0x28f3[47]],[_0x28f3[48],_0x28f3[49]],[_0x28f3[50],_0x28f3[51]],[_0x28f3[52],_0x28f3[53]],[_0x28f3[54],_0x28f3[55]],[_0x28f3[56],_0x28f3[57]],[_0x28f3[58],_0x28f3[59]],[_0x28f3[60],_0x28f3[61]],[_0x28f3[62],_0x28f3[63]],[_0x28f3[64],_0x28f3[65]],[_0x28f3[66],_0x28f3[67]]];return Promise[_0x28f3[37]]()[_0x28f3[36]](getContacts(_0x5559x1e,_0x5559x23))[_0x28f3[36]](function(_0x5559x22){_0x5559x1f[_0x28f3[35]](200)[_0x28f3[34]](_0x5559x22)})[_0x28f3[33]](function(_0x5559x21){return handleError(_0x5559x1f,_0x5559x21)})};function getContacts(_0x5559x1e,_0x5559x23){return function(){var _0x5559x25,_0x5559x26,_0x5559x27;switch(_0x5559x1e[_0x28f3[109]][_0x28f3[113]]){case _0x28f3[111]:return User[_0x28f3[110]](_0x5559x1e[_0x28f3[109]][_0x28f3[39]])[_0x28f3[36]](function(_0x5559x36){return _0x5559x36[_0x28f3[108]]()})[_0x28f3[36]](function(_0x5559x35){_0x5559x26= _[_0x28f3[79]](_0x5559x35,_0x28f3[39]);return List[_0x28f3[96]]({where:{defaultEntry:true},attributes:[_0x28f3[39]]})})[_0x28f3[36]](function(_0x5559x33){_0x5559x27= {CompanyId:_0x5559x1e[_0x28f3[84]][_0x28f3[99]]|| null,ListId:_0x5559x1e[_0x28f3[84]][_0x28f3[93]]|| null};delete _0x5559x1e[_0x28f3[84]][_0x28f3[99]];delete _0x5559x1e[_0x28f3[84]][_0x28f3[93]];var _0x5559x34=_0x5559x27[_0x28f3[93]]?{}:{ListId:{$in:_0x5559x26[_0x28f3[100]](_[_0x28f3[79]](_0x5559x33,_0x28f3[39]))}};if(_0x5559x1e[_0x28f3[84]][_0x28f3[101]]){_0x5559x34[_0x28f3[39]]= {$ne:_0x5559x1e[_0x28f3[84]][_0x28f3[101]]};delete _0x5559x1e[_0x28f3[84]][_0x28f3[101]]};return Contact[_0x28f3[107]](_0x28f3[104],_0x28f3[105],{method:[_0x28f3[106],_0x5559x27]})[_0x28f3[103]](Util[_0x28f3[102]](_0x5559x1e[_0x28f3[84]],_0x5559x34,{attributes:_0x5559x23,order:_0x5559x1e[_0x28f3[84]][_0x28f3[83]]|| _0x28f3[85]}))})[_0x28f3[36]](function(_0x5559x32){_0x5559x25= {rows:_[_0x28f3[79]](_0x5559x32[_0x28f3[68]],_0x28f3[97]),count:_0x5559x32[_0x28f3[68]]};return Contact[_0x28f3[98]]()})[_0x28f3[36]](function(_0x5559x2f){_0x5559x2f= _[_0x28f3[92]](_[_0x28f3[89]](_0x5559x2f),function(_0x5559x30){return _[_0x28f3[91]](_0x5559x30,_0x28f3[90])});var _0x5559x31={where:{name:_0x5559x2f}};_0x5559x27[_0x28f3[93]]&& (_0x5559x31[_0x28f3[95]][_0x28f3[94]]= [{ListId:_0x5559x27[_0x28f3[93]]},{ListId:null}]);return CustomField[_0x28f3[96]](_0x5559x31)})[_0x28f3[36]](function(_0x5559x2c){if(_0x5559x2c[_0x28f3[73]]){var _0x5559x2d=_[_0x28f3[79]](_0x5559x2c,function(_0x5559x2e){return _0x5559x2e[_0x28f3[71]]+ _0x28f3[76]+ _0x5559x2e[_0x28f3[77]]+ _0x28f3[78]})[_0x28f3[75]](_0x28f3[74]);return sequelize[_0x28f3[84]](util[_0x28f3[86]](_0x28f3[80]+ _[_0x28f3[79]](_0x5559x25[_0x28f3[68]],_0x28f3[39])[_0x28f3[75]](_0x28f3[81])+ _0x28f3[82],_0x5559x2d,_0x5559x1e[_0x28f3[84]][_0x28f3[83]]|| _0x28f3[85]),{type:sequelize[_0x28f3[88]][_0x28f3[87]]})}})[_0x28f3[36]](function(_0x5559x28){var _0x5559x29;if(_0x5559x28){_[_0x28f3[72]](_0x5559x25[_0x28f3[68]],function(_0x5559x2a,_0x5559x2b){_[_0x28f3[69]](_0x5559x2a,_0x5559x28[_0x5559x2b]);if(_0x5559x23){delete _0x5559x2a[_0x28f3[39]];_0x5559x2a[_0x28f3[70]]&& (_0x5559x2a[_0x28f3[70]]= _0x5559x2a[_0x28f3[70]][_0x28f3[71]]);_0x5559x2a[_0x28f3[19]]&& (_0x5559x2a[_0x28f3[19]]= _0x5559x2a[_0x28f3[19]][_0x28f3[71]])}})}else {if(_0x5559x23){_[_0x28f3[72]](_0x5559x25[_0x28f3[68]],function(_0x5559x2a,_0x5559x2b){delete _0x5559x2a[_0x28f3[39]];_0x5559x2a[_0x28f3[70]]&& (_0x5559x2a[_0x28f3[70]]= _0x5559x2a[_0x28f3[70]][_0x28f3[71]]);_0x5559x2a[_0x28f3[19]]&& (_0x5559x2a[_0x28f3[19]]= _0x5559x2a[_0x28f3[19]][_0x28f3[71]])})}};return _0x5559x25})[_0x28f3[36]](function(_0x5559x22){return _0x5559x22});default:_0x5559x27= {CompanyId:_0x5559x1e[_0x28f3[84]][_0x28f3[99]]|| null,ListId:_0x5559x1e[_0x28f3[84]][_0x28f3[93]]|| null};delete _0x5559x1e[_0x28f3[84]][_0x28f3[99]];delete _0x5559x1e[_0x28f3[84]][_0x28f3[93]];var _0x5559x34={};if(_0x5559x1e[_0x28f3[84]][_0x28f3[101]]){_0x5559x34[_0x28f3[39]]= {$ne:_0x5559x1e[_0x28f3[84]][_0x28f3[101]]};delete _0x5559x1e[_0x28f3[84]][_0x28f3[101]]};return Contact[_0x28f3[107]](_0x28f3[104],_0x28f3[105],{method:[_0x28f3[106],_0x5559x27]})[_0x28f3[103]](Util[_0x28f3[102]](_0x5559x1e[_0x28f3[84]],_0x5559x34,{attributes:_0x5559x23,order:_0x5559x1e[_0x28f3[84]][_0x28f3[83]]|| _0x28f3[85]}))[_0x28f3[36]](function(_0x5559x32){_0x5559x25= {rows:_[_0x28f3[79]](_0x5559x32[_0x28f3[68]],_0x28f3[97]),count:_0x5559x32[_0x28f3[112]]};return Contact[_0x28f3[98]]()})[_0x28f3[36]](function(_0x5559x2f){_0x5559x2f= _[_0x28f3[92]](_[_0x28f3[89]](_0x5559x2f),function(_0x5559x30){return _[_0x28f3[91]](_0x5559x30,_0x28f3[90])});var _0x5559x31={where:{name:_0x5559x2f}};_0x5559x27[_0x28f3[93]]&& (_0x5559x31[_0x28f3[95]][_0x28f3[94]]= [{ListId:_0x5559x27[_0x28f3[93]]},{ListId:null}]);return CustomField[_0x28f3[96]](_0x5559x31)})[_0x28f3[36]](function(_0x5559x2c){if(_0x5559x25[_0x28f3[68]][_0x28f3[73]]&& _0x5559x2c[_0x28f3[73]]){var _0x5559x2d=_[_0x28f3[79]](_0x5559x2c,function(_0x5559x2e){return _0x5559x2e[_0x28f3[71]]+ _0x28f3[76]+ _0x5559x2e[_0x28f3[77]]+ _0x28f3[78]})[_0x28f3[75]](_0x28f3[74]);return sequelize[_0x28f3[84]](util[_0x28f3[86]](_0x28f3[80]+ _[_0x28f3[79]](_0x5559x25[_0x28f3[68]],_0x28f3[39])[_0x28f3[75]](_0x28f3[81])+ _0x28f3[82],_0x5559x2d,_0x5559x1e[_0x28f3[84]][_0x28f3[83]]|| _0x28f3[85]),{type:sequelize[_0x28f3[88]][_0x28f3[87]]})}})[_0x28f3[36]](function(_0x5559x28){var _0x5559x29;if(_0x5559x28){_[_0x28f3[72]](_0x5559x25[_0x28f3[68]],function(_0x5559x2a,_0x5559x2b){_[_0x28f3[69]](_0x5559x2a,_0x5559x28[_0x5559x2b]);if(_0x5559x23){delete _0x5559x2a[_0x28f3[39]];_0x5559x2a[_0x28f3[70]]&& (_0x5559x2a[_0x28f3[70]]= _0x5559x2a[_0x28f3[70]][_0x28f3[71]]);_0x5559x2a[_0x28f3[19]]&& (_0x5559x2a[_0x28f3[19]]= _0x5559x2a[_0x28f3[19]][_0x28f3[71]])}})}else {if(_0x5559x23){_[_0x28f3[72]](_0x5559x25[_0x28f3[68]],function(_0x5559x2a,_0x5559x2b){delete _0x5559x2a[_0x28f3[39]];_0x5559x2a[_0x28f3[70]]&& (_0x5559x2a[_0x28f3[70]]= _0x5559x2a[_0x28f3[70]][_0x28f3[71]]);_0x5559x2a[_0x28f3[19]]&& (_0x5559x2a[_0x28f3[19]]= _0x5559x2a[_0x28f3[19]][_0x28f3[71]])})}};return _0x5559x25})[_0x28f3[36]](function(_0x5559x22){return _0x5559x22})}}}exports[_0x28f3[98]]= function(_0x5559x1e,_0x5559x1f){return Contact[_0x28f3[98]]()[_0x28f3[36]](function(_0x5559x2f){return _0x5559x1f[_0x28f3[35]](200)[_0x28f3[34]](_0x5559x2f)})[_0x28f3[33]](function(_0x5559x21){return handleError(_0x5559x1f,_0x5559x21)})};exports[_0x28f3[114]]= function(_0x5559x1e,_0x5559x1f,_0x5559x20){_0x5559x1e[_0x28f3[84]][_0x28f3[115]]= _0x5559x1e[_0x28f3[84]][_0x28f3[115]]|| _0x28f3[116];_0x5559x1e[_0x28f3[84]][_0x28f3[117]]= _0x5559x1e[_0x28f3[84]][_0x28f3[117]]|| _0x28f3[58];_0x5559x1e[_0x28f3[84]][_0x28f3[118]]= _0x5559x1e[_0x28f3[84]][_0x28f3[118]]|| _0x28f3[119];_0x5559x1e[_0x28f3[84]][_0x28f3[120]]= _0x5559x1e[_0x28f3[84]][_0x28f3[120]]|| _0x28f3[121];var _0x5559x37,_0x5559x38={};return Contact[_0x28f3[110]](_0x5559x1e[_0x28f3[136]][_0x28f3[39]])[_0x28f3[36]](function(_0x5559x39){if(!_0x5559x39){return _0x5559x1f[_0x28f3[123]](404)};switch(_0x5559x1e[_0x28f3[84]][_0x28f3[115]]){case _0x28f3[116]:switch(_0x5559x1e[_0x28f3[84]][_0x28f3[117]]){case _0x28f3[58]:_0x5559x37= (_0x5559x1e[_0x28f3[84]][_0x28f3[118]]=== _0x28f3[12])?ReportCallHistory:ReportCall;if(_0x5559x1e[_0x28f3[84]][_0x28f3[120]]=== _0x28f3[124]){_0x5559x38[_0x28f3[125]]= [_0x5559x39[_0x28f3[58]],_0x5559x39[_0x28f3[60]]]}else {_0x5559x38[_0x28f3[126]]= [_0x5559x39[_0x28f3[58]],_0x5559x39[_0x28f3[60]]]};break;case _0x28f3[64]:_0x5559x37= MailRoom;_0x5559x38[_0x28f3[127]]= _0x5559x39[_0x28f3[64]];if(_0x5559x1e[_0x28f3[84]][_0x28f3[118]]=== _0x28f3[12]){_0x5559x38[_0x28f3[128]]= {$lt:moment()[_0x28f3[130]](_0x28f3[129])}}else {_0x5559x38[_0x28f3[128]]= {$gte:moment()[_0x28f3[130]](_0x28f3[129])}};break;case _0x28f3[132]:_0x5559x37= ChatRoom;_0x5559x38[_0x28f3[131]]= _0x5559x39[_0x28f3[64]];if(_0x5559x1e[_0x28f3[84]][_0x28f3[118]]=== _0x28f3[12]){_0x5559x38[_0x28f3[128]]= {$lt:moment()[_0x28f3[130]](_0x28f3[129])}}else {_0x5559x38[_0x28f3[128]]= {$gte:moment()[_0x28f3[130]](_0x28f3[129])}};break;case _0x28f3[62]:_0x5559x37= FaxRoom;_0x5559x38[_0x28f3[131]]= _0x5559x39[_0x28f3[62]];if(_0x5559x1e[_0x28f3[84]][_0x28f3[118]]=== _0x28f3[12]){_0x5559x38[_0x28f3[128]]= {$lt:moment()[_0x28f3[130]](_0x28f3[129])}}else {_0x5559x38[_0x28f3[128]]= {$gte:moment()[_0x28f3[130]](_0x28f3[129])}};break;case _0x28f3[133]:_0x5559x37= SmsRoom;_0x5559x38[_0x28f3[131]]= [_0x5559x39[_0x28f3[58]],_0x5559x39[_0x28f3[60]]];if(_0x5559x1e[_0x28f3[84]][_0x28f3[118]]=== _0x28f3[12]){_0x5559x38[_0x28f3[128]]= {$lt:moment()[_0x28f3[130]](_0x28f3[129])}}else {_0x5559x38[_0x28f3[128]]= {$gte:moment()[_0x28f3[130]](_0x28f3[129])}};break;default:_0x5559x37= (_0x5559x1e[_0x28f3[84]][_0x28f3[118]]=== _0x28f3[12])?ReportCallHistory:ReportCall};break;case _0x28f3[135]:switch(_0x5559x1e[_0x28f3[84]][_0x28f3[117]]){case _0x28f3[58]:_0x5559x37= (_0x5559x1e[_0x28f3[84]][_0x28f3[118]]=== _0x28f3[12])?ReportQueueHistory:ReportQueue;_0x5559x38[_0x28f3[134]]= [_0x5559x39[_0x28f3[58]],_0x5559x39[_0x28f3[60]]];break;case _0x28f3[64]:return _0x5559x1f[_0x28f3[123]](404);default:_0x5559x37= (_0x5559x1e[_0x28f3[84]][_0x28f3[118]]=== _0x28f3[12])?ReportQueueHistory:ReportQueue};break;default:_0x5559x37= ReportCall};delete _0x5559x1e[_0x28f3[84]][_0x28f3[115]];delete _0x5559x1e[_0x28f3[84]][_0x28f3[117]];delete _0x5559x1e[_0x28f3[84]][_0x28f3[118]];delete _0x5559x1e[_0x28f3[84]][_0x28f3[120]];return _0x5559x37[_0x28f3[103]](Util[_0x28f3[102]](_0x5559x1e[_0x28f3[84]],_0x5559x38))})[_0x28f3[36]](function(_0x5559x22){_0x5559x1f[_0x28f3[35]](200)[_0x28f3[34]](_0x5559x22)})[_0x28f3[33]](function(_0x5559x21){console[_0x28f3[122]](_0x5559x21);return handleError(_0x5559x1f,_0x5559x21)})};exports[_0x28f3[117]]= function(_0x5559x1e,_0x5559x1f){var _0x5559x3a;return Contact[_0x28f3[107]](_0x28f3[104],_0x28f3[109],_0x28f3[105])[_0x28f3[110]](_0x5559x1e[_0x28f3[136]][_0x28f3[39]])[_0x28f3[36]](function(_0x5559x3f){if(!_0x5559x3f){return _0x5559x1f[_0x28f3[123]](404)};_0x5559x3a= _0x5559x3f;return CustomField[_0x28f3[96]]({where:{$or:[{ListId:_0x5559x3a[_0x28f3[93]]},{ListId:null}]}})})[_0x28f3[36]](function(_0x5559x2c){if(_0x5559x2c[_0x28f3[73]]){var _0x5559x2d=_[_0x28f3[79]](_0x5559x2c,_0x28f3[71])[_0x28f3[75]](_0x28f3[74]);return sequelize[_0x28f3[84]](util[_0x28f3[86]](_0x28f3[138],_0x5559x2d,_0x5559x1e[_0x28f3[136]][_0x28f3[39]]),{type:sequelize[_0x28f3[88]][_0x28f3[87]]})}})[_0x28f3[36]](function(_0x5559x3b){if(_0x5559x3b){_[_0x28f3[72]](_0x5559x3b[0],function(_0x5559x3c,_0x5559x3d,_0x5559x3e){if(_0x5559x3c=== _0x28f3[137]){_0x5559x3e[_0x5559x3d]= null}});_[_0x28f3[69]](_0x5559x3a[_0x28f3[97]],_0x5559x3b[0])}})[_0x28f3[36]](function(){return _0x5559x1f[_0x28f3[35]](200)[_0x28f3[34]](_0x5559x3a)})[_0x28f3[33]](function(_0x5559x21){console[_0x28f3[122]](_0x5559x21);return handleError(_0x5559x1f,_0x5559x21)})};exports[_0x28f3[139]]= function(_0x5559x1e,_0x5559x1f){var _0x5559x38={};switch(_0x5559x1e[_0x28f3[141]][_0x28f3[145]]){case _0x28f3[143]:if(_0x5559x1e[_0x28f3[141]][_0x28f3[140]]=== _0x28f3[135]){_0x5559x38= {$or:{phone:_0x5559x1e[_0x28f3[141]][_0x28f3[134]],mobile:_0x5559x1e[_0x28f3[141]][_0x28f3[134]]}}}else {_0x5559x38= {$or:{phone:_0x5559x1e[_0x28f3[141]][_0x28f3[142]],mobile:_0x5559x1e[_0x28f3[141]][_0x28f3[142]]}}};break;case _0x28f3[144]:_0x5559x38= {email:_0x5559x1e[_0x28f3[141]][_0x28f3[127]]};break;default:_0x5559x38= {}};var _0x5559x40=_[_0x28f3[79]](_[_0x28f3[79]](_0x5559x1e[_0x28f3[109]].Lists,_0x28f3[97]),_0x28f3[39]);var _0x5559x41;return List[_0x28f3[147]]({where:{defaultEntry:true}})[_0x28f3[36]](function(_0x5559x42){if(_0x5559x42){_0x5559x40[_0x28f3[146]](_0x5559x42[_0x28f3[39]])};if(_0x5559x1e[_0x28f3[141]][_0x28f3[93]]){_0x5559x41= _[_0x28f3[91]](_0x5559x40,_0x5559x1e[_0x28f3[141]].ListId)?{id:_0x5559x1e[_0x28f3[141]][_0x28f3[93]]}:null}else {_0x5559x41= {id:_0x5559x40}};if(_0x5559x41){return Contact[_0x28f3[103]]({where:_0x5559x38,include:[{model:List,where:_0x5559x41}]})};return null})[_0x28f3[36]](function(_0x5559x32){return _0x5559x1f[_0x28f3[35]](200)[_0x28f3[34]](_0x5559x32|| {count:0,rows:[]})})[_0x28f3[33]](function(_0x5559x21){console[_0x28f3[122]](_0x5559x21);return handleError(_0x5559x1f,_0x5559x21)})};exports[_0x28f3[148]]= function(_0x5559x1e,_0x5559x1f,_0x5559x20){if(!_0x5559x1e[_0x28f3[141]][_0x28f3[40]]||  !_0x5559x1e[_0x28f3[141]][_0x28f3[93]]){return handleError(_0x5559x1f,{message:_0x28f3[149]})};var _0x5559x3a,_0x5559x43=moment()[_0x28f3[86]](_0x28f3[150]),_0x5559x44=[],_0x5559x45=[];_0x5559x1e[_0x28f3[141]][_0x28f3[151]]= _0x5559x1e[_0x28f3[109]][_0x28f3[39]];_0x5559x1e[_0x28f3[141]][_0x28f3[128]]= _0x5559x43;_0x5559x1e[_0x28f3[141]][_0x28f3[152]]= _0x5559x43;_[_0x28f3[156]](_0x5559x1e[_0x28f3[141]],function(_0x5559x3c,_0x5559x3d){if(_0x5559x3c){switch(_0x5559x3d){case _0x28f3[44]:if(_0x5559x3c[_0x28f3[73]]){_0x5559x45[_0x28f3[146]](_0x28f3[78]+ _0x5559x3c[_0x28f3[75]](_0x28f3[153])+ _0x28f3[154]);_0x5559x44[_0x28f3[146]](_0x5559x3d)};break;default:_0x5559x44[_0x28f3[146]](_0x5559x3d);_0x5559x45[_0x28f3[146]](_[_0x28f3[155]](_0x5559x3c)?_0x28f3[78]+ _0x5559x3c+ _0x28f3[78]:_0x5559x3c)}}});return sequelize[_0x28f3[84]](util[_0x28f3[86]](_0x28f3[159],_0x5559x44[_0x28f3[75]](_0x28f3[74]),_0x5559x45[_0x28f3[75]](_0x28f3[74])))[_0x28f3[36]](function(_0x5559x39){_0x5559x1e[_0x28f3[141]][_0x28f3[39]]= _0x5559x39[0][_0x28f3[158]];return _0x5559x1f[_0x28f3[35]](201)[_0x28f3[34]](_0x5559x1e[_0x28f3[141]])})[_0x28f3[33]](function(_0x5559x21){console[_0x28f3[157]](_0x5559x21);return _0x5559x20(_0x5559x21)})};exports[_0x28f3[160]]= function(_0x5559x1e,_0x5559x1f,_0x5559x20){var _0x5559x3a,_0x5559x46;return Contact[_0x28f3[110]](_0x5559x1e[_0x28f3[136]][_0x28f3[39]])[_0x28f3[36]](function(_0x5559x39){_0x5559x3a= _0x5559x39[_0x28f3[97]];_0x5559x46= _[_0x28f3[163]](_0x5559x39[_0x28f3[97]]);delete _0x5559x46[_0x28f3[39]];_0x5559x46[_0x28f3[151]]= _0x5559x1e[_0x28f3[109]][_0x28f3[39]];_0x5559x46[_0x28f3[93]]= _0x5559x1e[_0x28f3[141]][_0x28f3[93]];_0x5559x46[_0x28f3[44]]= _0x5559x46[_0x28f3[44]]?_0x5559x46[_0x28f3[44]][_0x28f3[164]](_0x28f3[153]):[];if(_0x5559x46[_0x28f3[44]][_0x28f3[73]]> 1){_0x5559x46[_0x28f3[44]][_0x28f3[165]]()};return Contact[_0x28f3[148]](_0x5559x46)})[_0x28f3[36]](function(_0x5559x47){_0x5559x46= _0x5559x47;if(_0x5559x3a[_0x28f3[93]]=== _0x5559x1e[_0x28f3[141]][_0x28f3[93]]){return CustomField[_0x28f3[96]]({where:{$or:[{ListId:_0x5559x3a[_0x28f3[93]]},{ListId:null}]}})}})[_0x28f3[36]](function(_0x5559x2c){if(_0x5559x2c&& _0x5559x2c[_0x28f3[73]]){var _0x5559x2d=_[_0x28f3[79]](_0x5559x2c,_0x28f3[71])[_0x28f3[75]](_0x28f3[74]);return sequelize[_0x28f3[84]](util[_0x28f3[86]](_0x28f3[138],_0x5559x2d,_0x5559x3a[_0x28f3[39]]),{type:sequelize[_0x28f3[88]][_0x28f3[87]]})}})[_0x28f3[36]](function(_0x5559x3b){if(_0x5559x3b){var _0x5559x2d=[];_[_0x28f3[156]](_0x5559x3b[0],function(_0x5559x3c,_0x5559x3d){_0x5559x2d[_0x28f3[146]](util[_0x28f3[86]](_0x28f3[161],_0x5559x3d,_0x5559x3c))});if(_0x5559x2d[_0x28f3[73]]){_0x5559x2d= _0x5559x2d[_0x28f3[75]](_0x28f3[74]);return sequelize[_0x28f3[84]](util[_0x28f3[86]](_0x28f3[162],_0x5559x2d,_0x5559x46[_0x28f3[39]]))}}})[_0x28f3[36]](function(){return _0x5559x1f[_0x28f3[35]](201)[_0x28f3[34]](_0x5559x46)})[_0x28f3[33]](function(_0x5559x21){console[_0x28f3[122]](_0x5559x21);return _0x5559x20(_0x5559x21)})};exports[_0x28f3[166]]= function(_0x5559x1e,_0x5559x1f,_0x5559x20){var _0x5559x48=[],_0x5559x43=moment()[_0x28f3[86]](_0x28f3[150]),_0x5559x49=[],_0x5559x44,_0x5559x45,_0x5559x4a={ok:0,ko:0,failed:[]};return Tag[_0x28f3[96]]()[_0x28f3[36]](function(_0x5559x4b){var _0x5559x4c=[],_0x5559x4d=[];var _0x5559x4e=_[_0x28f3[79]](_[_0x28f3[79]](_0x5559x4b,_0x28f3[97]),_0x28f3[71]);Async[_0x28f3[174]](_0x5559x1e[_0x28f3[141]][_0x28f3[169]],function(_0x5559x39,_0x5559x2b){if(_0x5559x39[_0x28f3[40]]&& _0x5559x39[_0x28f3[93]]){_0x5559x39[_0x28f3[151]]= _0x5559x1e[_0x28f3[109]][_0x28f3[39]];_0x5559x39[_0x28f3[128]]= _0x5559x43;_0x5559x39[_0x28f3[152]]= _0x5559x43;_0x5559x39[_0x28f3[44]]&& (_0x5559x4d= _[_0x28f3[170]](_0x5559x4d,_0x5559x39[_0x28f3[44]]));_0x5559x44= [];_0x5559x45= [];_[_0x28f3[156]](_0x5559x39,function(_0x5559x3c,_0x5559x3d){if(_0x5559x3c){switch(_0x5559x3d){case _0x28f3[44]:if(_0x5559x3c[_0x28f3[73]]){_0x5559x45[_0x28f3[146]](_0x28f3[78]+ _0x5559x3c[_0x28f3[75]](_0x28f3[153])+ _0x28f3[154]);_0x5559x44[_0x28f3[146]](_0x5559x3d)};break;default:_0x5559x44[_0x28f3[146]](_0x5559x3d);_0x5559x45[_0x28f3[146]](_[_0x28f3[155]](_0x5559x3c)?_0x28f3[78]+ _0x5559x3c+ _0x28f3[78]:_0x5559x3c)}}});_0x5559x49[_0x28f3[146]](sequelize[_0x28f3[84]](util[_0x28f3[86]](_0x28f3[159],_0x5559x44[_0x28f3[75]](_0x28f3[74]),_0x5559x45[_0x28f3[75]](_0x28f3[74])))[_0x28f3[36]](function(_0x5559x47){_0x5559x39[_0x28f3[39]]= _0x5559x47[_0x28f3[39]];_0x5559x48[_0x28f3[146]](_0x5559x39);_0x5559x4a[_0x28f3[173]]++})[_0x28f3[33]](function(_0x5559x21){console[_0x28f3[122]](_0x5559x21[_0x28f3[167]]);_0x5559x4a[_0x28f3[171]]++;_0x5559x4a[_0x28f3[172]][_0x28f3[146]](_0x5559x2b)}))}else {_0x5559x4a[_0x28f3[171]]++;_0x5559x4a[_0x28f3[172]][_0x28f3[146]](_0x5559x2b)}});_0x5559x4d[_0x28f3[73]]&& _[_0x28f3[72]](_0x5559x4d,function(_0x5559x30){if(!_0x5559x4e[_0x28f3[73]]||  !_[_0x28f3[91]](_0x5559x4e,_0x5559x30)){_0x5559x4c[_0x28f3[146]](Tag[_0x28f3[148]]({name:_0x5559x30}))}});return _0x5559x4c})[_0x28f3[168]]()[_0x28f3[36]](function(){return _0x5559x49})[_0x28f3[168]]()[_0x28f3[36]](function(){return _0x5559x1f[_0x28f3[35]](201)[_0x28f3[34]](_0x5559x4a)})[_0x28f3[33]](function(_0x5559x21){console[_0x28f3[157]](_0x5559x21[_0x28f3[167]]);return _0x5559x20(_0x5559x21)})};exports[_0x28f3[175]]= function(_0x5559x1e,_0x5559x1f,_0x5559x20){return Promise[_0x28f3[168]]([])[_0x28f3[36]](updateContact(_0x5559x1e,_0x5559x1f))[_0x28f3[36]](function(_0x5559x39){return _0x5559x1f[_0x28f3[35]](200)[_0x28f3[34]](_0x5559x39)})[_0x28f3[33]](function(_0x5559x21){console[_0x28f3[122]](_0x5559x21);return handleError(_0x5559x1f,_0x5559x21)})};exports[_0x28f3[69]]= function(_0x5559x1e,_0x5559x1f,_0x5559x20){var _0x5559x3a;return Promise[_0x28f3[168]]([])[_0x28f3[36]](updateContact(_0x5559x1e,_0x5559x1f))[_0x28f3[36]](function(_0x5559x39){_0x5559x3a= _0x5559x39;if(_0x5559x1e[_0x28f3[141]][_0x28f3[176]]){return Contact[_0x28f3[177]]({where:{id:_0x5559x1e[_0x28f3[141]][_0x28f3[176]]},individualHooks:true})}})[_0x28f3[36]](function(){return _0x5559x1f[_0x28f3[35]](200)[_0x28f3[34]](_0x5559x3a)})[_0x28f3[33]](function(_0x5559x21){console[_0x28f3[122]](_0x5559x21);return handleError(_0x5559x1f,_0x5559x21)})};function updateContact(_0x5559x1e,_0x5559x1f){return function(){var _0x5559x3a;return Tag[_0x28f3[96]]()[_0x28f3[36]](function(_0x5559x4b){var _0x5559x4c=[];var _0x5559x4e=_[_0x28f3[79]](_[_0x28f3[79]](_0x5559x4b,_0x28f3[97]),_0x28f3[71]);if(_0x5559x1e[_0x28f3[141]][_0x28f3[44]]){_0x5559x1e[_0x28f3[141]][_0x28f3[44]][_0x28f3[72]](function(_0x5559x30){if(!_[_0x28f3[91]](_0x5559x4e,_0x5559x30)){_0x5559x4c[_0x28f3[146]](Tag[_0x28f3[148]]({name:_0x5559x30}))}})};return _0x5559x4c})[_0x28f3[36]](function(){return Contact[_0x28f3[110]](_0x5559x1e[_0x28f3[136]][_0x28f3[39]])})[_0x28f3[36]](function(_0x5559x39){if(!_0x5559x39){return _0x5559x1f[_0x28f3[123]](404)};delete _0x5559x1e[_0x28f3[141]][_0x28f3[39]];return _0x5559x39[_0x28f3[180]](_0x5559x1e[_0x28f3[141]])})[_0x28f3[36]](function(_0x5559x39){_0x5559x3a= _0x5559x39;return CustomField[_0x28f3[96]]({where:{$or:[{ListId:_0x5559x3a[_0x28f3[93]]},{ListId:null}]}})})[_0x28f3[36]](function(_0x5559x2c){if(_0x5559x2c[_0x28f3[73]]){var _0x5559x2d=[];_0x5559x2c[_0x28f3[72]](function(_0x5559x30){if(_0x5559x1e[_0x28f3[141]][_0x28f3[179]](_0x5559x30[_0x28f3[71]])){_0x5559x2d[_0x28f3[146]](util[_0x28f3[86]](_0x28f3[161],_0x5559x30[_0x28f3[71]],_0x5559x1e[_0x28f3[141]][_0x5559x30[_0x28f3[71]]]))}});if(_0x5559x2d[_0x28f3[73]]){_0x5559x2d= _0x5559x2d[_0x28f3[75]](_0x28f3[74]);return sequelize[_0x28f3[84]](util[_0x28f3[86]](_0x28f3[162],_0x5559x2d,_0x5559x3a[_0x28f3[39]]))}}})[_0x28f3[36]](function(){return TdUpdate[_0x28f3[148]]({action:_0x28f3[178],listId:_0x5559x3a[_0x28f3[93]],contactId:_0x5559x3a[_0x28f3[39]]})})[_0x28f3[36]](function(){return _0x5559x3a})}}exports[_0x28f3[177]]= function(_0x5559x1e,_0x5559x1f){return Contact[_0x28f3[110]](_0x5559x1e[_0x28f3[136]][_0x28f3[39]])[_0x28f3[36]](function(_0x5559x3f){if(!_0x5559x3f){return _0x5559x1f[_0x28f3[123]](404)};return _0x5559x3f[_0x28f3[177]]()})[_0x28f3[36]](function(_0x5559x39){return TdUpdate[_0x28f3[148]]({action:_0x28f3[181],listId:_0x5559x39[_0x28f3[93]],contactId:_0x5559x39[_0x28f3[39]]})})[_0x28f3[36]](function(){return _0x5559x1f[_0x28f3[123]](204)})[_0x28f3[33]](function(_0x5559x21){return handleError(_0x5559x1f,_0x5559x21)})};exports[_0x28f3[182]]= function(_0x5559x1e,_0x5559x1f){return Contact[_0x28f3[96]]({where:{id:_0x5559x1e[_0x28f3[84]][_0x28f3[183]]}})[_0x28f3[36]](function(_0x5559x32){var _0x5559x50=[];if(_0x5559x32&& _0x5559x32[_0x28f3[73]]){_[_0x28f3[72]](_0x5559x32,function(_0x5559x39){_0x5559x50[_0x28f3[146]](_0x5559x39[_0x28f3[177]]());_0x5559x50[_0x28f3[146]](TdUpdate[_0x28f3[148]]({action:_0x28f3[181],listId:_0x5559x39[_0x28f3[93]],contactId:_0x5559x39[_0x28f3[39]]}))})};return _0x5559x50})[_0x28f3[168]]()[_0x28f3[36]](function(){return _0x5559x1f[_0x28f3[123]](204)})[_0x28f3[33]](function(_0x5559x21){return handleError(_0x5559x1f,_0x5559x21)})};function handleError(_0x5559x1f,_0x5559x21){console[_0x28f3[122]](_0x5559x21[_0x28f3[167]]);return _0x5559x1f[_0x28f3[35]](500)[_0x28f3[34]](_0x5559x21)}
\ No newline at end of file
+var _0xc786=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74\x50\x68\x6F\x6E\x65","\x43\x6F\x6E\x74\x61\x63\x74\x45\x6D\x61\x69\x6C","\x43\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x48\x69\x73\x74\x6F\x72\x79","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x46\x61\x78\x52\x6F\x6F\x6D","\x53\x6D\x73\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x4C\x69\x73\x74","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C\x48\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x54\x61\x67","\x54\x64\x55\x70\x64\x61\x74\x65","\x73\x74\x72\x65\x61\x6D","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x61\x73\x79\x6E\x63","\x62\x6C\x75\x65\x62\x69\x72\x64","\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","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x72\x65\x73\x6F\x6C\x76\x65","\x65\x78\x74\x72\x61\x63\x74\x41\x6C\x6C","\x69\x64","\x66\x69\x72\x73\x74\x4E\x61\x6D\x65","\x46\x69\x72\x73\x74\x20\x4E\x61\x6D\x65","\x6C\x61\x73\x74\x4E\x61\x6D\x65","\x4C\x61\x73\x74\x20\x4E\x61\x6D\x65","\x74\x61\x67\x73","\x54\x61\x67\x73","\x73\x74\x72\x65\x65\x74","\x53\x74\x72\x65\x65\x74","\x70\x6F\x73\x74\x61\x6C\x43\x6F\x64\x65","\x50\x6F\x73\x74\x61\x6C\x20\x43\x6F\x64\x65","\x63\x69\x74\x79","\x43\x69\x74\x79","\x63\x6F\x75\x6E\x74\x72\x79","\x43\x6F\x75\x6E\x74\x72\x79","\x64\x61\x74\x65\x4F\x66\x42\x69\x72\x74\x68","\x44\x61\x74\x65\x20\x6F\x66\x20\x62\x69\x72\x74\x68","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x70\x68\x6F\x6E\x65","\x50\x68\x6F\x6E\x65","\x6D\x6F\x62\x69\x6C\x65","\x4D\x6F\x62\x69\x6C\x65","\x66\x61\x78","\x46\x61\x78","\x65\x6D\x61\x69\x6C","\x45\x6D\x61\x69\x6C","\x75\x72\x6C","\x55\x52\x4C","\x72\x6F\x77\x73","\x6D\x65\x72\x67\x65","\x43\x6F\x6D\x70\x61\x6E\x79","\x6E\x61\x6D\x65","\x66\x6F\x72\x45\x61\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x2C","\x6A\x6F\x69\x6E","\x20\x61\x73\x20\x27","\x61\x6C\x69\x61\x73","\x27","\x6D\x61\x70","\x53\x45\x4C\x45\x43\x54\x20\x69\x64\x2C\x25\x73\x20\x46\x52\x4F\x4D\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x20\x49\x4E\x20\x28\x27","\x27\x2C\x27","\x27\x29\x20\x4F\x52\x44\x45\x52\x20\x42\x59\x20\x25\x73","\x6F\x72\x64\x65\x72","\x71\x75\x65\x72\x79","\x69\x64\x20\x41\x53\x43","\x66\x6F\x72\x6D\x61\x74","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x6B\x65\x79\x73","\x63\x66\x5F","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x66\x69\x6C\x74\x65\x72","\x4C\x69\x73\x74\x49\x64","\x24\x6F\x72","\x77\x68\x65\x72\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x64\x65\x73\x63\x72\x69\x62\x65","\x43\x6F\x6D\x70\x61\x6E\x79\x49\x64","\x63\x6F\x6E\x63\x61\x74","\x6D\x65\x72\x67\x65\x63\x6F\x6E\x74\x61\x63\x74","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x6C\x69\x73\x74","\x63\x6F\x6D\x70\x61\x6E\x79","\x63\x6F\x6D\x70\x61\x6E\x79\x5F\x6C\x69\x73\x74\x5F\x66\x69\x6C\x74\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x4C\x69\x73\x74\x73","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x67\x65\x6E\x74","\x63\x6F\x75\x6E\x74","\x72\x6F\x6C\x65","\x67\x65\x74\x4C\x6F\x67","\x64\x65\x74\x61\x69\x6C","\x67\x65\x6E\x65\x72\x61\x6C","\x73\x68\x6F\x77","\x6C\x6F\x67\x54\x79\x70\x65","\x6A\x6F\x75\x72\x6E\x61\x6C","\x74\x79\x70\x65","\x69\x6E\x62\x6F\x75\x6E\x64","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x64\x65\x73\x74\x69\x6E\x61\x74\x69\x6F\x6E","\x73\x6F\x75\x72\x63\x65","\x66\x72\x6F\x6D","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x63\x6F\x6E\x74\x61\x63\x74","\x63\x68\x61\x74","\x73\x6D\x73","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x71\x75\x65\x75\x65","\x70\x61\x72\x61\x6D\x73","\x6E\x75\x6C\x6C","\x53\x45\x4C\x45\x43\x54\x20\x25\x73\x20\x46\x52\x4F\x4D\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x67\x65\x74\x43\x6F\x6E\x74\x61\x63\x74\x73","\x73\x75\x62\x74\x79\x70\x65\x43\x68\x61\x6E\x6E\x65\x6C","\x62\x6F\x64\x79","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x76\x6F\x69\x63\x65","\x6D\x61\x69\x6C","\x65\x76\x65\x6E\x74\x43\x68\x61\x6E\x6E\x65\x6C","\x63\x72\x65\x61\x74\x65\x43\x6F\x6E\x74\x61\x63\x74","\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x63\x6F\x6E\x74\x61\x63\x74\x20\x61\x75\x74\x6F\x20\x63\x72\x65\x61\x74\x69\x6F\x6E","\x65\x72\x72\x6F\x72","\x70\x75\x73\x68","\x67\x65\x74","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x63\x72\x65\x61\x74\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x4E\x61\x6D\x65\x20\x6F\x72\x20\x4C\x69\x73\x74\x49\x64\x20\x6D\x69\x73\x73\x69\x6E\x67\x20\x6F\x72\x20\x69\x6E\x76\x61\x6C\x69\x64\x21","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x55\x73\x65\x72\x49\x64","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x3B","\x3B\x27","\x69\x73\x53\x74\x72\x69\x6E\x67","\x66\x6F\x72\x4F\x77\x6E","\x69\x6E\x73\x65\x72\x74\x49\x64","\x49\x4E\x53\x45\x52\x54\x20\x49\x4E\x54\x4F\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x28\x25\x73\x29\x20\x56\x41\x4C\x55\x45\x53\x20\x28\x25\x73\x29","\x63\x6F\x70\x79","\x25\x73\x3D\x27\x25\x73\x27","\x55\x50\x44\x41\x54\x45\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x53\x45\x54\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x63\x6C\x6F\x6E\x65","\x73\x70\x6C\x69\x74","\x70\x6F\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x61\x6C\x6C","\x63\x6F\x6E\x74\x61\x63\x74\x73","\x75\x6E\x69\x6F\x6E","\x73\x74\x61\x63\x6B","\x64\x65\x62\x75\x67","\x6B\x6F","\x66\x61\x69\x6C\x65\x64","\x6F\x6B","\x66\x6F\x72\x45\x61\x63\x68\x4F\x66","\x75\x70\x64\x61\x74\x65","\x6F\x6C\x64\x43\x6F\x6E\x74\x61\x63\x74","\x64\x65\x73\x74\x72\x6F\x79","\x63\x6F\x6E\x74\x61\x63\x74\x2F\x75\x70\x64\x61\x74\x65","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x63\x6F\x6E\x74\x61\x63\x74\x2F\x64\x65\x6C\x65\x74\x65","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xc786[0];var _=require(_0xc786[1]);var moment=require(_0xc786[2]);var Contact=require(_0xc786[4])[_0xc786[3]];var User=require(_0xc786[4])[_0xc786[5]];var ContactPhone=require(_0xc786[4])[_0xc786[6]];var ContactEmail=require(_0xc786[4])[_0xc786[7]];var CustomField=require(_0xc786[4])[_0xc786[8]];var ReportCall=require(_0xc786[4])[_0xc786[9]];var ReportQueue=require(_0xc786[4])[_0xc786[10]];var ReportQueueHistory=require(_0xc786[4])[_0xc786[12]][_0xc786[11]];var ReportChatRoom=require(_0xc786[4])[_0xc786[13]];var ReportChatRoomHistory=require(_0xc786[4])[_0xc786[12]][_0xc786[14]];var ChatRoom=require(_0xc786[4])[_0xc786[15]];var FaxRoom=require(_0xc786[4])[_0xc786[16]];var SmsRoom=require(_0xc786[4])[_0xc786[17]];var ReportIntegration=require(_0xc786[4])[_0xc786[18]];var List=require(_0xc786[4])[_0xc786[19]];var ReportCallHistory=require(_0xc786[4])[_0xc786[12]][_0xc786[20]];var ReportMailSession=require(_0xc786[4])[_0xc786[21]];var MailRoom=require(_0xc786[4])[_0xc786[22]];var ReportMailSessionHistory=require(_0xc786[4])[_0xc786[12]][_0xc786[23]];var Tag=require(_0xc786[4])[_0xc786[24]];var TdUpdate=require(_0xc786[4])[_0xc786[25]];var stream=require(_0xc786[26]);var sequelize=require(_0xc786[4])[_0xc786[27]];var util=require(_0xc786[28]);var Util=require(_0xc786[29]);var Async=require(_0xc786[30]);var Promise=require(_0xc786[31]);var logger=require(_0xc786[33])(_0xc786[32]);exports[_0xc786[34]]= function(_0xe570x1f,_0xe570x20,_0xe570x21){return Promise[_0xc786[39]]()[_0xc786[38]](getContacts(_0xe570x1f))[_0xc786[38]](function(_0xe570x23){_0xe570x20[_0xc786[37]](200)[_0xc786[36]](_0xe570x23)})[_0xc786[35]](function(_0xe570x22){return handleError(_0xe570x20,_0xe570x22)})};exports[_0xc786[40]]= function(_0xe570x1f,_0xe570x20,_0xe570x21){var _0xe570x24=[_0xc786[41],[_0xc786[42],_0xc786[43]],[_0xc786[44],_0xc786[45]],[_0xc786[46],_0xc786[47]],[_0xc786[48],_0xc786[49]],[_0xc786[50],_0xc786[51]],[_0xc786[52],_0xc786[53]],[_0xc786[54],_0xc786[55]],[_0xc786[56],_0xc786[57]],[_0xc786[58],_0xc786[59]],[_0xc786[60],_0xc786[61]],[_0xc786[62],_0xc786[63]],[_0xc786[64],_0xc786[65]],[_0xc786[66],_0xc786[67]],[_0xc786[68],_0xc786[69]]];return Promise[_0xc786[39]]()[_0xc786[38]](getContacts(_0xe570x1f,_0xe570x24))[_0xc786[38]](function(_0xe570x23){_0xe570x20[_0xc786[37]](200)[_0xc786[36]](_0xe570x23)})[_0xc786[35]](function(_0xe570x22){return handleError(_0xe570x20,_0xe570x22)})};function getContacts(_0xe570x1f,_0xe570x24){return function(){var _0xe570x26,_0xe570x27,_0xe570x28;switch(_0xe570x1f[_0xc786[111]][_0xc786[115]]){case _0xc786[113]:return User[_0xc786[112]](_0xe570x1f[_0xc786[111]][_0xc786[41]])[_0xc786[38]](function(_0xe570x37){return _0xe570x37[_0xc786[110]]()})[_0xc786[38]](function(_0xe570x36){_0xe570x27= _[_0xc786[81]](_0xe570x36,_0xc786[41]);return List[_0xc786[98]]({where:{defaultEntry:true},attributes:[_0xc786[41]]})})[_0xc786[38]](function(_0xe570x34){_0xe570x28= {CompanyId:_0xe570x1f[_0xc786[86]][_0xc786[101]]|| null,ListId:_0xe570x1f[_0xc786[86]][_0xc786[95]]|| null};delete _0xe570x1f[_0xc786[86]][_0xc786[101]];delete _0xe570x1f[_0xc786[86]][_0xc786[95]];var _0xe570x35=_0xe570x28[_0xc786[95]]?{}:{ListId:{$in:_0xe570x27[_0xc786[102]](_[_0xc786[81]](_0xe570x34,_0xc786[41]))}};if(_0xe570x1f[_0xc786[86]][_0xc786[103]]){_0xe570x35[_0xc786[41]]= {$ne:_0xe570x1f[_0xc786[86]][_0xc786[103]]};delete _0xe570x1f[_0xc786[86]][_0xc786[103]]};return Contact[_0xc786[109]](_0xc786[106],_0xc786[107],{method:[_0xc786[108],_0xe570x28]})[_0xc786[105]](Util[_0xc786[104]](_0xe570x1f[_0xc786[86]],_0xe570x35,{attributes:_0xe570x24,order:_0xe570x1f[_0xc786[86]][_0xc786[85]]|| _0xc786[87]}))})[_0xc786[38]](function(_0xe570x33){_0xe570x26= {rows:_[_0xc786[81]](_0xe570x33[_0xc786[70]],_0xc786[99]),count:_0xe570x33[_0xc786[70]]};return Contact[_0xc786[100]]()})[_0xc786[38]](function(_0xe570x30){_0xe570x30= _[_0xc786[94]](_[_0xc786[91]](_0xe570x30),function(_0xe570x31){return _[_0xc786[93]](_0xe570x31,_0xc786[92])});var _0xe570x32={where:{name:_0xe570x30}};_0xe570x28[_0xc786[95]]&& (_0xe570x32[_0xc786[97]][_0xc786[96]]= [{ListId:_0xe570x28[_0xc786[95]]},{ListId:null}]);return CustomField[_0xc786[98]](_0xe570x32)})[_0xc786[38]](function(_0xe570x2d){if(_0xe570x2d[_0xc786[75]]){var _0xe570x2e=_[_0xc786[81]](_0xe570x2d,function(_0xe570x2f){return _0xe570x2f[_0xc786[73]]+ _0xc786[78]+ _0xe570x2f[_0xc786[79]]+ _0xc786[80]})[_0xc786[77]](_0xc786[76]);return sequelize[_0xc786[86]](util[_0xc786[88]](_0xc786[82]+ _[_0xc786[81]](_0xe570x26[_0xc786[70]],_0xc786[41])[_0xc786[77]](_0xc786[83])+ _0xc786[84],_0xe570x2e,_0xe570x1f[_0xc786[86]][_0xc786[85]]|| _0xc786[87]),{type:sequelize[_0xc786[90]][_0xc786[89]]})}})[_0xc786[38]](function(_0xe570x29){var _0xe570x2a;if(_0xe570x29){_[_0xc786[74]](_0xe570x26[_0xc786[70]],function(_0xe570x2b,_0xe570x2c){_[_0xc786[71]](_0xe570x2b,_0xe570x29[_0xe570x2c]);if(_0xe570x24){delete _0xe570x2b[_0xc786[41]];_0xe570x2b[_0xc786[72]]&& (_0xe570x2b[_0xc786[72]]= _0xe570x2b[_0xc786[72]][_0xc786[73]]);_0xe570x2b[_0xc786[19]]&& (_0xe570x2b[_0xc786[19]]= _0xe570x2b[_0xc786[19]][_0xc786[73]])}})}else {if(_0xe570x24){_[_0xc786[74]](_0xe570x26[_0xc786[70]],function(_0xe570x2b,_0xe570x2c){delete _0xe570x2b[_0xc786[41]];_0xe570x2b[_0xc786[72]]&& (_0xe570x2b[_0xc786[72]]= _0xe570x2b[_0xc786[72]][_0xc786[73]]);_0xe570x2b[_0xc786[19]]&& (_0xe570x2b[_0xc786[19]]= _0xe570x2b[_0xc786[19]][_0xc786[73]])})}};return _0xe570x26})[_0xc786[38]](function(_0xe570x23){return _0xe570x23});default:_0xe570x28= {CompanyId:_0xe570x1f[_0xc786[86]][_0xc786[101]]|| null,ListId:_0xe570x1f[_0xc786[86]][_0xc786[95]]|| null};delete _0xe570x1f[_0xc786[86]][_0xc786[101]];delete _0xe570x1f[_0xc786[86]][_0xc786[95]];var _0xe570x35={};if(_0xe570x1f[_0xc786[86]][_0xc786[103]]){_0xe570x35[_0xc786[41]]= {$ne:_0xe570x1f[_0xc786[86]][_0xc786[103]]};delete _0xe570x1f[_0xc786[86]][_0xc786[103]]};return Contact[_0xc786[109]](_0xc786[106],_0xc786[107],{method:[_0xc786[108],_0xe570x28]})[_0xc786[105]](Util[_0xc786[104]](_0xe570x1f[_0xc786[86]],_0xe570x35,{attributes:_0xe570x24,order:_0xe570x1f[_0xc786[86]][_0xc786[85]]|| _0xc786[87]}))[_0xc786[38]](function(_0xe570x33){_0xe570x26= {rows:_[_0xc786[81]](_0xe570x33[_0xc786[70]],_0xc786[99]),count:_0xe570x33[_0xc786[114]]};return Contact[_0xc786[100]]()})[_0xc786[38]](function(_0xe570x30){_0xe570x30= _[_0xc786[94]](_[_0xc786[91]](_0xe570x30),function(_0xe570x31){return _[_0xc786[93]](_0xe570x31,_0xc786[92])});var _0xe570x32={where:{name:_0xe570x30}};_0xe570x28[_0xc786[95]]&& (_0xe570x32[_0xc786[97]][_0xc786[96]]= [{ListId:_0xe570x28[_0xc786[95]]},{ListId:null}]);return CustomField[_0xc786[98]](_0xe570x32)})[_0xc786[38]](function(_0xe570x2d){if(_0xe570x26[_0xc786[70]][_0xc786[75]]&& _0xe570x2d[_0xc786[75]]){var _0xe570x2e=_[_0xc786[81]](_0xe570x2d,function(_0xe570x2f){return _0xe570x2f[_0xc786[73]]+ _0xc786[78]+ _0xe570x2f[_0xc786[79]]+ _0xc786[80]})[_0xc786[77]](_0xc786[76]);return sequelize[_0xc786[86]](util[_0xc786[88]](_0xc786[82]+ _[_0xc786[81]](_0xe570x26[_0xc786[70]],_0xc786[41])[_0xc786[77]](_0xc786[83])+ _0xc786[84],_0xe570x2e,_0xe570x1f[_0xc786[86]][_0xc786[85]]|| _0xc786[87]),{type:sequelize[_0xc786[90]][_0xc786[89]]})}})[_0xc786[38]](function(_0xe570x29){var _0xe570x2a;if(_0xe570x29){_[_0xc786[74]](_0xe570x26[_0xc786[70]],function(_0xe570x2b,_0xe570x2c){_[_0xc786[71]](_0xe570x2b,_0xe570x29[_0xe570x2c]);if(_0xe570x24){delete _0xe570x2b[_0xc786[41]];_0xe570x2b[_0xc786[72]]&& (_0xe570x2b[_0xc786[72]]= _0xe570x2b[_0xc786[72]][_0xc786[73]]);_0xe570x2b[_0xc786[19]]&& (_0xe570x2b[_0xc786[19]]= _0xe570x2b[_0xc786[19]][_0xc786[73]])}})}else {if(_0xe570x24){_[_0xc786[74]](_0xe570x26[_0xc786[70]],function(_0xe570x2b,_0xe570x2c){delete _0xe570x2b[_0xc786[41]];_0xe570x2b[_0xc786[72]]&& (_0xe570x2b[_0xc786[72]]= _0xe570x2b[_0xc786[72]][_0xc786[73]]);_0xe570x2b[_0xc786[19]]&& (_0xe570x2b[_0xc786[19]]= _0xe570x2b[_0xc786[19]][_0xc786[73]])})}};return _0xe570x26})[_0xc786[38]](function(_0xe570x23){return _0xe570x23})}}}exports[_0xc786[100]]= function(_0xe570x1f,_0xe570x20){return Contact[_0xc786[100]]()[_0xc786[38]](function(_0xe570x30){return _0xe570x20[_0xc786[37]](200)[_0xc786[36]](_0xe570x30)})[_0xc786[35]](function(_0xe570x22){return handleError(_0xe570x20,_0xe570x22)})};exports[_0xc786[116]]= function(_0xe570x1f,_0xe570x20,_0xe570x21){_0xe570x1f[_0xc786[86]][_0xc786[117]]= _0xe570x1f[_0xc786[86]][_0xc786[117]]|| _0xc786[118];_0xe570x1f[_0xc786[86]][_0xc786[119]]= _0xe570x1f[_0xc786[86]][_0xc786[119]]|| _0xc786[60];_0xe570x1f[_0xc786[86]][_0xc786[120]]= _0xe570x1f[_0xc786[86]][_0xc786[120]]|| _0xc786[121];_0xe570x1f[_0xc786[86]][_0xc786[122]]= _0xe570x1f[_0xc786[86]][_0xc786[122]]|| _0xc786[123];var _0xe570x38,_0xe570x39={};return Contact[_0xc786[112]](_0xe570x1f[_0xc786[137]][_0xc786[41]])[_0xc786[38]](function(_0xe570x3a){if(!_0xe570x3a){return _0xe570x20[_0xc786[124]](404)};switch(_0xe570x1f[_0xc786[86]][_0xc786[117]]){case _0xc786[118]:switch(_0xe570x1f[_0xc786[86]][_0xc786[119]]){case _0xc786[60]:_0xe570x38= (_0xe570x1f[_0xc786[86]][_0xc786[120]]=== _0xc786[12])?ReportCallHistory:ReportCall;if(_0xe570x1f[_0xc786[86]][_0xc786[122]]=== _0xc786[125]){_0xe570x39[_0xc786[126]]= [_0xe570x3a[_0xc786[60]],_0xe570x3a[_0xc786[62]]]}else {_0xe570x39[_0xc786[127]]= [_0xe570x3a[_0xc786[60]],_0xe570x3a[_0xc786[62]]]};break;case _0xc786[66]:_0xe570x38= MailRoom;_0xe570x39[_0xc786[128]]= _0xe570x3a[_0xc786[66]];if(_0xe570x1f[_0xc786[86]][_0xc786[120]]=== _0xc786[12]){_0xe570x39[_0xc786[129]]= {$lt:moment()[_0xc786[131]](_0xc786[130])}}else {_0xe570x39[_0xc786[129]]= {$gte:moment()[_0xc786[131]](_0xc786[130])}};break;case _0xc786[133]:_0xe570x38= ChatRoom;_0xe570x39[_0xc786[132]]= _0xe570x3a[_0xc786[66]];if(_0xe570x1f[_0xc786[86]][_0xc786[120]]=== _0xc786[12]){_0xe570x39[_0xc786[129]]= {$lt:moment()[_0xc786[131]](_0xc786[130])}}else {_0xe570x39[_0xc786[129]]= {$gte:moment()[_0xc786[131]](_0xc786[130])}};break;case _0xc786[64]:_0xe570x38= FaxRoom;_0xe570x39[_0xc786[132]]= _0xe570x3a[_0xc786[64]];if(_0xe570x1f[_0xc786[86]][_0xc786[120]]=== _0xc786[12]){_0xe570x39[_0xc786[129]]= {$lt:moment()[_0xc786[131]](_0xc786[130])}}else {_0xe570x39[_0xc786[129]]= {$gte:moment()[_0xc786[131]](_0xc786[130])}};break;case _0xc786[134]:_0xe570x38= SmsRoom;_0xe570x39[_0xc786[132]]= [_0xe570x3a[_0xc786[60]],_0xe570x3a[_0xc786[62]]];if(_0xe570x1f[_0xc786[86]][_0xc786[120]]=== _0xc786[12]){_0xe570x39[_0xc786[129]]= {$lt:moment()[_0xc786[131]](_0xc786[130])}}else {_0xe570x39[_0xc786[129]]= {$gte:moment()[_0xc786[131]](_0xc786[130])}};break;default:_0xe570x38= (_0xe570x1f[_0xc786[86]][_0xc786[120]]=== _0xc786[12])?ReportCallHistory:ReportCall};break;case _0xc786[136]:switch(_0xe570x1f[_0xc786[86]][_0xc786[119]]){case _0xc786[60]:_0xe570x38= (_0xe570x1f[_0xc786[86]][_0xc786[120]]=== _0xc786[12])?ReportQueueHistory:ReportQueue;_0xe570x39[_0xc786[135]]= [_0xe570x3a[_0xc786[60]],_0xe570x3a[_0xc786[62]]];break;case _0xc786[66]:return _0xe570x20[_0xc786[124]](404);default:_0xe570x38= (_0xe570x1f[_0xc786[86]][_0xc786[120]]=== _0xc786[12])?ReportQueueHistory:ReportQueue};break;default:_0xe570x38= ReportCall};delete _0xe570x1f[_0xc786[86]][_0xc786[117]];delete _0xe570x1f[_0xc786[86]][_0xc786[119]];delete _0xe570x1f[_0xc786[86]][_0xc786[120]];delete _0xe570x1f[_0xc786[86]][_0xc786[122]];return _0xe570x38[_0xc786[105]](Util[_0xc786[104]](_0xe570x1f[_0xc786[86]],_0xe570x39))})[_0xc786[38]](function(_0xe570x23){_0xe570x20[_0xc786[37]](200)[_0xc786[36]](_0xe570x23)})[_0xc786[35]](function(_0xe570x22){return handleError(_0xe570x20,_0xe570x22)})};exports[_0xc786[119]]= function(_0xe570x1f,_0xe570x20){var _0xe570x3b;return Contact[_0xc786[109]](_0xc786[106],_0xc786[111],_0xc786[107])[_0xc786[112]](_0xe570x1f[_0xc786[137]][_0xc786[41]])[_0xc786[38]](function(_0xe570x40){if(!_0xe570x40){return _0xe570x20[_0xc786[124]](404)};_0xe570x3b= _0xe570x40;return CustomField[_0xc786[98]]({where:{$or:[{ListId:_0xe570x3b[_0xc786[95]]},{ListId:null}]}})})[_0xc786[38]](function(_0xe570x2d){if(_0xe570x2d[_0xc786[75]]){var _0xe570x2e=_[_0xc786[81]](_0xe570x2d,_0xc786[73])[_0xc786[77]](_0xc786[76]);return sequelize[_0xc786[86]](util[_0xc786[88]](_0xc786[139],_0xe570x2e,_0xe570x1f[_0xc786[137]][_0xc786[41]]),{type:sequelize[_0xc786[90]][_0xc786[89]]})}})[_0xc786[38]](function(_0xe570x3c){if(_0xe570x3c){_[_0xc786[74]](_0xe570x3c[0],function(_0xe570x3d,_0xe570x3e,_0xe570x3f){if(_0xe570x3d=== _0xc786[138]){_0xe570x3f[_0xe570x3e]= null}});_[_0xc786[71]](_0xe570x3b[_0xc786[99]],_0xe570x3c[0])}})[_0xc786[38]](function(){return _0xe570x20[_0xc786[37]](200)[_0xc786[36]](_0xe570x3b)})[_0xc786[35]](function(_0xe570x22){return handleError(_0xe570x20,_0xe570x22)})};exports[_0xc786[140]]= function(_0xe570x1f,_0xe570x20){var _0xe570x39={},_0xe570x41;switch(_0xe570x1f[_0xc786[142]][_0xc786[146]]){case _0xc786[144]:if(_0xe570x1f[_0xc786[142]][_0xc786[141]]=== _0xc786[136]){_0xe570x39= {$or:{phone:_0xe570x1f[_0xc786[142]][_0xc786[135]],mobile:_0xe570x1f[_0xc786[142]][_0xc786[135]]}}}else {_0xe570x39= {$or:{phone:_0xe570x1f[_0xc786[142]][_0xc786[143]],mobile:_0xe570x1f[_0xc786[142]][_0xc786[143]]}}};break;case _0xc786[145]:_0xe570x39= {email:_0xe570x1f[_0xc786[142]][_0xc786[128]]};break;default:_0xe570x39= {}};var _0xe570x42=_[_0xc786[81]](_[_0xc786[81]](_0xe570x1f[_0xc786[111]].Lists,_0xc786[99]),_0xc786[41]);var _0xe570x43;return List[_0xc786[154]]({where:{defaultEntry:true}})[_0xc786[38]](function(_0xe570x44){if(_0xe570x44){_0xe570x42[_0xc786[150]](_0xe570x44[_0xc786[41]])};if(_0xe570x1f[_0xc786[142]][_0xc786[95]]){_0xe570x43= _[_0xc786[93]](_0xe570x42,_0xe570x1f[_0xc786[142]].ListId)?{id:_0xe570x1f[_0xc786[142]][_0xc786[95]]}:null}else {_0xe570x43= {id:_0xe570x42}};if(_0xe570x43){return Contact[_0xc786[105]]({where:_0xe570x39,include:[{model:List,where:_0xe570x43}]})};return null})[_0xc786[38]](function(_0xe570x33){if(_0xe570x33&& _0xe570x33[_0xc786[70]][_0xc786[75]]){_0xe570x41= _0xe570x33;return null}else {_0xe570x41= {count:0,rows:[]};if(_0xe570x1f[_0xc786[142]][_0xc786[147]]&& _0xe570x1f[_0xc786[142]][_0xc786[95]]&& _[_0xc786[93]](_0xe570x42,_0xe570x1f[_0xc786[142]].ListId)){var _0xe570x3b={};return Contact[_0xc786[153]]({firstName:_0xe570x1f[_0xc786[142]][_0xc786[152]],phone:_0xe570x1f[_0xc786[142]][_0xc786[135]],ListId:_0xe570x1f[_0xc786[142]][_0xc786[95]]})[_0xc786[38]](function(_0xe570x3a){_0xe570x3b= _0xe570x3a[_0xc786[151]]({plain:true});return List[_0xc786[112]](_0xe570x1f[_0xc786[142]].ListId,{raw:true})})[_0xc786[38]](function(_0xe570x44){_0xe570x3b[_0xc786[19]]= _0xe570x44;_0xe570x41[_0xc786[70]][_0xc786[150]](_0xe570x3b)})[_0xc786[35]](function(_0xe570x22){logger[_0xc786[149]](_0xc786[148],_0xe570x22)})}}})[_0xc786[38]](function(){return _0xe570x20[_0xc786[37]](200)[_0xc786[36]](_0xe570x41)})[_0xc786[35]](function(_0xe570x22){return handleError(_0xe570x20,_0xe570x22)})};exports[_0xc786[153]]= function(_0xe570x1f,_0xe570x20,_0xe570x21){if(!_0xe570x1f[_0xc786[142]][_0xc786[42]]||  !_0xe570x1f[_0xc786[142]][_0xc786[95]]){return handleError(_0xe570x20,{message:_0xc786[155]})};var _0xe570x3b,_0xe570x45=moment()[_0xc786[88]](_0xc786[156]),_0xe570x46=[],_0xe570x47=[];_0xe570x1f[_0xc786[142]][_0xc786[157]]= _0xe570x1f[_0xc786[111]][_0xc786[41]];_0xe570x1f[_0xc786[142]][_0xc786[129]]= _0xe570x45;_0xe570x1f[_0xc786[142]][_0xc786[158]]= _0xe570x45;_[_0xc786[162]](_0xe570x1f[_0xc786[142]],function(_0xe570x3d,_0xe570x3e){if(_0xe570x3d){switch(_0xe570x3e){case _0xc786[46]:if(_0xe570x3d[_0xc786[75]]){_0xe570x47[_0xc786[150]](_0xc786[80]+ _0xe570x3d[_0xc786[77]](_0xc786[159])+ _0xc786[160]);_0xe570x46[_0xc786[150]](_0xe570x3e)};break;default:_0xe570x46[_0xc786[150]](_0xe570x3e);_0xe570x47[_0xc786[150]](_[_0xc786[161]](_0xe570x3d)?_0xc786[80]+ _0xe570x3d+ _0xc786[80]:_0xe570x3d)}}});return sequelize[_0xc786[86]](util[_0xc786[88]](_0xc786[164],_0xe570x46[_0xc786[77]](_0xc786[76]),_0xe570x47[_0xc786[77]](_0xc786[76])))[_0xc786[38]](function(_0xe570x3a){_0xe570x1f[_0xc786[142]][_0xc786[41]]= _0xe570x3a[0][_0xc786[163]];return _0xe570x20[_0xc786[37]](201)[_0xc786[36]](_0xe570x1f[_0xc786[142]])})[_0xc786[35]](function(_0xe570x22){return _0xe570x21(_0xe570x22)})};exports[_0xc786[165]]= function(_0xe570x1f,_0xe570x20,_0xe570x21){var _0xe570x3b,_0xe570x48;return Contact[_0xc786[112]](_0xe570x1f[_0xc786[137]][_0xc786[41]])[_0xc786[38]](function(_0xe570x3a){_0xe570x3b= _0xe570x3a[_0xc786[99]];_0xe570x48= _[_0xc786[168]](_0xe570x3a[_0xc786[99]]);delete _0xe570x48[_0xc786[41]];_0xe570x48[_0xc786[157]]= _0xe570x1f[_0xc786[111]][_0xc786[41]];_0xe570x48[_0xc786[95]]= _0xe570x1f[_0xc786[142]][_0xc786[95]];_0xe570x48[_0xc786[46]]= _0xe570x48[_0xc786[46]]?_0xe570x48[_0xc786[46]][_0xc786[169]](_0xc786[159]):[];if(_0xe570x48[_0xc786[46]][_0xc786[75]]> 1){_0xe570x48[_0xc786[46]][_0xc786[170]]()};return Contact[_0xc786[153]](_0xe570x48)})[_0xc786[38]](function(_0xe570x49){_0xe570x48= _0xe570x49;if(_0xe570x3b[_0xc786[95]]=== _0xe570x1f[_0xc786[142]][_0xc786[95]]){return CustomField[_0xc786[98]]({where:{$or:[{ListId:_0xe570x3b[_0xc786[95]]},{ListId:null}]}})}})[_0xc786[38]](function(_0xe570x2d){if(_0xe570x2d&& _0xe570x2d[_0xc786[75]]){var _0xe570x2e=_[_0xc786[81]](_0xe570x2d,_0xc786[73])[_0xc786[77]](_0xc786[76]);return sequelize[_0xc786[86]](util[_0xc786[88]](_0xc786[139],_0xe570x2e,_0xe570x3b[_0xc786[41]]),{type:sequelize[_0xc786[90]][_0xc786[89]]})}})[_0xc786[38]](function(_0xe570x3c){if(_0xe570x3c){var _0xe570x2e=[];_[_0xc786[162]](_0xe570x3c[0],function(_0xe570x3d,_0xe570x3e){_0xe570x2e[_0xc786[150]](util[_0xc786[88]](_0xc786[166],_0xe570x3e,_0xe570x3d))});if(_0xe570x2e[_0xc786[75]]){_0xe570x2e= _0xe570x2e[_0xc786[77]](_0xc786[76]);return sequelize[_0xc786[86]](util[_0xc786[88]](_0xc786[167],_0xe570x2e,_0xe570x48[_0xc786[41]]))}}})[_0xc786[38]](function(){return _0xe570x20[_0xc786[37]](201)[_0xc786[36]](_0xe570x48)})[_0xc786[35]](function(_0xe570x22){return _0xe570x21(_0xe570x22)})};exports[_0xc786[171]]= function(_0xe570x1f,_0xe570x20,_0xe570x21){var _0xe570x41=[],_0xe570x45=moment()[_0xc786[88]](_0xc786[156]),_0xe570x4a=[],_0xe570x46,_0xe570x47,_0xe570x4b={ok:0,ko:0,failed:[]};return Tag[_0xc786[98]]()[_0xc786[38]](function(_0xe570x4c){var _0xe570x4d=[],_0xe570x4e=[];var _0xe570x4f=_[_0xc786[81]](_[_0xc786[81]](_0xe570x4c,_0xc786[99]),_0xc786[73]);Async[_0xc786[180]](_0xe570x1f[_0xc786[142]][_0xc786[173]],function(_0xe570x3a,_0xe570x2c){if(_0xe570x3a[_0xc786[42]]&& _0xe570x3a[_0xc786[95]]){_0xe570x3a[_0xc786[157]]= _0xe570x1f[_0xc786[111]][_0xc786[41]];_0xe570x3a[_0xc786[129]]= _0xe570x45;_0xe570x3a[_0xc786[158]]= _0xe570x45;_0xe570x3a[_0xc786[46]]&& (_0xe570x4e= _[_0xc786[174]](_0xe570x4e,_0xe570x3a[_0xc786[46]]));_0xe570x46= [];_0xe570x47= [];_[_0xc786[162]](_0xe570x3a,function(_0xe570x3d,_0xe570x3e){if(_0xe570x3d){switch(_0xe570x3e){case _0xc786[46]:if(_0xe570x3d[_0xc786[75]]){_0xe570x47[_0xc786[150]](_0xc786[80]+ _0xe570x3d[_0xc786[77]](_0xc786[159])+ _0xc786[160]);_0xe570x46[_0xc786[150]](_0xe570x3e)};break;default:_0xe570x46[_0xc786[150]](_0xe570x3e);_0xe570x47[_0xc786[150]](_[_0xc786[161]](_0xe570x3d)?_0xc786[80]+ _0xe570x3d+ _0xc786[80]:_0xe570x3d)}}});_0xe570x4a[_0xc786[150]](sequelize[_0xc786[86]](util[_0xc786[88]](_0xc786[164],_0xe570x46[_0xc786[77]](_0xc786[76]),_0xe570x47[_0xc786[77]](_0xc786[76])))[_0xc786[38]](function(_0xe570x49){_0xe570x3a[_0xc786[41]]= _0xe570x49[_0xc786[41]];_0xe570x41[_0xc786[150]](_0xe570x3a);_0xe570x4b[_0xc786[179]]++})[_0xc786[35]](function(_0xe570x22){logger[_0xc786[176]](_0xe570x22[_0xc786[175]]);_0xe570x4b[_0xc786[177]]++;_0xe570x4b[_0xc786[178]][_0xc786[150]](_0xe570x2c)}))}else {_0xe570x4b[_0xc786[177]]++;_0xe570x4b[_0xc786[178]][_0xc786[150]](_0xe570x2c)}});_0xe570x4e[_0xc786[75]]&& _[_0xc786[74]](_0xe570x4e,function(_0xe570x31){if(!_0xe570x4f[_0xc786[75]]||  !_[_0xc786[93]](_0xe570x4f,_0xe570x31)){_0xe570x4d[_0xc786[150]](Tag[_0xc786[153]]({name:_0xe570x31}))}});return _0xe570x4d})[_0xc786[172]]()[_0xc786[38]](function(){return _0xe570x4a})[_0xc786[172]]()[_0xc786[38]](function(){return _0xe570x20[_0xc786[37]](201)[_0xc786[36]](_0xe570x4b)})[_0xc786[35]](function(_0xe570x22){return _0xe570x21(_0xe570x22)})};exports[_0xc786[181]]= function(_0xe570x1f,_0xe570x20,_0xe570x21){return Promise[_0xc786[172]]([])[_0xc786[38]](updateContact(_0xe570x1f,_0xe570x20))[_0xc786[38]](function(_0xe570x3a){return _0xe570x20[_0xc786[37]](200)[_0xc786[36]](_0xe570x3a)})[_0xc786[35]](function(_0xe570x22){return handleError(_0xe570x20,_0xe570x22)})};exports[_0xc786[71]]= function(_0xe570x1f,_0xe570x20,_0xe570x21){var _0xe570x3b;return Promise[_0xc786[172]]([])[_0xc786[38]](updateContact(_0xe570x1f,_0xe570x20))[_0xc786[38]](function(_0xe570x3a){_0xe570x3b= _0xe570x3a;if(_0xe570x1f[_0xc786[142]][_0xc786[182]]){return Contact[_0xc786[183]]({where:{id:_0xe570x1f[_0xc786[142]][_0xc786[182]]},individualHooks:true})}})[_0xc786[38]](function(){return _0xe570x20[_0xc786[37]](200)[_0xc786[36]](_0xe570x3b)})[_0xc786[35]](function(_0xe570x22){return handleError(_0xe570x20,_0xe570x22)})};function updateContact(_0xe570x1f,_0xe570x20){return function(){var _0xe570x3b;return Tag[_0xc786[98]]()[_0xc786[38]](function(_0xe570x4c){var _0xe570x4d=[];var _0xe570x4f=_[_0xc786[81]](_[_0xc786[81]](_0xe570x4c,_0xc786[99]),_0xc786[73]);if(_0xe570x1f[_0xc786[142]][_0xc786[46]]){_0xe570x1f[_0xc786[142]][_0xc786[46]][_0xc786[74]](function(_0xe570x31){if(!_[_0xc786[93]](_0xe570x4f,_0xe570x31)){_0xe570x4d[_0xc786[150]](Tag[_0xc786[153]]({name:_0xe570x31}))}})};return _0xe570x4d})[_0xc786[38]](function(){return Contact[_0xc786[112]](_0xe570x1f[_0xc786[137]][_0xc786[41]])})[_0xc786[38]](function(_0xe570x3a){if(!_0xe570x3a){return _0xe570x20[_0xc786[124]](404)};delete _0xe570x1f[_0xc786[142]][_0xc786[41]];return _0xe570x3a[_0xc786[186]](_0xe570x1f[_0xc786[142]])})[_0xc786[38]](function(_0xe570x3a){_0xe570x3b= _0xe570x3a;return CustomField[_0xc786[98]]({where:{$or:[{ListId:_0xe570x3b[_0xc786[95]]},{ListId:null}]}})})[_0xc786[38]](function(_0xe570x2d){if(_0xe570x2d[_0xc786[75]]){var _0xe570x2e=[];_0xe570x2d[_0xc786[74]](function(_0xe570x31){if(_0xe570x1f[_0xc786[142]][_0xc786[185]](_0xe570x31[_0xc786[73]])){_0xe570x2e[_0xc786[150]](util[_0xc786[88]](_0xc786[166],_0xe570x31[_0xc786[73]],_0xe570x1f[_0xc786[142]][_0xe570x31[_0xc786[73]]]))}});if(_0xe570x2e[_0xc786[75]]){_0xe570x2e= _0xe570x2e[_0xc786[77]](_0xc786[76]);return sequelize[_0xc786[86]](util[_0xc786[88]](_0xc786[167],_0xe570x2e,_0xe570x3b[_0xc786[41]]))}}})[_0xc786[38]](function(){return TdUpdate[_0xc786[153]]({action:_0xc786[184],listId:_0xe570x3b[_0xc786[95]],contactId:_0xe570x3b[_0xc786[41]]})})[_0xc786[38]](function(){return _0xe570x3b})}}exports[_0xc786[183]]= function(_0xe570x1f,_0xe570x20){return Contact[_0xc786[112]](_0xe570x1f[_0xc786[137]][_0xc786[41]])[_0xc786[38]](function(_0xe570x40){if(!_0xe570x40){return _0xe570x20[_0xc786[124]](404)};return _0xe570x40[_0xc786[183]]()})[_0xc786[38]](function(_0xe570x3a){return TdUpdate[_0xc786[153]]({action:_0xc786[187],listId:_0xe570x3a[_0xc786[95]],contactId:_0xe570x3a[_0xc786[41]]})})[_0xc786[38]](function(){return _0xe570x20[_0xc786[124]](204)})[_0xc786[35]](function(_0xe570x22){return handleError(_0xe570x20,_0xe570x22)})};exports[_0xc786[188]]= function(_0xe570x1f,_0xe570x20){return Contact[_0xc786[98]]({where:{id:_0xe570x1f[_0xc786[86]][_0xc786[189]]}})[_0xc786[38]](function(_0xe570x33){var _0xe570x51=[];if(_0xe570x33&& _0xe570x33[_0xc786[75]]){_[_0xc786[74]](_0xe570x33,function(_0xe570x3a){_0xe570x51[_0xc786[150]](_0xe570x3a[_0xc786[183]]());_0xe570x51[_0xc786[150]](TdUpdate[_0xc786[153]]({action:_0xc786[187],listId:_0xe570x3a[_0xc786[95]],contactId:_0xe570x3a[_0xc786[41]]}))})};return _0xe570x51})[_0xc786[172]]()[_0xc786[38]](function(){return _0xe570x20[_0xc786[124]](204)})[_0xc786[35]](function(_0xe570x22){return handleError(_0xe570x20,_0xe570x22)})};function handleError(_0xe570x20,_0xe570x22){logger[_0xc786[149]](_0xe570x22[_0xc786[175]]);return _0xe570x20[_0xc786[37]](500)[_0xc786[36]](_0xe570x22)}
\ No newline at end of file