Built motion from commit 7db97eb.|0.0.116
[motion.git] / server / api / chat_room / chat_room.controller.js
index 6eb65bf..963e993 100644 (file)
@@ -1 +1 @@
-var _0x592f=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x64\x35","\x6D\x6F\x6D\x65\x6E\x74","\x74\x6F\x2D\x63\x73\x76","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65","\x43\x68\x61\x74\x56\x69\x73\x69\x74\x6F\x72","\x55\x73\x65\x72\x48\x61\x73\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x69\x6E\x64\x65\x78","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x69\x64","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x72\x6F\x6C\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x6D\x65","\x65\x72\x72\x6F\x72","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x67\x65\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x73","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x73\x68\x6F\x77","\x70\x61\x72\x61\x6D\x73","\x75\x73\x65\x72\x70\x69\x63","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x55\x73\x65\x72\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x67\x65\x74\x55\x73\x65\x72\x73","\x75\x73\x65\x72\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x73\x70\x72\x65\x61\x64","\x62\x61\x73\x65\x36\x34","\x73\x6F\x72\x74","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x4F\x50\x45\x4E","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x65\x78\x70\x6F\x72\x74","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x62\x6F\x64\x79","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65\x73","\x74\x65\x78\x74\x2F\x63\x73\x76","\x74\x79\x70\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x54\x79\x70\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x47\x72\x6F\x75\x70\x73","\x63\x72\x65\x61\x74\x65","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x75\x70\x64\x61\x74\x65\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79"];_0x592f[0];var _=require(_0x592f[1]);var md5=require(_0x592f[2]);var moment=require(_0x592f[3]);var csv=require(_0x592f[4]);var Util=require(_0x592f[5]);var User=require(_0x592f[7])[_0x592f[6]];var ChatRoom=require(_0x592f[7])[_0x592f[8]];var ChatMessage=require(_0x592f[7])[_0x592f[9]];var ChatVisitor=require(_0x592f[7])[_0x592f[10]];var UserHasChatRoom=require(_0x592f[7])[_0x592f[11]];exports[_0x592f[12]]=function(_0x4505xb,_0x4505xc,_0x4505xd){return ChatRoom[_0x592f[27]](_[_0x592f[26]](Util[_0x592f[19]](_0x4505xb[_0x592f[18]]),{include:[{model:User,attributes:[_0x592f[20],_0x592f[21],_0x592f[22],_0x592f[23],_0x592f[24],_0x592f[25]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x592f[17]](function(_0x4505xf){_0x4505xc[_0x592f[16]](200)[_0x592f[15]](_0x4505xf)})[_0x592f[14]](function(_0x4505xe){console[_0x592f[13]](_0x4505xe);return handleError(_0x4505xc,_0x4505xe)})};exports[_0x592f[28]]=function(_0x4505xb,_0x4505xc){return User[_0x592f[33]](_0x4505xb[_0x592f[32]][_0x592f[20]])[_0x592f[17]](function(_0x4505x11){return _0x4505x11[_0x592f[31]]({include:[{model:ChatVisitor,attributes:[_0x592f[20],_0x592f[22],_0x592f[23]]},{model:User,attributes:[_0x592f[20],_0x592f[21],_0x592f[22],_0x592f[23],_0x592f[24],_0x592f[25]]}]})})[_0x592f[17]](function(_0x4505x10){if(!_0x4505x10){return _0x4505xc[_0x592f[30]](404)};return _0x4505xc[_0x592f[15]](_0x4505x10)})[_0x592f[14]](function(_0x4505xe){console[_0x592f[29]](_0x4505xe);return handleError(_0x4505xc,_0x4505xe)})};exports[_0x592f[34]]=function(_0x4505xb,_0x4505xc){return ChatRoom[_0x592f[33]](_0x4505xb[_0x592f[35]][_0x592f[20]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x592f[20],_0x592f[23],_0x592f[22]]},{model:User,attributes:[_0x592f[20],_0x592f[23],_0x592f[21],_0x592f[22],_0x592f[36]]}]},{model:User,attributes:[_0x592f[20],_0x592f[23],_0x592f[21],_0x592f[22]]},{model:ChatVisitor}]})[_0x592f[17]](function(_0x4505x12){if(!_0x4505x12){return _0x4505xc[_0x592f[30]](404)};return _0x4505xc[_0x592f[15]](_0x4505x12)})[_0x592f[14]](function(_0x4505xe){return handleError(_0x4505xc,_0x4505xe)})};exports[_0x592f[37]]=function(_0x4505xb,_0x4505xc,_0x4505xd){var _0x4505x13;return ChatRoom[_0x592f[47]]({where:{token:md5(JSON[_0x592f[45]](_0x4505xb[_0x592f[18]][_0x592f[40]][_0x592f[44]]())).toString(_0x592f[43])},defaults:{type:_0x592f[25],token:md5(JSON[_0x592f[45]](_0x4505xb[_0x592f[18]][_0x592f[40]][_0x592f[44]]())).toString(_0x592f[43]),status:_0x592f[46]},include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x592f[20],_0x592f[23],_0x592f[22]]},{model:User,attributes:[_0x592f[20],_0x592f[21],_0x592f[22],_0x592f[23],_0x592f[24],_0x592f[25]]}]},{model:User,attributes:[_0x592f[20],_0x592f[21],_0x592f[22],_0x592f[23],_0x592f[24],_0x592f[25]]}]})[_0x592f[42]](function(_0x4505x12,_0x4505x15){_0x4505x13=_0x4505x12;if(_0x4505x15){return _0x4505x13[_0x592f[41]](_0x4505xb[_0x592f[18]][_0x592f[40]])}else {return}})[_0x592f[17]](function(){return _0x4505x13[_0x592f[39]]()})[_0x592f[17]](function(_0x4505x14){return _0x4505xc[_0x592f[16]](200)[_0x592f[15]](_[_0x592f[26]](_0x4505x13[_0x592f[38]],{Users:_0x4505x14}))})[_0x592f[14]](function(_0x4505xe){return handleError(_0x4505xc,_0x4505xe)})};exports[_0x592f[48]]=function(_0x4505xb,_0x4505xc,_0x4505xd){return ChatRoom[_0x592f[33]](_0x4505xb[_0x592f[35]][_0x592f[20]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x592f[20],_0x592f[22]]},{model:User,attributes:[_0x592f[20],_0x592f[22]]}]}]})[_0x592f[17]](function(_0x4505x12){var _0x4505x16=[];_0x4505x12[_0x592f[55]][_0x592f[54]](function(_0x4505x17){_0x4505x16[_0x592f[53]]({name:_0x4505x17[_0x592f[6]]?_0x4505x17[_0x592f[6]][_0x592f[22]]:_0x4505x17[_0x592f[10]][_0x592f[22]],text:_0x4505x17[_0x592f[51]][_0x592f[50]](/(\r\n|\n|\r)/gm,_0x592f[49]),date:_0x4505x17[_0x592f[52]]})});return _0x4505xc[_0x592f[57]](_0x592f[56])[_0x592f[16]](200)[_0x592f[15]](csv(_0x4505x16))})[_0x592f[14]](function(_0x4505xe){return handleError(_0x4505xc,_0x4505xe)})};exports[_0x592f[58]]=function(_0x4505xb,_0x4505xc){return User[_0x592f[33]](_0x4505xb[_0x592f[32]][_0x592f[20]])[_0x592f[17]](function(_0x4505x11){return _0x4505x11[_0x592f[31]]({where:{type:_0x4505xb[_0x592f[35]][_0x592f[57]]},include:[{model:ChatVisitor,attributes:[_0x592f[20],_0x592f[22],_0x592f[23]]}]})})[_0x592f[17]](function(_0x4505x10){if(!_0x4505x10){return _0x4505xc[_0x592f[30]](404)};return _0x4505xc[_0x592f[15]](_0x4505x10)})[_0x592f[14]](function(_0x4505xe){return handleError(_0x4505xc,_0x4505xe)})};exports[_0x592f[59]]=function(_0x4505xb,_0x4505xc){return User[_0x592f[33]](_0x4505xb[_0x592f[32]][_0x592f[20]])[_0x592f[17]](function(_0x4505x11){return _0x4505x11[_0x592f[31]]({include:[{model:ChatVisitor,attributes:[_0x592f[20],_0x592f[22],_0x592f[23]]},{model:User,attributes:[_0x592f[20],_0x592f[21],_0x592f[22],_0x592f[23],_0x592f[24],_0x592f[25]]}]})})[_0x592f[17]](function(_0x4505x10){if(!_0x4505x10){return _0x4505xc[_0x592f[30]](404)};return _0x4505xc[_0x592f[15]](_0x4505x10)})[_0x592f[14]](function(_0x4505xe){return handleError(_0x4505xc,_0x4505xe)})};exports[_0x592f[60]]=function(_0x4505xb,_0x4505xc){};exports[_0x592f[61]]=function(_0x4505xb,_0x4505xc){if(_0x4505xb[_0x592f[51]][_0x592f[20]]){delete _0x4505xb[_0x592f[51]][_0x592f[20]]};return ChatRoom[_0x592f[33]](_0x4505xb[_0x592f[35]][_0x592f[20]])[_0x592f[17]](function(_0x4505x12){if(!_0x4505x12){return _0x4505xc[_0x592f[30]](404)};var _0x4505x18=_[_0x592f[26]](_0x4505x12,_0x4505xb[_0x592f[51]]);return _0x4505x18[_0x592f[62]]()})[_0x592f[17]](function(_0x4505x12){return _0x4505xc[_0x592f[16]](200)[_0x592f[15]](_0x4505x12)})[_0x592f[14]](function(_0x4505xe){return handleError(_0x4505xc,_0x4505xe)})};exports[_0x592f[63]]=function(_0x4505xb,_0x4505xc){var _0x4505x13;if(_0x4505xb[_0x592f[51]][_0x592f[20]]){delete _0x4505xb[_0x592f[51]][_0x592f[20]]};return ChatRoom[_0x592f[33]](_0x4505xb[_0x592f[35]][_0x592f[20]])[_0x592f[17]](function(_0x4505x12){if(!_0x4505x12||!_0x4505xb[_0x592f[51]][_0x592f[40]]){return _0x4505xc[_0x592f[30]](404)};return _0x4505x12})[_0x592f[17]](function(_0x4505x12){return _0x4505x12[_0x592f[61]]({token:md5(JSON[_0x592f[45]](_0x4505xb[_0x592f[51]][_0x592f[40]][_0x592f[44]]())).toString(_0x592f[43])})})[_0x592f[17]](function(_0x4505x12){_0x4505x13=_0x4505x12;return _0x4505x12[_0x592f[41]](_0x4505xb[_0x592f[51]][_0x592f[40]][_0x592f[44]](),{individualHooks:true})})[_0x592f[17]](function(){return _0x4505x13[_0x592f[39]]()})[_0x592f[17]](function(_0x4505x14){return _0x4505xc[_0x592f[16]](200)[_0x592f[15]](_[_0x592f[26]](_0x4505x13[_0x592f[38]],{Users:_0x4505x14,ChatMessages:[]}))})[_0x592f[14]](function(_0x4505xe){return handleError(_0x4505xc,_0x4505xe)})};exports[_0x592f[64]]=function(_0x4505xb,_0x4505xc){return ChatRoom[_0x592f[33]](_0x4505xb[_0x592f[35]][_0x592f[20]])[_0x592f[17]](function(_0x4505x12){if(!_0x4505x12){return _0x4505xc[_0x592f[30]](404)};return _0x4505x12[_0x592f[64]]()})[_0x592f[17]](function(){return _0x4505xc[_0x592f[30]](204)})[_0x592f[14]](function(_0x4505xe){return handleError(_0x4505xc,_0x4505xe)})};function handleError(_0x4505xc,_0x4505xe){return _0x4505xc[_0x592f[16]](500)[_0x592f[15]](_0x4505xe)}
\ No newline at end of file
+var _0x4b57=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x64\x35","\x6D\x6F\x6D\x65\x6E\x74","\x74\x6F\x2D\x63\x73\x76","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65","\x43\x68\x61\x74\x57\x65\x62\x73\x69\x74\x65","\x43\x68\x61\x74\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x56\x69\x73\x69\x74\x6F\x72","\x4C\x69\x73\x74","\x55\x73\x65\x72\x48\x61\x73\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x69\x6E\x64\x65\x78","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x69\x64","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x72\x6F\x6C\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x6D\x61\x70","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x6F\x70\x65\x6E","\x4F\x50\x45\x4E","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x6E\x65\x77","\x4E\x45\x57","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x41\x42\x41\x4E\x44\x4F\x4E","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x74\x61\x67\x73","\x62\x6F\x64\x79","\x2C","\x73\x70\x6C\x69\x74","\x70\x61\x72\x61\x6D\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x75\x70\x64\x61\x74\x65","\x24\x61\x6E\x64","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x25","\x3B\x25","\x70\x75\x73\x68","\x67\x65\x74\x41\x67\x65\x6E\x74\x73","\x67\x65\x74\x41\x67\x65\x6E\x74\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x47\x72\x6F\x75\x70\x73","\x67\x72\x6F\x75\x70","\x61\x67\x65\x6E\x74","\x75\x73\x65\x72\x70\x69\x63","\x66\x69\x6E\x64\x41\x6C\x6C","\x67\x65\x74\x45\x78\x74\x65\x72\x6E\x61\x6C\x73","\x65\x78\x74\x65\x72\x6E\x61\x6C","\x69\x6E\x63\x6C\x75\x64\x65","\x67\x65\x74\x41\x67\x65\x6E\x74","\x67\x65\x74\x4F\x6E\x6C\x69\x6E\x65\x52\x6F\x6F\x6D","\x6F\x6E\x6C\x69\x6E\x65","\x6D\x65","\x65\x72\x72\x6F\x72","\x67\x65\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x73","\x73\x68\x6F\x77","\x61\x64\x64\x72\x65\x73\x73","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x55\x73\x65\x72\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x67\x65\x74\x55\x73\x65\x72\x73","\x75\x73\x65\x72\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x73\x70\x72\x65\x61\x64","\x62\x61\x73\x65\x36\x34","\x73\x6F\x72\x74","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x63\x72\x65\x61\x74\x65\x4D\x65\x73\x73\x61\x67\x65","\x74\x79\x70\x65","\x63\x72\x65\x61\x74\x65","\x65\x78\x70\x6F\x72\x74","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x66\x6F\x72\x45\x61\x63\x68","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65\x73","\x74\x65\x78\x74\x2F\x63\x73\x76","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x54\x79\x70\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x47\x72\x6F\x75\x70\x73","\x75\x70\x64\x61\x74\x65\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79"];_0x4b57[0];var _=require(_0x4b57[1]);var md5=require(_0x4b57[2]);var moment=require(_0x4b57[3]);var csv=require(_0x4b57[4]);var Util=require(_0x4b57[5]);var User=require(_0x4b57[7])[_0x4b57[6]];var Agent=require(_0x4b57[7])[_0x4b57[6]];var ChatRoom=require(_0x4b57[7])[_0x4b57[8]];var ChatMessage=require(_0x4b57[7])[_0x4b57[9]];var ChatWebsite=require(_0x4b57[7])[_0x4b57[10]];var ChatApplication=require(_0x4b57[7])[_0x4b57[11]];var ChatQueue=require(_0x4b57[7])[_0x4b57[12]];var ChatVisitor=require(_0x4b57[7])[_0x4b57[13]];var List=require(_0x4b57[7])[_0x4b57[14]];var UserHasChatRoom=require(_0x4b57[7])[_0x4b57[15]];exports[_0x4b57[16]]= function(_0x8231x10,_0x8231x11,_0x8231x12){return ChatRoom[_0x4b57[31]](_[_0x4b57[30]](Util[_0x4b57[23]](_0x8231x10[_0x4b57[22]]),{include:[{model:User,attributes:[_0x4b57[24],_0x4b57[25],_0x4b57[26],_0x4b57[27],_0x4b57[28],_0x4b57[29]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x4b57[21]](function(_0x8231x14){_0x8231x11[_0x4b57[20]](200)[_0x4b57[19]](_0x8231x14)})[_0x4b57[18]](function(_0x8231x13){console[_0x4b57[17]](_0x8231x13);return handleError(_0x8231x11,_0x8231x13)})};function getChatQueues(_0x8231x16){return function(){switch(_0x8231x16[_0x4b57[28]]){case _0x4b57[35]:return User[_0x4b57[34]](_0x8231x16[_0x4b57[24]],{attributes:[_0x4b57[24]]})[_0x4b57[21]](Util[_0x4b57[33]]({},{attributes:[_0x4b57[24]]}))[_0x4b57[21]](function(_0x8231x17){return {include:{model:ChatWebsite,include:{model:ChatApplication,include:{model:ChatQueue,where:{id:_[_0x4b57[32]](_0x8231x17,_0x4b57[24])}}}}}});default:return {}}}}exports[_0x4b57[36]]= function(_0x8231x10,_0x8231x11){return Promise[_0x4b57[41]]([])[_0x4b57[21]](getChatQueues(_0x8231x10[_0x4b57[35]]))[_0x4b57[21]](function(_0x8231x19){return ChatRoom[_0x4b57[40]](_[_0x4b57[30]]({where:{status:_0x4b57[37],createdAt:{$gte:moment()[_0x4b57[39]](_0x4b57[38])}}},_0x8231x19))})[_0x4b57[21]](function(_0x8231x18){_0x8231x11[_0x4b57[20]](200)[_0x4b57[19]]({value:_0x8231x18})})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[42]]= function(_0x8231x10,_0x8231x11){return Promise[_0x4b57[41]]([])[_0x4b57[21]](getChatQueues(_0x8231x10[_0x4b57[35]]))[_0x4b57[21]](function(_0x8231x19){return ChatRoom[_0x4b57[40]](_[_0x4b57[30]]({where:{status:_0x4b57[43],createdAt:{$gte:moment()[_0x4b57[39]](_0x4b57[38])}}},_0x8231x19))})[_0x4b57[21]](function(_0x8231x18){_0x8231x11[_0x4b57[20]](200)[_0x4b57[19]]({value:_0x8231x18})})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[44]]= function(_0x8231x10,_0x8231x11){return Promise[_0x4b57[41]]([])[_0x4b57[21]](getChatQueues(_0x8231x10[_0x4b57[35]]))[_0x4b57[21]](function(_0x8231x19){return ChatRoom[_0x4b57[40]](_[_0x4b57[30]]({where:{status:_0x4b57[45],createdAt:{$gte:moment()[_0x4b57[39]](_0x4b57[38])}}},_0x8231x19))})[_0x4b57[21]](function(_0x8231x18){_0x8231x11[_0x4b57[20]](200)[_0x4b57[19]]({value:_0x8231x18})})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[46]]= function(_0x8231x10,_0x8231x11){return Promise[_0x4b57[41]]([])[_0x4b57[21]](getChatQueues(_0x8231x10[_0x4b57[35]]))[_0x4b57[21]](function(_0x8231x19){return ChatRoom[_0x4b57[40]](_[_0x4b57[30]]({where:{status:_0x4b57[47],createdAt:{$gte:moment()[_0x4b57[39]](_0x4b57[38])}}},_0x8231x19))})[_0x4b57[21]](function(_0x8231x18){_0x8231x11[_0x4b57[20]](200)[_0x4b57[19]]({value:_0x8231x18})})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[48]]= function(_0x8231x10,_0x8231x11){return Promise[_0x4b57[41]]([])[_0x4b57[21]](getChatQueues(_0x8231x10[_0x4b57[35]]))[_0x4b57[21]](function(_0x8231x19){return ChatRoom[_0x4b57[40]](_[_0x4b57[30]]({where:{status:_0x4b57[49]}},_0x8231x19))})[_0x4b57[21]](function(_0x8231x18){_0x8231x11[_0x4b57[20]](200)[_0x4b57[19]]({value:_0x8231x18})})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[50]]= function(_0x8231x10,_0x8231x11,_0x8231x12){var _0x8231x1a={tags:_0x8231x10[_0x4b57[52]][_0x4b57[51]]};var _0x8231x1b={where:{id:_0x8231x10[_0x4b57[55]][_0x4b57[24]][_0x4b57[54]](_0x4b57[53])}};return ChatRoom[_0x4b57[57]](_0x8231x1a,_0x8231x1b)[_0x4b57[21]](function(_0x8231x1c){if(!_0x8231x1c){return _0x8231x11[_0x4b57[56]](404)};return _0x8231x1c})[_0x4b57[21]](function(_0x8231x1c){return _0x8231x11[_0x4b57[56]](200)})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};function checkTags(_0x8231x1e){if(_0x8231x1e){if(_0x8231x1e[_0x4b57[51]]){_0x8231x1e[_0x4b57[58]]= [];if(_[_0x4b57[59]](_0x8231x1e[_0x4b57[51]])){for(var _0x8231x1f=0;_0x8231x1f< _0x8231x1e[_0x4b57[51]][_0x4b57[60]];_0x8231x1f++){_0x8231x1e[_0x4b57[58]][_0x4b57[63]]({tags:{$like:_0x4b57[61]+ _0x8231x1e[_0x4b57[51]][_0x8231x1f]+ _0x4b57[62]}})}}else {_0x8231x1e[_0x4b57[58]][_0x4b57[63]]({tags:{$like:_0x4b57[61]+ _0x8231x1e[_0x4b57[51]]+ _0x4b57[62]}})};delete _0x8231x1e[_0x4b57[51]]}}}exports[_0x4b57[64]]= function(_0x8231x10,_0x8231x11,_0x8231x12){switch(_0x8231x10[_0x4b57[35]][_0x4b57[28]]){case _0x4b57[35]:return User[_0x4b57[34]](_0x8231x10[_0x4b57[35]][_0x4b57[24]],{attributes:[_0x4b57[24]],where:{id:{$ne:_0x8231x10[_0x4b57[35]][_0x4b57[24]]},online:true}})[_0x4b57[21]](Util[_0x4b57[65]](_[_0x4b57[30]](_0x8231x10[_0x4b57[22]],{id:{$ne:_0x8231x10[_0x4b57[35]][_0x4b57[24]]}})))[_0x4b57[21]](function(_0x8231x14){return _0x8231x11[_0x4b57[20]](200)[_0x4b57[19]](_0x8231x14)})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)});default:return User[_0x4b57[66]](_0x4b57[41])[_0x4b57[31]](_[_0x4b57[30]](Util[_0x4b57[23]](_0x8231x10[_0x4b57[22]]),{where:{id:{$ne:_0x8231x10[_0x4b57[35]][_0x4b57[24]]},online:true}}))[_0x4b57[21]](function(_0x8231x14){return _0x8231x11[_0x4b57[20]](200)[_0x4b57[19]](_0x8231x14)})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})}};exports[_0x4b57[67]]= function(_0x8231x10,_0x8231x11,_0x8231x12){checkTags(_0x8231x10[_0x4b57[22]]);var _0x8231x20={where:_[_0x4b57[30]]({type:_0x4b57[68]},_0x8231x10[_0x4b57[22]])};switch(_0x8231x10[_0x4b57[35]][_0x4b57[28]]){case _0x4b57[69]:_[_0x4b57[30]](_0x8231x20,{include:[{model:User,attributes:[_0x4b57[24]],where:{id:_0x8231x10[_0x4b57[35]][_0x4b57[24]]}}]});break;default:};return ChatRoom[_0x4b57[71]](_0x8231x20)[_0x4b57[21]](function(_0x8231x1c){return ChatRoom[_0x4b57[71]]({where:{id:{$in:_[_0x4b57[32]](_0x8231x1c,_0x4b57[24])}},include:[{model:User,attributes:[_0x4b57[24],_0x4b57[25],_0x4b57[26],_0x4b57[28],_0x4b57[70]]},{model:ChatVisitor}]})})[_0x4b57[21]](function(_0x8231x1c){return _0x8231x11[_0x4b57[20]](200)[_0x4b57[19]]({rows:_0x8231x1c,count:_0x8231x1c[_0x4b57[60]]})})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[72]]= function(_0x8231x10,_0x8231x11,_0x8231x12){checkTags(_0x8231x10[_0x4b57[22]]);var _0x8231x20={where:_[_0x4b57[30]]({type:_0x4b57[73]},_0x8231x10[_0x4b57[22]]),include:[{model:ChatVisitor,attributes:[_0x4b57[24],_0x4b57[26]]}]};switch(_0x8231x10[_0x4b57[35]][_0x4b57[28]]){case _0x4b57[69]:_0x8231x20[_0x4b57[74]][_0x4b57[63]]({model:User,attributes:[_0x4b57[24]],where:{id:_0x8231x10[_0x4b57[35]][_0x4b57[24]]}});break;default:};return ChatRoom[_0x4b57[71]](_0x8231x20)[_0x4b57[21]](function(_0x8231x1c){return _0x8231x11[_0x4b57[20]](200)[_0x4b57[19]]({rows:_0x8231x1c,count:_0x8231x1c[_0x4b57[60]]})})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[75]]= function(_0x8231x10,_0x8231x11,_0x8231x12){return User[_0x4b57[66]](_0x4b57[41])[_0x4b57[34]](_0x8231x10[_0x4b57[55]][_0x4b57[24]])[_0x4b57[21]](function(_0x8231x14){return _0x8231x11[_0x4b57[20]](200)[_0x4b57[19]](_0x8231x14)})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[76]]= function(_0x8231x10,_0x8231x11,_0x8231x12){return ChatRoom[_0x4b57[66]](_0x4b57[77])[_0x4b57[31]](_[_0x4b57[30]](Util[_0x4b57[23]](_0x8231x10[_0x4b57[22]]),{include:[{model:User,attributes:[_0x4b57[24],_0x4b57[25],_0x4b57[26],_0x4b57[27],_0x4b57[28],_0x4b57[29]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x4b57[21]](function(_0x8231x14){_0x8231x11[_0x4b57[20]](200)[_0x4b57[19]](_0x8231x14)})[_0x4b57[18]](function(_0x8231x13){console[_0x4b57[17]](_0x8231x13);return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[78]]= function(_0x8231x10,_0x8231x11){return User[_0x4b57[34]](_0x8231x10[_0x4b57[35]][_0x4b57[24]])[_0x4b57[21]](function(_0x8231x16){return _0x8231x16[_0x4b57[80]]({include:[{model:ChatVisitor,attributes:[_0x4b57[24],_0x4b57[26],_0x4b57[27]]},{model:User,attributes:[_0x4b57[24],_0x4b57[25],_0x4b57[26],_0x4b57[27],_0x4b57[28],_0x4b57[29]]}]})})[_0x4b57[21]](function(_0x8231x1c){if(!_0x8231x1c){return _0x8231x11[_0x4b57[56]](404)};return _0x8231x11[_0x4b57[19]](_0x8231x1c)})[_0x4b57[18]](function(_0x8231x13){console[_0x4b57[79]](_0x8231x13);return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[81]]= function(_0x8231x10,_0x8231x11){return ChatRoom[_0x4b57[34]](_0x8231x10[_0x4b57[55]][_0x4b57[24]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x4b57[24],_0x4b57[27],_0x4b57[26]]},{model:User,attributes:[_0x4b57[24],_0x4b57[27],_0x4b57[25],_0x4b57[26],_0x4b57[70],_0x4b57[28],_0x4b57[29]]}]},{model:User,attributes:[_0x4b57[24],_0x4b57[27],_0x4b57[25],_0x4b57[26],_0x4b57[70],_0x4b57[28],_0x4b57[29]]},{model:ChatVisitor},{model:ChatWebsite,attributes:[_0x4b57[24],_0x4b57[25],_0x4b57[82]],include:[List]}]})[_0x4b57[21]](function(_0x8231x21){if(!_0x8231x21){return _0x8231x11[_0x4b57[56]](404)};return _0x8231x11[_0x4b57[19]](_0x8231x21)})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[83]]= function(_0x8231x10,_0x8231x11,_0x8231x12){var _0x8231x22;return ChatRoom[_0x4b57[92]]({where:{token:md5(JSON[_0x4b57[91]](_0x8231x10[_0x4b57[22]][_0x4b57[86]][_0x4b57[90]]())).toString(_0x4b57[89])},defaults:{type:_0x4b57[29],token:md5(JSON[_0x4b57[91]](_0x8231x10[_0x4b57[22]][_0x4b57[86]][_0x4b57[90]]())).toString(_0x4b57[89]),status:_0x4b57[37]},include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x4b57[24],_0x4b57[27],_0x4b57[26]]},{model:User,attributes:[_0x4b57[24],_0x4b57[25],_0x4b57[26],_0x4b57[27],_0x4b57[28],_0x4b57[29]]}]},{model:User,attributes:[_0x4b57[24],_0x4b57[25],_0x4b57[26],_0x4b57[27],_0x4b57[28],_0x4b57[29]]}]})[_0x4b57[88]](function(_0x8231x21,_0x8231x24){_0x8231x22= _0x8231x21;if(_0x8231x24){return _0x8231x22[_0x4b57[87]](_0x8231x10[_0x4b57[22]][_0x4b57[86]])}})[_0x4b57[21]](function(){return _0x8231x22[_0x4b57[85]]()})[_0x4b57[21]](function(_0x8231x23){return _0x8231x11[_0x4b57[20]](200)[_0x4b57[19]](_[_0x4b57[30]](_0x8231x22[_0x4b57[84]],{Users:_0x8231x23}))})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[93]]= function(_0x8231x10,_0x8231x11,_0x8231x12){var _0x8231x22;return ChatRoom[_0x4b57[34]](_0x8231x10[_0x4b57[55]][_0x4b57[24]])[_0x4b57[21]](function(_0x8231x21){_0x8231x22= _0x8231x21;if(!_0x8231x22){return _0x8231x11[_0x4b57[56]](404)}})[_0x4b57[21]](function(){return ChatMessage[_0x4b57[95]](_[_0x4b57[30]](_0x8231x10[_0x4b57[52]],{type:_0x8231x22[_0x4b57[94]],ChatRoomId:_0x8231x10[_0x4b57[55]][_0x4b57[24]],UserId:_0x8231x10[_0x4b57[35]][_0x4b57[24]]}))})[_0x4b57[21]](function(_0x8231x25){return _0x8231x11[_0x4b57[20]](200)[_0x4b57[19]](_0x8231x25)})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[96]]= function(_0x8231x10,_0x8231x11,_0x8231x12){return ChatRoom[_0x4b57[34]](_0x8231x10[_0x4b57[55]][_0x4b57[24]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x4b57[24],_0x4b57[26]]},{model:User,attributes:[_0x4b57[24],_0x4b57[26]]}]}]})[_0x4b57[21]](function(_0x8231x21){var _0x8231x26=[];_0x8231x21[_0x4b57[101]][_0x4b57[100]](function(_0x8231x25){_0x8231x26[_0x4b57[63]]({name:_0x8231x25[_0x4b57[6]]?_0x8231x25[_0x4b57[6]][_0x4b57[26]]:_0x8231x25[_0x4b57[13]][_0x4b57[26]],text:_0x8231x25[_0x4b57[52]][_0x4b57[98]](/(\r\n|\n|\r)/gm,_0x4b57[97]),date:_0x8231x25[_0x4b57[99]]})});return _0x8231x11[_0x4b57[94]](_0x4b57[102])[_0x4b57[20]](200)[_0x4b57[19]](csv(_0x8231x26))})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[103]]= function(_0x8231x10,_0x8231x11){return User[_0x4b57[34]](_0x8231x10[_0x4b57[35]][_0x4b57[24]])[_0x4b57[21]](function(_0x8231x16){return _0x8231x16[_0x4b57[80]]({where:{type:_0x8231x10[_0x4b57[55]][_0x4b57[94]]},include:[{model:ChatVisitor,attributes:[_0x4b57[24],_0x4b57[26],_0x4b57[27]]}]})})[_0x4b57[21]](function(_0x8231x1c){if(!_0x8231x1c){return _0x8231x11[_0x4b57[56]](404)};return _0x8231x11[_0x4b57[19]](_0x8231x1c)})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[104]]= function(_0x8231x10,_0x8231x11){return User[_0x4b57[34]](_0x8231x10[_0x4b57[35]][_0x4b57[24]])[_0x4b57[21]](function(_0x8231x16){return _0x8231x16[_0x4b57[80]]({include:[{model:ChatVisitor,attributes:[_0x4b57[24],_0x4b57[26],_0x4b57[27]]},{model:User,attributes:[_0x4b57[24],_0x4b57[25],_0x4b57[26],_0x4b57[27],_0x4b57[28],_0x4b57[29]]}]})})[_0x4b57[21]](function(_0x8231x1c){if(!_0x8231x1c){return _0x8231x11[_0x4b57[56]](404)};return _0x8231x11[_0x4b57[19]](_0x8231x1c)})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[95]]= function(_0x8231x10,_0x8231x11){};exports[_0x4b57[57]]= function(_0x8231x10,_0x8231x11){if(_0x8231x10[_0x4b57[52]][_0x4b57[24]]){delete _0x8231x10[_0x4b57[52]][_0x4b57[24]]};return ChatRoom[_0x4b57[34]](_0x8231x10[_0x4b57[55]][_0x4b57[24]])[_0x4b57[21]](function(_0x8231x21){if(!_0x8231x21){return _0x8231x11[_0x4b57[56]](404)};return _0x8231x21[_0x4b57[57]](_0x8231x10[_0x4b57[52]])})[_0x4b57[21]](function(_0x8231x21){return _0x8231x11[_0x4b57[20]](200)[_0x4b57[19]](_0x8231x21)})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[105]]= function(_0x8231x10,_0x8231x11){var _0x8231x22;if(_0x8231x10[_0x4b57[52]][_0x4b57[24]]){delete _0x8231x10[_0x4b57[52]][_0x4b57[24]]};return ChatRoom[_0x4b57[34]](_0x8231x10[_0x4b57[55]][_0x4b57[24]])[_0x4b57[21]](function(_0x8231x21){if(!_0x8231x21|| !_0x8231x10[_0x4b57[52]][_0x4b57[86]]){return _0x8231x11[_0x4b57[56]](404)};return _0x8231x21})[_0x4b57[21]](function(_0x8231x21){return _0x8231x21[_0x4b57[57]]({type:_0x4b57[68],token:md5(JSON[_0x4b57[91]](_0x8231x10[_0x4b57[52]][_0x4b57[86]][_0x4b57[90]]())).toString(_0x4b57[89])})})[_0x4b57[21]](function(_0x8231x21){_0x8231x22= _0x8231x21;return _0x8231x21[_0x4b57[87]](_0x8231x10[_0x4b57[52]][_0x4b57[86]][_0x4b57[90]](),{individualHooks:true})})[_0x4b57[21]](function(){return _0x8231x22[_0x4b57[85]]()})[_0x4b57[21]](function(_0x8231x23){_[_0x4b57[30]](_0x8231x22[_0x4b57[84]],{Users:_0x8231x23});return _0x8231x11[_0x4b57[20]](200)[_0x4b57[19]](_0x8231x22)})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};exports[_0x4b57[106]]= function(_0x8231x10,_0x8231x11){return ChatRoom[_0x4b57[34]](_0x8231x10[_0x4b57[55]][_0x4b57[24]])[_0x4b57[21]](function(_0x8231x21){if(!_0x8231x21){return _0x8231x11[_0x4b57[56]](404)};return _0x8231x21[_0x4b57[106]]()})[_0x4b57[21]](function(){return _0x8231x11[_0x4b57[56]](204)})[_0x4b57[18]](function(_0x8231x13){return handleError(_0x8231x11,_0x8231x13)})};function handleError(_0x8231x11,_0x8231x13){console[_0x4b57[17]](_0x8231x13);return _0x8231x11[_0x4b57[20]](500)[_0x4b57[19]](_0x8231x13)}
\ No newline at end of file