Built motion from commit 78ef1e9a0.|1.0.36
[motion.git] / server / api / openchannel_account / openchannel_account.controller.js
index db988ab..90b12e9 100644 (file)
@@ -1 +1 @@
-var _0xc993=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\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\x41\x63\x63\x6F\x75\x6E\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x55\x73\x65\x72","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x43\x6F\x6E\x74\x61\x63\x74","\x49\x6E\x74\x65\x72\x76\x61\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x6F\x6D\x65\x6E\x74","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x67\x65\x74\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E\x73","\x6C\x65\x6E\x67\x74\x68","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E\x73","\x73\x68\x6F\x77\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x6E\x61\x6D\x65","\x6F\x6E\x6C\x69\x6E\x65","\x70\x72\x69\x6F\x72\x69\x74\x79\x20\x41\x53\x43","\x6D\x65\x72\x67\x65","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\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","\x62\x6F\x64\x79","\x63\x72\x65\x61\x74\x65\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x73\x65\x6E\x64\x4D\x65\x73\x73\x61\x67\x65","\x55\x73\x65\x72\x49\x64","\x75\x73\x65\x72","\x72\x65\x63\x65\x69\x76\x65\x4D\x65\x73\x73\x61\x67\x65","\x6D\x65\x73\x73\x61\x67\x65","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x4D\x65\x73\x73\x61\x67\x65\x41\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x61\x6D\x69","\x6C\x6F\x63\x61\x6C\x73","\x61\x70\x70","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D\x49\x64","\x52\x45\x43\x45\x49\x56\x45\x44","\x43\x4C\x4F\x53\x45\x44","\x66\x72\x6F\x6D","\x4E\x45\x57","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x4F\x50\x45\x4E","\x73\x79\x73\x74\x65\x6D","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x49\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x41\x63\x63\x6F\x75\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x64\x65\x62\x75\x67","\x52\x65\x63\x65\x69\x76\x65\x64\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x63\x6F\x6E\x74\x61\x69\x6E\x20\x73\x65\x6E\x64\x65\x72\x20\x49\x64","\x52\x65\x63\x65\x69\x76\x65\x64\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x63\x6F\x6E\x74\x61\x69\x6E\x20\x61\x6E\x79\x20\x62\x6F\x64\x79","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x44\x45\x53\x43","\x66\x69\x6E\x64\x41\x6C\x6C","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x75\x70\x64\x61\x74\x65\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x64\x69\x73\x70\x49\x64","\x75\x70\x64\x61\x74\x65\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x70\x72\x69\x6F\x72\x69\x74\x79","\x66\x6F\x72\x45\x61\x63\x68","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x64\x65\x73\x74\x72\x6F\x79","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x75\x70\x64\x61\x74\x65\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x61\x70\x70\x49\x64","\x64\x65\x73\x74\x72\x6F\x79\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x64\x65\x73\x74\x72\x6F\x79\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x69\x64\x73","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D\x73","\x63\x6F\x6E\x74\x61\x63\x74","\x74\x61\x67\x73","\x64\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x6C\x61\x73\x74\x45\x76\x65\x6E\x74","\x69\x73\x41\x72\x72\x61\x79","\x25","\x70\x75\x73\x68","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x69\x6E\x63\x6C\x75\x64\x65","\x61\x67\x65\x6E\x74","\x66\x69\x6E\x64","\x6D\x61\x70","\x71\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x49\x64","\x69\x6E\x74\x65\x72\x73\x65\x63\x74\x69\x6F\x6E","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x72\x6F\x6C\x65","\x63\x72\x65\x61\x74\x65\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x6D\x61\x78"];_0xc993[0];var _=require(_0xc993[1]);var Util=require(_0xc993[2]);var logger=require(_0xc993[4])(_0xc993[3]);var OpenchannelAccount=require(_0xc993[6])[_0xc993[5]];var sequelize=require(_0xc993[6])[_0xc993[7]];var User=require(_0xc993[6])[_0xc993[8]];var OpenchannelQueue=require(_0xc993[6])[_0xc993[9]];var OpenchannelApplication=require(_0xc993[6])[_0xc993[10]];var OpenchannelMessage=require(_0xc993[6])[_0xc993[11]];var OpenchannelRoom=require(_0xc993[6])[_0xc993[12]];var OpenchannelDisposition=require(_0xc993[6])[_0xc993[13]];var OpenchannelAccount=require(_0xc993[6])[_0xc993[5]];var Contact=require(_0xc993[6])[_0xc993[14]];var Interval=require(_0xc993[6])[_0xc993[15]];var Promise=require(_0xc993[16]);var moment=require(_0xc993[17]);function handleError(_0xcc59x11,_0xcc59x12){logger[_0xc993[19]](_0xcc59x12[_0xc993[18]]);return _0xcc59x11[_0xc993[21]](500)[_0xc993[20]](_0xcc59x12)}exports[_0xc993[22]]= function(_0xcc59x13,_0xcc59x11){return OpenchannelAccount[_0xc993[27]](Util[_0xc993[26]](_0xcc59x13[_0xc993[25]]))[_0xc993[24]](function(_0xcc59x14){_0xcc59x11[_0xc993[21]](200)[_0xc993[20]](_0xcc59x14)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[28]]= function(_0xcc59x13,_0xcc59x11){return OpenchannelAccount[_0xc993[32]](_0xcc59x13[_0xc993[31]][_0xc993[30]])[_0xc993[24]](function(_0xcc59x15){if(!_0xcc59x15){return _0xcc59x11[_0xc993[29]](404)};return _0xcc59x11[_0xc993[20]](_0xcc59x15)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[33]]= function(_0xcc59x13,_0xcc59x11,_0xcc59x16){return OpenchannelAccount[_0xc993[32]](_0xcc59x13[_0xc993[31]][_0xc993[30]])[_0xc993[24]](function(_0xcc59x15){if(!_0xcc59x15){return _0xcc59x11[_0xc993[29]](404)};return _0xcc59x15[_0xc993[35]]()})[_0xc993[24]](function(_0xcc59x17){return _0xcc59x11[_0xc993[21]](200)[_0xc993[20]]({rows:_0xcc59x17,count:_0xcc59x17[_0xc993[34]]})})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[36]]= function(_0xcc59x13,_0xcc59x11,_0xcc59x16){return OpenchannelAccount[_0xc993[43]](_0xc993[42])[_0xc993[32]](_0xcc59x13[_0xc993[31]][_0xc993[30]])[_0xc993[24]](function(_0xcc59x15){if(!_0xcc59x15){return _0xcc59x11[_0xc993[29]](404)};return _0xcc59x15[_0xc993[41]](_[_0xc993[40]](Util[_0xc993[26]](_0xcc59x13[_0xc993[25]]),{include:[{model:OpenchannelQueue,attributes:[_0xc993[30],_0xc993[37]]},{model:User,attributes:[_0xc993[30],_0xc993[37],_0xc993[38]]},{model:Interval,attributes:[_0xc993[30],_0xc993[37]]}],order:_0xc993[39]}))})[_0xc993[24]](function(_0xcc59x18){return _0xcc59x11[_0xc993[20]]({count:_0xcc59x18[_0xc993[34]],rows:_0xcc59x18})})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[44]]= function(_0xcc59x13,_0xcc59x11){return OpenchannelAccount[_0xc993[44]](_0xcc59x13[_0xc993[47]])[_0xc993[24]](function(_0xcc59x15){return _0xcc59x11[_0xc993[21]](201)[_0xc993[20]](_0xcc59x15)})[_0xc993[23]](sequelize.UniqueConstraintError,function(_0xcc59x12){return Util[_0xc993[46]][_0xc993[45]](_0xcc59x11,_0xcc59x12)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[48]]= function(_0xcc59x13,_0xcc59x11,_0xcc59x16){_0xcc59x13[_0xc993[47]][_0xc993[49]]= _0xcc59x13[_0xc993[31]][_0xc993[30]];return OpenchannelDisposition[_0xc993[44]](_0xcc59x13[_0xc993[47]])[_0xc993[24]](function(_0xcc59x19){return _0xcc59x11[_0xc993[21]](201)[_0xc993[20]](_0xcc59x19)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[50]]= function(_0xcc59x13,_0xcc59x11,_0xcc59x16){_0xcc59x13[_0xc993[47]][_0xc993[49]]= _0xcc59x13[_0xc993[31]][_0xc993[30]];_0xcc59x13[_0xc993[47]][_0xc993[51]]= _0xcc59x13[_0xc993[52]][_0xc993[30]];return OpenchannelMessage[_0xc993[44]](_0xcc59x13[_0xc993[47]],{user:_0xcc59x13[_0xc993[52]]})[_0xc993[24]](function(_0xcc59x1a){return _0xcc59x11[_0xc993[21]](201)[_0xc993[20]](_0xcc59x1a)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[53]]= function(_0xcc59x13,_0xcc59x11,_0xcc59x16){if(_0xcc59x13[_0xc993[47]][_0xc993[30]]){delete _0xcc59x13[_0xc993[47]][_0xc993[30]]};var _0xcc59x1b=_0xcc59x13[_0xc993[47]];var _0xcc59x1c;return OpenchannelAccount[_0xc993[32]](_0xcc59x13[_0xc993[31]][_0xc993[30]])[_0xc993[24]](function(_0xcc59x15){if(!_0xcc59x15){throw  new Error(_0xc993[70])};_0xcc59x1c= _0xcc59x15;logger[_0xc993[71]](_0xcc59x1b);if(!_0xcc59x1b[_0xc993[62]]){throw  new Error(_0xc993[72])};if(!_0xcc59x1b[_0xc993[47]]){throw  new Error(_0xc993[73])};return OpenchannelRoom[_0xc993[76]]({limit:1,where:{contact:_0xcc59x1b[_0xc993[62]],OpenchannelAccountId:_0xcc59x1c[_0xc993[30]]},order:[[_0xc993[74],_0xc993[75]]]})})[_0xc993[24]](function(_0xcc59x1f){var _0xcc59x1e=_0xcc59x1f[0];if(!_0xcc59x1e|| _0xcc59x1e[_0xc993[21]]== _0xc993[61]){var _0xcc59x20=_0xcc59x1e?_0xcc59x1e[_0xc993[30]]:null;return OpenchannelRoom[_0xc993[44]]({contact:_0xcc59x1b[_0xc993[62]],OpenchannelAccountId:_0xcc59x1c[_0xc993[30]],status:_0xc993[63],ParentId:_0xcc59x20,lastEvent:_0xc993[60],lastEventAt:moment()[_0xc993[65]](_0xc993[64]),openchannelIn:1})}else {return _0xcc59x1e[_0xc993[69]]({lastEvent:_0xc993[60],lastEventAt:moment()[_0xc993[65]](_0xc993[64]),status:_0xc993[66],openReason:_0xc993[67],openchannelIn:++_0xcc59x1e[_0xc993[68]]})}})[_0xc993[24]](function(_0xcc59x1e){_0xcc59x1b[_0xc993[49]]= _0xcc59x1c[_0xc993[30]];_0xcc59x1b[_0xc993[59]]= _0xcc59x1e[_0xc993[30]];_0xcc59x1b[_0xc993[21]]= _0xc993[60];return OpenchannelMessage[_0xc993[44]](_0xcc59x1b)})[_0xc993[24]](function(_0xcc59x1d){_0xcc59x13[_0xc993[58]][_0xc993[57]][_0xc993[56]][_0xc993[20]]({message:_0xc993[55],doc:_0xcc59x1d});return _0xcc59x11[_0xc993[21]](201)[_0xc993[20]](_0xcc59x1d)})[_0xc993[23]](function(_0xcc59x12){logger[_0xc993[19]](_0xcc59x12[_0xc993[18]]);return _0xcc59x11[_0xc993[21]](500)[_0xc993[20]]({code:500,message:_0xcc59x12[_0xc993[54]]})})};exports[_0xc993[77]]= function(_0xcc59x13,_0xcc59x11){if(_0xcc59x13[_0xc993[47]][_0xc993[30]]){delete _0xcc59x13[_0xc993[47]][_0xc993[30]]};return OpenchannelAccount[_0xc993[32]](_0xcc59x13[_0xc993[31]][_0xc993[30]])[_0xc993[24]](function(_0xcc59x15){if(!_0xcc59x15){return _0xcc59x11[_0xc993[29]](404)};var _0xcc59x21=_[_0xc993[40]](_0xcc59x15,_0xcc59x13[_0xc993[47]]);return _0xcc59x21[_0xc993[78]]()})[_0xc993[24]](function(_0xcc59x15){return _0xcc59x11[_0xc993[21]](200)[_0xc993[20]](_0xcc59x15)})[_0xc993[23]](sequelize.UniqueConstraintError,function(_0xcc59x12){return Util[_0xc993[46]][_0xc993[45]](_0xcc59x11,_0xcc59x12)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[79]]= function(_0xcc59x13,_0xcc59x11){if(_0xcc59x13[_0xc993[47]][_0xc993[30]]){delete _0xcc59x13[_0xc993[47]][_0xc993[30]]};return OpenchannelDisposition[_0xc993[32]](_0xcc59x13[_0xc993[31]][_0xc993[80]])[_0xc993[24]](function(_0xcc59x22){if(!_0xcc59x22){return _0xcc59x11[_0xc993[29]](404)};var _0xcc59x21=_[_0xc993[40]](_0xcc59x22,_0xcc59x13[_0xc993[47]]);return _0xcc59x21[_0xc993[78]]()})[_0xc993[24]](function(_0xcc59x22){return _0xcc59x11[_0xc993[21]](200)[_0xc993[20]](_0xcc59x22)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[81]]= function(_0xcc59x13,_0xcc59x11){var _0xcc59x23=0;var _0xcc59x24=_0xcc59x13[_0xc993[47]];_0xcc59x24[_0xc993[84]](function(_0xcc59x25){delete _0xcc59x25[_0xc993[30]];delete _0xcc59x25[_0xc993[74]];delete _0xcc59x25[_0xc993[82]];_0xcc59x25[_0xc993[83]]=  ++_0xcc59x23});return sequelize[_0xc993[87]](function(_0xcc59x27){return OpenchannelApplication[_0xc993[86]]({where:{OpenchannelAccountId:_0xcc59x13[_0xc993[31]][_0xc993[30]]},individualHooks:true,transaction:_0xcc59x27})[_0xc993[24]](function(_0xcc59x28){return OpenchannelApplication[_0xc993[85]](_0xcc59x24,{individualHooks:true,transaction:_0xcc59x27})})})[_0xc993[24]](function(_0xcc59x26){return _0xcc59x11[_0xc993[21]](200)[_0xc993[20]]({count:_0xcc59x26[_0xc993[34]],rows:_0xcc59x26})})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[88]]= function(_0xcc59x13,_0xcc59x11){if(_0xcc59x13[_0xc993[47]][_0xc993[30]]){delete _0xcc59x13[_0xc993[47]][_0xc993[30]]};return OpenchannelApplication[_0xc993[32]](_0xcc59x13[_0xc993[31]][_0xc993[89]])[_0xc993[24]](function(_0xcc59x28){if(!_0xcc59x28){return _0xcc59x11[_0xc993[29]](404)};var _0xcc59x21=_[_0xc993[40]](_0xcc59x28,_0xcc59x13[_0xc993[47]]);return _0xcc59x21[_0xc993[78]]()})[_0xc993[24]](function(_0xcc59x28){return _0xcc59x11[_0xc993[21]](200)[_0xc993[20]](_0xcc59x28)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[86]]= function(_0xcc59x13,_0xcc59x11){return OpenchannelAccount[_0xc993[32]](_0xcc59x13[_0xc993[31]][_0xc993[30]])[_0xc993[24]](function(_0xcc59x15){if(!_0xcc59x15){return _0xcc59x11[_0xc993[29]](404)};return _0xcc59x15[_0xc993[86]]()})[_0xc993[24]](function(){return _0xcc59x11[_0xc993[29]](204)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[90]]= function(_0xcc59x13,_0xcc59x11,_0xcc59x16){return OpenchannelApplication[_0xc993[32]](_0xcc59x13[_0xc993[31]][_0xc993[89]])[_0xc993[24]](function(_0xcc59x28){if(!_0xcc59x28){return _0xcc59x11[_0xc993[29]](404)};return _0xcc59x28[_0xc993[86]]()})[_0xc993[24]](function(){return _0xcc59x11[_0xc993[29]](204)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[91]]= function(_0xcc59x13,_0xcc59x11,_0xcc59x16){return OpenchannelDisposition[_0xc993[32]](_0xcc59x13[_0xc993[31]][_0xc993[80]])[_0xc993[24]](function(_0xcc59x19){if(!_0xcc59x19){return _0xcc59x11[_0xc993[29]](404)};return _0xcc59x19[_0xc993[86]]()})[_0xc993[24]](function(){return _0xcc59x11[_0xc993[29]](204)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[92]]= function(_0xcc59x13,_0xcc59x11){return OpenchannelApplication[_0xc993[86]]({where:{id:_0xcc59x13[_0xc993[25]][_0xc993[93]]},individualHooks:true})[_0xc993[24]](function(){return _0xcc59x11[_0xc993[29]](204)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})};exports[_0xc993[94]]= function(_0xcc59x13,_0xcc59x11,_0xcc59x16){var _0xcc59x29={where:{OpenchannelAccountId:_0xcc59x13[_0xc993[31]][_0xc993[30]],$and:[]},attributes:[_0xc993[30],_0xc993[95],_0xc993[74],_0xc993[82],_0xc993[96],_0xc993[97],_0xc993[98]],include:[]};if(_0xcc59x13[_0xc993[25]]){if(_0xcc59x13[_0xc993[25]][_0xc993[96]]){if(_[_0xc993[99]](_0xcc59x13[_0xc993[25]][_0xc993[96]])){for(var _0xcc59x2a=0;_0xcc59x2a< _0xcc59x13[_0xc993[25]][_0xc993[96]][_0xc993[34]];_0xcc59x2a++){_0xcc59x29[_0xc993[103]][_0xc993[102]][_0xc993[101]]({tags:{$like:_0xc993[100]+ _0xcc59x13[_0xc993[25]][_0xc993[96]][_0xcc59x2a]+ _0xc993[100]}})}}else {_0xcc59x29[_0xc993[103]][_0xc993[102]][_0xc993[101]]({tags:{$like:_0xc993[100]+ _0xcc59x13[_0xc993[25]][_0xc993[96]]+ _0xc993[100]}})};delete _0xcc59x13[_0xc993[25]][_0xc993[96]]};_[_0xc993[40]](_0xcc59x29[_0xc993[103]],_0xcc59x13[_0xc993[25]])};switch(_0xcc59x13[_0xc993[52]][_0xc993[112]]){case _0xc993[105]:_0xcc59x29[_0xc993[104]][_0xc993[101]]({model:User,attributes:[_0xc993[30]]});var _0xcc59x2b;var _0xcc59x2c;var _0xcc59x2d;return User[_0xc993[32]](_0xcc59x13[_0xc993[52]][_0xc993[30]])[_0xc993[24]](function(_0xcc59x30){if(_0xcc59x30){return _0xcc59x30[_0xc993[111]]()}else {return []}})[_0xc993[24]](function(_0xcc59x2f){_0xcc59x2c= _[_0xc993[107]](_0xcc59x2f,_0xc993[30]);return OpenchannelAccount[_0xc993[32]](_0xcc59x13[_0xc993[31]][_0xc993[30]])})[_0xc993[24]](function(_0xcc59x14){if(!_0xcc59x14){return _0xcc59x11[_0xc993[29]](404)};return _0xcc59x14[_0xc993[41]]({where:{$or:[{app:_0xc993[108]},{app:_0xc993[105]}]}})[_0xc993[24]](function(_0xcc59x24){_0xcc59x2b= _[_0xc993[107]](_[_0xc993[106]](_0xcc59x24,{"\x61\x70\x70":_0xc993[105]}),_0xc993[51]);_0xcc59x2d= _[_0xc993[107]](_[_0xc993[106]](_0xcc59x24,{"\x61\x70\x70":_0xc993[108]}),_0xc993[109]);if(_[_0xc993[110]](_0xcc59x2c,_0xcc59x2d)[_0xc993[34]]|| _[_0xc993[110]](_0xcc59x2b,[_0xcc59x13[_0xc993[52]][_0xc993[30]]])[_0xc993[34]]){return OpenchannelRoom[_0xc993[76]](_0xcc59x29)[_0xc993[24]](function(_0xcc59x2e){return _0xcc59x11[_0xc993[21]](200)[_0xc993[20]](_0xcc59x2e)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})}else {return _0xcc59x11[_0xc993[21]](200)[_0xc993[20]]([])}})})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)});default:return OpenchannelRoom[_0xc993[76]](_0xcc59x29)[_0xc993[24]](function(_0xcc59x2e){return _0xcc59x11[_0xc993[21]](200)[_0xc993[20]](_0xcc59x2e)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})}};exports[_0xc993[113]]= function(_0xcc59x13,_0xcc59x11,_0xcc59x16){return OpenchannelApplication[_0xc993[114]](_0xc993[83],{where:{OpenchannelAccountId:_0xcc59x13[_0xc993[31]][_0xc993[30]]}})[_0xc993[24]](function(_0xcc59x32){_0xcc59x13[_0xc993[47]][_0xc993[83]]= _0xcc59x32?++_0xcc59x32:1;_0xcc59x13[_0xc993[47]][_0xc993[49]]= _0xcc59x13[_0xc993[31]][_0xc993[30]];return OpenchannelApplication[_0xc993[44]](_0xcc59x13[_0xc993[47]])})[_0xc993[24]](function(_0xcc59x31){return _0xcc59x11[_0xc993[21]](201)[_0xc993[20]](_0xcc59x31)})[_0xc993[23]](function(_0xcc59x12){return handleError(_0xcc59x11,_0xcc59x12)})}
\ No newline at end of file
+var _0xee2a=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\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\x41\x63\x63\x6F\x75\x6E\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x55\x73\x65\x72","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x43\x6F\x6E\x74\x61\x63\x74","\x49\x6E\x74\x65\x72\x76\x61\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x6F\x6D\x65\x6E\x74","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x67\x65\x74\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E\x73","\x6C\x65\x6E\x67\x74\x68","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E\x73","\x73\x68\x6F\x77\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x6E\x61\x6D\x65","\x6F\x6E\x6C\x69\x6E\x65","\x70\x72\x69\x6F\x72\x69\x74\x79\x20\x41\x53\x43","\x6D\x65\x72\x67\x65","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\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","\x62\x6F\x64\x79","\x63\x72\x65\x61\x74\x65\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x73\x65\x6E\x64\x4D\x65\x73\x73\x61\x67\x65","\x55\x73\x65\x72\x49\x64","\x75\x73\x65\x72","\x72\x65\x63\x65\x69\x76\x65\x4D\x65\x73\x73\x61\x67\x65","\x6D\x65\x73\x73\x61\x67\x65","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x4D\x65\x73\x73\x61\x67\x65\x41\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x61\x6D\x69","\x6C\x6F\x63\x61\x6C\x73","\x61\x70\x70","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D\x49\x64","\x52\x45\x43\x45\x49\x56\x45\x44","\x43\x4C\x4F\x53\x45\x44","\x66\x72\x6F\x6D","\x4E\x45\x57","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x4F\x50\x45\x4E","\x73\x79\x73\x74\x65\x6D","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x49\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x41\x63\x63\x6F\x75\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x64\x65\x62\x75\x67","\x52\x65\x63\x65\x69\x76\x65\x64\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x63\x6F\x6E\x74\x61\x69\x6E\x20\x73\x65\x6E\x64\x65\x72\x20\x49\x64","\x52\x65\x63\x65\x69\x76\x65\x64\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x63\x6F\x6E\x74\x61\x69\x6E\x20\x61\x6E\x79\x20\x62\x6F\x64\x79","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x44\x45\x53\x43","\x66\x69\x6E\x64\x41\x6C\x6C","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x75\x70\x64\x61\x74\x65\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x64\x69\x73\x70\x49\x64","\x75\x70\x64\x61\x74\x65\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x70\x72\x69\x6F\x72\x69\x74\x79","\x66\x6F\x72\x45\x61\x63\x68","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x64\x65\x73\x74\x72\x6F\x79","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x75\x70\x64\x61\x74\x65\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x61\x70\x70\x49\x64","\x64\x65\x73\x74\x72\x6F\x79\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x64\x65\x73\x74\x72\x6F\x79\x44\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x73","\x69\x64\x73","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D\x73","\x63\x6F\x6E\x74\x61\x63\x74","\x74\x61\x67\x73","\x64\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x6C\x61\x73\x74\x45\x76\x65\x6E\x74","\x69\x73\x41\x72\x72\x61\x79","\x25","\x70\x75\x73\x68","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x69\x6E\x63\x6C\x75\x64\x65","\x61\x67\x65\x6E\x74","\x66\x69\x6E\x64","\x6D\x61\x70","\x71\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x49\x64","\x69\x6E\x74\x65\x72\x73\x65\x63\x74\x69\x6F\x6E","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x72\x6F\x6C\x65","\x63\x72\x65\x61\x74\x65\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x6D\x61\x78"];_0xee2a[0];var _=require(_0xee2a[1]);var Util=require(_0xee2a[2]);var logger=require(_0xee2a[4])(_0xee2a[3]);var OpenchannelAccount=require(_0xee2a[6])[_0xee2a[5]];var sequelize=require(_0xee2a[6])[_0xee2a[7]];var User=require(_0xee2a[6])[_0xee2a[8]];var OpenchannelQueue=require(_0xee2a[6])[_0xee2a[9]];var OpenchannelApplication=require(_0xee2a[6])[_0xee2a[10]];var OpenchannelMessage=require(_0xee2a[6])[_0xee2a[11]];var OpenchannelRoom=require(_0xee2a[6])[_0xee2a[12]];var OpenchannelDisposition=require(_0xee2a[6])[_0xee2a[13]];var OpenchannelAccount=require(_0xee2a[6])[_0xee2a[5]];var Contact=require(_0xee2a[6])[_0xee2a[14]];var Interval=require(_0xee2a[6])[_0xee2a[15]];var Promise=require(_0xee2a[16]);var moment=require(_0xee2a[17]);function handleError(_0x78e6x11,_0x78e6x12){logger[_0xee2a[19]](_0x78e6x12[_0xee2a[18]]);return _0x78e6x11[_0xee2a[21]](500)[_0xee2a[20]](_0x78e6x12)}exports[_0xee2a[22]]= function(_0x78e6x13,_0x78e6x11){return OpenchannelAccount[_0xee2a[27]](Util[_0xee2a[26]](_0x78e6x13[_0xee2a[25]]))[_0xee2a[24]](function(_0x78e6x14){_0x78e6x11[_0xee2a[21]](200)[_0xee2a[20]](_0x78e6x14)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[28]]= function(_0x78e6x13,_0x78e6x11){return OpenchannelAccount[_0xee2a[32]](_0x78e6x13[_0xee2a[31]][_0xee2a[30]])[_0xee2a[24]](function(_0x78e6x15){if(!_0x78e6x15){return _0x78e6x11[_0xee2a[29]](404)};return _0x78e6x11[_0xee2a[20]](_0x78e6x15)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[33]]= function(_0x78e6x13,_0x78e6x11,_0x78e6x16){return OpenchannelAccount[_0xee2a[32]](_0x78e6x13[_0xee2a[31]][_0xee2a[30]])[_0xee2a[24]](function(_0x78e6x15){if(!_0x78e6x15){return _0x78e6x11[_0xee2a[29]](404)};return _0x78e6x15[_0xee2a[35]]()})[_0xee2a[24]](function(_0x78e6x17){return _0x78e6x11[_0xee2a[21]](200)[_0xee2a[20]]({rows:_0x78e6x17,count:_0x78e6x17[_0xee2a[34]]})})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[36]]= function(_0x78e6x13,_0x78e6x11,_0x78e6x16){return OpenchannelAccount[_0xee2a[43]](_0xee2a[42])[_0xee2a[32]](_0x78e6x13[_0xee2a[31]][_0xee2a[30]])[_0xee2a[24]](function(_0x78e6x15){if(!_0x78e6x15){return _0x78e6x11[_0xee2a[29]](404)};return _0x78e6x15[_0xee2a[41]](_[_0xee2a[40]](Util[_0xee2a[26]](_0x78e6x13[_0xee2a[25]]),{include:[{model:OpenchannelQueue,attributes:[_0xee2a[30],_0xee2a[37]]},{model:User,attributes:[_0xee2a[30],_0xee2a[37],_0xee2a[38]]},{model:Interval,attributes:[_0xee2a[30],_0xee2a[37]]}],order:_0xee2a[39]}))})[_0xee2a[24]](function(_0x78e6x18){return _0x78e6x11[_0xee2a[20]]({count:_0x78e6x18[_0xee2a[34]],rows:_0x78e6x18})})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[44]]= function(_0x78e6x13,_0x78e6x11){return OpenchannelAccount[_0xee2a[44]](_0x78e6x13[_0xee2a[47]])[_0xee2a[24]](function(_0x78e6x15){return _0x78e6x11[_0xee2a[21]](201)[_0xee2a[20]](_0x78e6x15)})[_0xee2a[23]](sequelize.UniqueConstraintError,function(_0x78e6x12){return Util[_0xee2a[46]][_0xee2a[45]](_0x78e6x11,_0x78e6x12)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[48]]= function(_0x78e6x13,_0x78e6x11,_0x78e6x16){_0x78e6x13[_0xee2a[47]][_0xee2a[49]]= _0x78e6x13[_0xee2a[31]][_0xee2a[30]];return OpenchannelDisposition[_0xee2a[44]](_0x78e6x13[_0xee2a[47]])[_0xee2a[24]](function(_0x78e6x19){return _0x78e6x11[_0xee2a[21]](201)[_0xee2a[20]](_0x78e6x19)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[50]]= function(_0x78e6x13,_0x78e6x11,_0x78e6x16){_0x78e6x13[_0xee2a[47]][_0xee2a[49]]= _0x78e6x13[_0xee2a[31]][_0xee2a[30]];_0x78e6x13[_0xee2a[47]][_0xee2a[51]]= _0x78e6x13[_0xee2a[52]][_0xee2a[30]];return OpenchannelMessage[_0xee2a[44]](_0x78e6x13[_0xee2a[47]],{user:_0x78e6x13[_0xee2a[52]]})[_0xee2a[24]](function(_0x78e6x1a){return _0x78e6x11[_0xee2a[21]](201)[_0xee2a[20]](_0x78e6x1a)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[53]]= function(_0x78e6x13,_0x78e6x11,_0x78e6x16){if(_0x78e6x13[_0xee2a[47]][_0xee2a[30]]){delete _0x78e6x13[_0xee2a[47]][_0xee2a[30]]};var _0x78e6x1b=_0x78e6x13[_0xee2a[47]];var _0x78e6x1c;return OpenchannelAccount[_0xee2a[32]](_0x78e6x13[_0xee2a[31]][_0xee2a[30]])[_0xee2a[24]](function(_0x78e6x15){if(!_0x78e6x15){throw  new Error(_0xee2a[70])};_0x78e6x1c= _0x78e6x15;logger[_0xee2a[71]](_0x78e6x1b);if(!_0x78e6x1b[_0xee2a[62]]){throw  new Error(_0xee2a[72])};if(!_0x78e6x1b[_0xee2a[47]]){throw  new Error(_0xee2a[73])};return OpenchannelRoom[_0xee2a[76]]({limit:1,where:{contact:_0x78e6x1b[_0xee2a[62]],OpenchannelAccountId:_0x78e6x1c[_0xee2a[30]]},order:[[_0xee2a[74],_0xee2a[75]]]})})[_0xee2a[24]](function(_0x78e6x1f){var _0x78e6x1e=_0x78e6x1f[0];if(!_0x78e6x1e|| _0x78e6x1e[_0xee2a[21]]== _0xee2a[61]){var _0x78e6x20=_0x78e6x1e?_0x78e6x1e[_0xee2a[30]]:null;return OpenchannelRoom[_0xee2a[44]]({contact:_0x78e6x1b[_0xee2a[62]],OpenchannelAccountId:_0x78e6x1c[_0xee2a[30]],status:_0xee2a[63],ParentId:_0x78e6x20,lastEvent:_0xee2a[60],lastEventAt:moment()[_0xee2a[65]](_0xee2a[64]),openchannelIn:1})}else {return _0x78e6x1e[_0xee2a[69]]({lastEvent:_0xee2a[60],lastEventAt:moment()[_0xee2a[65]](_0xee2a[64]),status:_0xee2a[66],openReason:_0xee2a[67],openchannelIn:++_0x78e6x1e[_0xee2a[68]]})}})[_0xee2a[24]](function(_0x78e6x1e){_0x78e6x1b[_0xee2a[49]]= _0x78e6x1c[_0xee2a[30]];_0x78e6x1b[_0xee2a[59]]= _0x78e6x1e[_0xee2a[30]];_0x78e6x1b[_0xee2a[21]]= _0xee2a[60];return OpenchannelMessage[_0xee2a[44]](_0x78e6x1b)})[_0xee2a[24]](function(_0x78e6x1d){_0x78e6x13[_0xee2a[58]][_0xee2a[57]][_0xee2a[56]][_0xee2a[20]]({message:_0xee2a[55],doc:_0x78e6x1d});return _0x78e6x11[_0xee2a[21]](201)[_0xee2a[20]](_0x78e6x1d)})[_0xee2a[23]](function(_0x78e6x12){logger[_0xee2a[19]](_0x78e6x12[_0xee2a[18]]);return _0x78e6x11[_0xee2a[21]](500)[_0xee2a[20]]({code:500,message:_0x78e6x12[_0xee2a[54]]})})};exports[_0xee2a[77]]= function(_0x78e6x13,_0x78e6x11){if(_0x78e6x13[_0xee2a[47]][_0xee2a[30]]){delete _0x78e6x13[_0xee2a[47]][_0xee2a[30]]};return OpenchannelAccount[_0xee2a[32]](_0x78e6x13[_0xee2a[31]][_0xee2a[30]])[_0xee2a[24]](function(_0x78e6x15){if(!_0x78e6x15){return _0x78e6x11[_0xee2a[29]](404)};var _0x78e6x21=_[_0xee2a[40]](_0x78e6x15,_0x78e6x13[_0xee2a[47]]);return _0x78e6x21[_0xee2a[78]]()})[_0xee2a[24]](function(_0x78e6x15){return _0x78e6x11[_0xee2a[21]](200)[_0xee2a[20]](_0x78e6x15)})[_0xee2a[23]](sequelize.UniqueConstraintError,function(_0x78e6x12){return Util[_0xee2a[46]][_0xee2a[45]](_0x78e6x11,_0x78e6x12)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[79]]= function(_0x78e6x13,_0x78e6x11){if(_0x78e6x13[_0xee2a[47]][_0xee2a[30]]){delete _0x78e6x13[_0xee2a[47]][_0xee2a[30]]};return OpenchannelDisposition[_0xee2a[32]](_0x78e6x13[_0xee2a[31]][_0xee2a[80]])[_0xee2a[24]](function(_0x78e6x22){if(!_0x78e6x22){return _0x78e6x11[_0xee2a[29]](404)};var _0x78e6x21=_[_0xee2a[40]](_0x78e6x22,_0x78e6x13[_0xee2a[47]]);return _0x78e6x21[_0xee2a[78]]()})[_0xee2a[24]](function(_0x78e6x22){return _0x78e6x11[_0xee2a[21]](200)[_0xee2a[20]](_0x78e6x22)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[81]]= function(_0x78e6x13,_0x78e6x11){var _0x78e6x23=0;var _0x78e6x24=_0x78e6x13[_0xee2a[47]];_0x78e6x24[_0xee2a[84]](function(_0x78e6x25){delete _0x78e6x25[_0xee2a[30]];delete _0x78e6x25[_0xee2a[74]];delete _0x78e6x25[_0xee2a[82]];_0x78e6x25[_0xee2a[83]]=  ++_0x78e6x23});return sequelize[_0xee2a[87]](function(_0x78e6x27){return OpenchannelApplication[_0xee2a[86]]({where:{OpenchannelAccountId:_0x78e6x13[_0xee2a[31]][_0xee2a[30]]},individualHooks:true,transaction:_0x78e6x27})[_0xee2a[24]](function(_0x78e6x28){return OpenchannelApplication[_0xee2a[85]](_0x78e6x24,{individualHooks:true,transaction:_0x78e6x27})})})[_0xee2a[24]](function(_0x78e6x26){return _0x78e6x11[_0xee2a[21]](200)[_0xee2a[20]]({count:_0x78e6x26[_0xee2a[34]],rows:_0x78e6x26})})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[88]]= function(_0x78e6x13,_0x78e6x11){if(_0x78e6x13[_0xee2a[47]][_0xee2a[30]]){delete _0x78e6x13[_0xee2a[47]][_0xee2a[30]]};return OpenchannelApplication[_0xee2a[32]](_0x78e6x13[_0xee2a[31]][_0xee2a[89]])[_0xee2a[24]](function(_0x78e6x28){if(!_0x78e6x28){return _0x78e6x11[_0xee2a[29]](404)};var _0x78e6x21=_[_0xee2a[40]](_0x78e6x28,_0x78e6x13[_0xee2a[47]]);return _0x78e6x21[_0xee2a[78]]()})[_0xee2a[24]](function(_0x78e6x28){return _0x78e6x11[_0xee2a[21]](200)[_0xee2a[20]](_0x78e6x28)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[86]]= function(_0x78e6x13,_0x78e6x11){return OpenchannelAccount[_0xee2a[32]](_0x78e6x13[_0xee2a[31]][_0xee2a[30]])[_0xee2a[24]](function(_0x78e6x15){if(!_0x78e6x15){return _0x78e6x11[_0xee2a[29]](404)};return _0x78e6x15[_0xee2a[86]]()})[_0xee2a[24]](function(){return _0x78e6x11[_0xee2a[29]](204)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[90]]= function(_0x78e6x13,_0x78e6x11,_0x78e6x16){return OpenchannelApplication[_0xee2a[32]](_0x78e6x13[_0xee2a[31]][_0xee2a[89]])[_0xee2a[24]](function(_0x78e6x28){if(!_0x78e6x28){return _0x78e6x11[_0xee2a[29]](404)};return _0x78e6x28[_0xee2a[86]]()})[_0xee2a[24]](function(){return _0x78e6x11[_0xee2a[29]](204)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[91]]= function(_0x78e6x13,_0x78e6x11,_0x78e6x16){return OpenchannelDisposition[_0xee2a[32]](_0x78e6x13[_0xee2a[31]][_0xee2a[80]])[_0xee2a[24]](function(_0x78e6x19){if(!_0x78e6x19){return _0x78e6x11[_0xee2a[29]](404)};return _0x78e6x19[_0xee2a[86]]()})[_0xee2a[24]](function(){return _0x78e6x11[_0xee2a[29]](204)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[92]]= function(_0x78e6x13,_0x78e6x11){return OpenchannelApplication[_0xee2a[86]]({where:{id:_0x78e6x13[_0xee2a[25]][_0xee2a[93]]},individualHooks:true})[_0xee2a[24]](function(){return _0x78e6x11[_0xee2a[29]](204)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})};exports[_0xee2a[94]]= function(_0x78e6x13,_0x78e6x11,_0x78e6x16){var _0x78e6x29={where:{OpenchannelAccountId:_0x78e6x13[_0xee2a[31]][_0xee2a[30]],$and:[]},attributes:[_0xee2a[30],_0xee2a[95],_0xee2a[74],_0xee2a[82],_0xee2a[96],_0xee2a[97],_0xee2a[98]],include:[]};if(_0x78e6x13[_0xee2a[25]]){if(_0x78e6x13[_0xee2a[25]][_0xee2a[96]]){if(_[_0xee2a[99]](_0x78e6x13[_0xee2a[25]][_0xee2a[96]])){for(var _0x78e6x2a=0;_0x78e6x2a< _0x78e6x13[_0xee2a[25]][_0xee2a[96]][_0xee2a[34]];_0x78e6x2a++){_0x78e6x29[_0xee2a[103]][_0xee2a[102]][_0xee2a[101]]({tags:{$like:_0xee2a[100]+ _0x78e6x13[_0xee2a[25]][_0xee2a[96]][_0x78e6x2a]+ _0xee2a[100]}})}}else {_0x78e6x29[_0xee2a[103]][_0xee2a[102]][_0xee2a[101]]({tags:{$like:_0xee2a[100]+ _0x78e6x13[_0xee2a[25]][_0xee2a[96]]+ _0xee2a[100]}})};delete _0x78e6x13[_0xee2a[25]][_0xee2a[96]]};_[_0xee2a[40]](_0x78e6x29[_0xee2a[103]],_0x78e6x13[_0xee2a[25]])};switch(_0x78e6x13[_0xee2a[52]][_0xee2a[112]]){case _0xee2a[105]:_0x78e6x29[_0xee2a[104]][_0xee2a[101]]({model:User,attributes:[_0xee2a[30]]});var _0x78e6x2b;var _0x78e6x2c;var _0x78e6x2d;return User[_0xee2a[32]](_0x78e6x13[_0xee2a[52]][_0xee2a[30]])[_0xee2a[24]](function(_0x78e6x30){if(_0x78e6x30){return _0x78e6x30[_0xee2a[111]]()}else {return []}})[_0xee2a[24]](function(_0x78e6x2f){_0x78e6x2c= _[_0xee2a[107]](_0x78e6x2f,_0xee2a[30]);return OpenchannelAccount[_0xee2a[32]](_0x78e6x13[_0xee2a[31]][_0xee2a[30]])})[_0xee2a[24]](function(_0x78e6x14){if(!_0x78e6x14){return _0x78e6x11[_0xee2a[29]](404)};return _0x78e6x14[_0xee2a[41]]({where:{$or:[{app:_0xee2a[108]},{app:_0xee2a[105]}]}})[_0xee2a[24]](function(_0x78e6x24){_0x78e6x2b= _[_0xee2a[107]](_[_0xee2a[106]](_0x78e6x24,{"\x61\x70\x70":_0xee2a[105]}),_0xee2a[51]);_0x78e6x2d= _[_0xee2a[107]](_[_0xee2a[106]](_0x78e6x24,{"\x61\x70\x70":_0xee2a[108]}),_0xee2a[109]);if(_[_0xee2a[110]](_0x78e6x2c,_0x78e6x2d)[_0xee2a[34]]|| _[_0xee2a[110]](_0x78e6x2b,[_0x78e6x13[_0xee2a[52]][_0xee2a[30]]])[_0xee2a[34]]){return OpenchannelRoom[_0xee2a[76]](_0x78e6x29)[_0xee2a[24]](function(_0x78e6x2e){return _0x78e6x11[_0xee2a[21]](200)[_0xee2a[20]](_0x78e6x2e)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})}else {return _0x78e6x11[_0xee2a[21]](200)[_0xee2a[20]]([])}})})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)});default:return OpenchannelRoom[_0xee2a[76]](_0x78e6x29)[_0xee2a[24]](function(_0x78e6x2e){return _0x78e6x11[_0xee2a[21]](200)[_0xee2a[20]](_0x78e6x2e)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})}};exports[_0xee2a[113]]= function(_0x78e6x13,_0x78e6x11,_0x78e6x16){return OpenchannelApplication[_0xee2a[114]](_0xee2a[83],{where:{OpenchannelAccountId:_0x78e6x13[_0xee2a[31]][_0xee2a[30]]}})[_0xee2a[24]](function(_0x78e6x32){_0x78e6x13[_0xee2a[47]][_0xee2a[83]]= _0x78e6x32?++_0x78e6x32:1;_0x78e6x13[_0xee2a[47]][_0xee2a[49]]= _0x78e6x13[_0xee2a[31]][_0xee2a[30]];return OpenchannelApplication[_0xee2a[44]](_0x78e6x13[_0xee2a[47]])})[_0xee2a[24]](function(_0x78e6x31){return _0x78e6x11[_0xee2a[21]](201)[_0xee2a[20]](_0x78e6x31)})[_0xee2a[23]](function(_0x78e6x12){return handleError(_0x78e6x11,_0x78e6x12)})}
\ No newline at end of file