Built motion from commit (unavailable).|2.5.28
[motion2.git] / server / api / chatGroup / chatGroup.controller.js
index 4175c93..8ec98d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7da=['options','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','hasOwnProperty','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','status','end','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','offset','order','sort','where','pick','filter','map','VIRTUAL','merge','ChatGroup','count','includeAll','include','findAll','show','params'];(function(_0xb13d17,_0x1cd499){var _0x23c99e=function(_0x309af3){while(--_0x309af3){_0xb13d17['push'](_0xb13d17['shift']());}};_0x23c99e(++_0x1cd499);}(_0xc7da,0xf2));var _0xac7d=function(_0x4593f4,_0x5e34c8){_0x4593f4=_0x4593f4-0x0;var _0x3c0948=_0xc7da[_0x4593f4];return _0x3c0948;};'use strict';var pdf=require(_0xac7d('0x0'));var emlformat=require(_0xac7d('0x1'));var rimraf=require(_0xac7d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac7d('0x3'));var rp=require(_0xac7d('0x4'));var moment=require('moment');var BPromise=require(_0xac7d('0x5'));var Mustache=require(_0xac7d('0x6'));var util=require('util');var path=require(_0xac7d('0x7'));var sox=require(_0xac7d('0x8'));var csv=require(_0xac7d('0x9'));var ejs=require(_0xac7d('0xa'));var fs=require('fs');var _=require(_0xac7d('0xb'));var squel=require(_0xac7d('0xc'));var crypto=require('crypto');var jsforce=require(_0xac7d('0xd'));var deskjs=require(_0xac7d('0xe'));var toCsv=require(_0xac7d('0x9'));var querystring=require(_0xac7d('0xf'));var Papa=require(_0xac7d('0x10'));var Redis=require(_0xac7d('0x11'));var authService=require(_0xac7d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xac7d('0x13'));var hardwareService=require(_0xac7d('0x14'));var logger=require(_0xac7d('0x15'))('api');var utils=require(_0xac7d('0x16'));var config=require(_0xac7d('0x17'));var licenseUtil=require(_0xac7d('0x18'));var db=require(_0xac7d('0x19'))['db'];config['redis']=_[_0xac7d('0x1a')](config[_0xac7d('0x1b')],{'host':_0xac7d('0x1c'),'port':0x18eb});var socket=require(_0xac7d('0x1d'))(new Redis(config[_0xac7d('0x1b')]));require('./chatGroup.socket')[_0xac7d('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xac7d('0x1f')][_0xac7d('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x34980f,_0x355209,_0x533bac,_0x19e7ba){return new BPromise(function(_0x4283dd,_0x27ed38){var _0x12813a=_0x19e7ba||client;return _0x12813a[_0xac7d('0x21')](_0x34980f,_0x533bac)['then'](function(_0x7df8e0){logger[_0xac7d('0x22')]('ChatGroup,\x20%s,\x20%s',_0x355209,_0xac7d('0x23'));logger[_0xac7d('0x24')](_0xac7d('0x25'),_0x355209,_0xac7d('0x23'),JSON['stringify'](_0x7df8e0));if(_0x7df8e0[_0xac7d('0x26')]){if(_0x7df8e0[_0xac7d('0x26')][_0xac7d('0x27')]===0x1f4){logger['error'](_0xac7d('0x28'),_0x355209,_0x7df8e0['error'][_0xac7d('0x29')]);return _0x27ed38(_0x7df8e0[_0xac7d('0x26')][_0xac7d('0x29')]);}logger[_0xac7d('0x26')](_0xac7d('0x28'),_0x355209,_0x7df8e0[_0xac7d('0x26')]['message']);return _0x4283dd(_0x7df8e0['error'][_0xac7d('0x29')]);}else{logger[_0xac7d('0x22')]('ChatGroup,\x20%s,\x20%s',_0x355209,_0xac7d('0x23'));_0x4283dd(_0x7df8e0[_0xac7d('0x2a')][_0xac7d('0x29')]);}})[_0xac7d('0x2b')](function(_0x43aa8e){logger[_0xac7d('0x26')](_0xac7d('0x28'),_0x355209,_0x43aa8e);_0x27ed38(_0x43aa8e);});});}function respondWithStatusCode(_0x3bb7dd,_0x42e313){_0x42e313=_0x42e313||0xcc;return function(_0x26a8c4){if(_0x26a8c4){return _0x3bb7dd['sendStatus'](_0x42e313);}return _0x3bb7dd[_0xac7d('0x2c')](_0x42e313)[_0xac7d('0x2d')]();};}function respondWithResult(_0x31e220,_0x1bcfd5){_0x1bcfd5=_0x1bcfd5||0xc8;return function(_0x4cc590){if(_0x4cc590){return _0x31e220['status'](_0x1bcfd5)['json'](_0x4cc590);}};}function respondWithFilteredResult(_0xc30df3,_0x32b12c){return function(_0xac3f87){if(_0xac3f87){var _0x5bd39b=_0xac3f87['count'],_0x51df23=_0x32b12c['offset'],_0x506b88=_0x32b12c['offset']+_0x32b12c[_0xac7d('0x2e')],_0x4e2456;if(_0x506b88>=_0x5bd39b){_0x506b88=_0x5bd39b;_0x4e2456=0xc8;}else{_0x4e2456=0xce;}_0xc30df3[_0xac7d('0x2c')](_0x4e2456);return _0xc30df3[_0xac7d('0x2f')](_0xac7d('0x30'),_0x51df23+'-'+_0x506b88+'/'+_0x5bd39b)[_0xac7d('0x31')](_0xac3f87);}return null;};}function patchUpdates(_0x5c3c15){return function(_0x4ce2ed){try{jsonpatch[_0xac7d('0x32')](_0x4ce2ed,_0x5c3c15,!![]);}catch(_0xfbfbf7){return BPromise[_0xac7d('0x33')](_0xfbfbf7);}return _0x4ce2ed[_0xac7d('0x34')]();};}function saveUpdates(_0x39dc77,_0x500161){return function(_0x3ba58d){if(_0x3ba58d){return _0x3ba58d[_0xac7d('0x35')](_0x39dc77)[_0xac7d('0x36')](function(_0x96e66b){return _0x96e66b;});}return null;};}function removeEntity(_0x41c60a,_0x2e10f7){return function(_0x29163c){if(_0x29163c){return _0x29163c[_0xac7d('0x37')]()[_0xac7d('0x36')](function(){_0x41c60a[_0xac7d('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2237be,_0x1835d2){return function(_0x64724b){if(!_0x64724b){_0x2237be[_0xac7d('0x38')](0x194);}return _0x64724b;};}function handleError(_0x204717,_0x5690e4){_0x5690e4=_0x5690e4||0x1f4;return function(_0x2bfc9e){logger['error'](_0x2bfc9e['stack']);if(_0x2bfc9e[_0xac7d('0x39')]){delete _0x2bfc9e[_0xac7d('0x39')];}_0x204717[_0xac7d('0x2c')](_0x5690e4)[_0xac7d('0x3a')](_0x2bfc9e);};}exports[_0xac7d('0x3b')]=function(_0x24cdfb,_0x330fb0){var _0x1e48df={},_0x105bac={},_0x3a0bc2={'count':0x0,'rows':[]};var _0x1c5df3=_['map'](db['ChatGroup'][_0xac7d('0x3c')],function(_0x586b63){return{'name':_0x586b63[_0xac7d('0x3d')],'type':_0x586b63[_0xac7d('0x3e')][_0xac7d('0x3f')]};});_0x105bac[_0xac7d('0x40')]=_['map'](_0x1c5df3,'name');_0x105bac[_0xac7d('0x41')]=_[_0xac7d('0x42')](_0x24cdfb[_0xac7d('0x41')]);_0x105bac[_0xac7d('0x43')]=_[_0xac7d('0x44')](_0x105bac['model'],_0x105bac['query']);_0x1e48df[_0xac7d('0x45')]=_['intersection'](_0x105bac[_0xac7d('0x40')],qs[_0xac7d('0x46')](_0x24cdfb[_0xac7d('0x41')]['fields']));_0x1e48df[_0xac7d('0x45')]=_0x1e48df[_0xac7d('0x45')][_0xac7d('0x47')]?_0x1e48df[_0xac7d('0x45')]:_0x105bac[_0xac7d('0x40')];if(!_0x24cdfb[_0xac7d('0x41')]['hasOwnProperty']('nolimit')){_0x1e48df[_0xac7d('0x2e')]=qs[_0xac7d('0x2e')](_0x24cdfb['query'][_0xac7d('0x2e')]);_0x1e48df[_0xac7d('0x48')]=qs[_0xac7d('0x48')](_0x24cdfb['query']['offset']);}_0x1e48df[_0xac7d('0x49')]=qs['sort'](_0x24cdfb[_0xac7d('0x41')][_0xac7d('0x4a')]);_0x1e48df[_0xac7d('0x4b')]=qs[_0xac7d('0x43')](_[_0xac7d('0x4c')](_0x24cdfb[_0xac7d('0x41')],_0x105bac[_0xac7d('0x43')]),_0x1c5df3);if(_0x24cdfb[_0xac7d('0x41')][_0xac7d('0x4d')]){_0x1e48df[_0xac7d('0x4b')]=_['merge'](_0x1e48df[_0xac7d('0x4b')],{'$or':_[_0xac7d('0x4e')](_0x1c5df3,function(_0x37dca1){if(_0x37dca1[_0xac7d('0x3e')]!==_0xac7d('0x4f')){var _0x4092d1={};_0x4092d1[_0x37dca1[_0xac7d('0x39')]]={'$like':'%'+_0x24cdfb['query'][_0xac7d('0x4d')]+'%'};return _0x4092d1;}})});}_0x1e48df=_[_0xac7d('0x50')]({},_0x1e48df,_0x24cdfb['options']);var _0x1905c5={'where':_0x1e48df[_0xac7d('0x4b')]};return db[_0xac7d('0x51')][_0xac7d('0x52')](_0x1905c5)[_0xac7d('0x36')](function(_0x40abbb){_0x3a0bc2[_0xac7d('0x52')]=_0x40abbb;if(_0x24cdfb['query'][_0xac7d('0x53')]){_0x1e48df[_0xac7d('0x54')]=[{'all':!![]}];}return db['ChatGroup'][_0xac7d('0x55')](_0x1e48df);})[_0xac7d('0x36')](function(_0x3f3e3d){_0x3a0bc2['rows']=_0x3f3e3d;return _0x3a0bc2;})[_0xac7d('0x36')](respondWithFilteredResult(_0x330fb0,_0x1e48df))[_0xac7d('0x2b')](handleError(_0x330fb0,null));};exports[_0xac7d('0x56')]=function(_0x302794,_0x57e0c2){var _0x2cf14d={'raw':!![],'where':{'id':_0x302794[_0xac7d('0x57')]['id']}},_0x14901d={};_0x14901d[_0xac7d('0x40')]=_[_0xac7d('0x42')](db['ChatGroup']['rawAttributes']);_0x14901d[_0xac7d('0x41')]=_[_0xac7d('0x42')](_0x302794[_0xac7d('0x41')]);_0x14901d['filters']=_[_0xac7d('0x44')](_0x14901d['model'],_0x14901d[_0xac7d('0x41')]);_0x2cf14d[_0xac7d('0x45')]=_[_0xac7d('0x44')](_0x14901d[_0xac7d('0x40')],qs[_0xac7d('0x46')](_0x302794[_0xac7d('0x41')]['fields']));_0x2cf14d[_0xac7d('0x45')]=_0x2cf14d[_0xac7d('0x45')][_0xac7d('0x47')]?_0x2cf14d[_0xac7d('0x45')]:_0x14901d[_0xac7d('0x40')];if(_0x302794[_0xac7d('0x41')][_0xac7d('0x53')]){_0x2cf14d[_0xac7d('0x54')]=[{'all':!![]}];}_0x2cf14d=_[_0xac7d('0x50')]({},_0x2cf14d,_0x302794[_0xac7d('0x58')]);return db[_0xac7d('0x51')][_0xac7d('0x59')](_0x2cf14d)[_0xac7d('0x36')](handleEntityNotFound(_0x57e0c2,null))[_0xac7d('0x36')](respondWithResult(_0x57e0c2,null))[_0xac7d('0x2b')](handleError(_0x57e0c2,null));};exports[_0xac7d('0x5a')]=function(_0xda0b68,_0x4c5e10){return db[_0xac7d('0x51')][_0xac7d('0x5a')](_0xda0b68[_0xac7d('0x5b')],{})[_0xac7d('0x36')](respondWithResult(_0x4c5e10,0xc9))[_0xac7d('0x2b')](handleError(_0x4c5e10,null));};exports[_0xac7d('0x35')]=function(_0x5e9fa4,_0x5625f9){if(_0x5e9fa4[_0xac7d('0x5b')]['id']){delete _0x5e9fa4[_0xac7d('0x5b')]['id'];}return db[_0xac7d('0x51')][_0xac7d('0x59')]({'where':{'id':_0x5e9fa4['params']['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x5625f9,null))[_0xac7d('0x36')](saveUpdates(_0x5e9fa4[_0xac7d('0x5b')],null))[_0xac7d('0x36')](respondWithResult(_0x5625f9,null))[_0xac7d('0x2b')](handleError(_0x5625f9,null));};exports['destroy']=function(_0x28329b,_0x36d8bd){return db[_0xac7d('0x51')][_0xac7d('0x59')]({'where':{'id':_0x28329b['params']['id']}})['then'](handleEntityNotFound(_0x36d8bd,null))[_0xac7d('0x36')](removeEntity(_0x36d8bd,null))[_0xac7d('0x2b')](handleError(_0x36d8bd,null));};exports[_0xac7d('0x5c')]=function(_0x29fc2c,_0x430260){return db[_0xac7d('0x51')][_0xac7d('0x5c')]()[_0xac7d('0x36')](respondWithResult(_0x430260,null))[_0xac7d('0x2b')](handleError(_0x430260,null));};exports['getUnread']=function(_0x3fedfc,_0x26617a,_0x7a9823){return db[_0xac7d('0x5d')]['count']({'where':{'ChatGroupId':_0x3fedfc[_0xac7d('0x57')]['id'],'ToId':_0x3fedfc[_0xac7d('0x5e')]['id'],'read':![]}})[_0xac7d('0x36')](function(_0x45097a){return{'id':_[_0xac7d('0x5f')](_0x3fedfc['params']['id']),'count':_0x45097a};})[_0xac7d('0x36')](respondWithResult(_0x26617a,null))[_0xac7d('0x2b')](handleError(_0x26617a,null));};exports[_0xac7d('0x60')]=function(_0x13dc6b,_0x336cb2,_0x1b2c24){return db[_0xac7d('0x51')]['find']({'where':{'id':_0x13dc6b[_0xac7d('0x57')]['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x336cb2,null))[_0xac7d('0x36')](function(_0x3b670d){if(_0x3b670d){return _0x3b670d[_0xac7d('0x60')](_0x13dc6b[_0xac7d('0x5b')][_0xac7d('0x61')],_[_0xac7d('0x62')](_0x13dc6b[_0xac7d('0x5b')],[_0xac7d('0x61'),'id'])||{});}})[_0xac7d('0x36')](respondWithResult(_0x336cb2,null))[_0xac7d('0x2b')](handleError(_0x336cb2,null));};exports[_0xac7d('0x63')]=function(_0x5b8458,_0x2a6904,_0x388a95){var _0x7b4c80={};var _0x5823fa={};var _0xb0118a;var _0x4d8265;return db['ChatGroup'][_0xac7d('0x64')]({'where':{'id':_0x5b8458[_0xac7d('0x57')]['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x2a6904,null))[_0xac7d('0x36')](function(_0x2c7f9d){if(_0x2c7f9d){_0xb0118a=_0x2c7f9d;_0x5823fa['model']=_[_0xac7d('0x42')](db['User'][_0xac7d('0x3c')]);_0x5823fa['query']=_[_0xac7d('0x42')](_0x5b8458[_0xac7d('0x41')]);_0x5823fa[_0xac7d('0x43')]=_['intersection'](_0x5823fa[_0xac7d('0x40')],_0x5823fa[_0xac7d('0x41')]);_0x7b4c80[_0xac7d('0x45')]=_[_0xac7d('0x44')](_0x5823fa['model'],qs[_0xac7d('0x46')](_0x5b8458[_0xac7d('0x41')][_0xac7d('0x46')]));_0x7b4c80['attributes']=_0x7b4c80['attributes'][_0xac7d('0x47')]?_0x7b4c80[_0xac7d('0x45')]:_0x5823fa['model'];_0x7b4c80['order']=qs[_0xac7d('0x4a')](_0x5b8458['query'][_0xac7d('0x4a')]);_0x7b4c80[_0xac7d('0x4b')]=qs[_0xac7d('0x43')](_[_0xac7d('0x4c')](_0x5b8458[_0xac7d('0x41')],_0x5823fa['filters']));if(_0x5b8458[_0xac7d('0x41')][_0xac7d('0x4d')]){_0x7b4c80['where']=_[_0xac7d('0x50')](_0x7b4c80[_0xac7d('0x4b')],{'$or':_[_0xac7d('0x4e')](_0x7b4c80['attributes'],function(_0x28e419){var _0xca2186={};_0xca2186[_0x28e419]={'$like':'%'+_0x5b8458[_0xac7d('0x41')][_0xac7d('0x4d')]+'%'};return _0xca2186;})});}_0x7b4c80=_[_0xac7d('0x50')]({},_0x7b4c80,_0x5b8458[_0xac7d('0x58')]);return _0xb0118a['getMembers'](_0x7b4c80);}})['then'](function(_0x45d0fd){if(_0x45d0fd){_0x4d8265=_0x45d0fd[_0xac7d('0x47')];if(!_0x5b8458[_0xac7d('0x41')]['hasOwnProperty'](_0xac7d('0x65'))){_0x7b4c80[_0xac7d('0x2e')]=qs[_0xac7d('0x2e')](_0x5b8458[_0xac7d('0x41')][_0xac7d('0x2e')]);_0x7b4c80[_0xac7d('0x48')]=qs[_0xac7d('0x48')](_0x5b8458[_0xac7d('0x41')][_0xac7d('0x48')]);}return _0xb0118a['getMembers'](_0x7b4c80);}})['then'](function(_0x5c61d1){if(_0x5c61d1){return _0x5c61d1?{'count':_0x4d8265,'rows':_0x5c61d1}:null;}})[_0xac7d('0x36')](respondWithResult(_0x2a6904,null))['catch'](handleError(_0x2a6904,null));};exports[_0xac7d('0x66')]=function(_0x3a660e,_0x979958,_0xc5ba36){return db[_0xac7d('0x51')][_0xac7d('0x59')]({'where':{'id':_0x3a660e[_0xac7d('0x57')]['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x979958,null))['then'](function(_0x2e5a61){if(_0x2e5a61){return _0x2e5a61[_0xac7d('0x66')](_0x3a660e['query'][_0xac7d('0x61')]);}})['then'](respondWithStatusCode(_0x979958,null))[_0xac7d('0x2b')](handleError(_0x979958,null));};exports[_0xac7d('0x67')]=function(_0x413871,_0x23555d,_0x2d766d){if(_0x413871[_0xac7d('0x5b')]['id']){delete _0x413871['body']['id'];}return db[_0xac7d('0x51')][_0xac7d('0x59')]({'where':{'id':_0x413871[_0xac7d('0x57')]['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x23555d,null))['then'](function(_0x54fa30){if(_0x54fa30){_0x413871['body'][_0xac7d('0x68')]=_0x54fa30['id'];return db['ChatInternalMessage'][_0xac7d('0x5a')](_0x413871[_0xac7d('0x5b')]);}})['then'](respondWithResult(_0x23555d,null))[_0xac7d('0x2b')](handleError(_0x23555d,null));};exports[_0xac7d('0x69')]=function(_0x834710,_0x22a3ab,_0x2bc2c8){var _0xe4c0b={};var _0x1a2b21={};var _0x17dbc1;var _0x22e406;return db[_0xac7d('0x51')][_0xac7d('0x64')]({'where':{'id':_0x834710[_0xac7d('0x57')]['id']}})[_0xac7d('0x36')](handleEntityNotFound(_0x22a3ab,null))[_0xac7d('0x36')](function(_0x2cde10){if(_0x2cde10){_0x17dbc1=_0x2cde10;_0x1a2b21[_0xac7d('0x40')]=_[_0xac7d('0x42')](db[_0xac7d('0x5d')][_0xac7d('0x3c')]);_0x1a2b21['query']=_['keys'](_0x834710[_0xac7d('0x41')]);_0x1a2b21[_0xac7d('0x43')]=_[_0xac7d('0x44')](_0x1a2b21[_0xac7d('0x40')],_0x1a2b21['query']);_0xe4c0b[_0xac7d('0x45')]=_[_0xac7d('0x44')](_0x1a2b21[_0xac7d('0x40')],qs['fields'](_0x834710[_0xac7d('0x41')][_0xac7d('0x46')]));_0xe4c0b[_0xac7d('0x45')]=_0xe4c0b[_0xac7d('0x45')]['length']?_0xe4c0b[_0xac7d('0x45')]:_0x1a2b21[_0xac7d('0x40')];_0xe4c0b[_0xac7d('0x49')]=qs['sort'](_0x834710[_0xac7d('0x41')]['sort']);_0xe4c0b[_0xac7d('0x4b')]=qs[_0xac7d('0x43')](_[_0xac7d('0x4c')](_0x834710[_0xac7d('0x41')],_0x1a2b21['filters']));if(_0x834710[_0xac7d('0x41')][_0xac7d('0x4d')]){_0xe4c0b['where']=_[_0xac7d('0x50')](_0xe4c0b[_0xac7d('0x4b')],{'$or':_['map'](_0xe4c0b[_0xac7d('0x45')],function(_0x2be9ff){var _0x4efd06={};_0x4efd06[_0x2be9ff]={'$like':'%'+_0x834710['query'][_0xac7d('0x4d')]+'%'};return _0x4efd06;})});}if(_0x834710[_0xac7d('0x41')]['$gte']){var _0x3ca960=_0x834710[_0xac7d('0x41')][_0xac7d('0x6a')][_0xac7d('0x6b')](',');var _0x4d3bb9={};_0x4d3bb9[_0x3ca960[0x0]]={'$gte':moment(_0x3ca960[0x1])[_0xac7d('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')};_0xe4c0b['where']=_[_0xac7d('0x50')](_0xe4c0b[_0xac7d('0x4b')],_0x4d3bb9);}_0xe4c0b=_['merge']({},_0xe4c0b,_0x834710[_0xac7d('0x58')]);return _0x17dbc1[_0xac7d('0x69')](_0xe4c0b);}})[_0xac7d('0x36')](function(_0x441022){if(_0x441022){_0x22e406=_0x441022[_0xac7d('0x47')];if(!_0x834710[_0xac7d('0x41')][_0xac7d('0x6d')](_0xac7d('0x65'))){_0xe4c0b[_0xac7d('0x2e')]=qs[_0xac7d('0x2e')](_0x834710[_0xac7d('0x41')][_0xac7d('0x2e')]);_0xe4c0b[_0xac7d('0x48')]=qs[_0xac7d('0x48')](_0x834710[_0xac7d('0x41')][_0xac7d('0x48')]);}return _0x17dbc1[_0xac7d('0x69')](_0xe4c0b);}})[_0xac7d('0x36')](function(_0x39b19d){if(_0x39b19d){return _0x39b19d?{'count':_0x22e406,'rows':_0x39b19d}:null;}})['then'](respondWithResult(_0x22a3ab,null))[_0xac7d('0x2b')](handleError(_0x22a3ab,null));};
\ No newline at end of file
+var _0x62f0=['keys','include','create','body','destroy','find','describe','getUnread','ChatInternalMessage','user','toInteger','ids','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','then','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','end','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','rows','catch','show','params'];(function(_0x2827bc,_0x530dd3){var _0x458cf0=function(_0x5c55aa){while(--_0x5c55aa){_0x2827bc['push'](_0x2827bc['shift']());}};_0x458cf0(++_0x530dd3);}(_0x62f0,0x82));var _0x062f=function(_0x594670,_0x4b9fdd){_0x594670=_0x594670-0x0;var _0x36a5b7=_0x62f0[_0x594670];return _0x36a5b7;};'use strict';var emlformat=require(_0x062f('0x0'));var rimraf=require(_0x062f('0x1'));var zipdir=require(_0x062f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x062f('0x3'));var moment=require(_0x062f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x062f('0x5'));var util=require(_0x062f('0x6'));var path=require(_0x062f('0x7'));var sox=require(_0x062f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x062f('0x9'));var _=require(_0x062f('0xa'));var squel=require(_0x062f('0xb'));var crypto=require(_0x062f('0xc'));var jsforce=require(_0x062f('0xd'));var deskjs=require(_0x062f('0xe'));var toCsv=require(_0x062f('0xf'));var querystring=require(_0x062f('0x10'));var Papa=require(_0x062f('0x11'));var Redis=require(_0x062f('0x12'));var authService=require(_0x062f('0x13'));var qs=require(_0x062f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x062f('0x15'));var logger=require(_0x062f('0x16'))(_0x062f('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x062f('0x18'));var db=require(_0x062f('0x19'))['db'];config['redis']=_[_0x062f('0x1a')](config[_0x062f('0x1b')],{'host':_0x062f('0x1c'),'port':0x18eb});var socket=require(_0x062f('0x1d'))(new Redis(config[_0x062f('0x1b')]));require(_0x062f('0x1e'))[_0x062f('0x1f')](socket);var jayson=require(_0x062f('0x20'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x55ea02,_0x1c04b5,_0x3c9a36,_0x211211){return new BPromise(function(_0x102200,_0x189149){var _0x1a8cfd=_0x211211||client;return _0x1a8cfd['request'](_0x55ea02,_0x3c9a36)[_0x062f('0x21')](function(_0x1aae89){logger['info']('ChatGroup,\x20%s,\x20%s',_0x1c04b5,_0x062f('0x22'));logger['debug'](_0x062f('0x23'),_0x1c04b5,_0x062f('0x22'),JSON[_0x062f('0x24')](_0x1aae89));if(_0x1aae89[_0x062f('0x25')]){if(_0x1aae89[_0x062f('0x25')][_0x062f('0x26')]===0x1f4){logger['error'](_0x062f('0x27'),_0x1c04b5,_0x1aae89[_0x062f('0x25')]['message']);return _0x189149(_0x1aae89[_0x062f('0x25')][_0x062f('0x28')]);}logger[_0x062f('0x25')](_0x062f('0x27'),_0x1c04b5,_0x1aae89[_0x062f('0x25')][_0x062f('0x28')]);return _0x102200(_0x1aae89[_0x062f('0x25')]['message']);}else{logger['info'](_0x062f('0x27'),_0x1c04b5,_0x062f('0x22'));_0x102200(_0x1aae89[_0x062f('0x29')][_0x062f('0x28')]);}})['catch'](function(_0x51b973){logger['error'](_0x062f('0x27'),_0x1c04b5,_0x51b973);_0x189149(_0x51b973);});});}function respondWithStatusCode(_0x46f9d8,_0x49f7ac){_0x49f7ac=_0x49f7ac||0xcc;return function(_0x158e6a){if(_0x158e6a){return _0x46f9d8[_0x062f('0x2a')](_0x49f7ac);}return _0x46f9d8[_0x062f('0x2b')](_0x49f7ac)['end']();};}function respondWithResult(_0x712ebc,_0x4c77fa){_0x4c77fa=_0x4c77fa||0xc8;return function(_0x53b4f2){if(_0x53b4f2){return _0x712ebc[_0x062f('0x2b')](_0x4c77fa)['json'](_0x53b4f2);}};}function respondWithFilteredResult(_0x8cd08,_0x397457){return function(_0x87d1c3){if(_0x87d1c3){var _0x51b310=_0x87d1c3[_0x062f('0x2c')],_0x5b60eb=_0x397457[_0x062f('0x2d')],_0x579feb=_0x397457[_0x062f('0x2d')]+_0x397457[_0x062f('0x2e')],_0x1b209f;if(_0x579feb>=_0x51b310){_0x579feb=_0x51b310;_0x1b209f=0xc8;}else{_0x1b209f=0xce;}_0x8cd08[_0x062f('0x2b')](_0x1b209f);return _0x8cd08['set'](_0x062f('0x2f'),_0x5b60eb+'-'+_0x579feb+'/'+_0x51b310)[_0x062f('0x30')](_0x87d1c3);}return null;};}function patchUpdates(_0x35c92a){return function(_0x108fe4){try{jsonpatch['apply'](_0x108fe4,_0x35c92a,!![]);}catch(_0x9c4d8e){return BPromise[_0x062f('0x31')](_0x9c4d8e);}return _0x108fe4[_0x062f('0x32')]();};}function saveUpdates(_0x4f3d5f,_0x5d899d){return function(_0x5b2b6c){if(_0x5b2b6c){return _0x5b2b6c[_0x062f('0x33')](_0x4f3d5f)[_0x062f('0x21')](function(_0x2669c8){return _0x2669c8;});}return null;};}function removeEntity(_0x5e7782,_0x42f6ad){return function(_0x45b030){if(_0x45b030){return _0x45b030['destroy']()[_0x062f('0x21')](function(){_0x5e7782[_0x062f('0x2b')](0xcc)[_0x062f('0x34')]();});}};}function handleEntityNotFound(_0x254f65,_0x26915b){return function(_0x443136){if(!_0x443136){_0x254f65[_0x062f('0x2a')](0x194);}return _0x443136;};}function handleError(_0x10f5b5,_0x2c80a0){_0x2c80a0=_0x2c80a0||0x1f4;return function(_0x21ee46){logger[_0x062f('0x25')](_0x21ee46[_0x062f('0x35')]);if(_0x21ee46[_0x062f('0x36')]){delete _0x21ee46[_0x062f('0x36')];}_0x10f5b5[_0x062f('0x2b')](_0x2c80a0)[_0x062f('0x37')](_0x21ee46);};}exports[_0x062f('0x38')]=function(_0x15c1a6,_0x497195){var _0x2344dc={},_0x320df7={},_0x1eb15d={'count':0x0,'rows':[]};var _0x21f57b=_[_0x062f('0x39')](db[_0x062f('0x3a')][_0x062f('0x3b')],function(_0xc34905){return{'name':_0xc34905['fieldName'],'type':_0xc34905[_0x062f('0x3c')][_0x062f('0x3d')]};});_0x320df7[_0x062f('0x3e')]=_[_0x062f('0x39')](_0x21f57b,_0x062f('0x36'));_0x320df7[_0x062f('0x3f')]=_['keys'](_0x15c1a6[_0x062f('0x3f')]);_0x320df7[_0x062f('0x40')]=_[_0x062f('0x41')](_0x320df7['model'],_0x320df7[_0x062f('0x3f')]);_0x2344dc['attributes']=_[_0x062f('0x41')](_0x320df7[_0x062f('0x3e')],qs[_0x062f('0x42')](_0x15c1a6[_0x062f('0x3f')][_0x062f('0x42')]));_0x2344dc[_0x062f('0x43')]=_0x2344dc[_0x062f('0x43')][_0x062f('0x44')]?_0x2344dc[_0x062f('0x43')]:_0x320df7[_0x062f('0x3e')];if(!_0x15c1a6[_0x062f('0x3f')][_0x062f('0x45')]('nolimit')){_0x2344dc[_0x062f('0x2e')]=qs['limit'](_0x15c1a6['query']['limit']);_0x2344dc['offset']=qs[_0x062f('0x2d')](_0x15c1a6['query'][_0x062f('0x2d')]);}_0x2344dc[_0x062f('0x46')]=qs['sort'](_0x15c1a6[_0x062f('0x3f')][_0x062f('0x47')]);_0x2344dc[_0x062f('0x48')]=qs[_0x062f('0x40')](_[_0x062f('0x49')](_0x15c1a6['query'],_0x320df7[_0x062f('0x40')]),_0x21f57b);if(_0x15c1a6[_0x062f('0x3f')]['filter']){_0x2344dc[_0x062f('0x48')]=_[_0x062f('0x4a')](_0x2344dc[_0x062f('0x48')],{'$or':_[_0x062f('0x39')](_0x21f57b,function(_0x435358){if(_0x435358[_0x062f('0x3c')]!=='VIRTUAL'){var _0x17549d={};_0x17549d[_0x435358[_0x062f('0x36')]]={'$like':'%'+_0x15c1a6[_0x062f('0x3f')][_0x062f('0x4b')]+'%'};return _0x17549d;}})});}_0x2344dc=_[_0x062f('0x4a')]({},_0x2344dc,_0x15c1a6[_0x062f('0x4c')]);var _0x2715de={'where':_0x2344dc['where']};return db['ChatGroup'][_0x062f('0x2c')](_0x2715de)[_0x062f('0x21')](function(_0x537d4a){_0x1eb15d[_0x062f('0x2c')]=_0x537d4a;if(_0x15c1a6[_0x062f('0x3f')][_0x062f('0x4d')]){_0x2344dc['include']=[{'all':!![]}];}return db[_0x062f('0x3a')]['findAll'](_0x2344dc);})[_0x062f('0x21')](function(_0x280dfd){_0x1eb15d[_0x062f('0x4e')]=_0x280dfd;return _0x1eb15d;})[_0x062f('0x21')](respondWithFilteredResult(_0x497195,_0x2344dc))[_0x062f('0x4f')](handleError(_0x497195,null));};exports[_0x062f('0x50')]=function(_0x2b2a57,_0x268f8e){var _0x17df95={'raw':!![],'where':{'id':_0x2b2a57[_0x062f('0x51')]['id']}},_0x16d3f7={};_0x16d3f7['model']=_[_0x062f('0x52')](db[_0x062f('0x3a')][_0x062f('0x3b')]);_0x16d3f7['query']=_[_0x062f('0x52')](_0x2b2a57['query']);_0x16d3f7[_0x062f('0x40')]=_[_0x062f('0x41')](_0x16d3f7['model'],_0x16d3f7[_0x062f('0x3f')]);_0x17df95['attributes']=_[_0x062f('0x41')](_0x16d3f7[_0x062f('0x3e')],qs[_0x062f('0x42')](_0x2b2a57[_0x062f('0x3f')][_0x062f('0x42')]));_0x17df95[_0x062f('0x43')]=_0x17df95[_0x062f('0x43')][_0x062f('0x44')]?_0x17df95['attributes']:_0x16d3f7['model'];if(_0x2b2a57['query'][_0x062f('0x4d')]){_0x17df95[_0x062f('0x53')]=[{'all':!![]}];}_0x17df95=_['merge']({},_0x17df95,_0x2b2a57[_0x062f('0x4c')]);return db['ChatGroup']['find'](_0x17df95)[_0x062f('0x21')](handleEntityNotFound(_0x268f8e,null))['then'](respondWithResult(_0x268f8e,null))['catch'](handleError(_0x268f8e,null));};exports[_0x062f('0x54')]=function(_0x4b8840,_0x284504){return db['ChatGroup'][_0x062f('0x54')](_0x4b8840[_0x062f('0x55')],{})[_0x062f('0x21')](respondWithResult(_0x284504,0xc9))[_0x062f('0x4f')](handleError(_0x284504,null));};exports[_0x062f('0x33')]=function(_0x4045d5,_0x53c080){if(_0x4045d5[_0x062f('0x55')]['id']){delete _0x4045d5[_0x062f('0x55')]['id'];}return db[_0x062f('0x3a')]['find']({'where':{'id':_0x4045d5[_0x062f('0x51')]['id']}})['then'](handleEntityNotFound(_0x53c080,null))[_0x062f('0x21')](saveUpdates(_0x4045d5[_0x062f('0x55')],null))[_0x062f('0x21')](respondWithResult(_0x53c080,null))[_0x062f('0x4f')](handleError(_0x53c080,null));};exports[_0x062f('0x56')]=function(_0x14acd8,_0x424baa){return db[_0x062f('0x3a')][_0x062f('0x57')]({'where':{'id':_0x14acd8['params']['id']}})['then'](handleEntityNotFound(_0x424baa,null))[_0x062f('0x21')](removeEntity(_0x424baa,null))[_0x062f('0x4f')](handleError(_0x424baa,null));};exports[_0x062f('0x58')]=function(_0x2e05f2,_0x532e71){return db[_0x062f('0x3a')][_0x062f('0x58')]()[_0x062f('0x21')](respondWithResult(_0x532e71,null))[_0x062f('0x4f')](handleError(_0x532e71,null));};exports[_0x062f('0x59')]=function(_0x146ea5,_0xb846cc,_0x18aad3){return db[_0x062f('0x5a')][_0x062f('0x2c')]({'where':{'ChatGroupId':_0x146ea5[_0x062f('0x51')]['id'],'ToId':_0x146ea5[_0x062f('0x5b')]['id'],'read':![]}})[_0x062f('0x21')](function(_0xda805){return{'id':_[_0x062f('0x5c')](_0x146ea5['params']['id']),'count':_0xda805};})[_0x062f('0x21')](respondWithResult(_0xb846cc,null))[_0x062f('0x4f')](handleError(_0xb846cc,null));};exports['addMembers']=function(_0x232187,_0x31549f,_0xfa6ced){return db['ChatGroup'][_0x062f('0x57')]({'where':{'id':_0x232187[_0x062f('0x51')]['id']}})[_0x062f('0x21')](handleEntityNotFound(_0x31549f,null))[_0x062f('0x21')](function(_0x563957){if(_0x563957){return _0x563957['addMembers'](_0x232187[_0x062f('0x55')][_0x062f('0x5d')],_['omit'](_0x232187['body'],[_0x062f('0x5d'),'id'])||{});}})[_0x062f('0x21')](respondWithResult(_0x31549f,null))[_0x062f('0x4f')](handleError(_0x31549f,null));};exports[_0x062f('0x5e')]=function(_0x527700,_0x55388d,_0x51b76a){var _0x272c92={};var _0x2b2d1e={};var _0x5d4d03;var _0x1cc8ee;return db['ChatGroup'][_0x062f('0x5f')]({'where':{'id':_0x527700['params']['id']}})[_0x062f('0x21')](handleEntityNotFound(_0x55388d,null))[_0x062f('0x21')](function(_0x50b59b){if(_0x50b59b){_0x5d4d03=_0x50b59b;_0x2b2d1e[_0x062f('0x3e')]=_['keys'](db[_0x062f('0x60')][_0x062f('0x3b')]);_0x2b2d1e[_0x062f('0x3f')]=_[_0x062f('0x52')](_0x527700[_0x062f('0x3f')]);_0x2b2d1e[_0x062f('0x40')]=_['intersection'](_0x2b2d1e[_0x062f('0x3e')],_0x2b2d1e[_0x062f('0x3f')]);_0x272c92[_0x062f('0x43')]=_[_0x062f('0x41')](_0x2b2d1e[_0x062f('0x3e')],qs[_0x062f('0x42')](_0x527700[_0x062f('0x3f')]['fields']));_0x272c92[_0x062f('0x43')]=_0x272c92['attributes']['length']?_0x272c92[_0x062f('0x43')]:_0x2b2d1e[_0x062f('0x3e')];_0x272c92[_0x062f('0x46')]=qs[_0x062f('0x47')](_0x527700['query'][_0x062f('0x47')]);_0x272c92[_0x062f('0x48')]=qs[_0x062f('0x40')](_[_0x062f('0x49')](_0x527700[_0x062f('0x3f')],_0x2b2d1e[_0x062f('0x40')]));if(_0x527700['query'][_0x062f('0x4b')]){_0x272c92[_0x062f('0x48')]=_[_0x062f('0x4a')](_0x272c92[_0x062f('0x48')],{'$or':_['map'](_0x272c92['attributes'],function(_0x82a8a2){var _0x30f0b9={};_0x30f0b9[_0x82a8a2]={'$like':'%'+_0x527700['query'][_0x062f('0x4b')]+'%'};return _0x30f0b9;})});}_0x272c92=_[_0x062f('0x4a')]({},_0x272c92,_0x527700['options']);return _0x5d4d03['getMembers'](_0x272c92);}})[_0x062f('0x21')](function(_0x5a3813){if(_0x5a3813){_0x1cc8ee=_0x5a3813[_0x062f('0x44')];if(!_0x527700[_0x062f('0x3f')][_0x062f('0x45')](_0x062f('0x61'))){_0x272c92[_0x062f('0x2e')]=qs[_0x062f('0x2e')](_0x527700[_0x062f('0x3f')][_0x062f('0x2e')]);_0x272c92[_0x062f('0x2d')]=qs[_0x062f('0x2d')](_0x527700[_0x062f('0x3f')]['offset']);}return _0x5d4d03[_0x062f('0x5e')](_0x272c92);}})[_0x062f('0x21')](function(_0x58b022){if(_0x58b022){return _0x58b022?{'count':_0x1cc8ee,'rows':_0x58b022}:null;}})[_0x062f('0x21')](respondWithResult(_0x55388d,null))[_0x062f('0x4f')](handleError(_0x55388d,null));};exports['removeMembers']=function(_0x2f1132,_0x133370,_0x17482b){return db[_0x062f('0x3a')]['find']({'where':{'id':_0x2f1132['params']['id']}})[_0x062f('0x21')](handleEntityNotFound(_0x133370,null))['then'](function(_0x2052ef){if(_0x2052ef){return _0x2052ef[_0x062f('0x62')](_0x2f1132[_0x062f('0x3f')][_0x062f('0x5d')]);}})[_0x062f('0x21')](respondWithStatusCode(_0x133370,null))[_0x062f('0x4f')](handleError(_0x133370,null));};exports[_0x062f('0x63')]=function(_0x1f6747,_0x56de50,_0x3be13d){if(_0x1f6747[_0x062f('0x55')]['id']){delete _0x1f6747[_0x062f('0x55')]['id'];}return db[_0x062f('0x3a')][_0x062f('0x57')]({'where':{'id':_0x1f6747[_0x062f('0x51')]['id']}})[_0x062f('0x21')](handleEntityNotFound(_0x56de50,null))[_0x062f('0x21')](function(_0x4464e4){if(_0x4464e4){_0x1f6747[_0x062f('0x55')][_0x062f('0x64')]=_0x4464e4['id'];return db[_0x062f('0x5a')][_0x062f('0x54')](_0x1f6747[_0x062f('0x55')]);}})[_0x062f('0x21')](respondWithResult(_0x56de50,null))['catch'](handleError(_0x56de50,null));};exports[_0x062f('0x65')]=function(_0xf9cbe5,_0x3ffd63,_0x23dda7){var _0x249e41={};var _0x57b365={};var _0x21a443;var _0x8ff245;return db[_0x062f('0x3a')][_0x062f('0x5f')]({'where':{'id':_0xf9cbe5[_0x062f('0x51')]['id']}})[_0x062f('0x21')](handleEntityNotFound(_0x3ffd63,null))[_0x062f('0x21')](function(_0x3e1541){if(_0x3e1541){_0x21a443=_0x3e1541;_0x57b365[_0x062f('0x3e')]=_[_0x062f('0x52')](db[_0x062f('0x5a')]['rawAttributes']);_0x57b365['query']=_[_0x062f('0x52')](_0xf9cbe5[_0x062f('0x3f')]);_0x57b365[_0x062f('0x40')]=_[_0x062f('0x41')](_0x57b365[_0x062f('0x3e')],_0x57b365[_0x062f('0x3f')]);_0x249e41[_0x062f('0x43')]=_[_0x062f('0x41')](_0x57b365[_0x062f('0x3e')],qs[_0x062f('0x42')](_0xf9cbe5[_0x062f('0x3f')][_0x062f('0x42')]));_0x249e41[_0x062f('0x43')]=_0x249e41[_0x062f('0x43')][_0x062f('0x44')]?_0x249e41[_0x062f('0x43')]:_0x57b365[_0x062f('0x3e')];_0x249e41[_0x062f('0x46')]=qs[_0x062f('0x47')](_0xf9cbe5[_0x062f('0x3f')][_0x062f('0x47')]);_0x249e41[_0x062f('0x48')]=qs[_0x062f('0x40')](_['pick'](_0xf9cbe5['query'],_0x57b365[_0x062f('0x40')]));if(_0xf9cbe5['query'][_0x062f('0x4b')]){_0x249e41[_0x062f('0x48')]=_[_0x062f('0x4a')](_0x249e41[_0x062f('0x48')],{'$or':_[_0x062f('0x39')](_0x249e41[_0x062f('0x43')],function(_0x4db4b3){var _0x1a372e={};_0x1a372e[_0x4db4b3]={'$like':'%'+_0xf9cbe5[_0x062f('0x3f')][_0x062f('0x4b')]+'%'};return _0x1a372e;})});}if(_0xf9cbe5['query']['$gte']){var _0x553509=_0xf9cbe5['query'][_0x062f('0x66')][_0x062f('0x67')](',');var _0x2bfa0b={};_0x2bfa0b[_0x553509[0x0]]={'$gte':moment(_0x553509[0x1])[_0x062f('0x68')](_0x062f('0x69'))};_0x249e41[_0x062f('0x48')]=_[_0x062f('0x4a')](_0x249e41[_0x062f('0x48')],_0x2bfa0b);}_0x249e41=_['merge']({},_0x249e41,_0xf9cbe5['options']);return _0x21a443[_0x062f('0x65')](_0x249e41);}})['then'](function(_0x368064){if(_0x368064){_0x8ff245=_0x368064['length'];if(!_0xf9cbe5[_0x062f('0x3f')][_0x062f('0x45')]('nolimit')){_0x249e41['limit']=qs[_0x062f('0x2e')](_0xf9cbe5[_0x062f('0x3f')][_0x062f('0x2e')]);_0x249e41[_0x062f('0x2d')]=qs[_0x062f('0x2d')](_0xf9cbe5[_0x062f('0x3f')][_0x062f('0x2d')]);}return _0x21a443[_0x062f('0x65')](_0x249e41);}})['then'](function(_0x20d1f9){if(_0x20d1f9){return _0x20d1f9?{'count':_0x8ff245,'rows':_0x20d1f9}:null;}})['then'](respondWithResult(_0x3ffd63,null))[_0x062f('0x4f')](handleError(_0x3ffd63,null));};
\ No newline at end of file