Built motion from commit ec3309576.|1.0.33
[motion.git] / server / api / custom_report / custom_report.controller.js
index 5a08d63..10348ac 100644 (file)
@@ -1 +1 @@
-var _0xe464=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64","\x4D\x65\x74\x72\x69\x63","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x62\x75\x69\x6C\x64","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\x6D\x6F\x6D\x65\x6E\x74","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x67\x65\x74\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x72\x79","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x20\x71\x75\x65\x72\x79\x20\x66\x72\x6F\x6D\x20\x61\x70\x69\x3A","\x6C\x6F\x67","\x6E\x6F\x20\x73\x75\x66\x66\x69\x63\x69\x65\x6E\x74\x20\x71\x75\x65\x75\x65\x20\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E\x73\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x75\x73\x65\x72","\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E","\x61\x6C\x6C","\x62\x75\x69\x6C\x64\x51\x75\x65\x72\x79","\x73\x70\x72\x65\x61\x64","\x75\x73\x65\x72","\x62\x75\x69\x6C\x64\x46\x69\x6C\x74\x65\x72","\x66\x6F\x75\x6E\x64\x20\x72\x65\x70\x6F\x72\x74","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x64\x61\x69\x6C\x79","\x74\x72\x75\x65","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\x66\x6F\x72\x6D\x61\x74","\x65\x6E\x64\x44\x61\x74\x65","\x74\x61\x62\x6C\x65","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x5F\x68\x69\x73\x74\x6F\x72\x79","","\x72\x65\x70\x6C\x61\x63\x65","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x66\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\x70\x72\x65\x76\x69\x65\x77","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x6C\x69\x6D\x69\x74","\x76\x61\x6C\x75\x65","\x74\x61\x6B\x65","\x6F\x66\x66\x73\x65\x74","\x73\x6C\x69\x63\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x4F\x77\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x72\x79\x20\x65\x72\x72\x6F\x72","\x63\x68\x65\x63\x6B\x51\x75\x65\x72\x79","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66","\x50\x44\x46","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76","\x43\x53\x56","\x64\x65\x73\x74\x72\x6F\x79\x4E\x6F\x64\x65\x52\x65\x70\x6F\x72\x74\x73","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x66\x69\x6E\x64","\x4E\x6F\x64\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x64\x65\x73\x74\x72\x6F\x79","\x70\x75\x73\x68","\x66\x69\x6C\x74\x65\x72","\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x2E\x6A\x73","\x66\x6F\x72\x6B","\x65\x72\x72\x6F\x72","\x63\x68\x69\x6C\x64\x20\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x63\x68\x69\x6C\x64\x20\x63\x6C\x6F\x73\x65","\x6D\x65\x73\x73\x61\x67\x65","\x63\x68\x69\x6C\x64\x20\x6D\x65\x73\x73\x61\x67\x65","\x6B\x69\x6C\x6C","\x70\x61\x72\x65\x6E\x74","\x6E\x61\x6D\x65","\x73\x74\x61\x72\x74\x54\x69\x6D\x65","\x20","\x30\x30\x3A\x30\x30","\x65\x6E\x64\x54\x69\x6D\x65","\x32\x33\x3A\x35\x39","\x63\x72\x65\x61\x74\x65","\x74\x65\x78\x74","\x2F\x20","\x23","\x73\x68\x6F\x77","\x65\x78\x70\x6F\x72\x74","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E\x73","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x63\x6F\x70\x79","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x62\x6F\x64\x79","\x6D\x61\x70","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x46\x69\x65\x6C\x64\x73","\x69\x6D\x70\x6F\x72\x74","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x67\x65\x74\x54\x61\x62\x6C\x65","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x4D\x65\x74\x72\x69\x63\x49\x64","\x66\x69\x65\x6C\x64","\x6D\x65\x74\x72\x69\x63","\x54\x68\x65\x20\x6D\x65\x74\x72\x69\x63\x20\x77\x69\x74\x68\x20\x69\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x63\x75\x73\x74\x6F\x6D","\x54\x68\x65\x20\x66\x69\x65\x6C\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74\x20\x69\x6E\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65","\x6B\x65\x79\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x59\x6F\x75\x20\x68\x61\x76\x65\x20\x6E\x6F\x74\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x6F\x72\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63\x49\x64","\x68\x61\x73","\x65\x76\x65\x72\x79","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63","\x55\x6E\x73\x75\x70\x70\x6F\x72\x74\x65\x64\x20\x49\x6D\x70\x6F\x72\x74\x20\x66\x6F\x72\x6D\x61\x74\x20\x28\x4D\x65\x74\x72\x69\x63\x20\x74\x79\x70\x65\x20\x69\x6E\x20\x72\x65\x70\x6F\x72\x74\x20\x66\x69\x65\x6C\x64\x73\x20\x69\x73\x20\x6D\x69\x73\x73\x69\x6E\x67\x29","\x49\x64","\x67\x72\x6F\x75\x70\x42\x79","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x6E\x75\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x5F","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xe464[0];var _=require(_0xe464[1]);var util=require(_0xe464[2]);var sequelize=require(_0xe464[4])[_0xe464[3]];var CustomReport=require(_0xe464[4])[_0xe464[5]];var ReportField=require(_0xe464[4])[_0xe464[6]];var Metric=require(_0xe464[4])[_0xe464[7]];var ExtractedReport=require(_0xe464[4])[_0xe464[8]];var extractUtils=require(_0xe464[9]);var reportBuildUtils=require(_0xe464[10]);var Util=require(_0xe464[11]);var sr=require(_0xe464[12]);var moment=require(_0xe464[13]);var cp=require(_0xe464[14]);var ReportTree=require(_0xe464[4])[_0xe464[15]];exports[_0xe464[16]]= function(_0x8bf0xf,_0x8bf0x10,_0x8bf0x11){return CustomReport[_0xe464[23]](Util[_0xe464[22]](_0x8bf0xf[_0xe464[21]],{deletedAt:null}))[_0xe464[20]](function(_0x8bf0x13){_0x8bf0x10[_0xe464[19]](200)[_0xe464[18]](_0x8bf0x13)})[_0xe464[17]](function(_0x8bf0x12){return handleError(_0x8bf0x10,_0x8bf0x12)})};exports[_0xe464[24]]= function(_0x8bf0xf,_0x8bf0x10){return Promise[_0xe464[29]]([])[_0xe464[20]](getQuery(_0x8bf0xf,_0x8bf0x10))[_0xe464[20]](function(_0x8bf0x14){if(_0x8bf0x14){switch(_0x8bf0x14){case _0xe464[28]:_0x8bf0x14= _0xe464[27];break;default:}};_0x8bf0x10[_0xe464[19]](200)[_0xe464[18]]({query:_0x8bf0x14})})[_0xe464[17]](function(_0x8bf0x12){console[_0xe464[26]](_0xe464[25],_0x8bf0x12)})};function getQuery(_0x8bf0xf,_0x8bf0x10){var _0x8bf0x16;return function(){return CustomReport[_0xe464[51]](_0xe464[50])[_0xe464[49]](_0x8bf0xf[_0xe464[48]][_0xe464[47]])[_0xe464[20]](function(_0x8bf0x18){console[_0xe464[26]](_0xe464[34]);if(!_0x8bf0x18){return _0x8bf0x10[_0xe464[35]](404)};if(_0x8bf0xf[_0xe464[21]][_0xe464[36]]&& _0x8bf0xf[_0xe464[21]][_0xe464[36]]=== _0xe464[37]){_0x8bf0xf[_0xe464[21]][_0xe464[38]]= moment()[_0xe464[40]](_0xe464[39]);_0x8bf0xf[_0xe464[21]][_0xe464[41]]= moment()[_0xe464[40]](_0xe464[39]);_0x8bf0x18[_0xe464[43]][_0xe464[42]]= _0x8bf0x18[_0xe464[43]][_0xe464[42]][_0xe464[46]](_0xe464[44],_0xe464[45])};delete _0x8bf0xf[_0xe464[21]][_0xe464[36]];_0x8bf0x16= _0x8bf0x18[_0xe464[43]];return _0x8bf0x16[_0xe464[42]]})[_0xe464[20]](reportBuildUtils[_0xe464[33]](_0x8bf0xf[_0xe464[32]]))[_0xe464[20]](function(_0x8bf0x17){return [_0x8bf0x17,_0x8bf0x16]})[_0xe464[31]](reportBuildUtils[_0xe464[30]](_0x8bf0xf[_0xe464[21]]))}}exports[_0xe464[52]]= function(_0x8bf0xf,_0x8bf0x10){var _0x8bf0x19;return Promise[_0xe464[29]]([])[_0xe464[20]](getQuery(_0x8bf0xf,_0x8bf0x10))[_0xe464[20]](reportBuildUtils[_0xe464[64]]())[_0xe464[20]](function(_0x8bf0x1a){if(_0x8bf0x1a&& _[_0xe464[53]](_0x8bf0x1a)){_0x8bf0x19= _0x8bf0x1a[_0xe464[54]];if(_0x8bf0xf[_0xe464[21]][_0xe464[55]]){_0x8bf0x1a= _(_0x8bf0x1a)[_0xe464[59]](_0x8bf0xf[_0xe464[21]][_0xe464[58]]|| 0)[_0xe464[57]](_0x8bf0xf[_0xe464[21]][_0xe464[55]])[_0xe464[56]]()};_[_0xe464[62]](_0x8bf0x1a,function(_0x8bf0x1b){_[_0xe464[61]](_0x8bf0x1b,function(_0x8bf0x1c,_0x8bf0x1d){if(_0x8bf0x1c instanceof  Date){_0x8bf0x1b[_0x8bf0x1d]= moment(_0x8bf0x1c)[_0xe464[40]](_0xe464[60]).toString()}})});_0x8bf0x10[_0xe464[19]](200)[_0xe464[18]]({rows:_0x8bf0x1a,count:_0x8bf0x19})}else {return handleError(_0x8bf0x10,{message:_0x8bf0x1a|| _0xe464[63]})}})[_0xe464[17]](function(_0x8bf0x12){console[_0xe464[26]](_0x8bf0x12);return handleError(_0x8bf0x10,_0x8bf0x12)})};exports[_0xe464[65]]= function(_0x8bf0xf,_0x8bf0x10){docExtract(_0x8bf0xf,_0x8bf0x10,_0xe464[66])};exports[_0xe464[67]]= function(_0x8bf0xf,_0x8bf0x10){docExtract(_0x8bf0xf,_0x8bf0x10,_0xe464[68])};exports[_0xe464[69]]= function(_0x8bf0xf,_0x8bf0x10){return ReportTree[_0xe464[49]](2)[_0xe464[20]](function(_0x8bf0x1e){_0x8bf0x1e= JSON[_0xe464[71]](_0x8bf0x1e[_0xe464[70]]);var _0x8bf0x1f=_[_0xe464[72]](_0x8bf0x1e,{id:_0x8bf0xf[_0xe464[48]][_0xe464[47]]});if(!_0x8bf0x1f){throw  new Error(_0xe464[73])};var _0x8bf0x20=[];findSubNodes(_0x8bf0x1f,_0x8bf0x1e,_0x8bf0x20);return CustomReport[_0xe464[74]]({where:{parent:_0x8bf0x20},individualHooks:true})})[_0xe464[20]](function(){return _0x8bf0x10[_0xe464[35]](200)})[_0xe464[17]](function(_0x8bf0x12){console[_0xe464[26]](_0x8bf0x12);return handleError(_0x8bf0x10,_0x8bf0x12)})};function findSubNodes(_0x8bf0x1f,_0x8bf0x1e,_0x8bf0x22){_0x8bf0x22[_0xe464[75]](_0x8bf0x1f[_0xe464[47]]);var _0x8bf0x23=_[_0xe464[76]](_0x8bf0x1e,{parent:_0x8bf0x1f[_0xe464[47]]});if(!_0x8bf0x23|| !_0x8bf0x23[_0xe464[54]]){return};_[_0xe464[62]](_0x8bf0x23,function(_0x8bf0x24){findSubNodes(_0x8bf0x24,_0x8bf0x1e,_0x8bf0x22)})}function docExtract(_0x8bf0xf,_0x8bf0x10,_0x8bf0x26){var _0x8bf0x18;CustomReport[_0xe464[51]](_0xe464[50])[_0xe464[49]](_0x8bf0xf[_0xe464[48]][_0xe464[47]])[_0xe464[20]](function(_0x8bf0x16){if(!_0x8bf0x16){return _0x8bf0x10[_0xe464[35]](404)};_0x8bf0x18= _0x8bf0x16;return ReportTree[_0xe464[49]](2)})[_0xe464[20]](function(_0x8bf0x1e){_0x8bf0x1e= JSON[_0xe464[71]](_0x8bf0x1e[_0xe464[70]]);var _0x8bf0x2a=_[_0xe464[72]](_0x8bf0x1e,{id:_0x8bf0x18[_0xe464[87]]});var _0x8bf0x2b=getReportPath(_0x8bf0x2a,_0x8bf0x1e,_0x8bf0x18[_0xe464[88]]);if(_0x8bf0xf[_0xe464[21]][_0xe464[36]]&& _0x8bf0xf[_0xe464[21]][_0xe464[36]]=== _0xe464[37]){_0x8bf0xf[_0xe464[21]][_0xe464[38]]= moment()[_0xe464[40]](_0xe464[39]);_0x8bf0xf[_0xe464[21]][_0xe464[41]]= moment()[_0xe464[40]](_0xe464[39]);_0x8bf0x18[_0xe464[43]][_0xe464[42]]= _0x8bf0x18[_0xe464[43]][_0xe464[42]][_0xe464[46]](_0xe464[44],_0xe464[45])};delete _0x8bf0xf[_0xe464[21]][_0xe464[36]];return [_0x8bf0x18,ExtractedReport[_0xe464[94]]({name:_0x8bf0x2b,startDate:_0x8bf0xf[_0xe464[21]][_0xe464[38]]?_0x8bf0xf[_0xe464[21]][_0xe464[38]]+ (_0x8bf0xf[_0xe464[21]][_0xe464[89]]?_0xe464[90]+ _0x8bf0xf[_0xe464[21]][_0xe464[89]]:_0xe464[91]):null,endDate:_0x8bf0xf[_0xe464[21]][_0xe464[41]]?_0x8bf0xf[_0xe464[21]][_0xe464[41]]+ (_0x8bf0xf[_0xe464[21]][_0xe464[92]]?_0xe464[90]+ _0x8bf0xf[_0xe464[21]][_0xe464[92]]:_0xe464[93]):null,output:_0x8bf0x26,UserId:_0x8bf0xf[_0xe464[32]][_0xe464[47]]})]})[_0xe464[31]](function(_0x8bf0x18,_0x8bf0x27){var _0x8bf0x28=cp[_0xe464[78]](__dirname+ _0xe464[77]);_0x8bf0x28[_0xe464[81]](_0xe464[84],function(_0x8bf0x29){console[_0xe464[26]](_0xe464[85],_0x8bf0x29);_0x8bf0x28[_0xe464[86]]()})[_0xe464[81]](_0xe464[82],function(){console[_0xe464[26]](_0xe464[83])})[_0xe464[81]](_0xe464[79],function(_0x8bf0x12){console[_0xe464[26]](_0xe464[80],_0x8bf0x12)});_0x8bf0x28[_0xe464[18]]({report:_0x8bf0x18,query:_0x8bf0xf[_0xe464[21]],extractedId:_0x8bf0x27[_0xe464[47]],user:_0x8bf0xf[_0xe464[32]],type:_0x8bf0x26})})[_0xe464[17]](function(_0x8bf0x12){console[_0xe464[26]](_0x8bf0x12);return handleError(_0x8bf0x10,_0x8bf0x12)});return _0x8bf0x10[_0xe464[35]](200)}function getReportPath(_0x8bf0x2a,_0x8bf0x1e,_0x8bf0x2b){_0x8bf0x2b= _0x8bf0x2a[_0xe464[95]]+ _0xe464[96]+ _0x8bf0x2b;if(_0x8bf0x2a[_0xe464[87]]=== _0xe464[97]){return _0x8bf0x2b}else {return getReportPath(_[_0xe464[72]](_0x8bf0x1e,{id:_0x8bf0x2a[_0xe464[87]]}),_0x8bf0x1e,_0x8bf0x2b)}}exports[_0xe464[98]]= function(_0x8bf0xf,_0x8bf0x10){return CustomReport[_0xe464[51]](_0xe464[50])[_0xe464[49]](_0x8bf0xf[_0xe464[48]][_0xe464[47]])[_0xe464[20]](function(_0x8bf0x18){if(!_0x8bf0x18){return _0x8bf0x10[_0xe464[35]](404)};return _0x8bf0x10[_0xe464[18]](_0x8bf0x18)})[_0xe464[17]](function(_0x8bf0x12){return handleError(_0x8bf0x10,_0x8bf0x12)})};exports[_0xe464[99]]= function(_0x8bf0xf,_0x8bf0x10){return CustomReport[_0xe464[51]]({method:[_0xe464[102],{CustomReportId:_0x8bf0xf[_0xe464[48]][_0xe464[47]]}]})[_0xe464[49]](_0x8bf0xf[_0xe464[48]][_0xe464[47]],{attributes:[_0xe464[100],_0xe464[101],_0xe464[88],_0xe464[87],_0xe464[42]]})[_0xe464[20]](function(_0x8bf0x18){if(!_0x8bf0x18){return _0x8bf0x10[_0xe464[35]](404)};return _0x8bf0x10[_0xe464[18]](_0x8bf0x18)})[_0xe464[17]](function(_0x8bf0x12){return handleError(_0x8bf0x10,_0x8bf0x12)})};exports[_0xe464[103]]= function(_0x8bf0xf,_0x8bf0x10){var _0x8bf0x2d;return sequelize[_0xe464[108]](function(_0x8bf0x2e){return CustomReport[_0xe464[51]](_0xe464[50])[_0xe464[49]](_0x8bf0xf[_0xe464[48]][_0xe464[47]])[_0xe464[20]](function(_0x8bf0x18){if(!_0x8bf0x18){return _0x8bf0x10[_0xe464[35]](404)};var _0x8bf0x2f=_0x8bf0x18[_0xe464[43]];delete _0x8bf0x2f[_0xe464[47]];delete _0x8bf0x2f[_0xe464[104]];delete _0x8bf0x2f[_0xe464[105]];_0x8bf0x2f[_0xe464[87]]= _0x8bf0xf[_0xe464[106]][_0xe464[87]];_0x8bf0x2d= _[_0xe464[107]](_0x8bf0x2f.Fields,_0xe464[43]);return CustomReport[_0xe464[94]](_0x8bf0x2f,{transaction:_0x8bf0x2e})})[_0xe464[20]](function(_0x8bf0x18){return [_0x8bf0x18,_0x8bf0x2d]})[_0xe464[31]](createFields(_0x8bf0x2e))})[_0xe464[20]](function(){return _0x8bf0x10[_0xe464[35]](201)})[_0xe464[17]](function(_0x8bf0x12){console[_0xe464[26]](_0x8bf0x12);return handleError(_0x8bf0x10,_0x8bf0x12)})};exports[_0xe464[94]]= function(_0x8bf0xf,_0x8bf0x10){var _0x8bf0x16;return sequelize[_0xe464[108]](function(_0x8bf0x2e){return CustomReport[_0xe464[94]](_0x8bf0xf[_0xe464[106]],{transaction:_0x8bf0x2e})[_0xe464[20]](function(_0x8bf0x18){_0x8bf0x16= _0x8bf0x18;return [_0x8bf0x16,_0x8bf0xf[_0xe464[106]][_0xe464[109]]]})[_0xe464[31]](createFields(_0x8bf0x2e))})[_0xe464[20]](function(){return _0x8bf0x10[_0xe464[19]](201)[_0xe464[18]](_0x8bf0x16)})[_0xe464[17]](function(_0x8bf0x12){console[_0xe464[26]](_0x8bf0x12);return handleError(_0x8bf0x10,_0x8bf0x12)})};exports[_0xe464[110]]= function(_0x8bf0xf,_0x8bf0x10){var _0x8bf0x16;return sequelize[_0xe464[108]](function(_0x8bf0x2e){return CustomReport[_0xe464[94]](_0x8bf0xf[_0xe464[106]],{transaction:_0x8bf0x2e})[_0xe464[20]](function(_0x8bf0x18){_0x8bf0x16= _0x8bf0x18;return [_0x8bf0x16,_0x8bf0xf[_0xe464[106]][_0xe464[109]]]})[_0xe464[31]](createImportFields(_0x8bf0x2e))})[_0xe464[20]](function(){return _0x8bf0x10[_0xe464[19]](201)[_0xe464[18]](_0x8bf0x16)})[_0xe464[17]](function(_0x8bf0x12){console[_0xe464[26]](_0x8bf0x12);return handleError(_0x8bf0x10,_0x8bf0x12)})};exports[_0xe464[111]]= function(_0x8bf0xf,_0x8bf0x10,_0x8bf0x11){if(_0x8bf0xf[_0xe464[106]][_0xe464[47]]){delete _0x8bf0xf[_0xe464[106]][_0xe464[47]]};var _0x8bf0x16;return sequelize[_0xe464[108]](function(_0x8bf0x2e){return CustomReport[_0xe464[49]](_0x8bf0xf[_0xe464[48]][_0xe464[47]])[_0xe464[20]](function(_0x8bf0x18){if(!_0x8bf0x18){return _0x8bf0x10[_0xe464[35]](404)};var _0x8bf0x30=_[_0xe464[112]](_0x8bf0x18,_0x8bf0xf[_0xe464[106]]);return _0x8bf0x18[_0xe464[113]]({transaction:_0x8bf0x2e})})[_0xe464[20]](function(_0x8bf0x18){_0x8bf0x16= _0x8bf0x18;if(_0x8bf0xf[_0xe464[106]][_0xe464[109]]){return ReportField[_0xe464[74]]({where:{CustomReportId:_0x8bf0xf[_0xe464[48]][_0xe464[47]]},transaction:_0x8bf0x2e})}})[_0xe464[20]](function(){return [_0x8bf0x16,_0x8bf0xf[_0xe464[106]][_0xe464[109]]]})[_0xe464[31]](createFields(_0x8bf0x2e))})[_0xe464[20]](function(){return _0x8bf0x10[_0xe464[35]](200)})[_0xe464[17]](function(_0x8bf0x12){console[_0xe464[26]](_0x8bf0x12);return handleError(_0x8bf0x10,_0x8bf0x12)})};function createFields(_0x8bf0x2e){return function(_0x8bf0x18,_0x8bf0x32){if(_0x8bf0x32&& Array[_0xe464[53]](_0x8bf0x32)&& _0x8bf0x32[_0xe464[54]]){var _0x8bf0x33=reportBuildUtils[_0xe464[114]](_0x8bf0x18[_0xe464[42]]);if(_0x8bf0x33){var _0x8bf0x34;return _0x8bf0x33[_0xe464[127]]()[_0xe464[20]](function(_0x8bf0x39){_0x8bf0x34= _[_0xe464[125]](_0x8bf0x39);return Metric[_0xe464[126]]()})[_0xe464[20]](function(_0x8bf0x35){var _0x8bf0x36=[];_0x8bf0x35= _[_0xe464[107]](_0x8bf0x35,_0xe464[43]);_0x8bf0x32[_0xe464[62]](function(_0x8bf0x37){_0x8bf0x37[_0xe464[115]]= _0x8bf0x18[_0xe464[47]];if(_0x8bf0x37[_0xe464[116]]){var _0x8bf0x38=_[_0xe464[72]](_0x8bf0x35,{id:_0x8bf0x37[_0xe464[116]]});if(_0x8bf0x38){_0x8bf0x37[_0xe464[117]]= _0x8bf0x38[_0xe464[118]];_0x8bf0x36[_0xe464[75]](ReportField[_0xe464[94]](_0x8bf0x37,{transaction:_0x8bf0x2e}))}else {throw  new sequelize.Error(_0xe464[119]+ _0x8bf0x37[_0xe464[116]]+ _0xe464[120])}}else {if(_[_0xe464[121]](_0x8bf0x34,_0x8bf0x37[_0xe464[117]])|| _0x8bf0x37[_0xe464[122]]){_0x8bf0x36[_0xe464[75]](ReportField[_0xe464[94]](_0x8bf0x37,{transaction:_0x8bf0x2e}))}else {throw  new sequelize.Error(_0xe464[123]+ _0x8bf0x37[_0xe464[117]]+ _0xe464[124])}}});return _0x8bf0x36})[_0xe464[29]]()}else {throw  new sequelize.Error(_0xe464[128])}}}}function createImportFields(_0x8bf0x2e){return function(_0x8bf0x18,_0x8bf0x32){if(_0x8bf0x32&& Array[_0xe464[53]](_0x8bf0x32)&& _0x8bf0x32[_0xe464[54]]){var _0x8bf0x33=reportBuildUtils[_0xe464[114]](_0x8bf0x18[_0xe464[42]]);if(_0x8bf0x33){var _0x8bf0x34;return _0x8bf0x33[_0xe464[127]]()[_0xe464[20]](function(_0x8bf0x39){_0x8bf0x34= _[_0xe464[125]](_0x8bf0x39);var _0x8bf0x36=[];var _0x8bf0x3b;if(_[_0xe464[131]](_0x8bf0x32,function(_0x8bf0x37){return _[_0xe464[130]](_0x8bf0x37,_0xe464[129])})){_0x8bf0x3b= _0xe464[132]}else {if(_[_0xe464[131]](_0x8bf0x32,function(_0x8bf0x37){return _[_0xe464[130]](_0x8bf0x37,_0xe464[116])})){_0x8bf0x3b= _0xe464[7]}else {throw  new sequelize.Error(_0xe464[133])}};var _0x8bf0x3c=_[_0xe464[135]](_0x8bf0x32,_0x8bf0x3b+ _0xe464[134]);_[_0xe464[61]](_0x8bf0x3c,function(_0x8bf0x3d,_0x8bf0x1d){if(_0x8bf0x1d!== _0xe464[136]&& _0x8bf0x1d!== _0xe464[137]){_0x8bf0x3d[0][_0x8bf0x3b][_0xe464[138]][_0xe464[62]](function(_0x8bf0x37){_0x8bf0x37[_0xe464[115]]= _0x8bf0x18[_0xe464[47]]});_0x8bf0x3d[0][_0x8bf0x3b][_0xe464[88]]+= _0xe464[139]+ sr({length:5});_0x8bf0x36[_0xe464[75]](Metric[_0xe464[94]](_0x8bf0x3d[0][_0x8bf0x3b],{include:[{model:ReportField,as:_0xe464[138]}],transaction:_0x8bf0x2e}))}else {_0x8bf0x3d[_0xe464[62]](function(_0x8bf0x37){if(_[_0xe464[121]](_0x8bf0x34,_0x8bf0x37[_0xe464[117]])|| _0x8bf0x37[_0xe464[122]]){_0x8bf0x37[_0xe464[115]]= _0x8bf0x18[_0xe464[47]];_0x8bf0x36[_0xe464[75]](ReportField[_0xe464[94]](_0x8bf0x37,{transaction:_0x8bf0x2e}))}else {throw  new sequelize.Error(_0xe464[123]+ _0x8bf0x37[_0xe464[117]]+ _0xe464[124])}})}});return _0x8bf0x36})[_0xe464[29]]()}else {throw  new sequelize.Error(_0xe464[128])}}}}exports[_0xe464[74]]= function(_0x8bf0xf,_0x8bf0x10){return CustomReport[_0xe464[49]](_0x8bf0xf[_0xe464[48]][_0xe464[47]])[_0xe464[20]](function(_0x8bf0x18){if(!_0x8bf0x18){return _0x8bf0x10[_0xe464[35]](404)};return _0x8bf0x18[_0xe464[74]]()})[_0xe464[20]](function(){return _0x8bf0x10[_0xe464[35]](204)})[_0xe464[17]](function(_0x8bf0x12){return handleError(_0x8bf0x10,_0x8bf0x12)})};exports[_0xe464[140]]= function(_0x8bf0xf,_0x8bf0x10){return CustomReport[_0xe464[74]]({where:{id:_0x8bf0xf[_0xe464[21]][_0xe464[141]]},individualHooks:true})[_0xe464[20]](function(){return _0x8bf0x10[_0xe464[35]](204)})[_0xe464[17]](function(_0x8bf0x12){return handleError(_0x8bf0x10,_0x8bf0x12)})};function handleError(_0x8bf0x10,_0x8bf0x12){return _0x8bf0x10[_0xe464[19]](500)[_0xe464[18]](_0x8bf0x12)}
\ No newline at end of file
+var _0xbde8=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64","\x4D\x65\x74\x72\x69\x63","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x62\x75\x69\x6C\x64","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\x6D\x6F\x6D\x65\x6E\x74","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x67\x65\x74\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x72\x79","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x20\x71\x75\x65\x72\x79\x20\x66\x72\x6F\x6D\x20\x61\x70\x69\x3A","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x6E\x6F\x20\x73\x75\x66\x66\x69\x63\x69\x65\x6E\x74\x20\x71\x75\x65\x75\x65\x20\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E\x73\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x75\x73\x65\x72","\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E","\x61\x6C\x6C","\x62\x75\x69\x6C\x64\x51\x75\x65\x72\x79","\x73\x70\x72\x65\x61\x64","\x75\x73\x65\x72","\x62\x75\x69\x6C\x64\x46\x69\x6C\x74\x65\x72","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x64\x61\x69\x6C\x79","\x74\x72\x75\x65","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\x66\x6F\x72\x6D\x61\x74","\x65\x6E\x64\x44\x61\x74\x65","\x74\x61\x62\x6C\x65","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x5F\x68\x69\x73\x74\x6F\x72\x79","","\x72\x65\x70\x6C\x61\x63\x65","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x66\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\x70\x72\x65\x76\x69\x65\x77","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x6C\x69\x6D\x69\x74","\x76\x61\x6C\x75\x65","\x74\x61\x6B\x65","\x6F\x66\x66\x73\x65\x74","\x73\x6C\x69\x63\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x4F\x77\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x72\x79\x20\x65\x72\x72\x6F\x72","\x63\x68\x65\x63\x6B\x51\x75\x65\x72\x79","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x64\x65\x62\x75\x67","\x50\x44\x46","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x53\x56","\x64\x65\x73\x74\x72\x6F\x79\x4E\x6F\x64\x65\x52\x65\x70\x6F\x72\x74\x73","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x66\x69\x6E\x64","\x4E\x6F\x64\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x64\x65\x73\x74\x72\x6F\x79","\x70\x75\x73\x68","\x66\x69\x6C\x74\x65\x72","\x63\x6F\x6D\x6D\x6F\x6E\x20\x64\x6F\x63\x45\x78\x74\x72\x61\x63\x74\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x72\x65\x61\x74\x65\x64\x20\x6E\x65\x77\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x73\x20\x64\x62\x20\x65\x6E\x74\x72\x79\x2C\x20\x63\x61\x6C\x6C\x69\x6E\x67\x20\x65\x78\x74\x65\x72\x6E\x61\x6C\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x3A\x20","\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x2E\x6A\x73","\x66\x6F\x72\x6B","\x52\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x52\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x63\x6C\x6F\x73\x65","\x6D\x65\x73\x73\x61\x67\x65","\x52\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x6D\x65\x73\x73\x61\x67\x65","\x6B\x69\x6C\x6C","\x70\x61\x72\x65\x6E\x74","\x6E\x61\x6D\x65","\x46\x6F\x75\x6E\x64\x20\x74\x68\x65\x20\x72\x65\x70\x6F\x72\x74\x2C\x20\x63\x72\x65\x61\x74\x69\x6E\x67\x20\x74\x68\x65\x20\x6E\x65\x77\x20\x44\x42\x20\x72\x6F\x77\x20\x66\x6F\x72\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x73\x2E\x2E","\x73\x74\x61\x72\x74\x54\x69\x6D\x65","\x20","\x30\x30\x3A\x30\x30","\x65\x6E\x64\x54\x69\x6D\x65","\x32\x33\x3A\x35\x39","\x63\x72\x65\x61\x74\x65","\x74\x65\x78\x74","\x2F\x20","\x23","\x73\x68\x6F\x77","\x65\x78\x70\x6F\x72\x74","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E\x73","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x63\x6F\x70\x79","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x62\x6F\x64\x79","\x6D\x61\x70","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x46\x69\x65\x6C\x64\x73","\x69\x6D\x70\x6F\x72\x74","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x67\x65\x74\x54\x61\x62\x6C\x65","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x4D\x65\x74\x72\x69\x63\x49\x64","\x66\x69\x65\x6C\x64","\x6D\x65\x74\x72\x69\x63","\x54\x68\x65\x20\x6D\x65\x74\x72\x69\x63\x20\x77\x69\x74\x68\x20\x69\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x63\x75\x73\x74\x6F\x6D","\x54\x68\x65\x20\x66\x69\x65\x6C\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74\x20\x69\x6E\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65","\x6B\x65\x79\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x59\x6F\x75\x20\x68\x61\x76\x65\x20\x6E\x6F\x74\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x6F\x72\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63\x49\x64","\x68\x61\x73","\x65\x76\x65\x72\x79","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63","\x55\x6E\x73\x75\x70\x70\x6F\x72\x74\x65\x64\x20\x49\x6D\x70\x6F\x72\x74\x20\x66\x6F\x72\x6D\x61\x74\x20\x28\x4D\x65\x74\x72\x69\x63\x20\x74\x79\x70\x65\x20\x69\x6E\x20\x72\x65\x70\x6F\x72\x74\x20\x66\x69\x65\x6C\x64\x73\x20\x69\x73\x20\x6D\x69\x73\x73\x69\x6E\x67\x29","\x49\x64","\x67\x72\x6F\x75\x70\x42\x79","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x6E\x75\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x5F","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xbde8[0];var _=require(_0xbde8[1]);var util=require(_0xbde8[2]);var sequelize=require(_0xbde8[4])[_0xbde8[3]];var CustomReport=require(_0xbde8[4])[_0xbde8[5]];var ReportField=require(_0xbde8[4])[_0xbde8[6]];var Metric=require(_0xbde8[4])[_0xbde8[7]];var ExtractedReport=require(_0xbde8[4])[_0xbde8[8]];var extractUtils=require(_0xbde8[9]);var reportBuildUtils=require(_0xbde8[10]);var Util=require(_0xbde8[11]);var sr=require(_0xbde8[12]);var moment=require(_0xbde8[13]);var cp=require(_0xbde8[14]);var ReportTree=require(_0xbde8[4])[_0xbde8[15]];var logger=require(_0xbde8[17])(_0xbde8[16]);exports[_0xbde8[18]]= function(_0xfdbcx10,_0xfdbcx11,_0xfdbcx12){return CustomReport[_0xbde8[25]](Util[_0xbde8[24]](_0xfdbcx10[_0xbde8[23]],{deletedAt:null}))[_0xbde8[22]](function(_0xfdbcx14){_0xfdbcx11[_0xbde8[21]](200)[_0xbde8[20]](_0xfdbcx14)})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)})};exports[_0xbde8[26]]= function(_0xfdbcx10,_0xfdbcx11){return Promise[_0xbde8[32]]([])[_0xbde8[22]](getQuery(_0xfdbcx10,_0xfdbcx11))[_0xbde8[22]](function(_0xfdbcx15){if(_0xfdbcx15){switch(_0xfdbcx15){case _0xbde8[31]:_0xfdbcx15= _0xbde8[30];break;default:}};_0xfdbcx11[_0xbde8[21]](200)[_0xbde8[20]]({query:_0xfdbcx15})})[_0xbde8[19]](function(_0xfdbcx13){logger[_0xbde8[29]](_0xbde8[27],_0xfdbcx13[_0xbde8[28]])})};function getQuery(_0xfdbcx10,_0xfdbcx11){var _0xfdbcx17;return function(){return CustomReport[_0xbde8[53]](_0xbde8[52])[_0xbde8[51]](_0xfdbcx10[_0xbde8[50]][_0xbde8[49]])[_0xbde8[22]](function(_0xfdbcx19){if(!_0xfdbcx19){return _0xfdbcx11[_0xbde8[37]](404)};if(_0xfdbcx10[_0xbde8[23]][_0xbde8[38]]&& _0xfdbcx10[_0xbde8[23]][_0xbde8[38]]=== _0xbde8[39]){_0xfdbcx10[_0xbde8[23]][_0xbde8[40]]= moment()[_0xbde8[42]](_0xbde8[41]);_0xfdbcx10[_0xbde8[23]][_0xbde8[43]]= moment()[_0xbde8[42]](_0xbde8[41]);_0xfdbcx19[_0xbde8[45]][_0xbde8[44]]= _0xfdbcx19[_0xbde8[45]][_0xbde8[44]][_0xbde8[48]](_0xbde8[46],_0xbde8[47])};delete _0xfdbcx10[_0xbde8[23]][_0xbde8[38]];_0xfdbcx17= _0xfdbcx19[_0xbde8[45]];return _0xfdbcx17[_0xbde8[44]]})[_0xbde8[22]](reportBuildUtils[_0xbde8[36]](_0xfdbcx10[_0xbde8[35]]))[_0xbde8[22]](function(_0xfdbcx18){return [_0xfdbcx18,_0xfdbcx17]})[_0xbde8[34]](reportBuildUtils[_0xbde8[33]](_0xfdbcx10[_0xbde8[23]]))}}exports[_0xbde8[54]]= function(_0xfdbcx10,_0xfdbcx11){var _0xfdbcx1a;return Promise[_0xbde8[32]]([])[_0xbde8[22]](getQuery(_0xfdbcx10,_0xfdbcx11))[_0xbde8[22]](reportBuildUtils[_0xbde8[66]]())[_0xbde8[22]](function(_0xfdbcx1b){if(_0xfdbcx1b&& _[_0xbde8[55]](_0xfdbcx1b)){_0xfdbcx1a= _0xfdbcx1b[_0xbde8[56]];if(_0xfdbcx10[_0xbde8[23]][_0xbde8[57]]){_0xfdbcx1b= _(_0xfdbcx1b)[_0xbde8[61]](_0xfdbcx10[_0xbde8[23]][_0xbde8[60]]|| 0)[_0xbde8[59]](_0xfdbcx10[_0xbde8[23]][_0xbde8[57]])[_0xbde8[58]]()};_[_0xbde8[64]](_0xfdbcx1b,function(_0xfdbcx1c){_[_0xbde8[63]](_0xfdbcx1c,function(_0xfdbcx1d,_0xfdbcx1e){if(_0xfdbcx1d instanceof  Date){_0xfdbcx1c[_0xfdbcx1e]= moment(_0xfdbcx1d)[_0xbde8[42]](_0xbde8[62]).toString()}})});_0xfdbcx11[_0xbde8[21]](200)[_0xbde8[20]]({rows:_0xfdbcx1b,count:_0xfdbcx1a})}else {return handleError(_0xfdbcx11,{message:_0xfdbcx1b|| _0xbde8[65]})}})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)})};exports[_0xbde8[67]]= function(_0xfdbcx10,_0xfdbcx11){logger[_0xbde8[69]](_0xbde8[68]);docExtract(_0xfdbcx10,_0xfdbcx11,_0xbde8[70])};exports[_0xbde8[71]]= function(_0xfdbcx10,_0xfdbcx11){logger[_0xbde8[69]](_0xbde8[72]);docExtract(_0xfdbcx10,_0xfdbcx11,_0xbde8[73])};exports[_0xbde8[74]]= function(_0xfdbcx10,_0xfdbcx11){return ReportTree[_0xbde8[51]](2)[_0xbde8[22]](function(_0xfdbcx1f){_0xfdbcx1f= JSON[_0xbde8[76]](_0xfdbcx1f[_0xbde8[75]]);var _0xfdbcx20=_[_0xbde8[77]](_0xfdbcx1f,{id:_0xfdbcx10[_0xbde8[50]][_0xbde8[49]]});if(!_0xfdbcx20){throw  new Error(_0xbde8[78])};var _0xfdbcx21=[];findSubNodes(_0xfdbcx20,_0xfdbcx1f,_0xfdbcx21);return CustomReport[_0xbde8[79]]({where:{parent:_0xfdbcx21},individualHooks:true})})[_0xbde8[22]](function(){return _0xfdbcx11[_0xbde8[37]](200)})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)})};function findSubNodes(_0xfdbcx20,_0xfdbcx1f,_0xfdbcx23){_0xfdbcx23[_0xbde8[80]](_0xfdbcx20[_0xbde8[49]]);var _0xfdbcx24=_[_0xbde8[81]](_0xfdbcx1f,{parent:_0xfdbcx20[_0xbde8[49]]});if(!_0xfdbcx24||  !_0xfdbcx24[_0xbde8[56]]){return};_[_0xbde8[64]](_0xfdbcx24,function(_0xfdbcx25){findSubNodes(_0xfdbcx25,_0xfdbcx1f,_0xfdbcx23)})}function docExtract(_0xfdbcx10,_0xfdbcx11,_0xfdbcx27){var _0xfdbcx19;logger[_0xbde8[69]](_0xbde8[82]);CustomReport[_0xbde8[53]](_0xbde8[52])[_0xbde8[51]](_0xfdbcx10[_0xbde8[50]][_0xbde8[49]])[_0xbde8[22]](function(_0xfdbcx17){if(!_0xfdbcx17){return _0xfdbcx11[_0xbde8[37]](404)};_0xfdbcx19= _0xfdbcx17;return ReportTree[_0xbde8[51]](2)})[_0xbde8[22]](function(_0xfdbcx1f){_0xfdbcx1f= JSON[_0xbde8[76]](_0xfdbcx1f[_0xbde8[75]]);var _0xfdbcx2b=_[_0xbde8[77]](_0xfdbcx1f,{id:_0xfdbcx19[_0xbde8[93]]});var _0xfdbcx2c=getReportPath(_0xfdbcx2b,_0xfdbcx1f,_0xfdbcx19[_0xbde8[94]]);logger[_0xbde8[69]](_0xbde8[95]);if(_0xfdbcx10[_0xbde8[23]][_0xbde8[38]]&& _0xfdbcx10[_0xbde8[23]][_0xbde8[38]]=== _0xbde8[39]){_0xfdbcx10[_0xbde8[23]][_0xbde8[40]]= moment()[_0xbde8[42]](_0xbde8[41]);_0xfdbcx10[_0xbde8[23]][_0xbde8[43]]= moment()[_0xbde8[42]](_0xbde8[41]);_0xfdbcx19[_0xbde8[45]][_0xbde8[44]]= _0xfdbcx19[_0xbde8[45]][_0xbde8[44]][_0xbde8[48]](_0xbde8[46],_0xbde8[47])};delete _0xfdbcx10[_0xbde8[23]][_0xbde8[38]];return [_0xfdbcx19,ExtractedReport[_0xbde8[101]]({name:_0xfdbcx2c,startDate:_0xfdbcx10[_0xbde8[23]][_0xbde8[40]]?_0xfdbcx10[_0xbde8[23]][_0xbde8[40]]+ (_0xfdbcx10[_0xbde8[23]][_0xbde8[96]]?_0xbde8[97]+ _0xfdbcx10[_0xbde8[23]][_0xbde8[96]]:_0xbde8[98]):null,endDate:_0xfdbcx10[_0xbde8[23]][_0xbde8[43]]?_0xfdbcx10[_0xbde8[23]][_0xbde8[43]]+ (_0xfdbcx10[_0xbde8[23]][_0xbde8[99]]?_0xbde8[97]+ _0xfdbcx10[_0xbde8[23]][_0xbde8[99]]:_0xbde8[100]):null,output:_0xfdbcx27,UserId:_0xfdbcx10[_0xbde8[35]][_0xbde8[49]]})]})[_0xbde8[34]](function(_0xfdbcx19,_0xfdbcx28){logger[_0xbde8[69]](_0xbde8[83]+ _0xfdbcx27);var _0xfdbcx29=cp[_0xbde8[85]](__dirname+ _0xbde8[84]);_0xfdbcx29[_0xbde8[87]](_0xbde8[90],function(_0xfdbcx2a){logger[_0xbde8[69]](_0xbde8[91],_0xfdbcx2a);_0xfdbcx29[_0xbde8[92]]()})[_0xbde8[87]](_0xbde8[88],function(){logger[_0xbde8[69]](_0xbde8[89])})[_0xbde8[87]](_0xbde8[29],function(_0xfdbcx13){logger[_0xbde8[69]](_0xbde8[86],_0xfdbcx13)});_0xfdbcx29[_0xbde8[20]]({report:_0xfdbcx19,query:_0xfdbcx10[_0xbde8[23]],extractedId:_0xfdbcx28[_0xbde8[49]],user:_0xfdbcx10[_0xbde8[35]],type:_0xfdbcx27})})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)});return _0xfdbcx11[_0xbde8[37]](200)}function getReportPath(_0xfdbcx2b,_0xfdbcx1f,_0xfdbcx2c){_0xfdbcx2c= _0xfdbcx2b[_0xbde8[102]]+ _0xbde8[103]+ _0xfdbcx2c;if(_0xfdbcx2b[_0xbde8[93]]=== _0xbde8[104]){return _0xfdbcx2c}else {return getReportPath(_[_0xbde8[77]](_0xfdbcx1f,{id:_0xfdbcx2b[_0xbde8[93]]}),_0xfdbcx1f,_0xfdbcx2c)}}exports[_0xbde8[105]]= function(_0xfdbcx10,_0xfdbcx11){return CustomReport[_0xbde8[53]](_0xbde8[52])[_0xbde8[51]](_0xfdbcx10[_0xbde8[50]][_0xbde8[49]])[_0xbde8[22]](function(_0xfdbcx19){if(!_0xfdbcx19){return _0xfdbcx11[_0xbde8[37]](404)};return _0xfdbcx11[_0xbde8[20]](_0xfdbcx19)})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)})};exports[_0xbde8[106]]= function(_0xfdbcx10,_0xfdbcx11){return CustomReport[_0xbde8[53]]({method:[_0xbde8[109],{CustomReportId:_0xfdbcx10[_0xbde8[50]][_0xbde8[49]]}]})[_0xbde8[51]](_0xfdbcx10[_0xbde8[50]][_0xbde8[49]],{attributes:[_0xbde8[107],_0xbde8[108],_0xbde8[94],_0xbde8[93],_0xbde8[44]]})[_0xbde8[22]](function(_0xfdbcx19){if(!_0xfdbcx19){return _0xfdbcx11[_0xbde8[37]](404)};return _0xfdbcx11[_0xbde8[20]](_0xfdbcx19)})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)})};exports[_0xbde8[110]]= function(_0xfdbcx10,_0xfdbcx11){var _0xfdbcx2e;return sequelize[_0xbde8[115]](function(_0xfdbcx2f){return CustomReport[_0xbde8[53]](_0xbde8[52])[_0xbde8[51]](_0xfdbcx10[_0xbde8[50]][_0xbde8[49]])[_0xbde8[22]](function(_0xfdbcx19){if(!_0xfdbcx19){return _0xfdbcx11[_0xbde8[37]](404)};var _0xfdbcx30=_0xfdbcx19[_0xbde8[45]];delete _0xfdbcx30[_0xbde8[49]];delete _0xfdbcx30[_0xbde8[111]];delete _0xfdbcx30[_0xbde8[112]];_0xfdbcx30[_0xbde8[93]]= _0xfdbcx10[_0xbde8[113]][_0xbde8[93]];_0xfdbcx2e= _[_0xbde8[114]](_0xfdbcx30.Fields,_0xbde8[45]);return CustomReport[_0xbde8[101]](_0xfdbcx30,{transaction:_0xfdbcx2f})})[_0xbde8[22]](function(_0xfdbcx19){return [_0xfdbcx19,_0xfdbcx2e]})[_0xbde8[34]](createFields(_0xfdbcx2f))})[_0xbde8[22]](function(){return _0xfdbcx11[_0xbde8[37]](201)})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)})};exports[_0xbde8[101]]= function(_0xfdbcx10,_0xfdbcx11){var _0xfdbcx17;return sequelize[_0xbde8[115]](function(_0xfdbcx2f){return CustomReport[_0xbde8[101]](_0xfdbcx10[_0xbde8[113]],{transaction:_0xfdbcx2f})[_0xbde8[22]](function(_0xfdbcx19){_0xfdbcx17= _0xfdbcx19;return [_0xfdbcx17,_0xfdbcx10[_0xbde8[113]][_0xbde8[116]]]})[_0xbde8[34]](createFields(_0xfdbcx2f))})[_0xbde8[22]](function(){return _0xfdbcx11[_0xbde8[21]](201)[_0xbde8[20]](_0xfdbcx17)})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)})};exports[_0xbde8[117]]= function(_0xfdbcx10,_0xfdbcx11){var _0xfdbcx17;return sequelize[_0xbde8[115]](function(_0xfdbcx2f){return CustomReport[_0xbde8[101]](_0xfdbcx10[_0xbde8[113]],{transaction:_0xfdbcx2f})[_0xbde8[22]](function(_0xfdbcx19){_0xfdbcx17= _0xfdbcx19;return [_0xfdbcx17,_0xfdbcx10[_0xbde8[113]][_0xbde8[116]]]})[_0xbde8[34]](createImportFields(_0xfdbcx2f))})[_0xbde8[22]](function(){return _0xfdbcx11[_0xbde8[21]](201)[_0xbde8[20]](_0xfdbcx17)})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)})};exports[_0xbde8[118]]= function(_0xfdbcx10,_0xfdbcx11,_0xfdbcx12){if(_0xfdbcx10[_0xbde8[113]][_0xbde8[49]]){delete _0xfdbcx10[_0xbde8[113]][_0xbde8[49]]};var _0xfdbcx17;return sequelize[_0xbde8[115]](function(_0xfdbcx2f){return CustomReport[_0xbde8[51]](_0xfdbcx10[_0xbde8[50]][_0xbde8[49]])[_0xbde8[22]](function(_0xfdbcx19){if(!_0xfdbcx19){return _0xfdbcx11[_0xbde8[37]](404)};var _0xfdbcx31=_[_0xbde8[119]](_0xfdbcx19,_0xfdbcx10[_0xbde8[113]]);return _0xfdbcx19[_0xbde8[120]]({transaction:_0xfdbcx2f})})[_0xbde8[22]](function(_0xfdbcx19){_0xfdbcx17= _0xfdbcx19;if(_0xfdbcx10[_0xbde8[113]][_0xbde8[116]]){return ReportField[_0xbde8[79]]({where:{CustomReportId:_0xfdbcx10[_0xbde8[50]][_0xbde8[49]]},transaction:_0xfdbcx2f})}})[_0xbde8[22]](function(){return [_0xfdbcx17,_0xfdbcx10[_0xbde8[113]][_0xbde8[116]]]})[_0xbde8[34]](createFields(_0xfdbcx2f))})[_0xbde8[22]](function(){return _0xfdbcx11[_0xbde8[37]](200)})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)})};function createFields(_0xfdbcx2f){return function(_0xfdbcx19,_0xfdbcx33){if(_0xfdbcx33&& Array[_0xbde8[55]](_0xfdbcx33)&& _0xfdbcx33[_0xbde8[56]]){var _0xfdbcx34=reportBuildUtils[_0xbde8[121]](_0xfdbcx19[_0xbde8[44]]);if(_0xfdbcx34){var _0xfdbcx35;return _0xfdbcx34[_0xbde8[134]]()[_0xbde8[22]](function(_0xfdbcx3a){_0xfdbcx35= _[_0xbde8[132]](_0xfdbcx3a);return Metric[_0xbde8[133]]()})[_0xbde8[22]](function(_0xfdbcx36){var _0xfdbcx37=[];_0xfdbcx36= _[_0xbde8[114]](_0xfdbcx36,_0xbde8[45]);_0xfdbcx33[_0xbde8[64]](function(_0xfdbcx38){_0xfdbcx38[_0xbde8[122]]= _0xfdbcx19[_0xbde8[49]];if(_0xfdbcx38[_0xbde8[123]]){var _0xfdbcx39=_[_0xbde8[77]](_0xfdbcx36,{id:_0xfdbcx38[_0xbde8[123]]});if(_0xfdbcx39){_0xfdbcx38[_0xbde8[124]]= _0xfdbcx39[_0xbde8[125]];_0xfdbcx37[_0xbde8[80]](ReportField[_0xbde8[101]](_0xfdbcx38,{transaction:_0xfdbcx2f}))}else {throw  new sequelize.Error(_0xbde8[126]+ _0xfdbcx38[_0xbde8[123]]+ _0xbde8[127])}}else {if(_[_0xbde8[128]](_0xfdbcx35,_0xfdbcx38[_0xbde8[124]])|| _0xfdbcx38[_0xbde8[129]]){_0xfdbcx37[_0xbde8[80]](ReportField[_0xbde8[101]](_0xfdbcx38,{transaction:_0xfdbcx2f}))}else {throw  new sequelize.Error(_0xbde8[130]+ _0xfdbcx38[_0xbde8[124]]+ _0xbde8[131])}}});return _0xfdbcx37})[_0xbde8[32]]()}else {throw  new sequelize.Error(_0xbde8[135])}}}}function createImportFields(_0xfdbcx2f){return function(_0xfdbcx19,_0xfdbcx33){if(_0xfdbcx33&& Array[_0xbde8[55]](_0xfdbcx33)&& _0xfdbcx33[_0xbde8[56]]){var _0xfdbcx34=reportBuildUtils[_0xbde8[121]](_0xfdbcx19[_0xbde8[44]]);if(_0xfdbcx34){var _0xfdbcx35;return _0xfdbcx34[_0xbde8[134]]()[_0xbde8[22]](function(_0xfdbcx3a){_0xfdbcx35= _[_0xbde8[132]](_0xfdbcx3a);var _0xfdbcx37=[];var _0xfdbcx3c;if(_[_0xbde8[138]](_0xfdbcx33,function(_0xfdbcx38){return _[_0xbde8[137]](_0xfdbcx38,_0xbde8[136])})){_0xfdbcx3c= _0xbde8[139]}else {if(_[_0xbde8[138]](_0xfdbcx33,function(_0xfdbcx38){return _[_0xbde8[137]](_0xfdbcx38,_0xbde8[123])})){_0xfdbcx3c= _0xbde8[7]}else {throw  new sequelize.Error(_0xbde8[140])}};var _0xfdbcx3d=_[_0xbde8[142]](_0xfdbcx33,_0xfdbcx3c+ _0xbde8[141]);_[_0xbde8[63]](_0xfdbcx3d,function(_0xfdbcx3e,_0xfdbcx1e){if(_0xfdbcx1e!== _0xbde8[143]&& _0xfdbcx1e!== _0xbde8[144]){_0xfdbcx3e[0][_0xfdbcx3c][_0xbde8[145]][_0xbde8[64]](function(_0xfdbcx38){_0xfdbcx38[_0xbde8[122]]= _0xfdbcx19[_0xbde8[49]]});_0xfdbcx3e[0][_0xfdbcx3c][_0xbde8[94]]+= _0xbde8[146]+ sr({length:5});_0xfdbcx37[_0xbde8[80]](Metric[_0xbde8[101]](_0xfdbcx3e[0][_0xfdbcx3c],{include:[{model:ReportField,as:_0xbde8[145]}],transaction:_0xfdbcx2f}))}else {_0xfdbcx3e[_0xbde8[64]](function(_0xfdbcx38){if(_[_0xbde8[128]](_0xfdbcx35,_0xfdbcx38[_0xbde8[124]])|| _0xfdbcx38[_0xbde8[129]]){_0xfdbcx38[_0xbde8[122]]= _0xfdbcx19[_0xbde8[49]];_0xfdbcx37[_0xbde8[80]](ReportField[_0xbde8[101]](_0xfdbcx38,{transaction:_0xfdbcx2f}))}else {throw  new sequelize.Error(_0xbde8[130]+ _0xfdbcx38[_0xbde8[124]]+ _0xbde8[131])}})}});return _0xfdbcx37})[_0xbde8[32]]()}else {throw  new sequelize.Error(_0xbde8[135])}}}}exports[_0xbde8[79]]= function(_0xfdbcx10,_0xfdbcx11){return CustomReport[_0xbde8[51]](_0xfdbcx10[_0xbde8[50]][_0xbde8[49]])[_0xbde8[22]](function(_0xfdbcx19){if(!_0xfdbcx19){return _0xfdbcx11[_0xbde8[37]](404)};return _0xfdbcx19[_0xbde8[79]]()})[_0xbde8[22]](function(){return _0xfdbcx11[_0xbde8[37]](204)})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)})};exports[_0xbde8[147]]= function(_0xfdbcx10,_0xfdbcx11){return CustomReport[_0xbde8[79]]({where:{id:_0xfdbcx10[_0xbde8[23]][_0xbde8[148]]},individualHooks:true})[_0xbde8[22]](function(){return _0xfdbcx11[_0xbde8[37]](204)})[_0xbde8[19]](function(_0xfdbcx13){return handleError(_0xfdbcx11,_0xfdbcx13)})};function handleError(_0xfdbcx11,_0xfdbcx13){logger[_0xbde8[29]](_0xfdbcx13[_0xbde8[28]]);return _0xfdbcx11[_0xbde8[21]](500)[_0xbde8[20]](_0xfdbcx13)}
\ No newline at end of file