Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / chatQueue / chatQueue.controller.js
index 259e2ed..16a41e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf7e=['team_has_chat_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','name','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','pick','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','interface','flatMap','Agents','sequelize','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from'];(function(_0x15f852,_0x530d85){var _0x387460=function(_0x4aa3df){while(--_0x4aa3df){_0x15f852['push'](_0x15f852['shift']());}};_0x387460(++_0x530d85);}(_0xbf7e,0xb0));var _0xebf7=function(_0x2de30b,_0x450092){_0x2de30b=_0x2de30b-0x0;var _0x1c3e78=_0xbf7e[_0x2de30b];return _0x1c3e78;};'use strict';var pdf=require(_0xebf7('0x0'));var emlformat=require(_0xebf7('0x1'));var rimraf=require(_0xebf7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebf7('0x3'));var rp=require(_0xebf7('0x4'));var moment=require('moment');var BPromise=require(_0xebf7('0x5'));var Mustache=require(_0xebf7('0x6'));var util=require(_0xebf7('0x7'));var path=require(_0xebf7('0x8'));var sox=require(_0xebf7('0x9'));var csv=require(_0xebf7('0xa'));var ejs=require(_0xebf7('0xb'));var fs=require('fs');var _=require(_0xebf7('0xc'));var squel=require(_0xebf7('0xd'));var crypto=require(_0xebf7('0xe'));var jsforce=require(_0xebf7('0xf'));var deskjs=require(_0xebf7('0x10'));var toCsv=require(_0xebf7('0xa'));var querystring=require(_0xebf7('0x11'));var Papa=require('papaparse');var Redis=require(_0xebf7('0x12'));var authService=require(_0xebf7('0x13'));var qs=require(_0xebf7('0x14'));var as=require(_0xebf7('0x15'));var hardwareService=require(_0xebf7('0x16'));var logger=require('../../config/logger')(_0xebf7('0x17'));var utils=require(_0xebf7('0x18'));var config=require(_0xebf7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xebf7('0x1a'))['db'];config[_0xebf7('0x1b')]=_[_0xebf7('0x1c')](config[_0xebf7('0x1b')],{'host':_0xebf7('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xebf7('0x1e'))[_0xebf7('0x1f')](socket);var jayson=require(_0xebf7('0x20'));var client=jayson[_0xebf7('0x21')][_0xebf7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x244bcf,_0x2ffdcf,_0x2deaba,_0x5af253){return new BPromise(function(_0x4ee11e,_0x288597){var _0x24690b=_0x5af253||client;return _0x24690b[_0xebf7('0x23')](_0x244bcf,_0x2deaba)[_0xebf7('0x24')](function(_0x14d192){logger[_0xebf7('0x25')](_0xebf7('0x26'),_0x2ffdcf,_0xebf7('0x27'));logger[_0xebf7('0x28')](_0xebf7('0x29'),_0x2ffdcf,_0xebf7('0x27'),JSON['stringify'](_0x14d192));if(_0x14d192[_0xebf7('0x2a')]){if(_0x14d192[_0xebf7('0x2a')]['code']===0x1f4){logger[_0xebf7('0x2a')](_0xebf7('0x26'),_0x2ffdcf,_0x14d192[_0xebf7('0x2a')][_0xebf7('0x2b')]);return _0x288597(_0x14d192['error'][_0xebf7('0x2b')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2ffdcf,_0x14d192[_0xebf7('0x2a')][_0xebf7('0x2b')]);return _0x4ee11e(_0x14d192['error']['message']);}else{logger[_0xebf7('0x25')](_0xebf7('0x26'),_0x2ffdcf,_0xebf7('0x27'));_0x4ee11e(_0x14d192[_0xebf7('0x2c')][_0xebf7('0x2b')]);}})[_0xebf7('0x2d')](function(_0x50eb19){logger[_0xebf7('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x2ffdcf,_0x50eb19);_0x288597(_0x50eb19);});});}function respondWithStatusCode(_0x22cbf0,_0x226ebc){_0x226ebc=_0x226ebc||0xcc;return function(_0x532665){if(_0x532665){return _0x22cbf0['sendStatus'](_0x226ebc);}return _0x22cbf0[_0xebf7('0x2e')](_0x226ebc)[_0xebf7('0x2f')]();};}function respondWithResult(_0x1fd59a,_0x1c495a){_0x1c495a=_0x1c495a||0xc8;return function(_0x223fe3){if(_0x223fe3){return _0x1fd59a[_0xebf7('0x2e')](_0x1c495a)[_0xebf7('0x30')](_0x223fe3);}};}function respondWithFilteredResult(_0x2fbdde,_0xb06026){return function(_0x51a4ce){if(_0x51a4ce){var _0x3f7283=_0x51a4ce[_0xebf7('0x31')],_0x1afd51=_0xb06026[_0xebf7('0x32')],_0x3dc2aa=_0xb06026[_0xebf7('0x32')]+_0xb06026[_0xebf7('0x33')],_0x1718b5;if(_0x3dc2aa>=_0x3f7283){_0x3dc2aa=_0x3f7283;_0x1718b5=0xc8;}else{_0x1718b5=0xce;}_0x2fbdde[_0xebf7('0x2e')](_0x1718b5);return _0x2fbdde[_0xebf7('0x34')](_0xebf7('0x35'),_0x1afd51+'-'+_0x3dc2aa+'/'+_0x3f7283)[_0xebf7('0x30')](_0x51a4ce);}return null;};}function patchUpdates(_0x5b335c){return function(_0x479ec6){try{jsonpatch[_0xebf7('0x36')](_0x479ec6,_0x5b335c,!![]);}catch(_0x5b205f){return BPromise[_0xebf7('0x37')](_0x5b205f);}return _0x479ec6['save']();};}function saveUpdates(_0x4f04be,_0x41648d){return function(_0xc246bb){if(_0xc246bb){return _0xc246bb[_0xebf7('0x38')](_0x4f04be)[_0xebf7('0x24')](function(_0x1c94b1){return _0x1c94b1;});}return null;};}function removeEntity(_0x19f277,_0x34f7a8){return function(_0x40e176){if(_0x40e176){return _0x40e176[_0xebf7('0x39')]()['then'](function(){var _0x5ca514=_0x40e176[_0xebf7('0x3a')]({'plain':!![]});var _0x5567d5=_0xebf7('0x3b');return db['UserProfileResource']['destroy']({'where':{'type':_0x5567d5,'resourceId':_0x5ca514['id']}})[_0xebf7('0x24')](function(){return _0x40e176;});})[_0xebf7('0x24')](function(){_0x19f277['status'](0xcc)[_0xebf7('0x2f')]();});}};}function handleEntityNotFound(_0x387ed7,_0x1878ac){return function(_0x59b24c){if(!_0x59b24c){_0x387ed7['sendStatus'](0x194);}return _0x59b24c;};}function handleError(_0x38fc7a,_0xd3b1ea){_0xd3b1ea=_0xd3b1ea||0x1f4;return function(_0x12343a){logger[_0xebf7('0x2a')](_0x12343a['stack']);if(_0x12343a[_0xebf7('0x3c')]){delete _0x12343a['name'];}_0x38fc7a['status'](_0xd3b1ea)['send'](_0x12343a);};}exports[_0xebf7('0x3d')]=function(_0x51951c,_0x1bd6fb){var _0x4fbd5d={},_0x1feaa0={},_0x2c3a4c={'count':0x0,'rows':[]};var _0x4cfce0=_[_0xebf7('0x3e')](db[_0xebf7('0x3f')][_0xebf7('0x40')],function(_0x219deb){return{'name':_0x219deb[_0xebf7('0x41')],'type':_0x219deb['type'][_0xebf7('0x42')]};});_0x1feaa0[_0xebf7('0x43')]=_[_0xebf7('0x3e')](_0x4cfce0,_0xebf7('0x3c'));_0x1feaa0[_0xebf7('0x44')]=_['keys'](_0x51951c[_0xebf7('0x44')]);_0x1feaa0[_0xebf7('0x45')]=_[_0xebf7('0x46')](_0x1feaa0[_0xebf7('0x43')],_0x1feaa0[_0xebf7('0x44')]);_0x4fbd5d['attributes']=_[_0xebf7('0x46')](_0x1feaa0['model'],qs[_0xebf7('0x47')](_0x51951c['query']['fields']));_0x4fbd5d[_0xebf7('0x48')]=_0x4fbd5d[_0xebf7('0x48')][_0xebf7('0x49')]?_0x4fbd5d[_0xebf7('0x48')]:_0x1feaa0['model'];if(!_0x51951c[_0xebf7('0x44')]['hasOwnProperty']('nolimit')){_0x4fbd5d['limit']=qs[_0xebf7('0x33')](_0x51951c[_0xebf7('0x44')][_0xebf7('0x33')]);_0x4fbd5d['offset']=qs['offset'](_0x51951c['query'][_0xebf7('0x32')]);}_0x4fbd5d[_0xebf7('0x4a')]=qs[_0xebf7('0x4b')](_0x51951c[_0xebf7('0x44')][_0xebf7('0x4b')]);_0x4fbd5d[_0xebf7('0x4c')]=qs[_0xebf7('0x45')](_['pick'](_0x51951c[_0xebf7('0x44')],_0x1feaa0[_0xebf7('0x45')]),_0x4cfce0);if(_0x51951c['query'][_0xebf7('0x4d')]){_0x4fbd5d[_0xebf7('0x4c')]=_[_0xebf7('0x4e')](_0x4fbd5d[_0xebf7('0x4c')],{'$or':_[_0xebf7('0x3e')](_0x4cfce0,function(_0x22c21c){if(_0x22c21c['type']!==_0xebf7('0x4f')){var _0x5d3e77={};_0x5d3e77[_0x22c21c[_0xebf7('0x3c')]]={'$like':'%'+_0x51951c['query'][_0xebf7('0x4d')]+'%'};return _0x5d3e77;}})});}_0x4fbd5d=_[_0xebf7('0x4e')]({},_0x4fbd5d,_0x51951c[_0xebf7('0x50')]);var _0x555a5d={'where':_0x4fbd5d[_0xebf7('0x4c')]};return db['ChatQueue'][_0xebf7('0x31')](_0x555a5d)[_0xebf7('0x24')](function(_0xf35ed5){_0x2c3a4c[_0xebf7('0x31')]=_0xf35ed5;if(_0x51951c[_0xebf7('0x44')][_0xebf7('0x51')]){_0x4fbd5d['include']=[{'all':!![]}];}return db[_0xebf7('0x3f')][_0xebf7('0x52')](_0x4fbd5d);})['then'](function(_0x2ce3d0){_0x2c3a4c[_0xebf7('0x53')]=_0x2ce3d0;return _0x2c3a4c;})['then'](respondWithFilteredResult(_0x1bd6fb,_0x4fbd5d))[_0xebf7('0x2d')](handleError(_0x1bd6fb,null));};exports[_0xebf7('0x54')]=function(_0x25108a,_0x58318b){var _0x5f21e2={'raw':!![],'where':{'id':_0x25108a[_0xebf7('0x55')]['id']}},_0x9fc058={};_0x9fc058[_0xebf7('0x43')]=_[_0xebf7('0x56')](db[_0xebf7('0x3f')][_0xebf7('0x40')]);_0x9fc058[_0xebf7('0x44')]=_['keys'](_0x25108a[_0xebf7('0x44')]);_0x9fc058['filters']=_[_0xebf7('0x46')](_0x9fc058[_0xebf7('0x43')],_0x9fc058['query']);_0x5f21e2[_0xebf7('0x48')]=_[_0xebf7('0x46')](_0x9fc058['model'],qs['fields'](_0x25108a['query'][_0xebf7('0x47')]));_0x5f21e2[_0xebf7('0x48')]=_0x5f21e2[_0xebf7('0x48')][_0xebf7('0x49')]?_0x5f21e2['attributes']:_0x9fc058[_0xebf7('0x43')];if(_0x25108a[_0xebf7('0x44')][_0xebf7('0x51')]){_0x5f21e2[_0xebf7('0x57')]=[{'all':!![]}];}_0x5f21e2=_['merge']({},_0x5f21e2,_0x25108a[_0xebf7('0x50')]);return db[_0xebf7('0x3f')][_0xebf7('0x58')](_0x5f21e2)[_0xebf7('0x24')](handleEntityNotFound(_0x58318b,null))[_0xebf7('0x24')](respondWithResult(_0x58318b,null))[_0xebf7('0x2d')](handleError(_0x58318b,null));};exports[_0xebf7('0x59')]=function(_0xe810d8,_0x3099c1){return db[_0xebf7('0x3f')][_0xebf7('0x59')](_0xe810d8[_0xebf7('0x5a')],{})[_0xebf7('0x24')](function(_0x19170a){var _0x5ee7a7=_0xe810d8[_0xebf7('0x5b')]['get']({'plain':!![]});if(!_0x5ee7a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ee7a7[_0xebf7('0x5c')]==='user'){var _0x40d50e=_0x19170a[_0xebf7('0x3a')]({'plain':!![]});var _0x2579c7=_0xebf7('0x3b');return db[_0xebf7('0x5d')][_0xebf7('0x58')]({'where':{'name':_0x2579c7,'userProfileId':_0x5ee7a7[_0xebf7('0x5e')]},'raw':!![]})['then'](function(_0x158196){if(_0x158196&&_0x158196[_0xebf7('0x5f')]===0x0){return db[_0xebf7('0x60')][_0xebf7('0x59')]({'name':_0x40d50e[_0xebf7('0x3c')],'resourceId':_0x40d50e['id'],'type':_0x158196[_0xebf7('0x3c')],'sectionId':_0x158196['id']},{})[_0xebf7('0x24')](function(){return _0x19170a;});}else{return _0x19170a;}})[_0xebf7('0x2d')](function(_0x56ff9d){logger['error'](_0xebf7('0x61'),_0x56ff9d);throw _0x56ff9d;});}return _0x19170a;})[_0xebf7('0x24')](respondWithResult(_0x3099c1,0xc9))['catch'](handleError(_0x3099c1,null));};exports[_0xebf7('0x38')]=function(_0x12ff4b,_0x18b070){if(_0x12ff4b['body']['id']){delete _0x12ff4b[_0xebf7('0x5a')]['id'];}return db['ChatQueue'][_0xebf7('0x58')]({'where':{'id':_0x12ff4b[_0xebf7('0x55')]['id']}})[_0xebf7('0x24')](handleEntityNotFound(_0x18b070,null))[_0xebf7('0x24')](saveUpdates(_0x12ff4b['body'],null))[_0xebf7('0x24')](respondWithResult(_0x18b070,null))[_0xebf7('0x2d')](handleError(_0x18b070,null));};exports[_0xebf7('0x39')]=function(_0x59fe82,_0x1bfa5e){return db[_0xebf7('0x3f')][_0xebf7('0x58')]({'where':{'id':_0x59fe82[_0xebf7('0x55')]['id']}})['then'](handleEntityNotFound(_0x1bfa5e,null))[_0xebf7('0x24')](removeEntity(_0x1bfa5e,null))[_0xebf7('0x2d')](handleError(_0x1bfa5e,null));};exports['describe']=function(_0x2e93d6,_0x358f83){return db[_0xebf7('0x3f')]['describe']()[_0xebf7('0x24')](respondWithResult(_0x358f83,null))[_0xebf7('0x2d')](handleError(_0x358f83,null));};exports[_0xebf7('0x62')]=function(_0x28254d,_0x480d61,_0x1877ee){var _0x382380={'raw':!![],'where':{}},_0x15d548={},_0x313fe1;return db[_0xebf7('0x3f')][_0xebf7('0x63')]({'where':{'id':_0x28254d[_0xebf7('0x55')]['id']}})['then'](handleEntityNotFound(_0x480d61,null))[_0xebf7('0x24')](function(_0x558ea7){if(_0x558ea7){_0x313fe1=_0x558ea7['get']({'plain':!![]});_0x15d548['model']=_['keys'](db[_0xebf7('0x64')][_0xebf7('0x40')]);_0x15d548[_0xebf7('0x44')]=_[_0xebf7('0x56')](_0x28254d[_0xebf7('0x44')]);_0x15d548[_0xebf7('0x45')]=_['intersection'](_0x15d548['model'],_0x15d548['query']);_0x382380[_0xebf7('0x48')]=_[_0xebf7('0x46')](_0x15d548[_0xebf7('0x43')],qs[_0xebf7('0x47')](_0x28254d[_0xebf7('0x44')][_0xebf7('0x47')]));_0x382380[_0xebf7('0x48')]=_0x382380[_0xebf7('0x48')][_0xebf7('0x49')]?_0x382380['attributes']:_0x15d548['model'];if(!_0x28254d[_0xebf7('0x44')][_0xebf7('0x65')](_0xebf7('0x66'))){_0x382380['limit']=qs[_0xebf7('0x33')](_0x28254d[_0xebf7('0x44')][_0xebf7('0x33')]);_0x382380[_0xebf7('0x32')]=qs[_0xebf7('0x32')](_0x28254d[_0xebf7('0x44')]['offset']);}_0x382380['order']=qs[_0xebf7('0x4b')](_0x28254d['query']['sort']);_0x382380[_0xebf7('0x4c')]=qs['filters'](_[_0xebf7('0x67')](_0x28254d[_0xebf7('0x44')],_0x15d548[_0xebf7('0x45')]));_0x382380[_0xebf7('0x4c')][_0xebf7('0x68')]=_0x558ea7['id'];if(_0x28254d[_0xebf7('0x44')][_0xebf7('0x4d')]){_0x382380[_0xebf7('0x4c')]=_[_0xebf7('0x4e')](_0x382380[_0xebf7('0x4c')],{'$or':_[_0xebf7('0x3e')](_0x382380[_0xebf7('0x48')],function(_0x3da04a){var _0x224b20={};_0x224b20[_0x3da04a]={'$like':'%'+_0x28254d[_0xebf7('0x44')][_0xebf7('0x4d')]+'%'};return _0x224b20;})});}_0x382380=_[_0xebf7('0x4e')]({},_0x382380,_0x28254d[_0xebf7('0x50')]);return db['UserChatQueue'][_0xebf7('0x52')](_0x382380);}})['then'](function(_0x42f171){if(_0x42f171){return db[_0xebf7('0x69')]['findAndCountAll']({'where':{'id':_[_0xebf7('0x3e')](_0x42f171,_0xebf7('0x6a')),'role':_0xebf7('0x6b')},'attributes':['id',_0xebf7('0x3c'),_0xebf7('0x6c'),_0xebf7('0x6d'),_0xebf7('0x6e')]});}})['then'](function(_0x4955e8){if(_0x4955e8){return{'count':_0x4955e8[_0xebf7('0x31')],'rows':_[_0xebf7('0x3e')](_0x4955e8[_0xebf7('0x53')],function(_0x295eb8){return{'membername':_0x295eb8['name'],'UserId':_0x295eb8['id'],'queue_name':_0x313fe1[_0xebf7('0x3c')],'ChatQueueId':_0x313fe1['id'],'interface':util[_0xebf7('0x6f')](_0xebf7('0x70'),_0xebf7('0x71'),_0x295eb8[_0xebf7('0x3c')]),'penalty':0x0,'paused':_0x295eb8['chatPause'],'createdAt':_0x295eb8[_0xebf7('0x6e')],'updatedAt':_0x295eb8[_0xebf7('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x480d61,_0x382380))[_0xebf7('0x2d')](handleError(_0x480d61,null));};exports[_0xebf7('0x72')]=function(_0x50d58b,_0xf32601,_0x4ee52d){var _0xda96ae={};var _0x4610f3={};var _0x1ee2da;var _0x164a13;return db['ChatQueue']['findOne']({'where':{'id':_0x50d58b[_0xebf7('0x55')]['id']}})[_0xebf7('0x24')](handleEntityNotFound(_0xf32601,null))[_0xebf7('0x24')](function(_0x24180a){if(_0x24180a){_0x1ee2da=_0x24180a;_0x4610f3['model']=_[_0xebf7('0x56')](db[_0xebf7('0x73')][_0xebf7('0x40')]);_0x4610f3[_0xebf7('0x44')]=_[_0xebf7('0x56')](_0x50d58b[_0xebf7('0x44')]);_0x4610f3['filters']=_[_0xebf7('0x46')](_0x4610f3['model'],_0x4610f3['query']);_0xda96ae['attributes']=_[_0xebf7('0x46')](_0x4610f3['model'],qs[_0xebf7('0x47')](_0x50d58b['query'][_0xebf7('0x47')]));_0xda96ae['attributes']=_0xda96ae['attributes'][_0xebf7('0x49')]?_0xda96ae[_0xebf7('0x48')]:_0x4610f3[_0xebf7('0x43')];_0xda96ae['order']=qs['sort'](_0x50d58b[_0xebf7('0x44')][_0xebf7('0x4b')]);_0xda96ae[_0xebf7('0x4c')]=qs[_0xebf7('0x45')](_[_0xebf7('0x67')](_0x50d58b[_0xebf7('0x44')],_0x4610f3['filters']));if(_0x50d58b['query'][_0xebf7('0x4d')]){_0xda96ae[_0xebf7('0x4c')]=_[_0xebf7('0x4e')](_0xda96ae[_0xebf7('0x4c')],{'$or':_[_0xebf7('0x3e')](_0xda96ae[_0xebf7('0x48')],function(_0x16ed25){var _0x1d0572={};_0x1d0572[_0x16ed25]={'$like':'%'+_0x50d58b[_0xebf7('0x44')][_0xebf7('0x4d')]+'%'};return _0x1d0572;})});}_0xda96ae=_[_0xebf7('0x4e')]({},_0xda96ae,_0x50d58b['options']);return _0x1ee2da[_0xebf7('0x72')](_0xda96ae);}})['then'](function(_0x10e793){if(_0x10e793){_0x164a13=_0x10e793[_0xebf7('0x49')];if(!_0x50d58b[_0xebf7('0x44')][_0xebf7('0x65')](_0xebf7('0x66'))){_0xda96ae[_0xebf7('0x33')]=qs[_0xebf7('0x33')](_0x50d58b['query']['limit']);_0xda96ae[_0xebf7('0x32')]=qs[_0xebf7('0x32')](_0x50d58b[_0xebf7('0x44')][_0xebf7('0x32')]);}return _0x1ee2da['getTeams'](_0xda96ae);}})[_0xebf7('0x24')](function(_0x4c8d44){if(_0x4c8d44){return _0x4c8d44?{'count':_0x164a13,'rows':_0x4c8d44}:null;}})[_0xebf7('0x24')](respondWithResult(_0xf32601,null))[_0xebf7('0x2d')](handleError(_0xf32601,null));};exports['addTeams']=function(_0x21c346,_0x43d930,_0x2cd661){var _0x1a31de=_0x21c346[_0xebf7('0x5a')][_0xebf7('0x74')];return db['Team'][_0xebf7('0x52')]({'where':{'id':_0x1a31de},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xebf7('0x3c'),'online','voicePause',_0xebf7('0x75')],'raw':!![]}]})[_0xebf7('0x24')](function(_0x4a888d){if(_0x4a888d){var _0x31e01c=_[_0xebf7('0x76')](_0x4a888d,function(_0x95d6a1){var _0x121079=_0x95d6a1[_0xebf7('0x3a')]({'plain':!![]});return _0x121079[_0xebf7('0x77')];});return db[_0xebf7('0x3f')][_0xebf7('0x58')]({'where':{'id':_0x21c346[_0xebf7('0x55')]['id']}})[_0xebf7('0x24')](function(_0x3db872){return db[_0xebf7('0x78')]['transaction'](function(_0x503e25){return _0x3db872[_0xebf7('0x79')](_0x1a31de,{'transaction':_0x503e25})[_0xebf7('0x24')](function(){return BPromise['each'](_0x31e01c,function(_0x1b327a){return db['UserChatQueue'][_0xebf7('0x7a')]({'where':{'UserId':_0x1b327a['id'],'ChatQueueId':_0x21c346['params']['id']},'transaction':_0x503e25});});})['then'](function(){_0x31e01c[_0xebf7('0x7b')](function(_0x3f0e2b){socket[_0xebf7('0x7c')](_0xebf7('0x7d'),{'UserId':_0x3f0e2b['id'],'ChatQueueId':_0x3db872['id']});});});});});}})[_0xebf7('0x24')](respondWithStatusCode(_0x43d930,null))[_0xebf7('0x2d')](handleError(_0x43d930,null));};exports[_0xebf7('0x7e')]=function(_0x32afb7,_0x1829fd,_0x440b4d){return db[_0xebf7('0x73')][_0xebf7('0x52')]({'where':{'id':_0x32afb7['query'][_0xebf7('0x74')]},'attributes':['id'],'include':[{'model':db[_0xebf7('0x69')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xebf7('0x24')](handleEntityNotFound(_0x1829fd,null))[_0xebf7('0x24')](function(_0x220033){var _0x108dce=_['map'](_0x220033,'id');var _0x462b32=[];var _0x1841b4=[];var _0xc33411=squel['select']();_0xc33411[_0xebf7('0x7f')](_0xebf7('0x80'))[_0xebf7('0x81')](_0xebf7('0x82'),'tq')[_0xebf7('0x83')](_0xebf7('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xebf7('0x4c')]('ChatQueueId\x20=\x20?',_0x32afb7[_0xebf7('0x55')]['id']);for(var _0x1ce259=0x0;_0x1ce259<_0x220033[_0xebf7('0x49')];_0x1ce259+=0x1){let _0x2f6167=_0x220033[_0x1ce259];for(var _0x3f2263=0x0;_0x3f2263<_0x2f6167['Agents']['length'];_0x3f2263+=0x1){let _0x62214f=_0x2f6167[_0xebf7('0x77')][_0x3f2263];var _0x5d205e=_0xc33411[_0xebf7('0x85')]();_0x5d205e[_0xebf7('0x4c')](_0xebf7('0x86'),_0x62214f['id']);_0x1841b4[_0xebf7('0x87')](db[_0xebf7('0x78')][_0xebf7('0x44')](_0x5d205e['toString'](),{'type':db[_0xebf7('0x78')]['QueryTypes'][_0xebf7('0x88')]})['then'](function(_0x1b9fba){if(_0x1b9fba[_0xebf7('0x49')]===0x1){return _0x62214f['id'];}else{var _0x210b3d=_[_0xebf7('0x89')](_[_0xebf7('0x3e')](_0x1b9fba,_0xebf7('0x8a')),function(_0x1201e0){return _[_0xebf7('0x8b')](_0x108dce,_0x1201e0);});if(_0x210b3d){return _0x62214f['id'];}}}));}}return BPromise[_0xebf7('0x8c')](_0x1841b4)[_0xebf7('0x24')](function(_0x2e9551){_0x462b32=_(_0x462b32)[_0xebf7('0x8d')](_0x2e9551)[_0xebf7('0x8e')]()[_0xebf7('0x8f')]();return db[_0xebf7('0x3f')][_0xebf7('0x58')]({'where':{'id':_0x32afb7[_0xebf7('0x55')]['id']}})[_0xebf7('0x24')](function(_0x2b3d8a){return db[_0xebf7('0x78')][_0xebf7('0x90')](function(_0x824998){return _0x2b3d8a[_0xebf7('0x7e')](_0x32afb7[_0xebf7('0x44')][_0xebf7('0x74')],{'transaction':_0x824998})[_0xebf7('0x24')](function(){if(!_[_0xebf7('0x91')](_0x462b32)){return _0x2b3d8a['removeAgents'](_0x462b32,{'transaction':_0x824998});}})['then'](function(){_0x462b32[_0xebf7('0x7b')](function(_0x3b9788){socket['emit']('userChatQueue:remove',{'UserId':_0x3b9788,'ChatQueueId':_0x2b3d8a['id']});});});});});});})[_0xebf7('0x24')](respondWithStatusCode(_0x1829fd,null))[_0xebf7('0x2d')](handleError(_0x1829fd,null));};exports[_0xebf7('0x92')]=function(_0x2a4bf3,_0x27d829,_0x5c5c84){return db[_0xebf7('0x3f')][_0xebf7('0x58')]({'where':{'id':_0x2a4bf3[_0xebf7('0x55')]['id']}})[_0xebf7('0x24')](handleEntityNotFound(_0x27d829,null))['then'](function(_0x1f4d84){if(_0x1f4d84){return _0x1f4d84['addAgents'](_0x2a4bf3[_0xebf7('0x5a')][_0xebf7('0x74')],_[_0xebf7('0x93')](_0x2a4bf3[_0xebf7('0x5a')],[_0xebf7('0x74'),'id'])||{})[_0xebf7('0x94')](function(_0x15d71e){for(var _0x56dbb9=0x0;_0x56dbb9<_0x2a4bf3[_0xebf7('0x5a')][_0xebf7('0x74')][_0xebf7('0x49')];_0x56dbb9+=0x1){socket['emit']('userChatQueue:save',{'UserId':_0x2a4bf3[_0xebf7('0x5a')]['ids'][_0x56dbb9],'ChatQueueId':_0x2a4bf3['params']['id']});}return _0x15d71e;});}})['then'](respondWithResult(_0x27d829,null))['catch'](handleError(_0x27d829,null));};exports[_0xebf7('0x95')]=function(_0x36385f,_0x415937,_0x366b5b){return db[_0xebf7('0x3f')][_0xebf7('0x58')]({'where':{'id':_0x36385f[_0xebf7('0x55')]['id']}})[_0xebf7('0x24')](handleEntityNotFound(_0x415937,null))[_0xebf7('0x24')](function(_0x39b6f1){if(_0x39b6f1){return _0x39b6f1[_0xebf7('0x95')](_0x36385f[_0xebf7('0x44')][_0xebf7('0x74')])[_0xebf7('0x24')](function(){if(_[_0xebf7('0x96')](_0x36385f[_0xebf7('0x44')][_0xebf7('0x74')])){for(var _0x14e2e6=0x0;_0x14e2e6<_0x36385f['query'][_0xebf7('0x74')]['length'];_0x14e2e6+=0x1){socket[_0xebf7('0x7c')](_0xebf7('0x97'),{'UserId':Number(_0x36385f['query']['ids'][_0x14e2e6]),'ChatQueueId':Number(_0x36385f[_0xebf7('0x55')]['id'])});}}else{socket[_0xebf7('0x7c')]('userChatQueue:remove',{'UserId':Number(_0x36385f[_0xebf7('0x44')]['ids']),'ChatQueueId':Number(_0x36385f['params']['id'])});}});}})[_0xebf7('0x24')](respondWithStatusCode(_0x415937,null))[_0xebf7('0x2d')](handleError(_0x415937,null));};exports[_0xebf7('0x98')]=function(_0x37b7d7,_0x2c6c2e,_0x529a26){var _0xa434af={};var _0x2caa82={};var _0xaf6244;var _0x2e987f;return db[_0xebf7('0x3f')]['findOne']({'where':{'id':_0x37b7d7[_0xebf7('0x55')]['id']}})[_0xebf7('0x24')](handleEntityNotFound(_0x2c6c2e,null))[_0xebf7('0x24')](function(_0x5b4554){if(_0x5b4554){_0xaf6244=_0x5b4554;_0x2caa82[_0xebf7('0x43')]=_['keys'](db[_0xebf7('0x69')][_0xebf7('0x40')]);_0x2caa82['query']=_[_0xebf7('0x56')](_0x37b7d7['query']);_0x2caa82[_0xebf7('0x45')]=_['intersection'](_0x2caa82[_0xebf7('0x43')],_0x2caa82[_0xebf7('0x44')]);_0xa434af['attributes']=_[_0xebf7('0x46')](_0x2caa82['model'],qs[_0xebf7('0x47')](_0x37b7d7[_0xebf7('0x44')][_0xebf7('0x47')]));_0xa434af[_0xebf7('0x48')]=_0xa434af['attributes']['length']?_0xa434af[_0xebf7('0x48')]:_0x2caa82[_0xebf7('0x43')];_0xa434af[_0xebf7('0x4a')]=qs[_0xebf7('0x4b')](_0x37b7d7[_0xebf7('0x44')][_0xebf7('0x4b')]);_0xa434af['where']=qs[_0xebf7('0x45')](_['pick'](_0x37b7d7[_0xebf7('0x44')],_0x2caa82[_0xebf7('0x45')]));if(_0x37b7d7[_0xebf7('0x44')][_0xebf7('0x4d')]){_0xa434af['where']=_[_0xebf7('0x4e')](_0xa434af['where'],{'$or':_[_0xebf7('0x3e')](_0xa434af[_0xebf7('0x48')],function(_0x5740f3){var _0x4452ba={};_0x4452ba[_0x5740f3]={'$like':'%'+_0x37b7d7[_0xebf7('0x44')][_0xebf7('0x4d')]+'%'};return _0x4452ba;})});}_0xa434af=_[_0xebf7('0x4e')]({},_0xa434af,_0x37b7d7['options']);return _0xaf6244[_0xebf7('0x98')](_0xa434af);}})[_0xebf7('0x24')](function(_0x2e0cc0){if(_0x2e0cc0){_0x2e987f=_0x2e0cc0[_0xebf7('0x49')];if(!_0x37b7d7['query'][_0xebf7('0x65')](_0xebf7('0x66'))){_0xa434af[_0xebf7('0x33')]=qs['limit'](_0x37b7d7[_0xebf7('0x44')]['limit']);_0xa434af['offset']=qs[_0xebf7('0x32')](_0x37b7d7[_0xebf7('0x44')]['offset']);}return _0xaf6244[_0xebf7('0x98')](_0xa434af);}})[_0xebf7('0x24')](function(_0xc76f19){if(_0xc76f19){return _0xc76f19?{'count':_0x2e987f,'rows':_0xc76f19}:null;}})[_0xebf7('0x24')](respondWithResult(_0x2c6c2e,null))[_0xebf7('0x2d')](handleError(_0x2c6c2e,null));};
\ No newline at end of file
+var _0xca59=['removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','http','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','UserId','updatedAt','createdAt','format','SIP','chatPause','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value'];(function(_0x7cc7c3,_0x5d2075){var _0x40d43d=function(_0x5965da){while(--_0x5965da){_0x7cc7c3['push'](_0x7cc7c3['shift']());}};_0x40d43d(++_0x5d2075);}(_0xca59,0x1cd));var _0x9ca5=function(_0x46c6f9,_0x39d9c4){_0x46c6f9=_0x46c6f9-0x0;var _0x4f9bd2=_0xca59[_0x46c6f9];return _0x4f9bd2;};'use strict';var emlformat=require(_0x9ca5('0x0'));var rimraf=require(_0x9ca5('0x1'));var zipdir=require(_0x9ca5('0x2'));var jsonpatch=require(_0x9ca5('0x3'));var rp=require(_0x9ca5('0x4'));var moment=require(_0x9ca5('0x5'));var BPromise=require(_0x9ca5('0x6'));var Mustache=require(_0x9ca5('0x7'));var util=require(_0x9ca5('0x8'));var path=require(_0x9ca5('0x9'));var sox=require(_0x9ca5('0xa'));var csv=require(_0x9ca5('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ca5('0xc'));var _=require('lodash');var squel=require(_0x9ca5('0xd'));var crypto=require(_0x9ca5('0xe'));var jsforce=require(_0x9ca5('0xf'));var deskjs=require(_0x9ca5('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9ca5('0x11'));var Redis=require(_0x9ca5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ca5('0x13'));var logger=require(_0x9ca5('0x14'))(_0x9ca5('0x15'));var utils=require(_0x9ca5('0x16'));var config=require(_0x9ca5('0x17'));var licenseUtil=require(_0x9ca5('0x18'));var db=require(_0x9ca5('0x19'))['db'];config[_0x9ca5('0x1a')]=_['defaults'](config[_0x9ca5('0x1a')],{'host':_0x9ca5('0x1b'),'port':0x18eb});var socket=require(_0x9ca5('0x1c'))(new Redis(config[_0x9ca5('0x1a')]));require(_0x9ca5('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9ca5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xc6d6e7,_0x5d2019,_0x25e4e7,_0x10452f){return new BPromise(function(_0x469742,_0x54c610){var _0x54076a=_0x10452f||client;return _0x54076a['request'](_0xc6d6e7,_0x25e4e7)[_0x9ca5('0x1f')](function(_0x110cac){logger[_0x9ca5('0x20')](_0x9ca5('0x21'),_0x5d2019,'request\x20sent');logger[_0x9ca5('0x22')](_0x9ca5('0x23'),_0x5d2019,_0x9ca5('0x24'),JSON[_0x9ca5('0x25')](_0x110cac));if(_0x110cac[_0x9ca5('0x26')]){if(_0x110cac[_0x9ca5('0x26')][_0x9ca5('0x27')]===0x1f4){logger[_0x9ca5('0x26')](_0x9ca5('0x21'),_0x5d2019,_0x110cac[_0x9ca5('0x26')][_0x9ca5('0x28')]);return _0x54c610(_0x110cac['error'][_0x9ca5('0x28')]);}logger[_0x9ca5('0x26')](_0x9ca5('0x21'),_0x5d2019,_0x110cac['error'][_0x9ca5('0x28')]);return _0x469742(_0x110cac[_0x9ca5('0x26')][_0x9ca5('0x28')]);}else{logger[_0x9ca5('0x20')](_0x9ca5('0x21'),_0x5d2019,_0x9ca5('0x24'));_0x469742(_0x110cac[_0x9ca5('0x29')][_0x9ca5('0x28')]);}})[_0x9ca5('0x2a')](function(_0x4e5501){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5d2019,_0x4e5501);_0x54c610(_0x4e5501);});});}function respondWithStatusCode(_0x3be1e0,_0x56ef16){_0x56ef16=_0x56ef16||0xcc;return function(_0x582427){if(_0x582427){return _0x3be1e0[_0x9ca5('0x2b')](_0x56ef16);}return _0x3be1e0[_0x9ca5('0x2c')](_0x56ef16)['end']();};}function respondWithResult(_0x575a5a,_0x33e6fa){_0x33e6fa=_0x33e6fa||0xc8;return function(_0x5e45ae){if(_0x5e45ae){return _0x575a5a[_0x9ca5('0x2c')](_0x33e6fa)[_0x9ca5('0x2d')](_0x5e45ae);}};}function respondWithFilteredResult(_0x20e1d9,_0x4fb728){return function(_0xbe6384){if(_0xbe6384){var _0x2ee84b=typeof _0x4fb728[_0x9ca5('0x2e')]===_0x9ca5('0x2f')&&typeof _0x4fb728[_0x9ca5('0x30')]===_0x9ca5('0x2f');var _0xae526c=_0xbe6384[_0x9ca5('0x31')];var _0x12bd5c=_0x2ee84b?0x0:_0x4fb728[_0x9ca5('0x2e')];var _0x2930de=_0x2ee84b?_0xbe6384[_0x9ca5('0x31')]:_0x4fb728['offset']+_0x4fb728[_0x9ca5('0x30')];var _0x16e07e;if(_0x2930de>=_0xae526c){_0x2930de=_0xae526c;_0x16e07e=0xc8;}else{_0x16e07e=0xce;}_0x20e1d9[_0x9ca5('0x2c')](_0x16e07e);return _0x20e1d9[_0x9ca5('0x32')](_0x9ca5('0x33'),_0x12bd5c+'-'+_0x2930de+'/'+_0xae526c)[_0x9ca5('0x2d')](_0xbe6384);}return null;};}function patchUpdates(_0x50a43e){return function(_0x575d4b){try{jsonpatch[_0x9ca5('0x34')](_0x575d4b,_0x50a43e,!![]);}catch(_0x13cf8b){return BPromise['reject'](_0x13cf8b);}return _0x575d4b[_0x9ca5('0x35')]();};}function saveUpdates(_0x4e9f6c,_0xb48913){return function(_0x14e68f){if(_0x14e68f){return _0x14e68f[_0x9ca5('0x36')](_0x4e9f6c)[_0x9ca5('0x1f')](function(_0x4b285d){return _0x4b285d;});}return null;};}function removeEntity(_0x119262,_0x281053){return function(_0x216c28){if(_0x216c28){return _0x216c28[_0x9ca5('0x37')]()[_0x9ca5('0x1f')](function(){var _0x2ea5ed=_0x216c28[_0x9ca5('0x38')]({'plain':!![]});var _0x532057=_0x9ca5('0x39');return db[_0x9ca5('0x3a')]['destroy']({'where':{'type':_0x532057,'resourceId':_0x2ea5ed['id']}})[_0x9ca5('0x1f')](function(){return _0x216c28;});})[_0x9ca5('0x1f')](function(){_0x119262[_0x9ca5('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x243b81,_0x497acb){return function(_0x41d0ee){if(!_0x41d0ee){_0x243b81[_0x9ca5('0x2b')](0x194);}return _0x41d0ee;};}function handleError(_0x26ad6f,_0xde62e3){_0xde62e3=_0xde62e3||0x1f4;return function(_0x2174a3){logger[_0x9ca5('0x26')](_0x2174a3['stack']);if(_0x2174a3['name']){delete _0x2174a3[_0x9ca5('0x3b')];}_0x26ad6f[_0x9ca5('0x2c')](_0xde62e3)['send'](_0x2174a3);};}exports[_0x9ca5('0x3c')]=function(_0x25ae80,_0x46b317){var _0x3ef2f2={},_0x1494d9={},_0x121462={'count':0x0,'rows':[]};var _0x262012=_[_0x9ca5('0x3d')](db[_0x9ca5('0x3e')][_0x9ca5('0x3f')],function(_0x29b519){return{'name':_0x29b519[_0x9ca5('0x40')],'type':_0x29b519[_0x9ca5('0x41')][_0x9ca5('0x42')]};});_0x1494d9['model']=_[_0x9ca5('0x3d')](_0x262012,_0x9ca5('0x3b'));_0x1494d9[_0x9ca5('0x43')]=_[_0x9ca5('0x44')](_0x25ae80['query']);_0x1494d9[_0x9ca5('0x45')]=_['intersection'](_0x1494d9['model'],_0x1494d9[_0x9ca5('0x43')]);_0x3ef2f2[_0x9ca5('0x46')]=_[_0x9ca5('0x47')](_0x1494d9['model'],qs[_0x9ca5('0x48')](_0x25ae80['query'][_0x9ca5('0x48')]));_0x3ef2f2[_0x9ca5('0x46')]=_0x3ef2f2[_0x9ca5('0x46')][_0x9ca5('0x49')]?_0x3ef2f2[_0x9ca5('0x46')]:_0x1494d9[_0x9ca5('0x4a')];if(!_0x25ae80[_0x9ca5('0x43')][_0x9ca5('0x4b')](_0x9ca5('0x4c'))){_0x3ef2f2[_0x9ca5('0x30')]=qs['limit'](_0x25ae80['query'][_0x9ca5('0x30')]);_0x3ef2f2[_0x9ca5('0x2e')]=qs[_0x9ca5('0x2e')](_0x25ae80[_0x9ca5('0x43')][_0x9ca5('0x2e')]);}_0x3ef2f2[_0x9ca5('0x4d')]=qs[_0x9ca5('0x4e')](_0x25ae80[_0x9ca5('0x43')][_0x9ca5('0x4e')]);_0x3ef2f2[_0x9ca5('0x4f')]=qs[_0x9ca5('0x45')](_[_0x9ca5('0x50')](_0x25ae80[_0x9ca5('0x43')],_0x1494d9[_0x9ca5('0x45')]),_0x262012);if(_0x25ae80[_0x9ca5('0x43')][_0x9ca5('0x51')]){_0x3ef2f2[_0x9ca5('0x4f')]=_[_0x9ca5('0x52')](_0x3ef2f2[_0x9ca5('0x4f')],{'$or':_['map'](_0x262012,function(_0x1277bc){if(_0x1277bc[_0x9ca5('0x41')]!==_0x9ca5('0x53')){var _0x183ed1={};_0x183ed1[_0x1277bc[_0x9ca5('0x3b')]]={'$like':'%'+_0x25ae80[_0x9ca5('0x43')][_0x9ca5('0x51')]+'%'};return _0x183ed1;}})});}_0x3ef2f2=_[_0x9ca5('0x52')]({},_0x3ef2f2,_0x25ae80[_0x9ca5('0x54')]);var _0x534d17={'where':_0x3ef2f2[_0x9ca5('0x4f')]};return db[_0x9ca5('0x3e')][_0x9ca5('0x31')](_0x534d17)[_0x9ca5('0x1f')](function(_0x426060){_0x121462[_0x9ca5('0x31')]=_0x426060;if(_0x25ae80[_0x9ca5('0x43')][_0x9ca5('0x55')]){_0x3ef2f2['include']=[{'all':!![]}];}return db[_0x9ca5('0x3e')][_0x9ca5('0x56')](_0x3ef2f2);})[_0x9ca5('0x1f')](function(_0x55daca){_0x121462[_0x9ca5('0x57')]=_0x55daca;return _0x121462;})[_0x9ca5('0x1f')](respondWithFilteredResult(_0x46b317,_0x3ef2f2))[_0x9ca5('0x2a')](handleError(_0x46b317,null));};exports[_0x9ca5('0x58')]=function(_0x52d927,_0xad049e){var _0x3d93f0={'raw':!![],'where':{'id':_0x52d927[_0x9ca5('0x59')]['id']}},_0x587a90={};_0x587a90[_0x9ca5('0x4a')]=_[_0x9ca5('0x44')](db[_0x9ca5('0x3e')][_0x9ca5('0x3f')]);_0x587a90[_0x9ca5('0x43')]=_[_0x9ca5('0x44')](_0x52d927['query']);_0x587a90['filters']=_['intersection'](_0x587a90['model'],_0x587a90['query']);_0x3d93f0[_0x9ca5('0x46')]=_[_0x9ca5('0x47')](_0x587a90[_0x9ca5('0x4a')],qs['fields'](_0x52d927['query'][_0x9ca5('0x48')]));_0x3d93f0[_0x9ca5('0x46')]=_0x3d93f0[_0x9ca5('0x46')][_0x9ca5('0x49')]?_0x3d93f0[_0x9ca5('0x46')]:_0x587a90[_0x9ca5('0x4a')];if(_0x52d927[_0x9ca5('0x43')][_0x9ca5('0x55')]){_0x3d93f0[_0x9ca5('0x5a')]=[{'all':!![]}];}_0x3d93f0=_['merge']({},_0x3d93f0,_0x52d927[_0x9ca5('0x54')]);return db[_0x9ca5('0x3e')][_0x9ca5('0x5b')](_0x3d93f0)[_0x9ca5('0x1f')](handleEntityNotFound(_0xad049e,null))[_0x9ca5('0x1f')](respondWithResult(_0xad049e,null))['catch'](handleError(_0xad049e,null));};exports['create']=function(_0x165e51,_0x337a16){return db['ChatQueue'][_0x9ca5('0x5c')](_0x165e51['body'],{})[_0x9ca5('0x1f')](function(_0xb1612e){var _0x42246b=_0x165e51['user'][_0x9ca5('0x38')]({'plain':!![]});if(!_0x42246b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42246b[_0x9ca5('0x5d')]===_0x9ca5('0x5e')){var _0x7f0ae0=_0xb1612e[_0x9ca5('0x38')]({'plain':!![]});var _0x2e080f=_0x9ca5('0x39');return db[_0x9ca5('0x5f')][_0x9ca5('0x5b')]({'where':{'name':_0x2e080f,'userProfileId':_0x42246b['userProfileId']},'raw':!![]})['then'](function(_0x3b5500){if(_0x3b5500&&_0x3b5500[_0x9ca5('0x60')]===0x0){return db[_0x9ca5('0x3a')][_0x9ca5('0x5c')]({'name':_0x7f0ae0[_0x9ca5('0x3b')],'resourceId':_0x7f0ae0['id'],'type':_0x3b5500[_0x9ca5('0x3b')],'sectionId':_0x3b5500['id']},{})[_0x9ca5('0x1f')](function(){return _0xb1612e;});}else{return _0xb1612e;}})[_0x9ca5('0x2a')](function(_0x252561){logger[_0x9ca5('0x26')](_0x9ca5('0x61'),_0x252561);throw _0x252561;});}return _0xb1612e;})[_0x9ca5('0x1f')](respondWithResult(_0x337a16,0xc9))[_0x9ca5('0x2a')](handleError(_0x337a16,null));};exports[_0x9ca5('0x36')]=function(_0x11470f,_0x57b603){if(_0x11470f[_0x9ca5('0x62')]['id']){delete _0x11470f['body']['id'];}return db[_0x9ca5('0x3e')][_0x9ca5('0x5b')]({'where':{'id':_0x11470f[_0x9ca5('0x59')]['id']}})['then'](handleEntityNotFound(_0x57b603,null))[_0x9ca5('0x1f')](saveUpdates(_0x11470f[_0x9ca5('0x62')],null))[_0x9ca5('0x1f')](respondWithResult(_0x57b603,null))['catch'](handleError(_0x57b603,null));};exports[_0x9ca5('0x37')]=function(_0x44c885,_0x9f0639){return db[_0x9ca5('0x3e')]['find']({'where':{'id':_0x44c885[_0x9ca5('0x59')]['id']}})[_0x9ca5('0x1f')](handleEntityNotFound(_0x9f0639,null))[_0x9ca5('0x1f')](removeEntity(_0x9f0639,null))[_0x9ca5('0x2a')](handleError(_0x9f0639,null));};exports[_0x9ca5('0x63')]=function(_0x250847,_0x3e15e4){return db[_0x9ca5('0x3e')]['describe']()[_0x9ca5('0x1f')](respondWithResult(_0x3e15e4,null))['catch'](handleError(_0x3e15e4,null));};exports[_0x9ca5('0x64')]=function(_0x20e569,_0x156527,_0x367f21){var _0x2bb168={'raw':!![],'where':{}},_0x452a78={},_0x241f68;return db['ChatQueue'][_0x9ca5('0x65')]({'where':{'id':_0x20e569[_0x9ca5('0x59')]['id']}})[_0x9ca5('0x1f')](handleEntityNotFound(_0x156527,null))['then'](function(_0x4bfaf7){if(_0x4bfaf7){_0x241f68=_0x4bfaf7['get']({'plain':!![]});_0x452a78[_0x9ca5('0x4a')]=_[_0x9ca5('0x44')](db[_0x9ca5('0x66')][_0x9ca5('0x3f')]);_0x452a78['query']=_[_0x9ca5('0x44')](_0x20e569['query']);_0x452a78[_0x9ca5('0x45')]=_[_0x9ca5('0x47')](_0x452a78[_0x9ca5('0x4a')],_0x452a78[_0x9ca5('0x43')]);_0x2bb168[_0x9ca5('0x46')]=_[_0x9ca5('0x47')](_0x452a78[_0x9ca5('0x4a')],qs['fields'](_0x20e569[_0x9ca5('0x43')][_0x9ca5('0x48')]));_0x2bb168['attributes']=_0x2bb168[_0x9ca5('0x46')][_0x9ca5('0x49')]?_0x2bb168[_0x9ca5('0x46')]:_0x452a78[_0x9ca5('0x4a')];if(!_0x20e569[_0x9ca5('0x43')]['hasOwnProperty'](_0x9ca5('0x4c'))){_0x2bb168[_0x9ca5('0x30')]=qs['limit'](_0x20e569[_0x9ca5('0x43')]['limit']);_0x2bb168['offset']=qs[_0x9ca5('0x2e')](_0x20e569[_0x9ca5('0x43')][_0x9ca5('0x2e')]);}_0x2bb168[_0x9ca5('0x4d')]=qs[_0x9ca5('0x4e')](_0x20e569[_0x9ca5('0x43')][_0x9ca5('0x4e')]);_0x2bb168[_0x9ca5('0x4f')]=qs[_0x9ca5('0x45')](_['pick'](_0x20e569['query'],_0x452a78[_0x9ca5('0x45')]));_0x2bb168['where'][_0x9ca5('0x67')]=_0x4bfaf7['id'];if(_0x20e569[_0x9ca5('0x43')]['filter']){_0x2bb168[_0x9ca5('0x4f')]=_[_0x9ca5('0x52')](_0x2bb168['where'],{'$or':_[_0x9ca5('0x3d')](_0x2bb168[_0x9ca5('0x46')],function(_0xd62db8){var _0x4f9e1a={};_0x4f9e1a[_0xd62db8]={'$like':'%'+_0x20e569[_0x9ca5('0x43')][_0x9ca5('0x51')]+'%'};return _0x4f9e1a;})});}_0x2bb168=_['merge']({},_0x2bb168,_0x20e569[_0x9ca5('0x54')]);return db[_0x9ca5('0x66')][_0x9ca5('0x56')](_0x2bb168);}})[_0x9ca5('0x1f')](function(_0x58c343){if(_0x58c343){return db[_0x9ca5('0x68')]['findAndCountAll']({'where':{'id':_[_0x9ca5('0x3d')](_0x58c343,_0x9ca5('0x69')),'role':'agent'},'attributes':['id',_0x9ca5('0x3b'),'chatPause',_0x9ca5('0x6a'),_0x9ca5('0x6b')]});}})['then'](function(_0x112601){if(_0x112601){return{'count':_0x112601[_0x9ca5('0x31')],'rows':_[_0x9ca5('0x3d')](_0x112601['rows'],function(_0x12c154){return{'membername':_0x12c154[_0x9ca5('0x3b')],'UserId':_0x12c154['id'],'queue_name':_0x241f68[_0x9ca5('0x3b')],'ChatQueueId':_0x241f68['id'],'interface':util[_0x9ca5('0x6c')]('%s/%s',_0x9ca5('0x6d'),_0x12c154[_0x9ca5('0x3b')]),'penalty':0x0,'paused':_0x12c154[_0x9ca5('0x6e')],'createdAt':_0x12c154[_0x9ca5('0x6b')],'updatedAt':_0x12c154['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9ca5('0x1f')](respondWithFilteredResult(_0x156527,_0x2bb168))['catch'](handleError(_0x156527,null));};exports[_0x9ca5('0x6f')]=function(_0x1d9640,_0x21ded8,_0x1f8d89){var _0x20bda1={};var _0x5ccf3d={};var _0x4c4bf7;var _0x2257cf;return db[_0x9ca5('0x3e')][_0x9ca5('0x65')]({'where':{'id':_0x1d9640[_0x9ca5('0x59')]['id']}})['then'](handleEntityNotFound(_0x21ded8,null))[_0x9ca5('0x1f')](function(_0x7a08fd){if(_0x7a08fd){_0x4c4bf7=_0x7a08fd;_0x5ccf3d[_0x9ca5('0x4a')]=_[_0x9ca5('0x44')](db['Team']['rawAttributes']);_0x5ccf3d['query']=_[_0x9ca5('0x44')](_0x1d9640['query']);_0x5ccf3d[_0x9ca5('0x45')]=_[_0x9ca5('0x47')](_0x5ccf3d['model'],_0x5ccf3d[_0x9ca5('0x43')]);_0x20bda1[_0x9ca5('0x46')]=_[_0x9ca5('0x47')](_0x5ccf3d[_0x9ca5('0x4a')],qs[_0x9ca5('0x48')](_0x1d9640[_0x9ca5('0x43')]['fields']));_0x20bda1[_0x9ca5('0x46')]=_0x20bda1[_0x9ca5('0x46')][_0x9ca5('0x49')]?_0x20bda1[_0x9ca5('0x46')]:_0x5ccf3d[_0x9ca5('0x4a')];_0x20bda1['order']=qs[_0x9ca5('0x4e')](_0x1d9640[_0x9ca5('0x43')][_0x9ca5('0x4e')]);_0x20bda1['where']=qs[_0x9ca5('0x45')](_[_0x9ca5('0x50')](_0x1d9640[_0x9ca5('0x43')],_0x5ccf3d['filters']));if(_0x1d9640[_0x9ca5('0x43')][_0x9ca5('0x51')]){_0x20bda1[_0x9ca5('0x4f')]=_[_0x9ca5('0x52')](_0x20bda1['where'],{'$or':_[_0x9ca5('0x3d')](_0x20bda1[_0x9ca5('0x46')],function(_0x536df9){var _0x32d898={};_0x32d898[_0x536df9]={'$like':'%'+_0x1d9640['query'][_0x9ca5('0x51')]+'%'};return _0x32d898;})});}_0x20bda1=_['merge']({},_0x20bda1,_0x1d9640['options']);return _0x4c4bf7[_0x9ca5('0x6f')](_0x20bda1);}})[_0x9ca5('0x1f')](function(_0x5d53eb){if(_0x5d53eb){_0x2257cf=_0x5d53eb[_0x9ca5('0x49')];if(!_0x1d9640[_0x9ca5('0x43')]['hasOwnProperty'](_0x9ca5('0x4c'))){_0x20bda1[_0x9ca5('0x30')]=qs[_0x9ca5('0x30')](_0x1d9640[_0x9ca5('0x43')][_0x9ca5('0x30')]);_0x20bda1[_0x9ca5('0x2e')]=qs[_0x9ca5('0x2e')](_0x1d9640[_0x9ca5('0x43')][_0x9ca5('0x2e')]);}return _0x4c4bf7[_0x9ca5('0x6f')](_0x20bda1);}})[_0x9ca5('0x1f')](function(_0x13b6d3){if(_0x13b6d3){return _0x13b6d3?{'count':_0x2257cf,'rows':_0x13b6d3}:null;}})['then'](respondWithResult(_0x21ded8,null))[_0x9ca5('0x2a')](handleError(_0x21ded8,null));};exports[_0x9ca5('0x70')]=function(_0x2b558b,_0x5e1441,_0x10bacd){var _0x34e82d=_0x2b558b[_0x9ca5('0x62')][_0x9ca5('0x71')];return db[_0x9ca5('0x72')][_0x9ca5('0x56')]({'where':{'id':_0x34e82d},'attributes':['id'],'include':[{'model':db[_0x9ca5('0x68')],'as':_0x9ca5('0x73'),'attributes':['id','name',_0x9ca5('0x74'),_0x9ca5('0x75'),_0x9ca5('0x76')],'raw':!![]}]})[_0x9ca5('0x1f')](function(_0x4f3306){if(_0x4f3306){var _0x3b1a68=_[_0x9ca5('0x77')](_0x4f3306,function(_0x17c22c){var _0x28a0a8=_0x17c22c[_0x9ca5('0x38')]({'plain':!![]});return _0x28a0a8[_0x9ca5('0x73')];});return db[_0x9ca5('0x3e')]['find']({'where':{'id':_0x2b558b[_0x9ca5('0x59')]['id']}})[_0x9ca5('0x1f')](function(_0x3c4c70){return db[_0x9ca5('0x78')][_0x9ca5('0x79')](function(_0x5e08b5){return _0x3c4c70[_0x9ca5('0x70')](_0x34e82d,{'transaction':_0x5e08b5})[_0x9ca5('0x1f')](function(){return BPromise['each'](_0x3b1a68,function(_0x174b31){return db[_0x9ca5('0x66')][_0x9ca5('0x7a')]({'where':{'UserId':_0x174b31['id'],'ChatQueueId':_0x2b558b[_0x9ca5('0x59')]['id']},'transaction':_0x5e08b5});});})['then'](function(){_0x3b1a68[_0x9ca5('0x7b')](function(_0x5e26c1){socket['emit']('userChatQueue:save',{'UserId':_0x5e26c1['id'],'ChatQueueId':_0x3c4c70['id']});});});});});}})[_0x9ca5('0x1f')](respondWithStatusCode(_0x5e1441,null))[_0x9ca5('0x2a')](handleError(_0x5e1441,null));};exports[_0x9ca5('0x7c')]=function(_0x2cf3df,_0x158b14,_0x2c94b1){return db[_0x9ca5('0x72')][_0x9ca5('0x56')]({'where':{'id':_0x2cf3df[_0x9ca5('0x43')][_0x9ca5('0x71')]},'attributes':['id'],'include':[{'model':db[_0x9ca5('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9ca5('0x1f')](handleEntityNotFound(_0x158b14,null))[_0x9ca5('0x1f')](function(_0x214b8a){var _0x357008=_['map'](_0x214b8a,'id');var _0x46fffa=[];var _0x57705b=[];var _0x2f89d2=squel[_0x9ca5('0x7d')]();_0x2f89d2[_0x9ca5('0x7e')](_0x9ca5('0x7f'))[_0x9ca5('0x80')](_0x9ca5('0x81'),'tq')['join'](_0x9ca5('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9ca5('0x4f')]('ChatQueueId\x20=\x20?',_0x2cf3df['params']['id']);for(var _0x31e1f3=0x0;_0x31e1f3<_0x214b8a['length'];_0x31e1f3+=0x1){let _0x4522a3=_0x214b8a[_0x31e1f3];for(var _0x36cdd4=0x0;_0x36cdd4<_0x4522a3[_0x9ca5('0x73')][_0x9ca5('0x49')];_0x36cdd4+=0x1){let _0x24e8d1=_0x4522a3[_0x9ca5('0x73')][_0x36cdd4];var _0x4e9ccb=_0x2f89d2[_0x9ca5('0x83')]();_0x4e9ccb[_0x9ca5('0x4f')](_0x9ca5('0x84'),_0x24e8d1['id']);_0x57705b[_0x9ca5('0x85')](db[_0x9ca5('0x78')][_0x9ca5('0x43')](_0x4e9ccb[_0x9ca5('0x86')](),{'type':db[_0x9ca5('0x78')][_0x9ca5('0x87')][_0x9ca5('0x88')]})[_0x9ca5('0x1f')](function(_0xcc0dff){if(_0xcc0dff['length']===0x1){return _0x24e8d1['id'];}else{var _0x5ccde6=_[_0x9ca5('0x89')](_[_0x9ca5('0x3d')](_0xcc0dff,_0x9ca5('0x8a')),function(_0x5e3647){return _['includes'](_0x357008,_0x5e3647);});if(_0x5ccde6){return _0x24e8d1['id'];}}}));}}return BPromise[_0x9ca5('0x8b')](_0x57705b)[_0x9ca5('0x1f')](function(_0x4649ea){_0x46fffa=_(_0x46fffa)[_0x9ca5('0x8c')](_0x4649ea)[_0x9ca5('0x8d')]()[_0x9ca5('0x8e')]();return db['ChatQueue'][_0x9ca5('0x5b')]({'where':{'id':_0x2cf3df['params']['id']}})[_0x9ca5('0x1f')](function(_0x128a5d){return db[_0x9ca5('0x78')]['transaction'](function(_0x17ddf1){return _0x128a5d[_0x9ca5('0x7c')](_0x2cf3df[_0x9ca5('0x43')][_0x9ca5('0x71')],{'transaction':_0x17ddf1})[_0x9ca5('0x1f')](function(){if(!_['isEmpty'](_0x46fffa)){return _0x128a5d[_0x9ca5('0x8f')](_0x46fffa,{'transaction':_0x17ddf1});}})['then'](function(){_0x46fffa[_0x9ca5('0x7b')](function(_0x37eb83){socket[_0x9ca5('0x90')](_0x9ca5('0x91'),{'UserId':_0x37eb83,'ChatQueueId':_0x128a5d['id']});});});});});});})[_0x9ca5('0x1f')](respondWithStatusCode(_0x158b14,null))[_0x9ca5('0x2a')](handleError(_0x158b14,null));};exports['addAgents']=function(_0x39f27c,_0x19d076,_0x4f4c32){return db[_0x9ca5('0x3e')][_0x9ca5('0x5b')]({'where':{'id':_0x39f27c[_0x9ca5('0x59')]['id']}})[_0x9ca5('0x1f')](handleEntityNotFound(_0x19d076,null))[_0x9ca5('0x1f')](function(_0x3507fc){if(_0x3507fc){return _0x3507fc[_0x9ca5('0x92')](_0x39f27c[_0x9ca5('0x62')][_0x9ca5('0x71')],_[_0x9ca5('0x93')](_0x39f27c[_0x9ca5('0x62')],[_0x9ca5('0x71'),'id'])||{})[_0x9ca5('0x94')](function(_0x31f368){for(var _0x2be27c=0x0;_0x2be27c<_0x39f27c['body'][_0x9ca5('0x71')][_0x9ca5('0x49')];_0x2be27c+=0x1){socket[_0x9ca5('0x90')]('userChatQueue:save',{'UserId':Number(_0x39f27c['body'][_0x9ca5('0x71')][_0x2be27c]),'ChatQueueId':Number(_0x39f27c[_0x9ca5('0x59')]['id'])});}return _0x31f368;});}})[_0x9ca5('0x1f')](respondWithResult(_0x19d076,null))[_0x9ca5('0x2a')](handleError(_0x19d076,null));};exports[_0x9ca5('0x8f')]=function(_0x5cefc1,_0x18cee8,_0x1a1485){return db[_0x9ca5('0x3e')][_0x9ca5('0x5b')]({'where':{'id':_0x5cefc1[_0x9ca5('0x59')]['id']}})[_0x9ca5('0x1f')](handleEntityNotFound(_0x18cee8,null))[_0x9ca5('0x1f')](function(_0x59b0f8){if(_0x59b0f8){return _0x59b0f8[_0x9ca5('0x8f')](_0x5cefc1[_0x9ca5('0x43')]['ids'])[_0x9ca5('0x1f')](function(){if(_[_0x9ca5('0x95')](_0x5cefc1[_0x9ca5('0x43')][_0x9ca5('0x71')])){for(var _0x4509f3=0x0;_0x4509f3<_0x5cefc1[_0x9ca5('0x43')][_0x9ca5('0x71')][_0x9ca5('0x49')];_0x4509f3+=0x1){socket[_0x9ca5('0x90')](_0x9ca5('0x91'),{'UserId':Number(_0x5cefc1['query']['ids'][_0x4509f3]),'ChatQueueId':Number(_0x5cefc1[_0x9ca5('0x59')]['id'])});}}else{socket['emit'](_0x9ca5('0x91'),{'UserId':Number(_0x5cefc1[_0x9ca5('0x43')][_0x9ca5('0x71')]),'ChatQueueId':Number(_0x5cefc1[_0x9ca5('0x59')]['id'])});}});}})[_0x9ca5('0x1f')](respondWithStatusCode(_0x18cee8,null))[_0x9ca5('0x2a')](handleError(_0x18cee8,null));};exports['getAgents']=function(_0x340cdc,_0x315ba1,_0x430123){var _0x5ba063={};var _0x2bdcf7={};var _0xed0861;var _0x582594;return db[_0x9ca5('0x3e')][_0x9ca5('0x65')]({'where':{'id':_0x340cdc[_0x9ca5('0x59')]['id']}})['then'](handleEntityNotFound(_0x315ba1,null))[_0x9ca5('0x1f')](function(_0x995578){if(_0x995578){_0xed0861=_0x995578;_0x2bdcf7['model']=_[_0x9ca5('0x44')](db['User'][_0x9ca5('0x3f')]);_0x2bdcf7[_0x9ca5('0x43')]=_['keys'](_0x340cdc[_0x9ca5('0x43')]);_0x2bdcf7[_0x9ca5('0x45')]=_[_0x9ca5('0x47')](_0x2bdcf7[_0x9ca5('0x4a')],_0x2bdcf7[_0x9ca5('0x43')]);_0x5ba063[_0x9ca5('0x46')]=_[_0x9ca5('0x47')](_0x2bdcf7[_0x9ca5('0x4a')],qs[_0x9ca5('0x48')](_0x340cdc['query']['fields']));_0x5ba063[_0x9ca5('0x46')]=_0x5ba063[_0x9ca5('0x46')][_0x9ca5('0x49')]?_0x5ba063['attributes']:_0x2bdcf7[_0x9ca5('0x4a')];_0x5ba063[_0x9ca5('0x4d')]=qs['sort'](_0x340cdc[_0x9ca5('0x43')]['sort']);_0x5ba063[_0x9ca5('0x4f')]=qs[_0x9ca5('0x45')](_[_0x9ca5('0x50')](_0x340cdc[_0x9ca5('0x43')],_0x2bdcf7[_0x9ca5('0x45')]));if(_0x340cdc[_0x9ca5('0x43')][_0x9ca5('0x51')]){_0x5ba063[_0x9ca5('0x4f')]=_[_0x9ca5('0x52')](_0x5ba063[_0x9ca5('0x4f')],{'$or':_[_0x9ca5('0x3d')](_0x5ba063[_0x9ca5('0x46')],function(_0x4d04b6){var _0x19ebad={};_0x19ebad[_0x4d04b6]={'$like':'%'+_0x340cdc['query']['filter']+'%'};return _0x19ebad;})});}_0x5ba063=_[_0x9ca5('0x52')]({},_0x5ba063,_0x340cdc[_0x9ca5('0x54')]);return _0xed0861[_0x9ca5('0x96')](_0x5ba063);}})[_0x9ca5('0x1f')](function(_0x51bc80){if(_0x51bc80){_0x582594=_0x51bc80[_0x9ca5('0x49')];if(!_0x340cdc[_0x9ca5('0x43')][_0x9ca5('0x4b')](_0x9ca5('0x4c'))){_0x5ba063[_0x9ca5('0x30')]=qs[_0x9ca5('0x30')](_0x340cdc[_0x9ca5('0x43')][_0x9ca5('0x30')]);_0x5ba063[_0x9ca5('0x2e')]=qs[_0x9ca5('0x2e')](_0x340cdc[_0x9ca5('0x43')][_0x9ca5('0x2e')]);}return _0xed0861[_0x9ca5('0x96')](_0x5ba063);}})[_0x9ca5('0x1f')](function(_0x3192b8){if(_0x3192b8){return _0x3192b8?{'count':_0x582594,'rows':_0x3192b8}:null;}})['then'](respondWithResult(_0x315ba1,null))[_0x9ca5('0x2a')](handleError(_0x315ba1,null));};
\ No newline at end of file