18 var _0xa247=['getFields','hasOwnProperty','DeskField','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','ids','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','params','create','body','find'];(function(_0x1a43df,_0x418e74){var _0x444ada=function(_0xb010d0){while(--_0xb010d0){_0x1a43df['push'](_0x1a43df['shift']());}};_0x444ada(++_0x418e74);}(_0xa247,0x1f0));var _0x7a24=function(_0x8999cc,_0x3566db){_0x8999cc=_0x8999cc-0x0;var _0x580467=_0xa247[_0x8999cc];return _0x580467;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7a24('0x0'));var rp=require(_0x7a24('0x1'));var moment=require(_0x7a24('0x2'));var BPromise=require(_0x7a24('0x3'));var Mustache=require(_0x7a24('0x4'));var util=require(_0x7a24('0x5'));var path=require(_0x7a24('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7a24('0x7'));var fs=require('fs');var fs_extra=require(_0x7a24('0x8'));var _=require(_0x7a24('0x9'));var squel=require('squel');var crypto=require(_0x7a24('0xa'));var jsforce=require(_0x7a24('0xb'));var deskjs=require(_0x7a24('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7a24('0xd'));var Papa=require(_0x7a24('0xe'));var Redis=require(_0x7a24('0xf'));var authService=require(_0x7a24('0x10'));var qs=require(_0x7a24('0x11'));var as=require(_0x7a24('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7a24('0x13'));var utils=require(_0x7a24('0x14'));var config=require(_0x7a24('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7a24('0x16'))['db'];function respondWithStatusCode(_0x2e507d,_0x1d6373){_0x1d6373=_0x1d6373||0xcc;return function(_0x1b4d46){if(_0x1b4d46){return _0x2e507d[_0x7a24('0x17')](_0x1d6373);}return _0x2e507d[_0x7a24('0x18')](_0x1d6373)[_0x7a24('0x19')]();};}function respondWithResult(_0x178bf0,_0x3ad673){_0x3ad673=_0x3ad673||0xc8;return function(_0x19dc63){if(_0x19dc63){return _0x178bf0[_0x7a24('0x18')](_0x3ad673)['json'](_0x19dc63);}};}function respondWithFilteredResult(_0x1b81ac,_0x40c768){return function(_0x1a47fa){if(_0x1a47fa){var _0x7f198c=typeof _0x40c768[_0x7a24('0x1a')]===_0x7a24('0x1b')&&typeof _0x40c768[_0x7a24('0x1c')]===_0x7a24('0x1b');var _0x262183=_0x1a47fa[_0x7a24('0x1d')];var _0x5c589d=_0x7f198c?0x0:_0x40c768[_0x7a24('0x1a')];var _0x43b0e4=_0x7f198c?_0x1a47fa['count']:_0x40c768[_0x7a24('0x1a')]+_0x40c768['limit'];var _0x352786;if(_0x43b0e4>=_0x262183){_0x43b0e4=_0x262183;_0x352786=0xc8;}else{_0x352786=0xce;}_0x1b81ac[_0x7a24('0x18')](_0x352786);return _0x1b81ac[_0x7a24('0x1e')]('Content-Range',_0x5c589d+'-'+_0x43b0e4+'/'+_0x262183)['json'](_0x1a47fa);}return null;};}function patchUpdates(_0x1a39ad){return function(_0x292744){try{jsonpatch[_0x7a24('0x1f')](_0x292744,_0x1a39ad,!![]);}catch(_0xe31ea8){return BPromise[_0x7a24('0x20')](_0xe31ea8);}return _0x292744[_0x7a24('0x21')]();};}function saveUpdates(_0x4cb364,_0x2b23af){return function(_0xc2be5b){if(_0xc2be5b){return _0xc2be5b[_0x7a24('0x22')](_0x4cb364)[_0x7a24('0x23')](function(_0x813171){return _0x813171;});}return null;};}function removeEntity(_0x3fd2da,_0x3f2722){return function(_0x441117){if(_0x441117){return _0x441117[_0x7a24('0x24')]()[_0x7a24('0x23')](function(){_0x3fd2da['status'](0xcc)[_0x7a24('0x19')]();});}};}function handleEntityNotFound(_0x19e281,_0x3d4d78){return function(_0x374b74){if(!_0x374b74){_0x19e281[_0x7a24('0x17')](0x194);}return _0x374b74;};}function handleError(_0x31dc27,_0x2bc7bf){_0x2bc7bf=_0x2bc7bf||0x1f4;return function(_0x3d22e){logger[_0x7a24('0x25')](_0x3d22e['stack']);if(_0x3d22e['name']){delete _0x3d22e['name'];}_0x31dc27[_0x7a24('0x18')](_0x2bc7bf)[_0x7a24('0x26')](_0x3d22e);};}exports[_0x7a24('0x27')]=function(_0x4b4fff,_0x1f53a8){var _0x16030a={},_0x513f48={},_0x340200={'count':0x0,'rows':[]};var _0x4abdb2=_[_0x7a24('0x28')](db[_0x7a24('0x29')][_0x7a24('0x2a')],function(_0x39730c){return{'name':_0x39730c[_0x7a24('0x2b')],'type':_0x39730c[_0x7a24('0x2c')][_0x7a24('0x2d')]};});_0x513f48['model']=_[_0x7a24('0x28')](_0x4abdb2,_0x7a24('0x2e'));_0x513f48[_0x7a24('0x2f')]=_[_0x7a24('0x30')](_0x4b4fff[_0x7a24('0x2f')]);_0x513f48[_0x7a24('0x31')]=_[_0x7a24('0x32')](_0x513f48[_0x7a24('0x33')],_0x513f48[_0x7a24('0x2f')]);_0x16030a[_0x7a24('0x34')]=_[_0x7a24('0x32')](_0x513f48['model'],qs[_0x7a24('0x35')](_0x4b4fff['query'][_0x7a24('0x35')]));_0x16030a[_0x7a24('0x34')]=_0x16030a[_0x7a24('0x34')][_0x7a24('0x36')]?_0x16030a[_0x7a24('0x34')]:_0x513f48[_0x7a24('0x33')];if(!_0x4b4fff[_0x7a24('0x2f')]['hasOwnProperty'](_0x7a24('0x37'))){_0x16030a[_0x7a24('0x1c')]=qs[_0x7a24('0x1c')](_0x4b4fff[_0x7a24('0x2f')][_0x7a24('0x1c')]);_0x16030a['offset']=qs[_0x7a24('0x1a')](_0x4b4fff['query']['offset']);}_0x16030a[_0x7a24('0x38')]=qs[_0x7a24('0x39')](_0x4b4fff[_0x7a24('0x2f')]['sort']);_0x16030a[_0x7a24('0x3a')]=qs[_0x7a24('0x31')](_[_0x7a24('0x3b')](_0x4b4fff[_0x7a24('0x2f')],_0x513f48[_0x7a24('0x31')]),_0x4abdb2);if(_0x4b4fff[_0x7a24('0x2f')]['filter']){_0x16030a[_0x7a24('0x3a')]=_[_0x7a24('0x3c')](_0x16030a[_0x7a24('0x3a')],{'$or':_[_0x7a24('0x28')](_0x4abdb2,function(_0x53e964){if(_0x53e964['type']!==_0x7a24('0x3d')){var _0x46a0d1={};_0x46a0d1[_0x53e964[_0x7a24('0x2e')]]={'$like':'%'+_0x4b4fff[_0x7a24('0x2f')][_0x7a24('0x3e')]+'%'};return _0x46a0d1;}})});}_0x16030a=_[_0x7a24('0x3c')]({},_0x16030a,_0x4b4fff[_0x7a24('0x3f')]);var _0x1f8145={'where':_0x16030a[_0x7a24('0x3a')]};return db['DeskConfiguration'][_0x7a24('0x1d')](_0x1f8145)[_0x7a24('0x23')](function(_0x4c96d2){_0x340200[_0x7a24('0x1d')]=_0x4c96d2;if(_0x4b4fff[_0x7a24('0x2f')][_0x7a24('0x40')]){_0x16030a[_0x7a24('0x41')]=[{'all':!![]}];}return db[_0x7a24('0x29')]['findAll'](_0x16030a);})[_0x7a24('0x23')](function(_0x223c1f){_0x340200['rows']=_0x223c1f;return _0x340200;})[_0x7a24('0x23')](respondWithFilteredResult(_0x1f53a8,_0x16030a))[_0x7a24('0x42')](handleError(_0x1f53a8,null));};exports['show']=function(_0x40d6e8,_0x13c195){var _0x389c3d={'raw':![],'where':{'id':_0x40d6e8[_0x7a24('0x43')]['id']}},_0x5dd3fd={};_0x5dd3fd[_0x7a24('0x33')]=_['keys'](db[_0x7a24('0x29')][_0x7a24('0x2a')]);_0x5dd3fd[_0x7a24('0x2f')]=_[_0x7a24('0x30')](_0x40d6e8[_0x7a24('0x2f')]);_0x5dd3fd['filters']=_[_0x7a24('0x32')](_0x5dd3fd['model'],_0x5dd3fd[_0x7a24('0x2f')]);_0x389c3d[_0x7a24('0x34')]=_['intersection'](_0x5dd3fd['model'],qs[_0x7a24('0x35')](_0x40d6e8['query'][_0x7a24('0x35')]));_0x389c3d[_0x7a24('0x34')]=_0x389c3d[_0x7a24('0x34')][_0x7a24('0x36')]?_0x389c3d[_0x7a24('0x34')]:_0x5dd3fd[_0x7a24('0x33')];if(_0x40d6e8['query'][_0x7a24('0x40')]){_0x389c3d['include']=[{'all':!![]}];}_0x389c3d=_[_0x7a24('0x3c')]({},_0x389c3d,_0x40d6e8[_0x7a24('0x3f')]);return db[_0x7a24('0x29')]['find'](_0x389c3d)[_0x7a24('0x23')](handleEntityNotFound(_0x13c195,null))[_0x7a24('0x23')](respondWithResult(_0x13c195,null))[_0x7a24('0x42')](handleError(_0x13c195,null));};exports['create']=function(_0x7c2fe5,_0x1c2ce2){return db[_0x7a24('0x29')][_0x7a24('0x44')](_0x7c2fe5[_0x7a24('0x45')],{})[_0x7a24('0x23')](respondWithResult(_0x1c2ce2,0xc9))[_0x7a24('0x42')](handleError(_0x1c2ce2,null));};exports[_0x7a24('0x22')]=function(_0x3fe723,_0x298444){if(_0x3fe723[_0x7a24('0x45')]['id']){delete _0x3fe723[_0x7a24('0x45')]['id'];}return db[_0x7a24('0x29')][_0x7a24('0x46')]({'where':{'id':_0x3fe723[_0x7a24('0x43')]['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x298444,null))['then'](saveUpdates(_0x3fe723[_0x7a24('0x45')],null))[_0x7a24('0x23')](respondWithResult(_0x298444,null))['catch'](handleError(_0x298444,null));};exports[_0x7a24('0x24')]=function(_0x5a605d,_0x1047f8){return db[_0x7a24('0x29')]['find']({'where':{'id':_0x5a605d['params']['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x1047f8,null))[_0x7a24('0x23')](removeEntity(_0x1047f8,null))['catch'](handleError(_0x1047f8,null));};exports['getFields']=function(_0x44fc6a,_0x49e123,_0x3c7152){var _0x8340ef={};var _0x4d27b3={};var _0x38eba0;var _0x178f70;return db[_0x7a24('0x29')]['findOne']({'where':{'id':_0x44fc6a[_0x7a24('0x43')]['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x49e123,null))[_0x7a24('0x23')](function(_0x4aad54){if(_0x4aad54){_0x38eba0=_0x4aad54;_0x4d27b3[_0x7a24('0x33')]=_[_0x7a24('0x30')](db['DeskField'][_0x7a24('0x2a')]);_0x4d27b3['query']=_[_0x7a24('0x30')](_0x44fc6a[_0x7a24('0x2f')]);_0x4d27b3['filters']=_[_0x7a24('0x32')](_0x4d27b3[_0x7a24('0x33')],_0x4d27b3[_0x7a24('0x2f')]);_0x8340ef[_0x7a24('0x34')]=_['intersection'](_0x4d27b3[_0x7a24('0x33')],qs['fields'](_0x44fc6a[_0x7a24('0x2f')][_0x7a24('0x35')]));_0x8340ef['attributes']=_0x8340ef[_0x7a24('0x34')][_0x7a24('0x36')]?_0x8340ef[_0x7a24('0x34')]:_0x4d27b3[_0x7a24('0x33')];_0x8340ef[_0x7a24('0x38')]=qs[_0x7a24('0x39')](_0x44fc6a[_0x7a24('0x2f')][_0x7a24('0x39')]);_0x8340ef['where']=qs[_0x7a24('0x31')](_[_0x7a24('0x3b')](_0x44fc6a['query'],_0x4d27b3[_0x7a24('0x31')]));if(_0x44fc6a[_0x7a24('0x2f')][_0x7a24('0x3e')]){_0x8340ef[_0x7a24('0x3a')]=_[_0x7a24('0x3c')](_0x8340ef[_0x7a24('0x3a')],{'$or':_[_0x7a24('0x28')](_0x8340ef['attributes'],function(_0x2c919c){var _0x5df5aa={};_0x5df5aa[_0x2c919c]={'$like':'%'+_0x44fc6a[_0x7a24('0x2f')][_0x7a24('0x3e')]+'%'};return _0x5df5aa;})});}_0x8340ef=_[_0x7a24('0x3c')]({},_0x8340ef,_0x44fc6a[_0x7a24('0x3f')]);return _0x38eba0[_0x7a24('0x47')](_0x8340ef);}})[_0x7a24('0x23')](function(_0x5aab0d){if(_0x5aab0d){_0x178f70=_0x5aab0d[_0x7a24('0x36')];if(!_0x44fc6a[_0x7a24('0x2f')][_0x7a24('0x48')](_0x7a24('0x37'))){_0x8340ef[_0x7a24('0x1c')]=qs[_0x7a24('0x1c')](_0x44fc6a[_0x7a24('0x2f')][_0x7a24('0x1c')]);_0x8340ef[_0x7a24('0x1a')]=qs['offset'](_0x44fc6a['query']['offset']);}return _0x38eba0['getFields'](_0x8340ef);}})[_0x7a24('0x23')](function(_0xf1500d){if(_0xf1500d){return _0xf1500d?{'count':_0x178f70,'rows':_0xf1500d}:null;}})[_0x7a24('0x23')](respondWithResult(_0x49e123,null))[_0x7a24('0x42')](handleError(_0x49e123,null));};exports['getSubjects']=function(_0x5c4090,_0x258fa5,_0x1b5956){var _0x135181={};var _0x58946c={};var _0x2f6a23;var _0x44aefc;return db[_0x7a24('0x29')]['findOne']({'where':{'id':_0x5c4090['params']['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x258fa5,null))[_0x7a24('0x23')](function(_0x134ad4){if(_0x134ad4){_0x2f6a23=_0x134ad4;_0x58946c[_0x7a24('0x33')]=_[_0x7a24('0x30')](db[_0x7a24('0x49')][_0x7a24('0x2a')]);_0x58946c[_0x7a24('0x2f')]=_[_0x7a24('0x30')](_0x5c4090[_0x7a24('0x2f')]);_0x58946c[_0x7a24('0x31')]=_[_0x7a24('0x32')](_0x58946c[_0x7a24('0x33')],_0x58946c['query']);_0x135181[_0x7a24('0x34')]=_[_0x7a24('0x32')](_0x58946c[_0x7a24('0x33')],qs[_0x7a24('0x35')](_0x5c4090[_0x7a24('0x2f')]['fields']));_0x135181[_0x7a24('0x34')]=_0x135181['attributes'][_0x7a24('0x36')]?_0x135181[_0x7a24('0x34')]:_0x58946c[_0x7a24('0x33')];_0x135181[_0x7a24('0x38')]=qs['sort'](_0x5c4090['query'][_0x7a24('0x39')]);_0x135181['where']=qs[_0x7a24('0x31')](_[_0x7a24('0x3b')](_0x5c4090[_0x7a24('0x2f')],_0x58946c['filters']));if(_0x5c4090[_0x7a24('0x2f')]['filter']){_0x135181['where']=_[_0x7a24('0x3c')](_0x135181[_0x7a24('0x3a')],{'$or':_[_0x7a24('0x28')](_0x135181[_0x7a24('0x34')],function(_0x43aba0){var _0x119c26={};_0x119c26[_0x43aba0]={'$like':'%'+_0x5c4090['query']['filter']+'%'};return _0x119c26;})});}_0x135181=_[_0x7a24('0x3c')]({},_0x135181,_0x5c4090[_0x7a24('0x3f')]);return _0x2f6a23[_0x7a24('0x4a')](_0x135181);}})['then'](function(_0x1411d1){if(_0x1411d1){_0x44aefc=_0x1411d1[_0x7a24('0x36')];if(!_0x5c4090[_0x7a24('0x2f')]['hasOwnProperty'](_0x7a24('0x37'))){_0x135181['limit']=qs['limit'](_0x5c4090['query'][_0x7a24('0x1c')]);_0x135181[_0x7a24('0x1a')]=qs['offset'](_0x5c4090[_0x7a24('0x2f')]['offset']);}return _0x2f6a23[_0x7a24('0x4a')](_0x135181);}})[_0x7a24('0x23')](function(_0x9edcc9){if(_0x9edcc9){return _0x9edcc9?{'count':_0x44aefc,'rows':_0x9edcc9}:null;}})[_0x7a24('0x23')](respondWithResult(_0x258fa5,null))['catch'](handleError(_0x258fa5,null));};exports[_0x7a24('0x4b')]=function(_0x1b1067,_0x402359,_0x5740fe){var _0x2cf70e={};var _0x2d539c={};var _0x14a0a7;var _0x178ffc;return db['DeskConfiguration'][_0x7a24('0x4c')]({'where':{'id':_0x1b1067[_0x7a24('0x43')]['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x402359,null))['then'](function(_0x3e4043){if(_0x3e4043){_0x14a0a7=_0x3e4043;_0x2d539c[_0x7a24('0x33')]=_['keys'](db[_0x7a24('0x49')][_0x7a24('0x2a')]);_0x2d539c[_0x7a24('0x2f')]=_[_0x7a24('0x30')](_0x1b1067[_0x7a24('0x2f')]);_0x2d539c[_0x7a24('0x31')]=_['intersection'](_0x2d539c[_0x7a24('0x33')],_0x2d539c[_0x7a24('0x2f')]);_0x2cf70e[_0x7a24('0x34')]=_[_0x7a24('0x32')](_0x2d539c[_0x7a24('0x33')],qs[_0x7a24('0x35')](_0x1b1067[_0x7a24('0x2f')]['fields']));_0x2cf70e[_0x7a24('0x34')]=_0x2cf70e[_0x7a24('0x34')]['length']?_0x2cf70e[_0x7a24('0x34')]:_0x2d539c[_0x7a24('0x33')];_0x2cf70e['order']=qs[_0x7a24('0x39')](_0x1b1067[_0x7a24('0x2f')]['sort']);_0x2cf70e[_0x7a24('0x3a')]=qs[_0x7a24('0x31')](_[_0x7a24('0x3b')](_0x1b1067[_0x7a24('0x2f')],_0x2d539c[_0x7a24('0x31')]));if(_0x1b1067[_0x7a24('0x2f')][_0x7a24('0x3e')]){_0x2cf70e[_0x7a24('0x3a')]=_[_0x7a24('0x3c')](_0x2cf70e[_0x7a24('0x3a')],{'$or':_[_0x7a24('0x28')](_0x2cf70e[_0x7a24('0x34')],function(_0xe72227){var _0x14cea4={};_0x14cea4[_0xe72227]={'$like':'%'+_0x1b1067[_0x7a24('0x2f')][_0x7a24('0x3e')]+'%'};return _0x14cea4;})});}_0x2cf70e=_['merge']({},_0x2cf70e,_0x1b1067['options']);return _0x14a0a7[_0x7a24('0x4b')](_0x2cf70e);}})['then'](function(_0x2efb53){if(_0x2efb53){_0x178ffc=_0x2efb53['length'];if(!_0x1b1067['query'][_0x7a24('0x48')](_0x7a24('0x37'))){_0x2cf70e[_0x7a24('0x1c')]=qs[_0x7a24('0x1c')](_0x1b1067[_0x7a24('0x2f')][_0x7a24('0x1c')]);_0x2cf70e['offset']=qs[_0x7a24('0x1a')](_0x1b1067[_0x7a24('0x2f')][_0x7a24('0x1a')]);}return _0x14a0a7[_0x7a24('0x4b')](_0x2cf70e);}})[_0x7a24('0x23')](function(_0x69b83b){if(_0x69b83b){return _0x69b83b?{'count':_0x178ffc,'rows':_0x69b83b}:null;}})[_0x7a24('0x23')](respondWithResult(_0x402359,null))[_0x7a24('0x42')](handleError(_0x402359,null));};exports[_0x7a24('0x4d')]=function(_0x1f3355,_0x5c4481,_0x174c4e){var _0x1ec16f={};var _0x510d18={};var _0x558047;var _0x36aead;return db[_0x7a24('0x29')][_0x7a24('0x4c')]({'where':{'id':_0x1f3355[_0x7a24('0x43')]['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x5c4481,null))[_0x7a24('0x23')](function(_0x27e37c){if(_0x27e37c){_0x558047=_0x27e37c;_0x510d18[_0x7a24('0x33')]=_[_0x7a24('0x30')](db[_0x7a24('0x4e')][_0x7a24('0x2a')]);_0x510d18['query']=_['keys'](_0x1f3355[_0x7a24('0x2f')]);_0x510d18['filters']=_[_0x7a24('0x32')](_0x510d18[_0x7a24('0x33')],_0x510d18[_0x7a24('0x2f')]);_0x1ec16f[_0x7a24('0x34')]=_[_0x7a24('0x32')](_0x510d18[_0x7a24('0x33')],qs[_0x7a24('0x35')](_0x1f3355[_0x7a24('0x2f')][_0x7a24('0x35')]));_0x1ec16f[_0x7a24('0x34')]=_0x1ec16f[_0x7a24('0x34')][_0x7a24('0x36')]?_0x1ec16f['attributes']:_0x510d18[_0x7a24('0x33')];_0x1ec16f['order']=qs['sort'](_0x1f3355[_0x7a24('0x2f')][_0x7a24('0x39')]);_0x1ec16f[_0x7a24('0x3a')]=qs['filters'](_['pick'](_0x1f3355[_0x7a24('0x2f')],_0x510d18[_0x7a24('0x31')]));if(_0x1f3355[_0x7a24('0x2f')]['filter']){_0x1ec16f[_0x7a24('0x3a')]=_['merge'](_0x1ec16f[_0x7a24('0x3a')],{'$or':_[_0x7a24('0x28')](_0x1ec16f[_0x7a24('0x34')],function(_0xbf074b){var _0x4cf9fa={};_0x4cf9fa[_0xbf074b]={'$like':'%'+_0x1f3355[_0x7a24('0x2f')][_0x7a24('0x3e')]+'%'};return _0x4cf9fa;})});}_0x1ec16f=_['merge']({},_0x1ec16f,_0x1f3355[_0x7a24('0x3f')]);return _0x558047['getTags'](_0x1ec16f);}})[_0x7a24('0x23')](function(_0x10f255){if(_0x10f255){_0x36aead=_0x10f255['length'];if(!_0x1f3355[_0x7a24('0x2f')][_0x7a24('0x48')](_0x7a24('0x37'))){_0x1ec16f[_0x7a24('0x1c')]=qs[_0x7a24('0x1c')](_0x1f3355['query'][_0x7a24('0x1c')]);_0x1ec16f[_0x7a24('0x1a')]=qs['offset'](_0x1f3355[_0x7a24('0x2f')]['offset']);}return _0x558047['getTags'](_0x1ec16f);}})[_0x7a24('0x23')](function(_0x10c62a){if(_0x10c62a){return _0x10c62a?{'count':_0x36aead,'rows':_0x10c62a}:null;}})['then'](respondWithResult(_0x5c4481,null))[_0x7a24('0x42')](handleError(_0x5c4481,null));};exports[_0x7a24('0x4f')]=function(_0x4a9712,_0xb4ba90,_0x183e67){if(_0x4a9712[_0x7a24('0x45')]['id']){delete _0x4a9712[_0x7a24('0x45')]['id'];}return db[_0x7a24('0x29')][_0x7a24('0x4c')]({'where':{'id':_0x4a9712[_0x7a24('0x43')]['id']}})['then'](handleEntityNotFound(_0xb4ba90,null))[_0x7a24('0x23')](function(_0x36c122){if(_0x36c122){return _0x36c122['setTags'](_0x4a9712[_0x7a24('0x45')][_0x7a24('0x50')]||[]);}return null;})['then'](respondWithResult(_0xb4ba90,null))['catch'](handleError(_0xb4ba90,null));};