Built motion from commit 76c0fab.|0.0.109
[motion.git] / server / config / routing / sms / index.js
index 66134f2..d2078dd 100644 (file)
@@ -1 +1 @@
-var _0x836e=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x75\x74\x69\x6C","\x61\x73\x79\x6E\x63","\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x53\x65\x73\x73\x69\x6F\x6E","\x53\x6D\x73\x4D\x65\x73\x73\x61\x67\x65","\x53\x6D\x73\x52\x6F\x6F\x6D","\x53\x6D\x73\x51\x75\x65\x75\x65","\x49\x6E\x74\x65\x72\x76\x61\x6C","\x55\x73\x65\x72","\x2E\x2F\x73\x65\x73\x73\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x73","\x53\x6D\x73\x20\x52\x6F\x75\x74\x69\x6E\x67\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E","\x6C\x6F\x67","\x73\x74\x61\x74\x75\x73","\x52\x45\x43\x45\x49\x56\x45\x44","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x72\x6F\x6F\x6D\x69\x64","\x69\x64","\x75\x6E\x69\x71\x75\x65\x69\x64","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x66\x6F\x72\x6D\x61\x74","\x61\x67\x65\x6E\x74\x73","\x6E\x61\x6D\x65","\x6D\x61\x70","\x67\x65\x74\x53\x6D\x73\x41\x63\x63\x6F\x75\x6E\x74","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x61\x63\x63\x6F\x75\x6E\x74\x6E\x61\x6D\x65","\x61\x63\x63\x6F\x75\x6E\x74\x6E\x75\x6D\x62\x65\x72","\x70\x68\x6F\x6E\x65","\x66\x69\x64\x65\x6C\x69\x74\x79","\x61\x70\x70\x74\x69\x6D\x65\x6F\x75\x74","\x71\x75\x65\x75\x65\x74\x69\x6D\x65\x6F\x75\x74","\x74\x69\x6D\x65\x6F\x75\x74","\x73\x74\x72\x61\x74\x65\x67\x79","\x62\x65\x65\x70\x61\x6C\x6C","\x70\x72\x69\x6F\x72\x69\x74\x79\x20\x41\x53\x43","\x6F\x6E\x6C\x69\x6E\x65","\x73\x6D\x73\x50\x61\x75\x73\x65","\x67\x65\x74\x53\x6D\x73\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x68\x61\x6E\x64\x6C\x65\x20\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x63\x6C\x6F\x6E\x65\x44\x65\x65\x70","\x6C\x65\x6E\x67\x74\x68","\x70\x75\x73\x68","\x61\x70\x70","\x6A\x6F\x69\x6E\x41\x74","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x71\x75\x65\x75\x65\x69\x64","\x71\x75\x65\x75\x65\x6E\x61\x6D\x65","\x55\x73\x65\x72\x73","\x55\x73\x65\x72\x48\x61\x73\x53\x6D\x73\x51\x75\x65\x75\x65\x2E\x70\x65\x6E\x61\x6C\x74\x79","\x6F\x72\x64\x65\x72\x42\x79","\x70\x65\x6E\x61\x6C\x74\x79","\x55\x73\x65\x72\x48\x61\x73\x53\x6D\x73\x51\x75\x65\x75\x65","\x71\x75\x65\x75\x65","\x61\x67\x65\x6E\x74","\x64\x61\x74\x61\x31","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x74\x69\x6D\x65\x73\x6C\x6F\x74","\x63\x72\x65\x61\x74\x65","\x75\x70\x64\x61\x74\x65","\x64\x61\x74\x61\x32","\x72\x65\x70\x6F\x72\x74\x20\x73\x6D\x73\x20\x72\x6F\x6F\x6D","\x66\x72\x6F\x6D","\x66\x6F\x72\x45\x61\x63\x68","\x45\x6E\x64\x20\x73\x6D\x73\x20\x72\x6F\x75\x74\x69\x6E\x67\x2E\x2E","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x66\x69\x6E\x64\x42\x79\x49\x64","\x77\x61\x74\x65\x72\x66\x61\x6C\x6C","\x65\x72\x72","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x53\x6D\x73\x41\x63\x63\x6F\x75\x6E\x74\x2E\x2E","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x53\x6D\x73\x52\x6F\x6F\x6D\x2E\x2E","\x67\x65\x74\x53\x6D\x73\x52\x6F\x6F\x6D"];_0x836e[0];var _=require(_0x836e[1]);var moment=require(_0x836e[2]);var util=require(_0x836e[3]);var async=require(_0x836e[4]);var Util=require(_0x836e[5]);var ReportSms=require(_0x836e[7])[_0x836e[6]];var ReportSmsRoom=require(_0x836e[7])[_0x836e[8]];var ReportSmsSession=require(_0x836e[7])[_0x836e[9]];var SmsMessage=require(_0x836e[7])[_0x836e[10]];var SmsRoom=require(_0x836e[7])[_0x836e[11]];var SmsQueue=require(_0x836e[7])[_0x836e[12]];var Interval=require(_0x836e[7])[_0x836e[13]];var User=require(_0x836e[7])[_0x836e[14]];var Session=require(_0x836e[15]);module[_0x836e[16]]=function(){console[_0x836e[18]](_0x836e[17]);SmsMessage[_0x836e[21]](function(_0x2c07xf){if(_0x2c07xf[_0x836e[19]]===_0x836e[20]){handleMessage(_0x2c07xf)}})};function handleEntityNotFound(_0x2c07xf){return function(_0x2c07x11){if(!_0x2c07x11){throw {message:_0x2c07xf}};return _0x2c07x11}}function handleSmsRoom(_0x2c07x13,_0x2c07x14){return function(_0x2c07x15){console[_0x836e[18]](_0x2c07x15);_0x2c07x13[_0x836e[22]]=_0x2c07x15[_0x836e[23]];_0x2c07x13[_0x836e[24]]=util[_0x836e[27]](_0x836e[25],moment()[_0x836e[26]](),_0x2c07x15[_0x836e[23]]);_0x2c07x14[_0x836e[28]]=_[_0x836e[30]](_0x2c07x15.Users,function(_0x2c07x16){return {id:_0x2c07x16[_0x836e[23]],name:_0x2c07x16[_0x836e[29]],penalty:0}});return _0x2c07x15[_0x836e[31]]()}}function handleSmsAccount(_0x2c07x13,_0x2c07x14){return function(_0x2c07x18){_0x2c07x13[_0x836e[32]]=_0x2c07x18[_0x836e[23]];_0x2c07x13[_0x836e[33]]=_0x2c07x18[_0x836e[29]];_0x2c07x13[_0x836e[34]]=_0x2c07x18[_0x836e[35]];_0x2c07x14[_0x836e[36]]=_0x2c07x18[_0x836e[36]];if(_0x2c07x18[_0x836e[36]]){_0x2c07x14[_0x836e[37]]=_0x2c07x14[_0x836e[38]]=_0x2c07x18[_0x836e[39]];_0x2c07x14[_0x836e[36]]=_0x2c07x18[_0x836e[39]];_0x2c07x14[_0x836e[40]]=_0x836e[41]};return _0x2c07x18[_0x836e[45]]({order:_0x836e[42],include:[{model:SmsQueue,attributes:[_0x836e[23],_0x836e[29],_0x836e[39],_0x836e[40]],include:[{model:User,attributes:[_0x836e[23],_0x836e[29],_0x836e[43],_0x836e[44]]}]},{model:User,attributes:[_0x836e[23],_0x836e[29],_0x836e[43],_0x836e[44]]},{model:Interval,include:[{all:true}]}]})}}function handleApps(_0x2c07x13,_0x2c07x14){return function(_0x2c07x1a){var _0x2c07x1b=[];console[_0x836e[18]](_0x836e[46]);if(_0x2c07x14[_0x836e[36]]){_0x2c07x13[_0x836e[38]]=_0x2c07x14[_0x836e[36]];_0x2c07x13[_0x836e[37]]=_0x2c07x14[_0x836e[36]];_0x2c07x13[_0x836e[28]]=_0x2c07x14[_0x836e[28]];_0x2c07x13[_0x836e[47]]=_0x836e[36];_0x2c07x13[_0x836e[40]]=_0x836e[41];var _0x2c07x1c=_[_0x836e[48]](_0x2c07x13);if(_0x2c07x1c[_0x836e[28]][_0x836e[49]]){_0x2c07x1b[_0x836e[50]](function(_0x2c07x1d){ new Session(_0x2c07x1c,_0x2c07x1d)})}};_0x2c07x1a[_0x836e[73]](function(_0x2c07x1e,_0x2c07x1f){var _0x2c07x1c=_[_0x836e[48]](_0x2c07x13);_0x2c07x1c[_0x836e[37]]=_0x2c07x1e[_0x836e[39]];_0x2c07x1c[_0x836e[47]]=_0x2c07x1e[_0x836e[51]];_0x2c07x1c[_0x836e[52]]=moment()[_0x836e[27]](_0x836e[53]);switch(_0x2c07x1e[_0x836e[51]]){case _0x836e[61]:_0x2c07x1c[_0x836e[54]]=_0x2c07x1e[_0x836e[12]][_0x836e[23]];_0x2c07x1c[_0x836e[55]]=_0x2c07x1e[_0x836e[12]][_0x836e[29]];_0x2c07x1c[_0x836e[40]]=_0x2c07x1e[_0x836e[12]][_0x836e[40]];_0x2c07x1c[_0x836e[38]]=_0x2c07x1e[_0x836e[12]][_0x836e[39]];_0x2c07x1e[_0x836e[12]][_0x836e[56]]=_[_0x836e[58]](_0x2c07x1e[_0x836e[12]].Users,_0x836e[57]);_0x2c07x1c[_0x836e[28]]=_[_0x836e[30]](_0x2c07x1e[_0x836e[12]].Users,function(_0x2c07x20){return {id:_0x2c07x20[_0x836e[23]],name:_0x2c07x20[_0x836e[29]],penalty:_0x2c07x20[_0x836e[60]][_0x836e[59]]}});break;case _0x836e[62]:_0x2c07x1c[_0x836e[38]]=_0x2c07x1e[_0x836e[39]];_0x2c07x1c[_0x836e[40]]=_0x836e[41];_0x2c07x1c[_0x836e[28]]=[{id:_0x2c07x1e[_0x836e[14]][_0x836e[23]],name:_0x2c07x1e[_0x836e[14]][_0x836e[29]],penalty:0}];break;default:};if(_0x2c07x1b[_0x836e[49]]){_0x2c07x1b[_0x836e[50]](function(_0x2c07x21,_0x2c07x1d){if(_0x2c07x21){_0x2c07x1d(null,_0x2c07x21)}else {console[_0x836e[18]](_0x836e[63],_0x2c07x1c);return ReportSmsSession[_0x836e[69]]({leaveAt:moment()[_0x836e[27]](_0x836e[53]),unmanaged:true},{where:{leaveAt:null,uniqueid:_0x2c07x1c[_0x836e[24]]},individualHooks:true})[_0x836e[66]](function(){return ReportSmsSession[_0x836e[68]]({uniqueid:_0x2c07x1c[_0x836e[24]],accountid:_0x2c07x1c[_0x836e[32]],accountname:_0x2c07x1c[_0x836e[33]],accountnumber:_0x2c07x1c[_0x836e[34]],application:_0x2c07x1c[_0x836e[47]],memberid:(_0x2c07x1c[_0x836e[47]]===_0x836e[62]&&_0x2c07x1c[_0x836e[28]][0])?_0x2c07x1c[_0x836e[28]][0][_0x836e[23]]:null,membername:(_0x2c07x1c[_0x836e[47]]===_0x836e[62]&&_0x2c07x1c[_0x836e[28]][0])?_0x2c07x1c[_0x836e[28]][0][_0x836e[29]]:null,queue:_0x2c07x1c[_0x836e[54]],queuename:_0x2c07x1c[_0x836e[55]],roomid:_0x2c07x1c[_0x836e[22]],fidelity:_0x2c07x1c[_0x836e[47]]===_0x836e[36]?_0x2c07x1c[_0x836e[67]]:null,joinAt:moment()[_0x836e[27]](_0x836e[53])})})[_0x836e[66]](function(){ new Session(_0x2c07x1c,_0x2c07x1d)})[_0x836e[65]](function(_0x2c07x22){console[_0x836e[64]](_0x2c07x22)})}})}else {_0x2c07x1b[_0x836e[50]](function(_0x2c07x1d){console[_0x836e[18]](_0x836e[70],_0x2c07x1c);return ReportSmsRoom[_0x836e[68]]({uniqueid:_0x2c07x1c[_0x836e[24]],accountid:_0x2c07x1c[_0x836e[32]],accountname:_0x2c07x1c[_0x836e[33]],accountnumber:_0x2c07x1c[_0x836e[34]],from:_0x2c07x1c[_0x836e[72]],roomid:_0x2c07x1c[_0x836e[22]],joinAt:moment()[_0x836e[27]](_0x836e[53])})[_0x836e[66]](function(_0x2c07x1c){console[_0x836e[18]](_0x836e[71],_0x2c07x1c);return ReportSmsSession[_0x836e[68]]({uniqueid:_0x2c07x1c[_0x836e[24]],accountid:_0x2c07x1c[_0x836e[32]],accountname:_0x2c07x1c[_0x836e[33]],accountnumber:_0x2c07x1c[_0x836e[34]],application:_0x2c07x1c[_0x836e[47]],memberid:(_0x2c07x1c[_0x836e[47]]===_0x836e[62]&&_0x2c07x1c[_0x836e[28]][0])?_0x2c07x1c[_0x836e[28]][0][_0x836e[23]]:null,membername:(_0x2c07x1c[_0x836e[47]]===_0x836e[62]&&_0x2c07x1c[_0x836e[28]][0])?_0x2c07x1c[_0x836e[28]][0][_0x836e[29]]:null,queue:_0x2c07x1c[_0x836e[54]],queuename:_0x2c07x1c[_0x836e[55]],roomid:_0x2c07x1c[_0x836e[22]],fidelity:_0x2c07x1c[_0x836e[47]]===_0x836e[36]?_0x2c07x1c[_0x836e[67]]:null,joinAt:moment()[_0x836e[27]](_0x836e[53])})})[_0x836e[66]](function(){ new Session(_0x2c07x1c,_0x2c07x1d)})[_0x836e[65]](function(_0x2c07x22){console[_0x836e[64]](_0x2c07x22)})})}});async[_0x836e[77]](_0x2c07x1b,function(_0x2c07x22,_0x2c07x23){console[_0x836e[18]](_0x836e[74]);if(_0x2c07x22){console[_0x836e[64]](_0x2c07x22)};if(!_0x2c07x23){return ReportSmsRoom[_0x836e[69]]({leaveAt:moment()[_0x836e[27]](_0x836e[53]),unmanaged:true},{where:{leaveAt:null,uniqueid:_0x2c07x13[_0x836e[24]]},individualHooks:true})[_0x836e[66]](function(){return ReportSmsSession[_0x836e[69]]({leaveAt:moment()[_0x836e[27]](_0x836e[53]),unmanaged:true},{where:{leaveAt:null,uniqueid:_0x2c07x13[_0x836e[24]]},individualHooks:true})})[_0x836e[66]](function(){return SmsRoom[_0x836e[76]](_0x2c07x13[_0x836e[22]])})[_0x836e[66]](function(_0x2c07x24){if(_0x2c07x24){return _0x2c07x24[_0x836e[69]]({status:_0x836e[75]})}})[_0x836e[65]](function(_0x2c07x22){console[_0x836e[64]](_0x2c07x22)})}})}}function handleMessage(_0x2c07xf){var _0x2c07x14={agents:[]};var _0x2c07x13={messageid:_0x2c07xf[_0x836e[23]],from:_0x2c07xf[_0x836e[72]]||null,joinAt:moment()[_0x836e[27]](_0x836e[53])};return _0x2c07xf[_0x836e[81]]({include:[{model:User,attributes:[_0x836e[23],_0x836e[29],_0x836e[43],_0x836e[44]]}]})[_0x836e[66]](handleEntityNotFound(_0x836e[80]))[_0x836e[66]](handleSmsRoom(_0x2c07x13,_0x2c07x14))[_0x836e[66]](handleEntityNotFound(_0x836e[79]))[_0x836e[66]](handleSmsAccount(_0x2c07x13,_0x2c07x14))[_0x836e[66]](handleApps(_0x2c07x13,_0x2c07x14))[_0x836e[65]](function(_0x2c07x22){console[_0x836e[64]](_0x836e[78],_0x2c07x22)})}
\ No newline at end of file
+var _0x73e3=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x75\x74\x69\x6C","\x61\x73\x79\x6E\x63","\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x53\x65\x73\x73\x69\x6F\x6E","\x53\x6D\x73\x4D\x65\x73\x73\x61\x67\x65","\x53\x6D\x73\x52\x6F\x6F\x6D","\x53\x6D\x73\x51\x75\x65\x75\x65","\x49\x6E\x74\x65\x72\x76\x61\x6C","\x55\x73\x65\x72","\x2E\x2F\x73\x65\x73\x73\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x73","\x53\x6D\x73\x20\x52\x6F\x75\x74\x69\x6E\x67\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E","\x6C\x6F\x67","\x73\x74\x61\x74\x75\x73","\x52\x45\x43\x45\x49\x56\x45\x44","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x72\x6F\x6F\x6D\x69\x64","\x69\x64","\x75\x6E\x69\x71\x75\x65\x69\x64","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x66\x6F\x72\x6D\x61\x74","\x61\x67\x65\x6E\x74\x73","\x6E\x61\x6D\x65","\x6D\x61\x70","\x67\x65\x74\x53\x6D\x73\x41\x63\x63\x6F\x75\x6E\x74","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x61\x63\x63\x6F\x75\x6E\x74\x6E\x61\x6D\x65","\x61\x63\x63\x6F\x75\x6E\x74\x6E\x75\x6D\x62\x65\x72","\x70\x68\x6F\x6E\x65","\x66\x69\x64\x65\x6C\x69\x74\x79","\x61\x70\x70\x74\x69\x6D\x65\x6F\x75\x74","\x71\x75\x65\x75\x65\x74\x69\x6D\x65\x6F\x75\x74","\x74\x69\x6D\x65\x6F\x75\x74","\x73\x74\x72\x61\x74\x65\x67\x79","\x62\x65\x65\x70\x61\x6C\x6C","\x70\x72\x69\x6F\x72\x69\x74\x79\x20\x41\x53\x43","\x6F\x6E\x6C\x69\x6E\x65","\x73\x6D\x73\x50\x61\x75\x73\x65","\x67\x65\x74\x53\x6D\x73\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x68\x61\x6E\x64\x6C\x65\x20\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x63\x6C\x6F\x6E\x65\x44\x65\x65\x70","\x6C\x65\x6E\x67\x74\x68","\x70\x75\x73\x68","\x61\x70\x70","\x6A\x6F\x69\x6E\x41\x74","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x71\x75\x65\x75\x65\x69\x64","\x71\x75\x65\x75\x65\x6E\x61\x6D\x65","\x55\x73\x65\x72\x73","\x55\x73\x65\x72\x48\x61\x73\x53\x6D\x73\x51\x75\x65\x75\x65\x2E\x70\x65\x6E\x61\x6C\x74\x79","\x6F\x72\x64\x65\x72\x42\x79","\x70\x65\x6E\x61\x6C\x74\x79","\x55\x73\x65\x72\x48\x61\x73\x53\x6D\x73\x51\x75\x65\x75\x65","\x71\x75\x65\x75\x65","\x61\x67\x65\x6E\x74","\x64\x61\x74\x61\x31","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x74\x69\x6D\x65\x73\x6C\x6F\x74","\x63\x72\x65\x61\x74\x65","\x75\x70\x64\x61\x74\x65","\x64\x61\x74\x61\x32","\x72\x65\x70\x6F\x72\x74\x20\x73\x6D\x73\x20\x72\x6F\x6F\x6D","\x66\x72\x6F\x6D","\x66\x6F\x72\x45\x61\x63\x68","\x45\x6E\x64\x20\x73\x6D\x73\x20\x72\x6F\x75\x74\x69\x6E\x67\x2E\x2E","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x66\x69\x6E\x64\x42\x79\x49\x64","\x77\x61\x74\x65\x72\x66\x61\x6C\x6C","\x65\x72\x72","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x53\x6D\x73\x41\x63\x63\x6F\x75\x6E\x74\x2E\x2E","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x53\x6D\x73\x52\x6F\x6F\x6D\x2E\x2E","\x67\x65\x74\x53\x6D\x73\x52\x6F\x6F\x6D"];_0x73e3[0];var _=require(_0x73e3[1]);var moment=require(_0x73e3[2]);var util=require(_0x73e3[3]);var async=require(_0x73e3[4]);var Util=require(_0x73e3[5]);var ReportSms=require(_0x73e3[7])[_0x73e3[6]];var ReportSmsRoom=require(_0x73e3[7])[_0x73e3[8]];var ReportSmsSession=require(_0x73e3[7])[_0x73e3[9]];var SmsMessage=require(_0x73e3[7])[_0x73e3[10]];var SmsRoom=require(_0x73e3[7])[_0x73e3[11]];var SmsQueue=require(_0x73e3[7])[_0x73e3[12]];var Interval=require(_0x73e3[7])[_0x73e3[13]];var User=require(_0x73e3[7])[_0x73e3[14]];var Session=require(_0x73e3[15]);module[_0x73e3[16]]=function(){console[_0x73e3[18]](_0x73e3[17]);SmsMessage[_0x73e3[21]](function(_0xeeb9xf){if(_0xeeb9xf[_0x73e3[19]]===_0x73e3[20]){handleMessage(_0xeeb9xf)}})};function handleEntityNotFound(_0xeeb9xf){return function(_0xeeb9x11){if(!_0xeeb9x11){throw {message:_0xeeb9xf}};return _0xeeb9x11}}function handleSmsRoom(_0xeeb9x13,_0xeeb9x14){return function(_0xeeb9x15){console[_0x73e3[18]](_0xeeb9x15);_0xeeb9x13[_0x73e3[22]]=_0xeeb9x15[_0x73e3[23]];_0xeeb9x13[_0x73e3[24]]=util[_0x73e3[27]](_0x73e3[25],moment()[_0x73e3[26]](),_0xeeb9x15[_0x73e3[23]]);_0xeeb9x14[_0x73e3[28]]=_[_0x73e3[30]](_0xeeb9x15.Users,function(_0xeeb9x16){return {id:_0xeeb9x16[_0x73e3[23]],name:_0xeeb9x16[_0x73e3[29]],penalty:0}});return _0xeeb9x15[_0x73e3[31]]()}}function handleSmsAccount(_0xeeb9x13,_0xeeb9x14){return function(_0xeeb9x18){_0xeeb9x13[_0x73e3[32]]=_0xeeb9x18[_0x73e3[23]];_0xeeb9x13[_0x73e3[33]]=_0xeeb9x18[_0x73e3[29]];_0xeeb9x13[_0x73e3[34]]=_0xeeb9x18[_0x73e3[35]];_0xeeb9x14[_0x73e3[36]]=_0xeeb9x18[_0x73e3[36]];if(_0xeeb9x18[_0x73e3[36]]){_0xeeb9x14[_0x73e3[37]]=_0xeeb9x14[_0x73e3[38]]=_0xeeb9x18[_0x73e3[39]];_0xeeb9x14[_0x73e3[36]]=_0xeeb9x18[_0x73e3[39]];_0xeeb9x14[_0x73e3[40]]=_0x73e3[41]};return _0xeeb9x18[_0x73e3[45]]({order:_0x73e3[42],include:[{model:SmsQueue,attributes:[_0x73e3[23],_0x73e3[29],_0x73e3[39],_0x73e3[40]],include:[{model:User,attributes:[_0x73e3[23],_0x73e3[29],_0x73e3[43],_0x73e3[44]]}]},{model:User,attributes:[_0x73e3[23],_0x73e3[29],_0x73e3[43],_0x73e3[44]]},{model:Interval,include:[{all:true}]}]})}}function handleApps(_0xeeb9x13,_0xeeb9x14){return function(_0xeeb9x1a){var _0xeeb9x1b=[];console[_0x73e3[18]](_0x73e3[46]);if(_0xeeb9x14[_0x73e3[36]]){_0xeeb9x13[_0x73e3[38]]=_0xeeb9x14[_0x73e3[36]];_0xeeb9x13[_0x73e3[37]]=_0xeeb9x14[_0x73e3[36]];_0xeeb9x13[_0x73e3[28]]=_0xeeb9x14[_0x73e3[28]];_0xeeb9x13[_0x73e3[47]]=_0x73e3[36];_0xeeb9x13[_0x73e3[40]]=_0x73e3[41];var _0xeeb9x1c=_[_0x73e3[48]](_0xeeb9x13);if(_0xeeb9x1c[_0x73e3[28]][_0x73e3[49]]){_0xeeb9x1b[_0x73e3[50]](function(_0xeeb9x1d){ new Session(_0xeeb9x1c,_0xeeb9x1d)})}};_0xeeb9x1a[_0x73e3[73]](function(_0xeeb9x1e,_0xeeb9x1f){var _0xeeb9x1c=_[_0x73e3[48]](_0xeeb9x13);_0xeeb9x1c[_0x73e3[37]]=_0xeeb9x1e[_0x73e3[39]];_0xeeb9x1c[_0x73e3[47]]=_0xeeb9x1e[_0x73e3[51]];_0xeeb9x1c[_0x73e3[52]]=moment()[_0x73e3[27]](_0x73e3[53]);switch(_0xeeb9x1e[_0x73e3[51]]){case _0x73e3[61]:_0xeeb9x1c[_0x73e3[54]]=_0xeeb9x1e[_0x73e3[12]][_0x73e3[23]];_0xeeb9x1c[_0x73e3[55]]=_0xeeb9x1e[_0x73e3[12]][_0x73e3[29]];_0xeeb9x1c[_0x73e3[40]]=_0xeeb9x1e[_0x73e3[12]][_0x73e3[40]];_0xeeb9x1c[_0x73e3[38]]=_0xeeb9x1e[_0x73e3[12]][_0x73e3[39]];_0xeeb9x1e[_0x73e3[12]][_0x73e3[56]]=_[_0x73e3[58]](_0xeeb9x1e[_0x73e3[12]].Users,_0x73e3[57]);_0xeeb9x1c[_0x73e3[28]]=_[_0x73e3[30]](_0xeeb9x1e[_0x73e3[12]].Users,function(_0xeeb9x20){return {id:_0xeeb9x20[_0x73e3[23]],name:_0xeeb9x20[_0x73e3[29]],penalty:_0xeeb9x20[_0x73e3[60]][_0x73e3[59]]}});break;case _0x73e3[62]:_0xeeb9x1c[_0x73e3[38]]=_0xeeb9x1e[_0x73e3[39]];_0xeeb9x1c[_0x73e3[40]]=_0x73e3[41];_0xeeb9x1c[_0x73e3[28]]=[{id:_0xeeb9x1e[_0x73e3[14]][_0x73e3[23]],name:_0xeeb9x1e[_0x73e3[14]][_0x73e3[29]],penalty:0}];break;default:};if(_0xeeb9x1b[_0x73e3[49]]){_0xeeb9x1b[_0x73e3[50]](function(_0xeeb9x21,_0xeeb9x1d){if(_0xeeb9x21){_0xeeb9x1d(null,_0xeeb9x21)}else {console[_0x73e3[18]](_0x73e3[63],_0xeeb9x1c);return ReportSmsSession[_0x73e3[69]]({leaveAt:moment()[_0x73e3[27]](_0x73e3[53]),unmanaged:true},{where:{leaveAt:null,uniqueid:_0xeeb9x1c[_0x73e3[24]]},individualHooks:true})[_0x73e3[66]](function(){return ReportSmsSession[_0x73e3[68]]({uniqueid:_0xeeb9x1c[_0x73e3[24]],accountid:_0xeeb9x1c[_0x73e3[32]],accountname:_0xeeb9x1c[_0x73e3[33]],accountnumber:_0xeeb9x1c[_0x73e3[34]],application:_0xeeb9x1c[_0x73e3[47]],memberid:(_0xeeb9x1c[_0x73e3[47]]===_0x73e3[62]&&_0xeeb9x1c[_0x73e3[28]][0])?_0xeeb9x1c[_0x73e3[28]][0][_0x73e3[23]]:null,membername:(_0xeeb9x1c[_0x73e3[47]]===_0x73e3[62]&&_0xeeb9x1c[_0x73e3[28]][0])?_0xeeb9x1c[_0x73e3[28]][0][_0x73e3[29]]:null,queue:_0xeeb9x1c[_0x73e3[54]],queuename:_0xeeb9x1c[_0x73e3[55]],roomid:_0xeeb9x1c[_0x73e3[22]],fidelity:_0xeeb9x1c[_0x73e3[47]]===_0x73e3[36]?_0xeeb9x1c[_0x73e3[67]]:null,joinAt:moment()[_0x73e3[27]](_0x73e3[53])})})[_0x73e3[66]](function(){ new Session(_0xeeb9x1c,_0xeeb9x1d)})[_0x73e3[65]](function(_0xeeb9x22){console[_0x73e3[64]](_0xeeb9x22)})}})}else {_0xeeb9x1b[_0x73e3[50]](function(_0xeeb9x1d){console[_0x73e3[18]](_0x73e3[70],_0xeeb9x1c);return ReportSmsRoom[_0x73e3[68]]({uniqueid:_0xeeb9x1c[_0x73e3[24]],accountid:_0xeeb9x1c[_0x73e3[32]],accountname:_0xeeb9x1c[_0x73e3[33]],accountnumber:_0xeeb9x1c[_0x73e3[34]],from:_0xeeb9x1c[_0x73e3[72]],roomid:_0xeeb9x1c[_0x73e3[22]],joinAt:moment()[_0x73e3[27]](_0x73e3[53])})[_0x73e3[66]](function(_0xeeb9x1c){console[_0x73e3[18]](_0x73e3[71],_0xeeb9x1c);return ReportSmsSession[_0x73e3[68]]({uniqueid:_0xeeb9x1c[_0x73e3[24]],accountid:_0xeeb9x1c[_0x73e3[32]],accountname:_0xeeb9x1c[_0x73e3[33]],accountnumber:_0xeeb9x1c[_0x73e3[34]],application:_0xeeb9x1c[_0x73e3[47]],memberid:(_0xeeb9x1c[_0x73e3[47]]===_0x73e3[62]&&_0xeeb9x1c[_0x73e3[28]][0])?_0xeeb9x1c[_0x73e3[28]][0][_0x73e3[23]]:null,membername:(_0xeeb9x1c[_0x73e3[47]]===_0x73e3[62]&&_0xeeb9x1c[_0x73e3[28]][0])?_0xeeb9x1c[_0x73e3[28]][0][_0x73e3[29]]:null,queue:_0xeeb9x1c[_0x73e3[54]],queuename:_0xeeb9x1c[_0x73e3[55]],roomid:_0xeeb9x1c[_0x73e3[22]],fidelity:_0xeeb9x1c[_0x73e3[47]]===_0x73e3[36]?_0xeeb9x1c[_0x73e3[67]]:null,joinAt:moment()[_0x73e3[27]](_0x73e3[53])})})[_0x73e3[66]](function(){ new Session(_0xeeb9x1c,_0xeeb9x1d)})[_0x73e3[65]](function(_0xeeb9x22){console[_0x73e3[64]](_0xeeb9x22)})})}});async[_0x73e3[77]](_0xeeb9x1b,function(_0xeeb9x22,_0xeeb9x23){console[_0x73e3[18]](_0x73e3[74]);if(_0xeeb9x22){console[_0x73e3[64]](_0xeeb9x22)};if(!_0xeeb9x23){return ReportSmsRoom[_0x73e3[69]]({leaveAt:moment()[_0x73e3[27]](_0x73e3[53]),unmanaged:true},{where:{leaveAt:null,uniqueid:_0xeeb9x13[_0x73e3[24]]},individualHooks:true})[_0x73e3[66]](function(){return ReportSmsSession[_0x73e3[69]]({leaveAt:moment()[_0x73e3[27]](_0x73e3[53]),unmanaged:true},{where:{leaveAt:null,uniqueid:_0xeeb9x13[_0x73e3[24]]},individualHooks:true})})[_0x73e3[66]](function(){return SmsRoom[_0x73e3[76]](_0xeeb9x13[_0x73e3[22]])})[_0x73e3[66]](function(_0xeeb9x24){if(_0xeeb9x24){return _0xeeb9x24[_0x73e3[69]]({status:_0x73e3[75]})}})[_0x73e3[65]](function(_0xeeb9x22){console[_0x73e3[64]](_0xeeb9x22)})}})}}function handleMessage(_0xeeb9xf){var _0xeeb9x14={agents:[]};var _0xeeb9x13={messageid:_0xeeb9xf[_0x73e3[23]],from:_0xeeb9xf[_0x73e3[72]]||null,joinAt:moment()[_0x73e3[27]](_0x73e3[53])};return _0xeeb9xf[_0x73e3[81]]({include:[{model:User,attributes:[_0x73e3[23],_0x73e3[29],_0x73e3[43],_0x73e3[44]]}]})[_0x73e3[66]](handleEntityNotFound(_0x73e3[80]))[_0x73e3[66]](handleSmsRoom(_0xeeb9x13,_0xeeb9x14))[_0x73e3[66]](handleEntityNotFound(_0x73e3[79]))[_0x73e3[66]](handleSmsAccount(_0xeeb9x13,_0xeeb9x14))[_0x73e3[66]](handleApps(_0xeeb9x13,_0xeeb9x14))[_0x73e3[65]](function(_0xeeb9x22){console[_0x73e3[64]](_0x73e3[78],_0xeeb9x22)})}
\ No newline at end of file