Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / dashboard / dashboard.controller.js
index c3d1131..fa5dcc8 100644 (file)
@@ -1 +1 @@
-const a168_0x2d25=['attributes','custom','0.00','set','reportType','sendStatus','UserProfileResource','status','addItem','CustomDashboards','attrSerie3','web-report','value','attrFontSize','attrReport','attrs','update','updatedAt','Dashboard','pie-chart','HH:mm:ss','createdAt','limit','role','pick','query','sort','get','userProfileId','keys','getItems','attrPath','error','findOne','nolimit','json','Unable\x20to\x20retrieve\x20the\x20current\x20user','rows','where','map','stringify','count','catch','offset','fieldName','attrMetric','clone','name','filters','UserProfileSection','counter','omit','VIRTUAL','attrUrl','merge','include','../../rediscache','undefined','intersection','order','findAll','api','Content-Range','attrHourFormat','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','options','./dashboard.socket','create','then','like','autoAssociation','fields','../../mysqldb','destroy','attrTimezone','attrRefresh','model','attrSerie2','rawAttributes','show','includeAll','filter','length','iframe','index','body','params','type','DashboardItem','attrVoiceQueues','user','key','../../config/logger','register'];(function(_0x26b434,_0x2d2559){const _0x944288=function(_0xfcad25){while(--_0xfcad25){_0x26b434['push'](_0x26b434['shift']());}};_0x944288(++_0x2d2559);}(a168_0x2d25,0x83));const a168_0x9442=function(_0x26b434,_0x2d2559){_0x26b434=_0x26b434-0x0;let _0x944288=a168_0x2d25[_0x26b434];return _0x944288;};const _0x2058e9=a168_0x9442;'use strict';const _=require('lodash'),qs=require('../../components/parsers/qs'),logger=require(_0x2058e9('0x37'))(_0x2058e9('0x18')),{getSocket}=require(_0x2058e9('0x13')),socket=getSocket(),db=require(_0x2058e9('0x23'))['db'],{Op}=require('sequelize');require(_0x2058e9('0x1d'))[_0x2058e9('0x38')](socket);function respondWithResult(_0xfcad25,_0xe8e588){return _0xe8e588=_0xe8e588||0xc8,function(_0x55d785){const _0x50d7c0=a168_0x9442;if(_0x55d785)return _0xfcad25[_0x50d7c0('0x40')](_0xe8e588)[_0x50d7c0('0x5c')](_0x55d785);};}function respondWithFilteredResult(_0x4510ae,_0x3ccadf){return function(_0xaef49c){const _0x3ed6d8=a168_0x9442;if(_0xaef49c){const _0x2c7953=_0xaef49c[_0x3ed6d8('0x4')],_0x2f6cca=_0x3ccadf[_0x3ed6d8('0x6')];let _0x4597d1=_0x3ccadf[_0x3ed6d8('0x6')]+_0x3ccadf[_0x3ed6d8('0x4f')],_0x2235c8;return _0x4597d1>=_0x2c7953?(_0x4597d1=_0x2c7953,_0x2235c8=0xc8):_0x2235c8=0xce,_0x4510ae[_0x3ed6d8('0x40')](_0x2235c8),_0x4510ae[_0x3ed6d8('0x3c')](_0x3ed6d8('0x19'),_0x2f6cca+'-'+_0x4597d1+'/'+_0x2c7953)[_0x3ed6d8('0x5c')](_0xaef49c);}return null;};}function saveUpdates(_0x1bed9a){return function(_0x8a122c){const _0x5bfe6a=a168_0x9442;if(_0x8a122c)return _0x8a122c[_0x5bfe6a('0x49')](_0x1bed9a)[_0x5bfe6a('0x1f')](function(_0x1652f5){return _0x1652f5;});return null;};}function removeEntity(_0x3eba33){return function(_0x1f543a){const _0x121574=a168_0x9442;if(_0x1f543a)return _0x1f543a[_0x121574('0x24')]()[_0x121574('0x1f')](function(){const _0x24c90f=_0x121574,_0x5ee646=_0x1f543a[_0x24c90f('0x54')]({'plain':!![]}),_0x57e469=_0x24c90f('0x42');return db['UserProfileResource'][_0x24c90f('0x24')]({'where':{'type':_0x57e469,'resourceId':_0x5ee646['id']}})['then'](function(){return _0x1f543a;});})[_0x121574('0x1f')](function(){_0x3eba33['status'](0xcc)['end']();});};}function handleEntityNotFound(_0x3cd70b){return function(_0x330aa3){const _0x31e0ce=a168_0x9442;return!_0x330aa3&&_0x3cd70b[_0x31e0ce('0x3e')](0x194),_0x330aa3;};}function handleError(_0x446ebe,_0x503378){return _0x503378=_0x503378||0x1f4,function(_0x4a8360){const _0xe3c206=a168_0x9442;logger['error'](_0x4a8360['stack']),_0x4a8360[_0xe3c206('0xa')]&&delete _0x4a8360[_0xe3c206('0xa')],_0x446ebe['status'](_0x503378)['send'](_0x4a8360);};}exports[_0x2058e9('0x2f')]=function(_0x2a26e6,_0x66c218){const _0x4a508d=_0x2058e9;let _0x3d46a3={};const _0x4c9a10={},_0x3399ca={'count':0x0,'rows':[]},_0x58e89d=_[_0x4a508d('0x2')](db[_0x4a508d('0x4b')][_0x4a508d('0x29')],function(_0x396f2e){const _0x3b1a04=_0x4a508d;return{'name':_0x396f2e[_0x3b1a04('0x7')],'type':_0x396f2e[_0x3b1a04('0x32')][_0x3b1a04('0x36')]};});_0x4c9a10[_0x4a508d('0x27')]=_[_0x4a508d('0x2')](_0x58e89d,_0x4a508d('0xa')),_0x4c9a10[_0x4a508d('0x52')]=_[_0x4a508d('0x56')](_0x2a26e6[_0x4a508d('0x52')]),_0x4c9a10[_0x4a508d('0xb')]=_[_0x4a508d('0x15')](_0x4c9a10[_0x4a508d('0x27')],_0x4c9a10[_0x4a508d('0x52')]),_0x3d46a3[_0x4a508d('0x39')]=_[_0x4a508d('0x15')](_0x4c9a10[_0x4a508d('0x27')],qs[_0x4a508d('0x22')](_0x2a26e6[_0x4a508d('0x52')]['fields'])),_0x3d46a3['attributes']=_0x3d46a3[_0x4a508d('0x39')]['length']?_0x3d46a3[_0x4a508d('0x39')]:_0x4c9a10['model'];typeof _0x2a26e6[_0x4a508d('0x52')][_0x4a508d('0x5b')]===_0x4a508d('0x14')&&(_0x3d46a3['limit']=qs[_0x4a508d('0x4f')](_0x2a26e6[_0x4a508d('0x52')][_0x4a508d('0x4f')]),_0x3d46a3[_0x4a508d('0x6')]=qs[_0x4a508d('0x6')](_0x2a26e6['query']['offset']));_0x3d46a3[_0x4a508d('0x16')]=qs[_0x4a508d('0x53')](_0x2a26e6[_0x4a508d('0x52')][_0x4a508d('0x53')]),_0x3d46a3[_0x4a508d('0x1')]=qs[_0x4a508d('0xb')](_[_0x4a508d('0x51')](_0x2a26e6[_0x4a508d('0x52')],_0x4c9a10[_0x4a508d('0xb')]),_0x58e89d);_0x2a26e6['query']['filter']&&(_0x3d46a3[_0x4a508d('0x1')]=_['merge'](_0x3d46a3[_0x4a508d('0x1')],{[Op['or']]:_[_0x4a508d('0x2')](_0x58e89d,function(_0xb97e63){const _0xd0f31b=_0x4a508d;if(_0xb97e63[_0xd0f31b('0x32')]!==_0xd0f31b('0xf')){const _0x1a0bf8={};return _0x1a0bf8[_0xb97e63[_0xd0f31b('0xa')]]={[Op[_0xd0f31b('0x20')]]:'%'+_0x2a26e6[_0xd0f31b('0x52')][_0xd0f31b('0x2c')]+'%'},_0x1a0bf8;}})}));_0x3d46a3=_[_0x4a508d('0x11')]({},_0x3d46a3,_0x2a26e6[_0x4a508d('0x1c')]);const _0x17ccbd={'where':_0x3d46a3[_0x4a508d('0x1')]};return db[_0x4a508d('0x4b')][_0x4a508d('0x4')](_0x17ccbd)[_0x4a508d('0x1f')](function(_0x429593){const _0x520344=_0x4a508d;return _0x3399ca[_0x520344('0x4')]=_0x429593,_0x2a26e6[_0x520344('0x52')][_0x520344('0x2b')]&&(_0x3d46a3[_0x520344('0x12')]=[{'all':!![]}]),db[_0x520344('0x4b')][_0x520344('0x17')](_0x3d46a3);})['then'](function(_0xc706a2){const _0x422e6b=_0x4a508d;return _0x3399ca[_0x422e6b('0x0')]=_0xc706a2,_0x3399ca;})['then'](respondWithFilteredResult(_0x66c218,_0x3d46a3))[_0x4a508d('0x5')](handleError(_0x66c218,null));},exports[_0x2058e9('0x2a')]=function(_0x447231,_0x247d9c){const _0x38d45b=_0x2058e9;let _0x1d6a95={'raw':![],'where':{'id':_0x447231['params']['id']}};const _0x319205={};return _0x319205[_0x38d45b('0x27')]=_[_0x38d45b('0x56')](db[_0x38d45b('0x4b')]['rawAttributes']),_0x319205[_0x38d45b('0x52')]=_[_0x38d45b('0x56')](_0x447231[_0x38d45b('0x52')]),_0x319205['filters']=_['intersection'](_0x319205[_0x38d45b('0x27')],_0x319205['query']),_0x1d6a95['attributes']=_['intersection'](_0x319205[_0x38d45b('0x27')],qs[_0x38d45b('0x22')](_0x447231[_0x38d45b('0x52')][_0x38d45b('0x22')])),_0x1d6a95['attributes']=_0x1d6a95['attributes'][_0x38d45b('0x2d')]?_0x1d6a95['attributes']:_0x319205[_0x38d45b('0x27')],_0x447231[_0x38d45b('0x52')]['includeAll']&&(_0x1d6a95[_0x38d45b('0x12')]=[{'all':!![]}]),_0x1d6a95=_[_0x38d45b('0x11')]({},_0x1d6a95,_0x447231['options']),db['Dashboard'][_0x38d45b('0x5a')](_0x1d6a95)['then'](handleEntityNotFound(_0x247d9c,null))[_0x38d45b('0x1f')](respondWithResult(_0x247d9c,null))[_0x38d45b('0x5')](handleError(_0x247d9c,null));},exports[_0x2058e9('0x1e')]=function(_0x3a8c65,_0x50dea9){const _0x163478=_0x2058e9;return db[_0x163478('0x4b')][_0x163478('0x1e')](_0x3a8c65[_0x163478('0x30')],{})['then'](function(_0x3b4579){const _0x34d18e=_0x163478,_0x417178=_0x3a8c65[_0x34d18e('0x35')]['get']({'plain':!![]});if(!_0x417178)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x417178[_0x34d18e('0x50')]===_0x34d18e('0x35')){const _0x5b6b59=_0x3b4579[_0x34d18e('0x54')]({'plain':!![]}),_0x417f1a=_0x34d18e('0x42');return db[_0x34d18e('0xc')][_0x34d18e('0x5a')]({'where':{'name':_0x417f1a,'userProfileId':_0x417178[_0x34d18e('0x55')]},'raw':!![]})['then'](function(_0x10b4a9){const _0x2230fb=_0x34d18e;return _0x10b4a9&&_0x10b4a9[_0x2230fb('0x21')]===0x0?db[_0x2230fb('0x3f')][_0x2230fb('0x1e')]({'name':_0x5b6b59[_0x2230fb('0xa')],'resourceId':_0x5b6b59['id'],'type':_0x10b4a9['name'],'sectionId':_0x10b4a9['id']},{})[_0x2230fb('0x1f')](function(){return _0x3b4579;}):_0x3b4579;})[_0x34d18e('0x5')](function(_0x36764d){const _0x3deb86=_0x34d18e;logger[_0x3deb86('0x59')](_0x3deb86('0x1b'),_0x36764d);throw _0x36764d;});}return _0x3b4579;})[_0x163478('0x1f')](respondWithResult(_0x50dea9,0xc9))['catch'](handleError(_0x50dea9,null));},exports[_0x2058e9('0x9')]=function(_0x1281d7,_0x56d71b){const _0x33bd5c=_0x2058e9;let _0x3a2fcf={'where':{'id':_0x1281d7[_0x33bd5c('0x31')]['id']}};const _0x490123={};return _0x490123[_0x33bd5c('0x27')]=_[_0x33bd5c('0x56')](db['Dashboard']['rawAttributes']),_0x3a2fcf[_0x33bd5c('0x39')]=_['intersection'](_0x490123[_0x33bd5c('0x27')],qs[_0x33bd5c('0x22')](_0x1281d7[_0x33bd5c('0x52')][_0x33bd5c('0x22')])),_0x3a2fcf[_0x33bd5c('0x39')]=_0x3a2fcf['attributes'][_0x33bd5c('0x2d')]?_0x3a2fcf['attributes']:_0x490123['model'],_0x1281d7[_0x33bd5c('0x52')][_0x33bd5c('0x2b')]&&(_0x3a2fcf[_0x33bd5c('0x12')]=[{'all':!![]}]),_0x3a2fcf=_['merge']({},_0x3a2fcf,_0x1281d7[_0x33bd5c('0x1c')]),db[_0x33bd5c('0x4b')][_0x33bd5c('0x5a')](_0x3a2fcf)[_0x33bd5c('0x1f')](handleEntityNotFound(_0x56d71b,null))[_0x33bd5c('0x1f')](function(_0x5f157e){const _0x5b9d40=_0x33bd5c;if(_0x5f157e){let _0x222083=_0x5f157e[_0x5b9d40('0x54')]({'plain':!![]});return _0x222083=qs[_0x5b9d40('0xe')](_0x222083,['id',_0x5b9d40('0x4e'),'updatedAt']),_0x1281d7['body']=_[_0x5b9d40('0xe')](_0x1281d7[_0x5b9d40('0x30')],['id','createdAt',_0x5b9d40('0x4a')]),db[_0x5b9d40('0x4b')][_0x5b9d40('0x1e')](_[_0x5b9d40('0x11')](_0x222083,_0x1281d7[_0x5b9d40('0x30')]),{'include':_0x1281d7['query']['includeAll']?[{'all':!![]}]:undefined})[_0x5b9d40('0x1f')](function(_0x47d187){const _0x245370=_0x5b9d40,_0x5d626b=_0x1281d7[_0x245370('0x35')][_0x245370('0x54')]({'plain':!![]});if(!_0x5d626b)throw new Error(_0x245370('0x5d'));if(_0x5d626b['role']===_0x245370('0x35')){const _0x396c77=_0x47d187[_0x245370('0x54')]({'plain':!![]}),_0x2f25c6=_0x245370('0x42');return db['UserProfileSection'][_0x245370('0x5a')]({'where':{'name':_0x2f25c6,'userProfileId':_0x5d626b[_0x245370('0x55')]},'raw':!![]})[_0x245370('0x1f')](function(_0x21a0fd){const _0x1ff582=_0x245370;return _0x21a0fd&&_0x21a0fd[_0x1ff582('0x21')]===0x0?db[_0x1ff582('0x3f')]['create']({'name':_0x396c77[_0x1ff582('0xa')],'resourceId':_0x396c77['id'],'type':_0x21a0fd['name'],'sectionId':_0x21a0fd['id']},{})[_0x1ff582('0x1f')](function(){return _0x47d187;}):_0x47d187;})[_0x245370('0x5')](function(_0x121a12){const _0x1aca81=_0x245370;logger[_0x1aca81('0x59')](_0x1aca81('0x1b'),_0x121a12);throw _0x121a12;});}return _0x47d187;});}})[_0x33bd5c('0x1f')](respondWithResult(_0x56d71b,0xc9))[_0x33bd5c('0x5')](handleError(_0x56d71b,null));},exports[_0x2058e9('0x49')]=function(_0x469c90,_0x2ad513){const _0x55ce66=_0x2058e9;return _0x469c90[_0x55ce66('0x30')]['id']&&delete _0x469c90['body']['id'],db[_0x55ce66('0x4b')][_0x55ce66('0x5a')]({'where':{'id':_0x469c90[_0x55ce66('0x31')]['id']}})[_0x55ce66('0x1f')](handleEntityNotFound(_0x2ad513,null))['then'](saveUpdates(_0x469c90[_0x55ce66('0x30')],null))[_0x55ce66('0x1f')](respondWithResult(_0x2ad513,null))['catch'](handleError(_0x2ad513,null));},exports[_0x2058e9('0x24')]=function(_0x15696e,_0x274dde){const _0x46590c=_0x2058e9;return db[_0x46590c('0x4b')]['findOne']({'where':{'id':_0x15696e[_0x46590c('0x31')]['id']}})[_0x46590c('0x1f')](handleEntityNotFound(_0x274dde,null))[_0x46590c('0x1f')](removeEntity(_0x274dde,null))[_0x46590c('0x5')](handleError(_0x274dde,null));};function widgetAttributes(_0x3e7d39){const _0x5cc72d=_0x2058e9;try{switch(_0x3e7d39[_0x5cc72d('0x32')]){case _0x5cc72d('0x2e'):return[{'name':_0x5cc72d('0x10'),'value':_0x3e7d39[_0x5cc72d('0x10')]||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39[_0x5cc72d('0x48')][0x0]?_0x3e7d39[_0x5cc72d('0x48')][0x0]['value']:undefined)||'https://'}];case _0x5cc72d('0x3a'):return[{'name':'attrPath','value':_0x3e7d39[_0x5cc72d('0x58')]||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39[_0x5cc72d('0x48')][0x0]?_0x3e7d39[_0x5cc72d('0x48')][0x0][_0x5cc72d('0x45')]:undefined)||''}];case'clock':return[{'name':_0x5cc72d('0x1a'),'value':_0x3e7d39[_0x5cc72d('0x1a')]||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39[_0x5cc72d('0x48')][0x0]?_0x3e7d39[_0x5cc72d('0x48')][0x0][_0x5cc72d('0x45')]:undefined)||_0x5cc72d('0x4d')},{'name':_0x5cc72d('0x25'),'value':_0x3e7d39[_0x5cc72d('0x25')]||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39['attrs'][0x1]?_0x3e7d39[_0x5cc72d('0x48')][0x1][_0x5cc72d('0x45')]:undefined)||_0x5cc72d('0x3b')},{'name':_0x5cc72d('0x46'),'value':_0x3e7d39['attrFontSize']||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39[_0x5cc72d('0x48')][0x2]?_0x3e7d39['attrs'][0x2][_0x5cc72d('0x45')]:undefined)||0xc}];case _0x5cc72d('0xd'):return[{'name':_0x5cc72d('0x8'),'value':_0x3e7d39[_0x5cc72d('0x8')]||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39[_0x5cc72d('0x48')][0x0]?_0x3e7d39[_0x5cc72d('0x48')][0x0][_0x5cc72d('0x45')]:undefined)||'total'},{'name':_0x5cc72d('0x34'),'value':_0x3e7d39[_0x5cc72d('0x34')]||(_0x3e7d39['attrs']&&_0x3e7d39['attrs'][0x1]?_0x3e7d39[_0x5cc72d('0x48')][0x1][_0x5cc72d('0x45')]:undefined)||[]},{'name':_0x5cc72d('0x46'),'value':_0x3e7d39['attrFontSize']||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39[_0x5cc72d('0x48')][0x2]?_0x3e7d39['attrs'][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x5cc72d('0x4c'):return[{'name':'attrSerie1','value':_0x3e7d39['attrSerie1']||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39[_0x5cc72d('0x48')][0x0]?_0x3e7d39[_0x5cc72d('0x48')][0x0][_0x5cc72d('0x45')]:undefined)||'total'},{'name':_0x5cc72d('0x28'),'value':_0x3e7d39[_0x5cc72d('0x28')]||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39[_0x5cc72d('0x48')][0x1]?_0x3e7d39[_0x5cc72d('0x48')][0x1]['value']:undefined)||null},{'name':_0x5cc72d('0x43'),'value':_0x3e7d39['attrSerie3']||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39[_0x5cc72d('0x48')][0x2]?_0x3e7d39[_0x5cc72d('0x48')][0x2][_0x5cc72d('0x45')]:undefined)||null},{'name':_0x5cc72d('0x34'),'value':_0x3e7d39[_0x5cc72d('0x34')]||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39[_0x5cc72d('0x48')][0x3]?_0x3e7d39[_0x5cc72d('0x48')][0x3]['value']:undefined)||[]}];case _0x5cc72d('0x44'):return[{'name':_0x5cc72d('0x47'),'type':_0x3e7d39[_0x5cc72d('0x3d')]||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39['attrs'][0x0]?_0x3e7d39[_0x5cc72d('0x48')][0x0][_0x5cc72d('0x32')]:undefined)||null,'value':_0x3e7d39[_0x5cc72d('0x47')]||(_0x3e7d39[_0x5cc72d('0x48')]&&_0x3e7d39['attrs'][0x0]?_0x3e7d39['attrs'][0x0][_0x5cc72d('0x45')]:undefined)||null},{'name':_0x5cc72d('0x26'),'value':_0x3e7d39['attrRefresh']||(_0x3e7d39['attrs']&&_0x3e7d39[_0x5cc72d('0x48')][0x1]?_0x3e7d39['attrs'][0x1][_0x5cc72d('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x6971f4){return logger[_0x5cc72d('0x59')]('widgetAttributes:\x20%s',JSON[_0x5cc72d('0x3')](_0x6971f4)),[];}}exports[_0x2058e9('0x41')]=function(_0xf3c14b,_0x41e93d){const _0x4eabe8=_0x2058e9;return _0xf3c14b[_0x4eabe8('0x30')]['id']&&delete _0xf3c14b['body']['id'],db[_0x4eabe8('0x4b')][_0x4eabe8('0x5a')]({'where':{'id':_0xf3c14b[_0x4eabe8('0x31')]['id']}})['then'](handleEntityNotFound(_0x41e93d,null))[_0x4eabe8('0x1f')](function(_0x35b94c){const _0x166f95=_0x4eabe8;if(_0x35b94c)return _0xf3c14b[_0x166f95('0x30')]['DashboardId']=_0x35b94c['id'],_0xf3c14b[_0x166f95('0x30')][_0x166f95('0x48')]=widgetAttributes(_0xf3c14b['body']),db[_0x166f95('0x33')]['create'](_0xf3c14b[_0x166f95('0x30')]);})[_0x4eabe8('0x1f')](respondWithResult(_0x41e93d,null))[_0x4eabe8('0x5')](handleError(_0x41e93d,null));},exports[_0x2058e9('0x57')]=function(_0xe97df8,_0x4f7f8b){const _0x4bb60f=_0x2058e9;let _0x233f19={};const _0x16a2ff={};let _0x4354ce,_0x433f4c;return db[_0x4bb60f('0x4b')][_0x4bb60f('0x5a')]({'where':{'id':_0xe97df8['params']['id']}})[_0x4bb60f('0x1f')](handleEntityNotFound(_0x4f7f8b,null))[_0x4bb60f('0x1f')](function(_0x8e6b24){const _0x4d2c60=_0x4bb60f;if(_0x8e6b24)return _0x4354ce=_0x8e6b24,_0x16a2ff[_0x4d2c60('0x27')]=_['keys'](db['DashboardItem'][_0x4d2c60('0x29')]),_0x16a2ff[_0x4d2c60('0x52')]=_[_0x4d2c60('0x56')](_0xe97df8[_0x4d2c60('0x52')]),_0x16a2ff['filters']=_['intersection'](_0x16a2ff[_0x4d2c60('0x27')],_0x16a2ff[_0x4d2c60('0x52')]),_0x233f19[_0x4d2c60('0x39')]=_[_0x4d2c60('0x15')](_0x16a2ff['model'],qs[_0x4d2c60('0x22')](_0xe97df8['query']['fields'])),_0x233f19['attributes']=_0x233f19[_0x4d2c60('0x39')][_0x4d2c60('0x2d')]?_0x233f19[_0x4d2c60('0x39')]:_0x16a2ff[_0x4d2c60('0x27')],_0x233f19[_0x4d2c60('0x16')]=qs['sort'](_0xe97df8[_0x4d2c60('0x52')][_0x4d2c60('0x53')]),_0x233f19[_0x4d2c60('0x1')]=qs[_0x4d2c60('0xb')](_['pick'](_0xe97df8['query'],_0x16a2ff[_0x4d2c60('0xb')])),_0xe97df8[_0x4d2c60('0x52')][_0x4d2c60('0x2c')]&&(_0x233f19['where']=_['merge'](_0x233f19['where'],{[Op['or']]:_[_0x4d2c60('0x2')](_0x233f19[_0x4d2c60('0x39')],function(_0x413498){const _0x3a6866=_0x4d2c60,_0x258de2={};return _0x258de2[_0x413498]={[Op[_0x3a6866('0x20')]]:'%'+_0xe97df8[_0x3a6866('0x52')][_0x3a6866('0x2c')]+'%'},_0x258de2;})})),_0x233f19=_[_0x4d2c60('0x11')]({},_0x233f19,_0xe97df8[_0x4d2c60('0x1c')]),_0x4354ce['getItems'](_0x233f19);})[_0x4bb60f('0x1f')](function(_0x2b0788){const _0x3c4591=_0x4bb60f;if(_0x2b0788)return _0x433f4c=_0x2b0788[_0x3c4591('0x2d')],typeof _0xe97df8[_0x3c4591('0x52')][_0x3c4591('0x5b')]==='undefined'&&(_0x233f19['limit']=qs['limit'](_0xe97df8[_0x3c4591('0x52')][_0x3c4591('0x4f')]),_0x233f19[_0x3c4591('0x6')]=qs[_0x3c4591('0x6')](_0xe97df8[_0x3c4591('0x52')][_0x3c4591('0x6')])),_0x4354ce[_0x3c4591('0x57')](_0x233f19);})[_0x4bb60f('0x1f')](function(_0x3d00c3){if(_0x3d00c3)return _0x3d00c3?{'count':_0x433f4c,'rows':_0x3d00c3}:null;})[_0x4bb60f('0x1f')](respondWithResult(_0x4f7f8b,null))[_0x4bb60f('0x5')](handleError(_0x4f7f8b,null));};
\ No newline at end of file
+const a168_0x141c=['like','findOne','options','status','attributes','attrMetric','register','autoAssociation','send','query','intersection','stringify','addItem','attrSerie2','iframe','Unable\x20to\x20retrieve\x20the\x20current\x20user','undefined','fieldName','createdAt','nolimit','attrUrl','create','../../config/logger','attrHourFormat','get','user','clock','total','DashboardItem','set','../../mysqldb','clone','sequelize','includeAll','multibar-chart','update','pie-chart','attrFontSize','0.00','attrSerie3','api','role','findAll','index','offset','include','length','params','attrSerie1','then','filter','key','attrs','../../components/parsers/qs','attrPath','map','attrTimezone','count','attrReport','name','rows','attrVoiceQueues','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getItems','sort','keys','destroy','CustomDashboards','limit','pick','../../rediscache','sendStatus','show','lodash','type','VIRTUAL','attrRefresh','value','stack','Content-Range','json','userProfileId','Dashboard','fields','filters','model','UserProfileSection','https://','end','error','updatedAt','merge','catch','body','counter','omit','where','UserProfileResource','web-report','rawAttributes','reportType','order'];(function(_0x1bdbd2,_0x141c2b){const _0x3ee4ec=function(_0xd7c9aa){while(--_0xd7c9aa){_0x1bdbd2['push'](_0x1bdbd2['shift']());}};_0x3ee4ec(++_0x141c2b);}(a168_0x141c,0xb1));const a168_0x3ee4=function(_0x1bdbd2,_0x141c2b){_0x1bdbd2=_0x1bdbd2-0x0;let _0x3ee4ec=a168_0x141c[_0x1bdbd2];return _0x3ee4ec;};const _0x23dbe6=a168_0x3ee4;'use strict';const _=require(_0x23dbe6('0x64')),qs=require(_0x23dbe6('0x50')),logger=require(_0x23dbe6('0x31'))(_0x23dbe6('0x43')),{getSocket}=require(_0x23dbe6('0x61')),socket=getSocket(),db=require(_0x23dbe6('0x39'))['db'],{Op}=require(_0x23dbe6('0x3b'));require('./dashboard.socket')[_0x23dbe6('0x21')](socket);function respondWithResult(_0xd7c9aa,_0x2d4c45){return _0x2d4c45=_0x2d4c45||0xc8,function(_0x4af027){const _0x2c5071=a168_0x3ee4;if(_0x4af027)return _0xd7c9aa[_0x2c5071('0x1e')](_0x2d4c45)[_0x2c5071('0x5')](_0x4af027);};}function respondWithFilteredResult(_0x3e9b13,_0x4e60b4){return function(_0x22764f){const _0x6f3a8b=a168_0x3ee4;if(_0x22764f){const _0x55e6e4=_0x22764f[_0x6f3a8b('0x54')],_0x188b5a=_0x4e60b4[_0x6f3a8b('0x47')];let _0x3adbde=_0x4e60b4[_0x6f3a8b('0x47')]+_0x4e60b4[_0x6f3a8b('0x5f')],_0x149d08;return _0x3adbde>=_0x55e6e4?(_0x3adbde=_0x55e6e4,_0x149d08=0xc8):_0x149d08=0xce,_0x3e9b13[_0x6f3a8b('0x1e')](_0x149d08),_0x3e9b13[_0x6f3a8b('0x38')](_0x6f3a8b('0x4'),_0x188b5a+'-'+_0x3adbde+'/'+_0x55e6e4)['json'](_0x22764f);}return null;};}function saveUpdates(_0x4da8ae){return function(_0x269c06){const _0x4170b2=a168_0x3ee4;if(_0x269c06)return _0x269c06[_0x4170b2('0x3e')](_0x4da8ae)[_0x4170b2('0x4c')](function(_0x272032){return _0x272032;});return null;};}function removeEntity(_0x3478b6){return function(_0x327590){const _0x1b24f6=a168_0x3ee4;if(_0x327590)return _0x327590[_0x1b24f6('0x5d')]()[_0x1b24f6('0x4c')](function(){const _0x327552=_0x1b24f6,_0x4efa9f=_0x327590[_0x327552('0x33')]({'plain':!![]}),_0x37c21c='CustomDashboards';return db[_0x327552('0x16')]['destroy']({'where':{'type':_0x37c21c,'resourceId':_0x4efa9f['id']}})[_0x327552('0x4c')](function(){return _0x327590;});})['then'](function(){const _0x4cf9af=_0x1b24f6;_0x3478b6[_0x4cf9af('0x1e')](0xcc)[_0x4cf9af('0xd')]();});};}function handleEntityNotFound(_0x5bfa18){return function(_0x501f9e){const _0x48b913=a168_0x3ee4;return!_0x501f9e&&_0x5bfa18[_0x48b913('0x62')](0x194),_0x501f9e;};}function handleError(_0x1f35e5,_0x1e54a1){return _0x1e54a1=_0x1e54a1||0x1f4,function(_0x29e92a){const _0x26d50c=a168_0x3ee4;logger[_0x26d50c('0xe')](_0x29e92a[_0x26d50c('0x3')]),_0x29e92a[_0x26d50c('0x56')]&&delete _0x29e92a[_0x26d50c('0x56')],_0x1f35e5['status'](_0x1e54a1)[_0x26d50c('0x23')](_0x29e92a);};}exports[_0x23dbe6('0x46')]=function(_0x4dfdd1,_0x5939b3){const _0x4be539=_0x23dbe6;let _0x3e4c27={};const _0x38a6af={},_0x18177d={'count':0x0,'rows':[]},_0x57936a=_[_0x4be539('0x52')](db['Dashboard']['rawAttributes'],function(_0x17b976){const _0x412751=_0x4be539;return{'name':_0x17b976[_0x412751('0x2c')],'type':_0x17b976[_0x412751('0x65')][_0x412751('0x4e')]};});_0x38a6af['model']=_['map'](_0x57936a,_0x4be539('0x56')),_0x38a6af[_0x4be539('0x24')]=_['keys'](_0x4dfdd1[_0x4be539('0x24')]),_0x38a6af[_0x4be539('0x9')]=_[_0x4be539('0x25')](_0x38a6af[_0x4be539('0xa')],_0x38a6af[_0x4be539('0x24')]),_0x3e4c27['attributes']=_['intersection'](_0x38a6af[_0x4be539('0xa')],qs[_0x4be539('0x8')](_0x4dfdd1[_0x4be539('0x24')][_0x4be539('0x8')])),_0x3e4c27[_0x4be539('0x1f')]=_0x3e4c27[_0x4be539('0x1f')][_0x4be539('0x49')]?_0x3e4c27[_0x4be539('0x1f')]:_0x38a6af[_0x4be539('0xa')];typeof _0x4dfdd1['query'][_0x4be539('0x2e')]===_0x4be539('0x2b')&&(_0x3e4c27[_0x4be539('0x5f')]=qs[_0x4be539('0x5f')](_0x4dfdd1[_0x4be539('0x24')]['limit']),_0x3e4c27[_0x4be539('0x47')]=qs['offset'](_0x4dfdd1[_0x4be539('0x24')]['offset']));_0x3e4c27[_0x4be539('0x1a')]=qs[_0x4be539('0x5b')](_0x4dfdd1[_0x4be539('0x24')][_0x4be539('0x5b')]),_0x3e4c27[_0x4be539('0x15')]=qs['filters'](_[_0x4be539('0x60')](_0x4dfdd1[_0x4be539('0x24')],_0x38a6af[_0x4be539('0x9')]),_0x57936a);_0x4dfdd1['query'][_0x4be539('0x4d')]&&(_0x3e4c27[_0x4be539('0x15')]=_[_0x4be539('0x10')](_0x3e4c27['where'],{[Op['or']]:_[_0x4be539('0x52')](_0x57936a,function(_0x1f51ed){const _0x2e7c49=_0x4be539;if(_0x1f51ed[_0x2e7c49('0x65')]!==_0x2e7c49('0x0')){const _0x30cf35={};return _0x30cf35[_0x1f51ed[_0x2e7c49('0x56')]]={[Op[_0x2e7c49('0x1b')]]:'%'+_0x4dfdd1[_0x2e7c49('0x24')][_0x2e7c49('0x4d')]+'%'},_0x30cf35;}})}));_0x3e4c27=_[_0x4be539('0x10')]({},_0x3e4c27,_0x4dfdd1[_0x4be539('0x1d')]);const _0x11d27a={'where':_0x3e4c27[_0x4be539('0x15')]};return db[_0x4be539('0x7')][_0x4be539('0x54')](_0x11d27a)[_0x4be539('0x4c')](function(_0x2185cf){const _0x45f365=_0x4be539;return _0x18177d[_0x45f365('0x54')]=_0x2185cf,_0x4dfdd1[_0x45f365('0x24')][_0x45f365('0x3c')]&&(_0x3e4c27[_0x45f365('0x48')]=[{'all':!![]}]),db['Dashboard'][_0x45f365('0x45')](_0x3e4c27);})[_0x4be539('0x4c')](function(_0x1f3ebe){const _0x5c3bf7=_0x4be539;return _0x18177d[_0x5c3bf7('0x57')]=_0x1f3ebe,_0x18177d;})[_0x4be539('0x4c')](respondWithFilteredResult(_0x5939b3,_0x3e4c27))[_0x4be539('0x11')](handleError(_0x5939b3,null));},exports[_0x23dbe6('0x63')]=function(_0x2b2cbc,_0x3b2677){const _0x55fa53=_0x23dbe6;let _0x1c9020={'raw':![],'where':{'id':_0x2b2cbc[_0x55fa53('0x4a')]['id']}};const _0x42a3fe={};return _0x42a3fe['model']=_[_0x55fa53('0x5c')](db['Dashboard'][_0x55fa53('0x18')]),_0x42a3fe[_0x55fa53('0x24')]=_[_0x55fa53('0x5c')](_0x2b2cbc[_0x55fa53('0x24')]),_0x42a3fe['filters']=_[_0x55fa53('0x25')](_0x42a3fe[_0x55fa53('0xa')],_0x42a3fe['query']),_0x1c9020[_0x55fa53('0x1f')]=_[_0x55fa53('0x25')](_0x42a3fe['model'],qs[_0x55fa53('0x8')](_0x2b2cbc[_0x55fa53('0x24')]['fields'])),_0x1c9020[_0x55fa53('0x1f')]=_0x1c9020[_0x55fa53('0x1f')][_0x55fa53('0x49')]?_0x1c9020['attributes']:_0x42a3fe[_0x55fa53('0xa')],_0x2b2cbc[_0x55fa53('0x24')]['includeAll']&&(_0x1c9020[_0x55fa53('0x48')]=[{'all':!![]}]),_0x1c9020=_[_0x55fa53('0x10')]({},_0x1c9020,_0x2b2cbc[_0x55fa53('0x1d')]),db[_0x55fa53('0x7')][_0x55fa53('0x1c')](_0x1c9020)[_0x55fa53('0x4c')](handleEntityNotFound(_0x3b2677,null))[_0x55fa53('0x4c')](respondWithResult(_0x3b2677,null))[_0x55fa53('0x11')](handleError(_0x3b2677,null));},exports[_0x23dbe6('0x30')]=function(_0xf843d,_0x50275f){const _0x1ea572=_0x23dbe6;return db[_0x1ea572('0x7')][_0x1ea572('0x30')](_0xf843d[_0x1ea572('0x12')],{})[_0x1ea572('0x4c')](function(_0xecee52){const _0x177c8a=_0x1ea572,_0x3cf8a3=_0xf843d[_0x177c8a('0x34')]['get']({'plain':!![]});if(!_0x3cf8a3)throw new Error(_0x177c8a('0x2a'));if(_0x3cf8a3[_0x177c8a('0x44')]===_0x177c8a('0x34')){const _0xfea817=_0xecee52[_0x177c8a('0x33')]({'plain':!![]}),_0x4288b8='CustomDashboards';return db[_0x177c8a('0xb')][_0x177c8a('0x1c')]({'where':{'name':_0x4288b8,'userProfileId':_0x3cf8a3['userProfileId']},'raw':!![]})['then'](function(_0x205632){const _0x27660f=_0x177c8a;return _0x205632&&_0x205632[_0x27660f('0x22')]===0x0?db[_0x27660f('0x16')][_0x27660f('0x30')]({'name':_0xfea817[_0x27660f('0x56')],'resourceId':_0xfea817['id'],'type':_0x205632[_0x27660f('0x56')],'sectionId':_0x205632['id']},{})['then'](function(){return _0xecee52;}):_0xecee52;})[_0x177c8a('0x11')](function(_0x31ca03){const _0x2751ee=_0x177c8a;logger[_0x2751ee('0xe')](_0x2751ee('0x59'),_0x31ca03);throw _0x31ca03;});}return _0xecee52;})[_0x1ea572('0x4c')](respondWithResult(_0x50275f,0xc9))['catch'](handleError(_0x50275f,null));},exports[_0x23dbe6('0x3a')]=function(_0x3b814c,_0x2ac268){const _0x49ab99=_0x23dbe6;let _0x441c68={'where':{'id':_0x3b814c['params']['id']}};const _0x565aa0={};return _0x565aa0[_0x49ab99('0xa')]=_[_0x49ab99('0x5c')](db[_0x49ab99('0x7')]['rawAttributes']),_0x441c68[_0x49ab99('0x1f')]=_[_0x49ab99('0x25')](_0x565aa0[_0x49ab99('0xa')],qs[_0x49ab99('0x8')](_0x3b814c[_0x49ab99('0x24')]['fields'])),_0x441c68[_0x49ab99('0x1f')]=_0x441c68[_0x49ab99('0x1f')][_0x49ab99('0x49')]?_0x441c68[_0x49ab99('0x1f')]:_0x565aa0[_0x49ab99('0xa')],_0x3b814c[_0x49ab99('0x24')]['includeAll']&&(_0x441c68['include']=[{'all':!![]}]),_0x441c68=_[_0x49ab99('0x10')]({},_0x441c68,_0x3b814c['options']),db[_0x49ab99('0x7')][_0x49ab99('0x1c')](_0x441c68)[_0x49ab99('0x4c')](handleEntityNotFound(_0x2ac268,null))[_0x49ab99('0x4c')](function(_0x5e802d){const _0x1e6acb=_0x49ab99;if(_0x5e802d){let _0xeacdc2=_0x5e802d[_0x1e6acb('0x33')]({'plain':!![]});return _0xeacdc2=qs[_0x1e6acb('0x14')](_0xeacdc2,['id',_0x1e6acb('0x2d'),'updatedAt']),_0x3b814c[_0x1e6acb('0x12')]=_[_0x1e6acb('0x14')](_0x3b814c[_0x1e6acb('0x12')],['id','createdAt',_0x1e6acb('0xf')]),db[_0x1e6acb('0x7')][_0x1e6acb('0x30')](_['merge'](_0xeacdc2,_0x3b814c[_0x1e6acb('0x12')]),{'include':_0x3b814c[_0x1e6acb('0x24')][_0x1e6acb('0x3c')]?[{'all':!![]}]:undefined})['then'](function(_0x1ad30f){const _0xf20407=_0x1e6acb,_0x49dcbc=_0x3b814c[_0xf20407('0x34')][_0xf20407('0x33')]({'plain':!![]});if(!_0x49dcbc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49dcbc[_0xf20407('0x44')]===_0xf20407('0x34')){const _0x2501a1=_0x1ad30f['get']({'plain':!![]}),_0x1a8d17=_0xf20407('0x5e');return db['UserProfileSection'][_0xf20407('0x1c')]({'where':{'name':_0x1a8d17,'userProfileId':_0x49dcbc[_0xf20407('0x6')]},'raw':!![]})['then'](function(_0x3b8c12){const _0x43e1ea=_0xf20407;return _0x3b8c12&&_0x3b8c12[_0x43e1ea('0x22')]===0x0?db[_0x43e1ea('0x16')][_0x43e1ea('0x30')]({'name':_0x2501a1[_0x43e1ea('0x56')],'resourceId':_0x2501a1['id'],'type':_0x3b8c12['name'],'sectionId':_0x3b8c12['id']},{})[_0x43e1ea('0x4c')](function(){return _0x1ad30f;}):_0x1ad30f;})[_0xf20407('0x11')](function(_0x1eb7f7){const _0x410467=_0xf20407;logger[_0x410467('0xe')](_0x410467('0x59'),_0x1eb7f7);throw _0x1eb7f7;});}return _0x1ad30f;});}})[_0x49ab99('0x4c')](respondWithResult(_0x2ac268,0xc9))['catch'](handleError(_0x2ac268,null));},exports['update']=function(_0x483aa3,_0xd61a16){const _0x3d3785=_0x23dbe6;return _0x483aa3[_0x3d3785('0x12')]['id']&&delete _0x483aa3[_0x3d3785('0x12')]['id'],db['Dashboard'][_0x3d3785('0x1c')]({'where':{'id':_0x483aa3[_0x3d3785('0x4a')]['id']}})[_0x3d3785('0x4c')](handleEntityNotFound(_0xd61a16,null))[_0x3d3785('0x4c')](saveUpdates(_0x483aa3['body'],null))[_0x3d3785('0x4c')](respondWithResult(_0xd61a16,null))[_0x3d3785('0x11')](handleError(_0xd61a16,null));},exports['destroy']=function(_0x9f1204,_0x4e4f6){const _0x570ea5=_0x23dbe6;return db[_0x570ea5('0x7')][_0x570ea5('0x1c')]({'where':{'id':_0x9f1204[_0x570ea5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4e4f6,null))['then'](removeEntity(_0x4e4f6,null))[_0x570ea5('0x11')](handleError(_0x4e4f6,null));};function widgetAttributes(_0x4605bf){const _0x3e1633=_0x23dbe6;try{switch(_0x4605bf[_0x3e1633('0x65')]){case _0x3e1633('0x29'):return[{'name':_0x3e1633('0x2f'),'value':_0x4605bf['attrUrl']||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf[_0x3e1633('0x4f')][0x0]?_0x4605bf[_0x3e1633('0x4f')][0x0][_0x3e1633('0x2')]:undefined)||_0x3e1633('0xc')}];case'custom':return[{'name':'attrPath','value':_0x4605bf[_0x3e1633('0x51')]||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf[_0x3e1633('0x4f')][0x0]?_0x4605bf['attrs'][0x0][_0x3e1633('0x2')]:undefined)||''}];case _0x3e1633('0x35'):return[{'name':_0x3e1633('0x32'),'value':_0x4605bf[_0x3e1633('0x32')]||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf[_0x3e1633('0x4f')][0x0]?_0x4605bf['attrs'][0x0][_0x3e1633('0x2')]:undefined)||'HH:mm:ss'},{'name':_0x3e1633('0x53'),'value':_0x4605bf['attrTimezone']||(_0x4605bf['attrs']&&_0x4605bf[_0x3e1633('0x4f')][0x1]?_0x4605bf['attrs'][0x1][_0x3e1633('0x2')]:undefined)||_0x3e1633('0x41')},{'name':_0x3e1633('0x40'),'value':_0x4605bf[_0x3e1633('0x40')]||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf[_0x3e1633('0x4f')][0x2]?_0x4605bf[_0x3e1633('0x4f')][0x2][_0x3e1633('0x2')]:undefined)||0xc}];case _0x3e1633('0x13'):return[{'name':_0x3e1633('0x20'),'value':_0x4605bf['attrMetric']||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf['attrs'][0x0]?_0x4605bf[_0x3e1633('0x4f')][0x0][_0x3e1633('0x2')]:undefined)||_0x3e1633('0x36')},{'name':_0x3e1633('0x58'),'value':_0x4605bf['attrVoiceQueues']||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf[_0x3e1633('0x4f')][0x1]?_0x4605bf[_0x3e1633('0x4f')][0x1][_0x3e1633('0x2')]:undefined)||[]},{'name':_0x3e1633('0x40'),'value':_0x4605bf[_0x3e1633('0x40')]||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf[_0x3e1633('0x4f')][0x2]?_0x4605bf[_0x3e1633('0x4f')][0x2][_0x3e1633('0x2')]:undefined)||0x14}];case _0x3e1633('0x3d'):case _0x3e1633('0x3f'):return[{'name':_0x3e1633('0x4b'),'value':_0x4605bf['attrSerie1']||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf[_0x3e1633('0x4f')][0x0]?_0x4605bf[_0x3e1633('0x4f')][0x0][_0x3e1633('0x2')]:undefined)||_0x3e1633('0x36')},{'name':_0x3e1633('0x28'),'value':_0x4605bf[_0x3e1633('0x28')]||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf[_0x3e1633('0x4f')][0x1]?_0x4605bf['attrs'][0x1][_0x3e1633('0x2')]:undefined)||null},{'name':_0x3e1633('0x42'),'value':_0x4605bf[_0x3e1633('0x42')]||(_0x4605bf['attrs']&&_0x4605bf[_0x3e1633('0x4f')][0x2]?_0x4605bf[_0x3e1633('0x4f')][0x2][_0x3e1633('0x2')]:undefined)||null},{'name':_0x3e1633('0x58'),'value':_0x4605bf['attrVoiceQueues']||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf[_0x3e1633('0x4f')][0x3]?_0x4605bf[_0x3e1633('0x4f')][0x3]['value']:undefined)||[]}];case _0x3e1633('0x17'):return[{'name':_0x3e1633('0x55'),'type':_0x4605bf[_0x3e1633('0x19')]||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf[_0x3e1633('0x4f')][0x0]?_0x4605bf['attrs'][0x0][_0x3e1633('0x65')]:undefined)||null,'value':_0x4605bf[_0x3e1633('0x55')]||(_0x4605bf['attrs']&&_0x4605bf['attrs'][0x0]?_0x4605bf[_0x3e1633('0x4f')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x4605bf[_0x3e1633('0x1')]||(_0x4605bf[_0x3e1633('0x4f')]&&_0x4605bf[_0x3e1633('0x4f')][0x1]?_0x4605bf[_0x3e1633('0x4f')][0x1][_0x3e1633('0x2')]:undefined)||0x0}];default:return[];}}catch(_0x3c16d5){return logger[_0x3e1633('0xe')]('widgetAttributes:\x20%s',JSON[_0x3e1633('0x26')](_0x3c16d5)),[];}}exports[_0x23dbe6('0x27')]=function(_0x534257,_0x32defb){const _0x38ae24=_0x23dbe6;return _0x534257[_0x38ae24('0x12')]['id']&&delete _0x534257['body']['id'],db[_0x38ae24('0x7')][_0x38ae24('0x1c')]({'where':{'id':_0x534257[_0x38ae24('0x4a')]['id']}})[_0x38ae24('0x4c')](handleEntityNotFound(_0x32defb,null))[_0x38ae24('0x4c')](function(_0x4e0671){const _0x377b36=_0x38ae24;if(_0x4e0671)return _0x534257[_0x377b36('0x12')]['DashboardId']=_0x4e0671['id'],_0x534257[_0x377b36('0x12')][_0x377b36('0x4f')]=widgetAttributes(_0x534257[_0x377b36('0x12')]),db[_0x377b36('0x37')][_0x377b36('0x30')](_0x534257[_0x377b36('0x12')]);})[_0x38ae24('0x4c')](respondWithResult(_0x32defb,null))[_0x38ae24('0x11')](handleError(_0x32defb,null));},exports[_0x23dbe6('0x5a')]=function(_0x3c9cf9,_0x249c05){const _0x265ea1=_0x23dbe6;let _0x4ccbdc={};const _0x801fd2={};let _0x591cd3,_0xe037bb;return db[_0x265ea1('0x7')][_0x265ea1('0x1c')]({'where':{'id':_0x3c9cf9[_0x265ea1('0x4a')]['id']}})[_0x265ea1('0x4c')](handleEntityNotFound(_0x249c05,null))['then'](function(_0xab44e0){const _0x3951cf=_0x265ea1;if(_0xab44e0)return _0x591cd3=_0xab44e0,_0x801fd2['model']=_[_0x3951cf('0x5c')](db['DashboardItem'][_0x3951cf('0x18')]),_0x801fd2[_0x3951cf('0x24')]=_[_0x3951cf('0x5c')](_0x3c9cf9[_0x3951cf('0x24')]),_0x801fd2[_0x3951cf('0x9')]=_[_0x3951cf('0x25')](_0x801fd2[_0x3951cf('0xa')],_0x801fd2[_0x3951cf('0x24')]),_0x4ccbdc['attributes']=_[_0x3951cf('0x25')](_0x801fd2['model'],qs[_0x3951cf('0x8')](_0x3c9cf9[_0x3951cf('0x24')][_0x3951cf('0x8')])),_0x4ccbdc['attributes']=_0x4ccbdc['attributes'][_0x3951cf('0x49')]?_0x4ccbdc[_0x3951cf('0x1f')]:_0x801fd2['model'],_0x4ccbdc['order']=qs[_0x3951cf('0x5b')](_0x3c9cf9['query'][_0x3951cf('0x5b')]),_0x4ccbdc['where']=qs['filters'](_['pick'](_0x3c9cf9[_0x3951cf('0x24')],_0x801fd2[_0x3951cf('0x9')])),_0x3c9cf9[_0x3951cf('0x24')]['filter']&&(_0x4ccbdc[_0x3951cf('0x15')]=_[_0x3951cf('0x10')](_0x4ccbdc[_0x3951cf('0x15')],{[Op['or']]:_['map'](_0x4ccbdc[_0x3951cf('0x1f')],function(_0x2221f7){const _0x30abbd=_0x3951cf,_0x417ca8={};return _0x417ca8[_0x2221f7]={[Op[_0x30abbd('0x1b')]]:'%'+_0x3c9cf9[_0x30abbd('0x24')][_0x30abbd('0x4d')]+'%'},_0x417ca8;})})),_0x4ccbdc=_[_0x3951cf('0x10')]({},_0x4ccbdc,_0x3c9cf9[_0x3951cf('0x1d')]),_0x591cd3[_0x3951cf('0x5a')](_0x4ccbdc);})[_0x265ea1('0x4c')](function(_0xc51d1c){const _0x380ff0=_0x265ea1;if(_0xc51d1c)return _0xe037bb=_0xc51d1c['length'],typeof _0x3c9cf9[_0x380ff0('0x24')][_0x380ff0('0x2e')]===_0x380ff0('0x2b')&&(_0x4ccbdc[_0x380ff0('0x5f')]=qs['limit'](_0x3c9cf9[_0x380ff0('0x24')]['limit']),_0x4ccbdc[_0x380ff0('0x47')]=qs[_0x380ff0('0x47')](_0x3c9cf9['query']['offset'])),_0x591cd3[_0x380ff0('0x5a')](_0x4ccbdc);})[_0x265ea1('0x4c')](function(_0x529541){if(_0x529541)return _0x529541?{'count':_0xe037bb,'rows':_0x529541}:null;})[_0x265ea1('0x4c')](respondWithResult(_0x249c05,null))[_0x265ea1('0x11')](handleError(_0x249c05,null));};
\ No newline at end of file