Built motion from commit da617fac.|2.6.6
[motion2.git] / server / components / import / cm / csv.js
index 897a3d7..7688d56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44f3=['ioredis','../../../mysqldb','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','length','duplicate','Duplicate\x20Contact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','insert','cm_hopper','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','str','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','cm_hopper_black','id\x20IN\x20?','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','query','VoiceQueueId','all','BlackLists','Campaign','always','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse'];(function(_0x1bc600,_0x294439){var _0x54ea70=function(_0x3916c3){while(--_0x3916c3){_0x1bc600['push'](_0x1bc600['shift']());}};_0x54ea70(++_0x294439);}(_0x44f3,0x69));var _0x344f=function(_0x4a9a92,_0x1af2f5){_0x4a9a92=_0x4a9a92-0x0;var _0x38d651=_0x44f3[_0x4a9a92];return _0x38d651;};'use strict';var BPromise=require(_0x344f('0x0'));var util=require(_0x344f('0x1'));var _=require(_0x344f('0x2'));var fs=require('fs');var squel=require(_0x344f('0x3'));var Papa=require(_0x344f('0x4'));var Redis=require(_0x344f('0x5'));var db=require(_0x344f('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x344f('0x7'));config[_0x344f('0x8')]=_[_0x344f('0x9')](config[_0x344f('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x344f('0xa'))(new Redis(config[_0x344f('0x8')]));require(_0x344f('0xb'))[_0x344f('0xc')](socket);try{if(!process['argv'][0x2]||process[_0x344f('0xd')][0x2]===_0x344f('0xe')||process['argv'][0x2]===_0x344f('0xf')){throw new Error(_0x344f('0x10'));}var FILEPATH=process[_0x344f('0xd')][0x2];if(!process[_0x344f('0xd')][0x3]||process[_0x344f('0xd')][0x3]===_0x344f('0xe')||process['argv'][0x3]===_0x344f('0xf')||!process[_0x344f('0xd')][0x4]||process[_0x344f('0xd')][0x4]===_0x344f('0xe')||process['argv'][0x4]===_0x344f('0xf')){throw new Error(_0x344f('0x11'));}var FIELDS=_[_0x344f('0x12')](process[_0x344f('0xd')][0x3]['split'](','),process[_0x344f('0xd')][0x4][_0x344f('0x13')](','));if(!process[_0x344f('0xd')][0x5]||process[_0x344f('0xd')][0x5]===_0x344f('0xe')||process[_0x344f('0xd')][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x344f('0xd')][0x5];var COMPANYID=process[_0x344f('0xd')][0x6]&&process['argv'][0x6]!==_0x344f('0xe')&&process[_0x344f('0xd')][0x6]!==_0x344f('0xf')?process[_0x344f('0xd')][0x6]:null;var DUPLICATES=process[_0x344f('0xd')][0x7]&&process[_0x344f('0xd')][0x7]!==_0x344f('0xe')&&process[_0x344f('0xd')][0x7]!==_0x344f('0xf')?process[_0x344f('0xd')][0x7]:null;if(!process[_0x344f('0xd')][0x8]||process[_0x344f('0xd')][0x8]==='undefined'||process[_0x344f('0xd')][0x8]===_0x344f('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x344f('0xd')][0x8];}catch(_0x5440fe){logger[_0x344f('0x14')](_0x5440fe);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x1c0caa,_0x1b9ae6,_0x15fc70,_0x272ebb){var _0x1d9ece={'message':_0x1b9ae6};_0x1d9ece[_0x1c0caa]=!![];if(_0x15fc70){_0x1d9ece['contact']=_0x15fc70;}if(_0x272ebb){_0x1d9ece[_0x344f('0x15')]=_0x272ebb;}return _0x1d9ece;}function isEmail(_0x265fee){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x344f('0x16')](_0x265fee);}function checkRow(_0x159f22,_0x27d890,_0x1569ea){return new BPromise(function(_0x2288f9,_0x1fc67e){if(_[_0x344f('0x17')](_0x159f22)){return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x344f('0x18'),null,_0x1569ea));}if(_0x159f22[_0x344f('0x19')]&&_0x159f22['errors']['length']){var _0x2de0c2=_[_0x344f('0x1a')](_0x159f22[_0x344f('0x19')],_0x344f('0x1b'))[_0x344f('0x1c')](';');return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x2de0c2,null,_0x1569ea));}var _0x250a47={};for(var _0x290a49 in FIELDS){if(FIELDS[_0x344f('0x1d')](_0x290a49)&&FIELDS[_0x290a49]){_0x250a47[_0x290a49]=_0x159f22[_0x344f('0x1e')][0x0][FIELDS[_0x290a49]]||_0x159f22[_0x344f('0x1e')][0x0]['\ufeff'+FIELDS[_0x290a49]];}}if(!_0x250a47['firstName']){return _0x1fc67e(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x1569ea));}if(!_0x250a47[_0x344f('0x1f')]){return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x344f('0x20'),null,_0x1569ea));}if(_0x250a47[_0x344f('0x21')]){var _0x2ca8a7=moment(_0x250a47['birthDate'],'YYYY-MM-DD');if(!_0x2ca8a7[_0x344f('0x22')]()){return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x344f('0x23'),null,_0x1569ea));}}if(_0x250a47['email']){if(!isEmail(_0x250a47[_0x344f('0x24')])){return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x344f('0x25'),null,_0x1569ea));}}_0x250a47[_0x344f('0x26')]=LISTID;_0x250a47['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x344f('0x27')]&&_0x27d890){var _0x194911={};for(var _0x3d127a=0x0,_0x2cf070=DUPLICATES[_0x344f('0x27')];_0x3d127a<_0x2cf070;_0x3d127a+=0x1){_0x194911[DUPLICATES[_0x3d127a]]=_0x250a47[DUPLICATES[_0x3d127a]];}var _0x349017=_['find'](_0x27d890,_0x194911);if(_0x349017){return _0x1fc67e(handleCheckRowError(_0x344f('0x28'),_0x344f('0x29'),_0x349017,_0x1569ea));}}return db['CmContact']['create'](_0x250a47,{'raw':!![],'hooks':![],'fields':_[_0x344f('0x2a')](_0x250a47)})[_0x344f('0x2b')](function(_0x27b83f){if(DUPLICATES&&DUPLICATES[_0x344f('0x27')]&&_0x27d890){_0x27d890[_0x344f('0x2c')](_[_0x344f('0x2d')](_0x250a47,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x27b83f['id'];return _0x2288f9();})[_0x344f('0x2e')](function(_0x248415){return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x344f('0x2f')+(_0x248415['message']||JSON[_0x344f('0x30')](_0x248415)),null,_0x1569ea));});});}function checkHopper(){function _0x3df324(){return function(_0x35b844){logger['error'](_0x344f('0x31'),'checkHopper',util[_0x344f('0x32')](_0x35b844,{'showHidden':![],'depth':null}));};}var _0x617947=function(_0x512c26,_0x38a46c){var _0x411165=squel['insert']()[_0x344f('0x33')]('cm_hopper')[_0x344f('0x34')]([_0x344f('0x1f'),_0x344f('0x35'),_0x344f('0x36'),'ListId',_0x38a46c,_0x344f('0x37'),_0x344f('0x38')],squel[_0x344f('0x39')]()[_0x344f('0x3a')](_0x344f('0x1f'),'phone')['field'](_0x344f('0x3b'),_0x344f('0x35'))[_0x344f('0x3a')]('id',_0x344f('0x36'))[_0x344f('0x3a')](LISTID[_0x344f('0x3c')](),_0x344f('0x26'))['field'](_0x512c26['id']['toString'](),_0x38a46c)['field'](_0x344f('0x3b'),_0x344f('0x37'))[_0x344f('0x3a')](_0x344f('0x3b'),_0x344f('0x38'))[_0x344f('0x3d')]('cm_contacts')[_0x344f('0x3e')]('deletedAt\x20IS\x20NULL')[_0x344f('0x3e')]('ListId\x20=\x20?',LISTID[_0x344f('0x3c')]())[_0x344f('0x3e')](_0x344f('0x3f'))[_0x344f('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x344f('0x39')]()[_0x344f('0x3a')](_0x344f('0x1f'))[_0x344f('0x3d')]('cm_hopper')[_0x344f('0x3e')](_0x38a46c+_0x344f('0x40'),_0x512c26['id'][_0x344f('0x3c')]())))[_0x344f('0x3c')]();return _0x411165;};var _0x552f64=function(_0x1afa63,_0x339647){var _0x807ea1=squel[_0x344f('0x41')]()[_0x344f('0x33')](_0x344f('0x42'))['fromQuery']([_0x344f('0x1f'),_0x344f('0x35'),'ContactId',_0x344f('0x26'),_0x339647,_0x344f('0x37'),'updatedAt'],squel[_0x344f('0x39')]()[_0x344f('0x3a')](_0x344f('0x1f'),_0x344f('0x1f'))[_0x344f('0x3a')](_0x344f('0x3b'),_0x344f('0x35'))[_0x344f('0x3a')]('id',_0x344f('0x36'))[_0x344f('0x3a')](LISTID[_0x344f('0x3c')](),_0x344f('0x26'))[_0x344f('0x3a')](_0x1afa63['id'][_0x344f('0x3c')](),_0x339647)['field'](_0x344f('0x3b'),_0x344f('0x37'))['field'](_0x344f('0x3b'),_0x344f('0x38'))['from'](_0x344f('0x43'))[_0x344f('0x3e')](_0x344f('0x44'))['where'](_0x344f('0x45'),LISTID[_0x344f('0x3c')]())[_0x344f('0x3e')]('id\x20IN\x20?',squel[_0x344f('0x46')](hopperContacts))[_0x344f('0x3e')](_0x344f('0x3f'))[_0x344f('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x344f('0x39')]()['field'](_0x344f('0x47'))['from'](_0x344f('0x48'))[_0x344f('0x3e')](_0x339647+_0x344f('0x40'),_0x1afa63['id'][_0x344f('0x3c')]()))['where'](_0x344f('0x49'),squel['select']()[_0x344f('0x3a')](_0x344f('0x1f'))[_0x344f('0x3d')](_0x344f('0x42'))['where'](_0x339647+_0x344f('0x40'),_0x1afa63['id'][_0x344f('0x3c')]())))[_0x344f('0x3c')]();return _0x807ea1;};function _0x224759(_0x5eddcd,_0x5e3b00){var _0x192338=squel[_0x344f('0x41')]()[_0x344f('0x33')]('cm_hopper')['fromQuery']([_0x344f('0x1f'),_0x344f('0x35'),_0x344f('0x36'),_0x344f('0x26'),_0x5e3b00,_0x344f('0x37'),'updatedAt'],squel['select']()[_0x344f('0x3a')]('phone',_0x344f('0x1f'))[_0x344f('0x3a')](_0x344f('0x3b'),'scheduledAt')[_0x344f('0x3a')]('id',_0x344f('0x36'))['field'](LISTID[_0x344f('0x3c')](),_0x344f('0x26'))[_0x344f('0x3a')](_0x5eddcd['id'][_0x344f('0x3c')](),_0x5e3b00)[_0x344f('0x3a')]('NOW()',_0x344f('0x37'))[_0x344f('0x3a')](_0x344f('0x3b'),'updatedAt')[_0x344f('0x3d')](_0x344f('0x43'))[_0x344f('0x3e')](_0x344f('0x44'))[_0x344f('0x3e')]('ListId\x20=\x20?',LISTID['toString']())[_0x344f('0x3e')]('id\x20IN\x20?',squel[_0x344f('0x46')](hopperContacts))['where'](_0x344f('0x3f')))[_0x344f('0x3c')]();return _0x192338;}function _0x38b5dd(_0x3fe958,_0x426c01){var _0x4c10e7=squel[_0x344f('0x41')]()[_0x344f('0x33')](_0x344f('0x4a'))['fromQuery']([_0x344f('0x1f'),'ContactId',_0x344f('0x26'),_0x426c01,'createdAt',_0x344f('0x38')],squel['select']()[_0x344f('0x3a')](_0x344f('0x1f'),'phone')[_0x344f('0x3a')]('id',_0x344f('0x36'))[_0x344f('0x3a')](LISTID[_0x344f('0x3c')](),_0x344f('0x26'))[_0x344f('0x3a')](_0x3fe958['id'][_0x344f('0x3c')](),_0x426c01)[_0x344f('0x3a')]('NOW()',_0x344f('0x37'))['field'](_0x344f('0x3b'),_0x344f('0x38'))[_0x344f('0x3d')](_0x344f('0x43'))[_0x344f('0x3e')](_0x344f('0x44'))[_0x344f('0x3e')](_0x344f('0x45'),LISTID[_0x344f('0x3c')]())[_0x344f('0x3e')](_0x344f('0x4b'),squel[_0x344f('0x46')](hopperContacts))[_0x344f('0x3e')](_0x344f('0x3f')))[_0x344f('0x3c')]();return _0x4c10e7;}return db[_0x344f('0x4c')][_0x344f('0x4d')]({'where':{'type':_0x344f('0x4e')},'attributes':['id',_0x344f('0x4f')],'include':[{'model':db[_0x344f('0x50')],'as':_0x344f('0x51'),'where':{'id':LISTID}}]})[_0x344f('0x2b')](function(_0x4e9e6a){var _0x4461d8=[];if(_0x4e9e6a){var _0x35b177;for(var _0x5d805d=0x0,_0x540593;_0x5d805d<_0x4e9e6a['length'];_0x5d805d+=0x1){_0x540593=_0x4e9e6a[_0x5d805d][_0x344f('0x52')]({'plain':!![]});switch(_0x540593[_0x344f('0x4f')]){case'always':_0x4461d8['push'](db[_0x344f('0x53')][_0x344f('0x54')](_0x552f64(_0x540593,_0x344f('0x55')))[_0x344f('0x2b')](function(){})[_0x344f('0x2e')](_0x3df324()));break;case'onlyIfOpen':_0x4461d8[_0x344f('0x2c')](db[_0x344f('0x53')][_0x344f('0x54')](_0x617947(_0x540593,_0x344f('0x55')))[_0x344f('0x2b')](function(){})[_0x344f('0x2e')](_0x3df324()));break;default:_0x4461d8['push'](db['sequelize'][_0x344f('0x54')](_0x224759(_0x540593,_0x344f('0x55')))[_0x344f('0x2b')](function(){})[_0x344f('0x2e')](_0x3df324()));}}}return _0x4461d8;})[_0x344f('0x56')]()[_0x344f('0x2b')](function(){return db['VoiceQueue'][_0x344f('0x4d')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x344f('0x50')],'as':_0x344f('0x57'),'where':{'id':LISTID}}]})[_0x344f('0x2b')](function(_0x3bf9ae){var _0x5a4b8=[];if(_0x3bf9ae){var _0x1802da;for(var _0x4b933e=0x0,_0x23428d;_0x4b933e<_0x3bf9ae[_0x344f('0x27')];_0x4b933e+=0x1){_0x23428d=_0x3bf9ae[_0x4b933e]['get']({'plain':!![]});_0x5a4b8[_0x344f('0x2c')](db[_0x344f('0x53')][_0x344f('0x54')](_0x38b5dd(_0x23428d,_0x344f('0x55')))[_0x344f('0x2b')](function(){})[_0x344f('0x2e')](_0x3df324()));}}return _0x5a4b8;})[_0x344f('0x56')]();})[_0x344f('0x2b')](function(){return db[_0x344f('0x58')][_0x344f('0x4d')]({'attributes':['id',_0x344f('0x4f')],'include':[{'model':db[_0x344f('0x50')],'as':_0x344f('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x2b8977){var _0x30511d=[];if(_0x2b8977){for(var _0x323347=0x0,_0x3facda;_0x323347<_0x2b8977[_0x344f('0x27')];_0x323347+=0x1){_0x3facda=_0x2b8977[_0x323347]['get']({'plain':!![]});switch(_0x3facda[_0x344f('0x4f')]){case _0x344f('0x59'):_0x30511d[_0x344f('0x2c')](db['sequelize'][_0x344f('0x54')](_0x552f64(_0x3facda,_0x344f('0x5a')))[_0x344f('0x2b')](function(){})[_0x344f('0x2e')](_0x3df324()));break;case _0x344f('0x5b'):_0x30511d['push'](db[_0x344f('0x53')][_0x344f('0x54')](_0x617947(_0x3facda,'CampaignId'))['then'](function(){})[_0x344f('0x2e')](_0x3df324()));break;default:_0x30511d['push'](db[_0x344f('0x53')][_0x344f('0x54')](_0x224759(_0x3facda,_0x344f('0x5a')))['then'](function(){})[_0x344f('0x2e')](_0x3df324()));}}}return _0x30511d;})[_0x344f('0x56')]();})[_0x344f('0x2b')](function(){return db[_0x344f('0x58')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x344f('0x50')],'as':_0x344f('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x83ee2){var _0x1c1100=[];if(_0x83ee2){for(var _0x294789=0x0,_0xea36cd;_0x294789<_0x83ee2[_0x344f('0x27')];_0x294789+=0x1){_0xea36cd=_0x83ee2[_0x294789][_0x344f('0x52')]({'plain':!![]});_0x1c1100['push'](db[_0x344f('0x53')][_0x344f('0x54')](_0x38b5dd(_0xea36cd,_0x344f('0x5a')))['then'](function(){})[_0x344f('0x2e')](_0x3df324()));}}return _0x1c1100;})['all']();})[_0x344f('0x2e')](function(_0x93e081){logger[_0x344f('0x14')](_0x344f('0x5c'),_0x344f('0x5d'),_0x93e081[_0x344f('0x1b')]);});}var processPromises=function(_0x4bf66b){return BPromise[_0x344f('0x56')](promises)[_0x344f('0x2b')](function(_0xfda9cd){})['catch'](function(_0x2bf7ad){logger[_0x344f('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0x344f('0x30')](_0x2bf7ad));})[_0x344f('0x5e')](function(){socket[_0x344f('0x5f')](_0x344f('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bf66b){return _0x4bf66b[_0x344f('0x61')]();}});};var endCsv=function(){return BPromise[_0x344f('0x62')]()[_0x344f('0x2b')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x344f('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x344f('0x63')](FILEPATH);}catch(_0x3963ad){logger[_0x344f('0x14')](_0x344f('0x64'),JSON[_0x344f('0x30')](_0x3963ad));}finally{process[_0x344f('0x65')](0x0);}});};process['on']('SIGINT',function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x344f('0x62')]()[_0x344f('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x344f('0x13')](',');return db[_0x344f('0x66')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x344f('0x2b')](function(_0xf87f56){var _0x5be281=fs[_0x344f('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x344f('0x68')](_0x5be281,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1c8f95,_0x5218a3){total+=0x1;var _0x3a464d=total;promises[_0x344f('0x2c')](checkRow(_0x1c8f95,_0xf87f56,_0x3a464d)[_0x344f('0x2b')](function(){success+=0x1;})[_0x344f('0x2e')](function(_0x2b98cc){if(_0x2b98cc[_0x344f('0x14')]){errors+=0x1;delete _0x2b98cc[_0x344f('0x14')];}else if(_0x2b98cc[_0x344f('0x28')]){duplicates+=0x1;delete _0x2b98cc[_0x344f('0x28')];}rows[_0x344f('0x2c')](_0x2b98cc);}));if(total%0xc8===0x0){_0x5218a3[_0x344f('0x69')]();return processPromises(_0x5218a3);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0x344f('0x6a'));endCsv();});},'error':function(_0x5625ca,_0x5420a7){logger[_0x344f('0x6b')](_0x344f('0x6c'),JSON['stringify'](_0x5625ca));endCsv();}});})[_0x344f('0x2e')](function(_0x31684b){logger[_0x344f('0x14')](_0x344f('0x6d'),JSON[_0x344f('0x30')](_0x31684b));});}main();
\ No newline at end of file
+var _0x23c5=['CmContact','create','keys','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','ContactId','createdAt','select','field','NOW()','scheduledAt','toString','updatedAt','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','\x20=\x20?','insert','fromQuery','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueue','dialCheckDuplicateType','CmList','Lists','get','always','push','then','onlyIfOpen','sequelize','query','VoiceQueueId','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact'];(function(_0x5e271e,_0x167577){var _0x30afa5=function(_0x423f6b){while(--_0x423f6b){_0x5e271e['push'](_0x5e271e['shift']());}};_0x30afa5(++_0x167577);}(_0x23c5,0x11e));var _0x523c=function(_0x3c2140,_0x5d4bda){_0x3c2140=_0x3c2140-0x0;var _0x1e7568=_0x23c5[_0x3c2140];return _0x1e7568;};'use strict';var BPromise=require(_0x523c('0x0'));var util=require(_0x523c('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x523c('0x2'));var Papa=require(_0x523c('0x3'));var Redis=require('ioredis');var db=require(_0x523c('0x4'))['db'];var config=require(_0x523c('0x5'));var logger=require(_0x523c('0x6'))('api');config[_0x523c('0x7')]=_[_0x523c('0x8')](config[_0x523c('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x523c('0x9'))(new Redis(config[_0x523c('0x7')]));require(_0x523c('0xa'))['register'](socket);try{if(!process[_0x523c('0xb')][0x2]||process[_0x523c('0xb')][0x2]===_0x523c('0xc')||process[_0x523c('0xb')][0x2]==='null'){throw new Error(_0x523c('0xd'));}var FILEPATH=process[_0x523c('0xb')][0x2];if(!process[_0x523c('0xb')][0x3]||process[_0x523c('0xb')][0x3]===_0x523c('0xc')||process['argv'][0x3]==='null'||!process[_0x523c('0xb')][0x4]||process['argv'][0x4]===_0x523c('0xc')||process[_0x523c('0xb')][0x4]===_0x523c('0xe')){throw new Error(_0x523c('0xf'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0x523c('0x10')](','),process['argv'][0x4]['split'](','));if(!process[_0x523c('0xb')][0x5]||process['argv'][0x5]===_0x523c('0xc')||process[_0x523c('0xb')][0x5]==='null'){throw new Error(_0x523c('0x11'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x523c('0xb')][0x6]&&process[_0x523c('0xb')][0x6]!==_0x523c('0xc')&&process[_0x523c('0xb')][0x6]!==_0x523c('0xe')?process[_0x523c('0xb')][0x6]:null;var DUPLICATES=process[_0x523c('0xb')][0x7]&&process[_0x523c('0xb')][0x7]!==_0x523c('0xc')&&process[_0x523c('0xb')][0x7]!==_0x523c('0xe')?process[_0x523c('0xb')][0x7]:null;if(!process[_0x523c('0xb')][0x8]||process[_0x523c('0xb')][0x8]===_0x523c('0xc')||process[_0x523c('0xb')][0x8]===_0x523c('0xe')){throw new Error(_0x523c('0x12'));}var SOCKET_TIMESTAMP=process[_0x523c('0xb')][0x8];}catch(_0x3ce659){logger[_0x523c('0x13')](_0x3ce659);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0xa86a9c,_0x2c97eb,_0xa518ba,_0x7ff6b){var _0x3e4750={'message':_0x2c97eb};_0x3e4750[_0xa86a9c]=!![];if(_0xa518ba){_0x3e4750[_0x523c('0x14')]=_0xa518ba;}if(_0x7ff6b){_0x3e4750[_0x523c('0x15')]=_0x7ff6b;}return _0x3e4750;}function isEmail(_0x11465c){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x11465c);}function checkRow(_0x1ffa76,_0x48e36a,_0x5e216e){return new BPromise(function(_0x5328a3,_0x2c12b2){if(_[_0x523c('0x16')](_0x1ffa76)){return _0x2c12b2(handleCheckRowError('error',_0x523c('0x17'),null,_0x5e216e));}if(_0x1ffa76[_0x523c('0x18')]&&_0x1ffa76[_0x523c('0x18')][_0x523c('0x19')]){var _0x1ef042=_[_0x523c('0x1a')](_0x1ffa76[_0x523c('0x18')],_0x523c('0x1b'))[_0x523c('0x1c')](';');return _0x2c12b2(handleCheckRowError(_0x523c('0x13'),_0x1ef042,null,_0x5e216e));}var _0x10da43={};for(var _0x3b0c10 in FIELDS){if(FIELDS[_0x523c('0x1d')](_0x3b0c10)&&FIELDS[_0x3b0c10]){_0x10da43[_0x3b0c10]=_0x1ffa76['data'][0x0][FIELDS[_0x3b0c10]]||_0x1ffa76[_0x523c('0x1e')][0x0]['\ufeff'+FIELDS[_0x3b0c10]];}}if(!_0x10da43[_0x523c('0x1f')]){return _0x2c12b2(handleCheckRowError(_0x523c('0x13'),'firstName\x20not\x20specified!',null,_0x5e216e));}if(!_0x10da43[_0x523c('0x20')]){return _0x2c12b2(handleCheckRowError('error',_0x523c('0x21'),null,_0x5e216e));}if(_0x10da43[_0x523c('0x22')]){var _0xaaf22e=moment(_0x10da43['birthDate'],_0x523c('0x23'));if(!_0xaaf22e[_0x523c('0x24')]()){return _0x2c12b2(handleCheckRowError('error',_0x523c('0x25'),null,_0x5e216e));}}if(_0x10da43[_0x523c('0x26')]){if(!isEmail(_0x10da43[_0x523c('0x26')])){return _0x2c12b2(handleCheckRowError(_0x523c('0x13'),'email\x20format\x20is\x20not\x20valid!',null,_0x5e216e));}}_0x10da43[_0x523c('0x27')]=LISTID;_0x10da43[_0x523c('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x48e36a){var _0x359831={};for(var _0x34d1fb=0x0,_0x5a733d=DUPLICATES['length'];_0x34d1fb<_0x5a733d;_0x34d1fb+=0x1){_0x359831[DUPLICATES[_0x34d1fb]]=_0x10da43[DUPLICATES[_0x34d1fb]];}var _0x5232f4=_[_0x523c('0x29')](_0x48e36a,_0x359831);if(_0x5232f4){return _0x2c12b2(handleCheckRowError(_0x523c('0x2a'),_0x523c('0x2b'),_0x5232f4,_0x5e216e));}}return db[_0x523c('0x2c')][_0x523c('0x2d')](_0x10da43,{'raw':!![],'hooks':![],'fields':_[_0x523c('0x2e')](_0x10da43)})['then'](function(_0x10f330){if(DUPLICATES&&DUPLICATES[_0x523c('0x19')]&&_0x48e36a){_0x48e36a['push'](_[_0x523c('0x2f')](_0x10da43,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x10f330['id'];return _0x5328a3();})[_0x523c('0x30')](function(_0x5c357f){return _0x2c12b2(handleCheckRowError(_0x523c('0x13'),_0x523c('0x31')+(_0x5c357f[_0x523c('0x1b')]||JSON[_0x523c('0x32')](_0x5c357f)),null,_0x5e216e));});});}function checkHopper(){function _0x3309f1(){return function(_0x15894d){logger[_0x523c('0x13')](_0x523c('0x33'),_0x523c('0x34'),util[_0x523c('0x35')](_0x15894d,{'showHidden':![],'depth':null}));};}var _0x4bebe3=function(_0x4ccc20,_0x4f3085){var _0x3d93be=squel['insert']()[_0x523c('0x36')](_0x523c('0x37'))['fromQuery']([_0x523c('0x20'),'scheduledAt',_0x523c('0x38'),'ListId',_0x4f3085,_0x523c('0x39'),'updatedAt'],squel[_0x523c('0x3a')]()[_0x523c('0x3b')]('phone',_0x523c('0x20'))['field'](_0x523c('0x3c'),_0x523c('0x3d'))['field']('id',_0x523c('0x38'))[_0x523c('0x3b')](LISTID[_0x523c('0x3e')](),_0x523c('0x27'))[_0x523c('0x3b')](_0x4ccc20['id']['toString'](),_0x4f3085)[_0x523c('0x3b')](_0x523c('0x3c'),_0x523c('0x39'))[_0x523c('0x3b')]('NOW()',_0x523c('0x3f'))['from'](_0x523c('0x40'))[_0x523c('0x41')](_0x523c('0x42'))[_0x523c('0x41')](_0x523c('0x43'),LISTID['toString']())[_0x523c('0x41')](_0x523c('0x44'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x523c('0x3a')]()['field'](_0x523c('0x20'))[_0x523c('0x45')](_0x523c('0x37'))[_0x523c('0x41')](_0x4f3085+_0x523c('0x46'),_0x4ccc20['id'][_0x523c('0x3e')]())))['toString']();return _0x3d93be;};var _0x502dcf=function(_0x51220d,_0x9af306){var _0x3e26a4=squel[_0x523c('0x47')]()[_0x523c('0x36')](_0x523c('0x37'))[_0x523c('0x48')](['phone',_0x523c('0x3d'),_0x523c('0x38'),_0x523c('0x27'),_0x9af306,'createdAt','updatedAt'],squel[_0x523c('0x3a')]()['field'](_0x523c('0x20'),_0x523c('0x20'))[_0x523c('0x3b')](_0x523c('0x3c'),_0x523c('0x3d'))[_0x523c('0x3b')]('id',_0x523c('0x38'))[_0x523c('0x3b')](LISTID[_0x523c('0x3e')](),_0x523c('0x27'))[_0x523c('0x3b')](_0x51220d['id'][_0x523c('0x3e')](),_0x9af306)[_0x523c('0x3b')](_0x523c('0x3c'),'createdAt')[_0x523c('0x3b')](_0x523c('0x3c'),'updatedAt')[_0x523c('0x45')](_0x523c('0x40'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x523c('0x43'),LISTID[_0x523c('0x3e')]())[_0x523c('0x41')](_0x523c('0x49'),squel[_0x523c('0x4a')](hopperContacts))[_0x523c('0x41')](_0x523c('0x44'))[_0x523c('0x41')](_0x523c('0x4b'),squel['select']()[_0x523c('0x3b')]('calleridnum')[_0x523c('0x45')](_0x523c('0x4c'))[_0x523c('0x41')](_0x9af306+_0x523c('0x46'),_0x51220d['id'][_0x523c('0x3e')]()))[_0x523c('0x41')](_0x523c('0x4b'),squel[_0x523c('0x3a')]()[_0x523c('0x3b')](_0x523c('0x20'))[_0x523c('0x45')](_0x523c('0x37'))[_0x523c('0x41')](_0x9af306+_0x523c('0x46'),_0x51220d['id'][_0x523c('0x3e')]())))['toString']();return _0x3e26a4;};function _0xe3e24c(_0x489a91,_0x2d1afc){var _0x5dcaa2=squel[_0x523c('0x47')]()[_0x523c('0x36')](_0x523c('0x37'))['fromQuery']([_0x523c('0x20'),'scheduledAt',_0x523c('0x38'),_0x523c('0x27'),_0x2d1afc,'createdAt',_0x523c('0x3f')],squel[_0x523c('0x3a')]()['field'](_0x523c('0x20'),_0x523c('0x20'))[_0x523c('0x3b')](_0x523c('0x3c'),'scheduledAt')[_0x523c('0x3b')]('id',_0x523c('0x38'))[_0x523c('0x3b')](LISTID[_0x523c('0x3e')](),_0x523c('0x27'))[_0x523c('0x3b')](_0x489a91['id'][_0x523c('0x3e')](),_0x2d1afc)['field']('NOW()','createdAt')['field']('NOW()',_0x523c('0x3f'))[_0x523c('0x45')](_0x523c('0x40'))[_0x523c('0x41')](_0x523c('0x42'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0x523c('0x41')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x523c('0x41')](_0x523c('0x44')))[_0x523c('0x3e')]();return _0x5dcaa2;}function _0x12c3d2(_0x1c27a8,_0x389d23){var _0x5cd3e9=squel[_0x523c('0x47')]()[_0x523c('0x36')]('cm_hopper_black')[_0x523c('0x48')](['phone',_0x523c('0x38'),'ListId',_0x389d23,_0x523c('0x39'),'updatedAt'],squel[_0x523c('0x3a')]()[_0x523c('0x3b')](_0x523c('0x20'),_0x523c('0x20'))[_0x523c('0x3b')]('id',_0x523c('0x38'))[_0x523c('0x3b')](LISTID[_0x523c('0x3e')](),_0x523c('0x27'))[_0x523c('0x3b')](_0x1c27a8['id'][_0x523c('0x3e')](),_0x389d23)[_0x523c('0x3b')](_0x523c('0x3c'),_0x523c('0x39'))['field']('NOW()',_0x523c('0x3f'))[_0x523c('0x45')](_0x523c('0x40'))[_0x523c('0x41')](_0x523c('0x42'))[_0x523c('0x41')](_0x523c('0x43'),LISTID[_0x523c('0x3e')]())[_0x523c('0x41')]('id\x20IN\x20?',squel[_0x523c('0x4a')](hopperContacts))[_0x523c('0x41')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x5cd3e9;}return db[_0x523c('0x4d')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x523c('0x4e')],'include':[{'model':db[_0x523c('0x4f')],'as':_0x523c('0x50'),'where':{'id':LISTID}}]})['then'](function(_0x71edd9){var _0x298929=[];if(_0x71edd9){var _0x305d21;for(var _0x30af87=0x0,_0x4e977a;_0x30af87<_0x71edd9[_0x523c('0x19')];_0x30af87+=0x1){_0x4e977a=_0x71edd9[_0x30af87][_0x523c('0x51')]({'plain':!![]});switch(_0x4e977a[_0x523c('0x4e')]){case _0x523c('0x52'):_0x298929[_0x523c('0x53')](db['sequelize']['query'](_0x502dcf(_0x4e977a,'VoiceQueueId'))[_0x523c('0x54')](function(){})[_0x523c('0x30')](_0x3309f1()));break;case _0x523c('0x55'):_0x298929['push'](db[_0x523c('0x56')][_0x523c('0x57')](_0x4bebe3(_0x4e977a,_0x523c('0x58')))['then'](function(){})[_0x523c('0x30')](_0x3309f1()));break;default:_0x298929[_0x523c('0x53')](db[_0x523c('0x56')][_0x523c('0x57')](_0xe3e24c(_0x4e977a,_0x523c('0x58')))[_0x523c('0x54')](function(){})[_0x523c('0x30')](_0x3309f1()));}}}return _0x298929;})[_0x523c('0x59')]()[_0x523c('0x54')](function(){return db[_0x523c('0x4d')][_0x523c('0x5a')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x523c('0x4f')],'as':_0x523c('0x5b'),'where':{'id':LISTID}}]})[_0x523c('0x54')](function(_0x335c54){var _0x42dc36=[];if(_0x335c54){var _0x424a44;for(var _0x50a670=0x0,_0x3997a2;_0x50a670<_0x335c54['length'];_0x50a670+=0x1){_0x3997a2=_0x335c54[_0x50a670]['get']({'plain':!![]});_0x42dc36[_0x523c('0x53')](db[_0x523c('0x56')][_0x523c('0x57')](_0x12c3d2(_0x3997a2,_0x523c('0x58')))[_0x523c('0x54')](function(){})[_0x523c('0x30')](_0x3309f1()));}}return _0x42dc36;})[_0x523c('0x59')]();})[_0x523c('0x54')](function(){return db[_0x523c('0x5c')][_0x523c('0x5a')]({'attributes':['id',_0x523c('0x4e')],'include':[{'model':db[_0x523c('0x4f')],'as':_0x523c('0x50'),'where':{'id':LISTID}}]})['then'](function(_0x1512df){var _0x4e7c02=[];if(_0x1512df){for(var _0x4af366=0x0,_0x417a8d;_0x4af366<_0x1512df[_0x523c('0x19')];_0x4af366+=0x1){_0x417a8d=_0x1512df[_0x4af366][_0x523c('0x51')]({'plain':!![]});switch(_0x417a8d[_0x523c('0x4e')]){case'always':_0x4e7c02['push'](db[_0x523c('0x56')][_0x523c('0x57')](_0x502dcf(_0x417a8d,_0x523c('0x5d')))[_0x523c('0x54')](function(){})['catch'](_0x3309f1()));break;case _0x523c('0x55'):_0x4e7c02[_0x523c('0x53')](db['sequelize']['query'](_0x4bebe3(_0x417a8d,_0x523c('0x5d')))[_0x523c('0x54')](function(){})[_0x523c('0x30')](_0x3309f1()));break;default:_0x4e7c02[_0x523c('0x53')](db['sequelize'][_0x523c('0x57')](_0xe3e24c(_0x417a8d,'CampaignId'))[_0x523c('0x54')](function(){})[_0x523c('0x30')](_0x3309f1()));}}}return _0x4e7c02;})[_0x523c('0x59')]();})[_0x523c('0x54')](function(){return db['Campaign'][_0x523c('0x5a')]({'attributes':['id'],'include':[{'model':db[_0x523c('0x4f')],'as':_0x523c('0x5b'),'where':{'id':LISTID}}]})[_0x523c('0x54')](function(_0x2604cb){var _0x449f54=[];if(_0x2604cb){for(var _0xe8d702=0x0,_0xece91d;_0xe8d702<_0x2604cb[_0x523c('0x19')];_0xe8d702+=0x1){_0xece91d=_0x2604cb[_0xe8d702]['get']({'plain':!![]});_0x449f54[_0x523c('0x53')](db[_0x523c('0x56')]['query'](_0x12c3d2(_0xece91d,_0x523c('0x5d')))[_0x523c('0x54')](function(){})['catch'](_0x3309f1()));}}return _0x449f54;})['all']();})[_0x523c('0x30')](function(_0x3b4083){logger['error'](_0x523c('0x5e'),'generalCheckHopper',_0x3b4083[_0x523c('0x1b')]);});}var processPromises=function(_0x1f8af2){return BPromise[_0x523c('0x59')](promises)[_0x523c('0x54')](function(_0x532a09){})['catch'](function(_0x792c62){logger['error'](_0x523c('0x5f'),JSON['stringify'](_0x792c62));})['finally'](function(){socket[_0x523c('0x60')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1f8af2){return _0x1f8af2[_0x523c('0x61')]();}});};var endCsv=function(){return BPromise[_0x523c('0x62')]()[_0x523c('0x54')](function(){if(hopperContacts){return checkHopper();}})[_0x523c('0x54')](function(){socket[_0x523c('0x60')](_0x523c('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x523c('0x64')](FILEPATH);}catch(_0x4a895f){logger[_0x523c('0x13')](_0x523c('0x65'),JSON[_0x523c('0x32')](_0x4a895f));}finally{process[_0x523c('0x66')](0x0);}});};process['on'](_0x523c('0x67'),function(){logger[_0x523c('0x68')](_0x523c('0x69'));endCsv();});function main(){return BPromise[_0x523c('0x62')]()[_0x523c('0x54')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x523c('0x2c')][_0x523c('0x5a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x523c('0x54')](function(_0x51be0c){var _0x128bfd=fs[_0x523c('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x523c('0x6b')](_0x128bfd,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1d4340,_0x10a6c6){total+=0x1;var _0x433047=total;promises[_0x523c('0x53')](checkRow(_0x1d4340,_0x51be0c,_0x433047)[_0x523c('0x54')](function(){success+=0x1;})['catch'](function(_0x4af966){if(_0x4af966['error']){errors+=0x1;delete _0x4af966['error'];}else if(_0x4af966[_0x523c('0x2a')]){duplicates+=0x1;delete _0x4af966[_0x523c('0x2a')];}rows[_0x523c('0x53')](_0x4af966);}));if(total%0xc8===0x0){_0x10a6c6[_0x523c('0x6c')]();return processPromises(_0x10a6c6);}},'complete':function(){return processPromises()[_0x523c('0x54')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x3dca7e,_0x46cda9){logger[_0x523c('0x68')]('CSV\x20parse\x20error',JSON['stringify'](_0x3dca7e));endCsv();}});})['catch'](function(_0x59441d){logger[_0x523c('0x13')](_0x523c('0x6d'),JSON[_0x523c('0x32')](_0x59441d));});}main();
\ No newline at end of file