Built motion from commit a5685af.|0.0.128
[motion.git] / server / api / default_report / default_report.controller.js
index 05e972c..6e79f26 100644 (file)
@@ -1 +1 @@
-var _0x225d=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x44\x65\x66\x61\x75\x6C\x74\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\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","\x6D\x6F\x6D\x65\x6E\x74","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\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","\x6C\x6F\x67","\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","\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","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\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","\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","\x6E\x61\x6D\x65","\x63\x72\x65\x61\x74\x65","\x28","\x72\x75\x6C\x65\x73","\x20","\x6F\x70\x65\x72\x61\x74\x6F\x72","\x67\x72\x6F\x75\x70","\x66\x69\x65\x6C\x64","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E","\x20\x27","\x4C\x49\x4B\x45","\x25","\x27","\x29","\x73\x68\x6F\x77","\x63\x6F\x70\x79","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x70\x61\x72\x65\x6E\x74","\x62\x6F\x64\x79","\x46\x69\x65\x6C\x64\x73","\x6D\x61\x70","\x44\x65\x66\x61\x75\x6C\x74\x52\x65\x70\x6F\x72\x74\x49\x64","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79"];_0x225d[0];var _=require(_0x225d[1]);var util=require(_0x225d[2]);var DefaultReport=require(_0x225d[4])[_0x225d[3]];var sequelize=require(_0x225d[4])[_0x225d[5]];var CustomReport=require(_0x225d[4])[_0x225d[6]];var ExtractedReport=require(_0x225d[4])[_0x225d[7]];var extractUtils=require(_0x225d[8]);var reportBuildUtils=require(_0x225d[9]);var Util=require(_0x225d[10]);var moment=require(_0x225d[11]);var cp=require(_0x225d[12]);exports[_0x225d[13]]=function(_0x9608xc,_0x9608xd,_0x9608xe){return DefaultReport[_0x225d[20]](Util[_0x225d[19]](_0x9608xc[_0x225d[18]]))[_0x225d[17]](function(_0x9608x10){_0x9608xd[_0x225d[16]](200)[_0x225d[15]](_0x9608x10)})[_0x225d[14]](function(_0x9608xf){return handleError(_0x9608xd,_0x9608xf)})};exports[_0x225d[21]]=function(_0x9608xc,_0x9608xd){return Promise[_0x225d[24]]([])[_0x225d[17]](getQuery(_0x9608xc,_0x9608xd))[_0x225d[17]](function(_0x9608x11){_0x9608xd[_0x225d[16]](200)[_0x225d[15]]({query:_0x9608x11})})[_0x225d[14]](function(_0x9608xf){console[_0x225d[23]](_0x225d[22],_0x9608xf)})};function getQuery(_0x9608xc,_0x9608xd){var _0x9608x13;return function(){return DefaultReport[_0x225d[46]](_0x225d[45])[_0x225d[44]](_0x9608xc[_0x225d[43]][_0x225d[42]])[_0x225d[17]](function(_0x9608x15){console[_0x225d[23]](_0x225d[29]);if(!_0x9608x15){return _0x9608xd[_0x225d[30]](404)};if(_0x9608xc[_0x225d[18]][_0x225d[31]]&&_0x9608xc[_0x225d[18]][_0x225d[31]]===_0x225d[32]){_0x9608xc[_0x225d[18]][_0x225d[33]]=moment()[_0x225d[35]](_0x225d[34]);_0x9608xc[_0x225d[18]][_0x225d[36]]=moment()[_0x225d[35]](_0x225d[34]);_0x9608x15[_0x225d[38]][_0x225d[37]]=_0x9608x15[_0x225d[38]][_0x225d[37]][_0x225d[41]](_0x225d[39],_0x225d[40])};delete _0x9608xc[_0x225d[18]][_0x225d[31]];_0x9608x13=_0x9608x15[_0x225d[38]];return _0x9608x13[_0x225d[37]]})[_0x225d[17]](reportBuildUtils[_0x225d[28]](_0x9608xc[_0x225d[27]]))[_0x225d[17]](function(_0x9608x14){return [_0x9608x14,_0x9608x13]})[_0x225d[26]](reportBuildUtils[_0x225d[25]](_0x9608xc[_0x225d[18]]))}}exports[_0x225d[47]]=function(_0x9608xc,_0x9608xd){var _0x9608x16;return Promise[_0x225d[24]]([])[_0x225d[17]](getQuery(_0x9608xc,_0x9608xd))[_0x225d[17]](function(_0x9608x11){return sequelize[_0x225d[18]](_0x9608x11,{type:sequelize[_0x225d[58]][_0x225d[57]]})})[_0x225d[17]](function(_0x9608x17){_0x9608x16=_0x9608x17[_0x225d[48]];if(_0x9608xc[_0x225d[18]][_0x225d[49]]){_0x9608x17=_(_0x9608x17)[_0x225d[53]](_0x9608xc[_0x225d[18]][_0x225d[52]]||0)[_0x225d[51]](_0x9608xc[_0x225d[18]][_0x225d[49]])[_0x225d[50]]()};_[_0x225d[56]](_0x9608x17,function(_0x9608x18){_[_0x225d[55]](_0x9608x18,function(_0x9608x19,_0x9608x1a){if(_0x9608x19 instanceof Date){_0x9608x18[_0x9608x1a]=moment(_0x9608x19)[_0x225d[35]](_0x225d[54]).toString()}})});_0x9608xd[_0x225d[16]](200)[_0x225d[15]]({rows:_0x9608x17,count:_0x9608x16})})[_0x225d[14]](function(_0x9608xf){console[_0x225d[23]](_0x9608xf);return handleError(_0x9608xd,_0x9608xf)})};exports[_0x225d[59]]=function(_0x9608xc,_0x9608xd){docExtract(_0x9608xc,_0x9608xd,_0x225d[60])};exports[_0x225d[61]]=function(_0x9608xc,_0x9608xd){docExtract(_0x9608xc,_0x9608xd,_0x225d[62])};function docExtract(_0x9608xc,_0x9608xd,_0x9608x1c){DefaultReport[_0x225d[46]](_0x225d[45])[_0x225d[44]](_0x9608xc[_0x225d[43]][_0x225d[42]])[_0x225d[17]](function(_0x9608x15){if(!_0x9608x15){return _0x9608xd[_0x225d[30]](404)};if(_0x9608xc[_0x225d[18]][_0x225d[31]]&&_0x9608xc[_0x225d[18]][_0x225d[31]]===_0x225d[32]){_0x9608xc[_0x225d[18]][_0x225d[33]]=moment()[_0x225d[35]](_0x225d[34]);_0x9608xc[_0x225d[18]][_0x225d[36]]=moment()[_0x225d[35]](_0x225d[34]);_0x9608x15[_0x225d[38]][_0x225d[37]]=_0x9608x15[_0x225d[38]][_0x225d[37]][_0x225d[41]](_0x225d[39],_0x225d[40])};delete _0x9608xc[_0x225d[18]][_0x225d[31]];return [_0x9608x15,ExtractedReport[_0x225d[74]]({name:_0x9608x15[_0x225d[73]],startDate:_0x9608xc[_0x225d[18]][_0x225d[33]]||null,endDate:_0x9608xc[_0x225d[18]][_0x225d[36]]||null,output:_0x9608x1c})]})[_0x225d[26]](function(_0x9608x15,_0x9608x1d){var _0x9608x1e=cp[_0x225d[64]](__dirname+_0x225d[63]);_0x9608x1e[_0x225d[67]](_0x225d[70],function(_0x9608x1f){console[_0x225d[23]](_0x225d[71],_0x9608x1f);_0x9608x1e[_0x225d[72]]()})[_0x225d[67]](_0x225d[68],function(){console[_0x225d[23]](_0x225d[69])})[_0x225d[67]](_0x225d[65],function(_0x9608xf){console[_0x225d[23]](_0x225d[66],_0x9608xf)});_0x9608x1e[_0x225d[15]]({report:_0x9608x15,query:_0x9608xc[_0x225d[18]],extractedId:_0x9608x1d[_0x225d[42]],user:_0x9608xc[_0x225d[27]],type:_0x9608x1c})})[_0x225d[14]](function(_0x9608xf){console[_0x225d[23]](_0x9608xf);return handleError(_0x9608xd,_0x9608xf)});return _0x9608xd[_0x225d[30]](200)}function getConditions(_0x9608x21){if(!_0x9608x21){return _0x225d[40]};for(var _0x9608x22=_0x225d[75],_0x9608x23=0;_0x9608x23<_0x9608x21[_0x225d[76]][_0x225d[48]];_0x9608x23++){_0x9608x23>0&&(_0x9608x22+=_0x225d[77]+_0x9608x21[_0x225d[78]]+_0x225d[77]);_0x9608x22+=_0x9608x21[_0x225d[76]][_0x9608x23][_0x225d[79]]?getConditions(_0x9608x21[_0x225d[76]][_0x9608x23][_0x225d[79]]):_0x9608x21[_0x225d[76]][_0x9608x23][_0x225d[80]]+_0x225d[77]+_0x9608x21[_0x225d[76]][_0x9608x23][_0x225d[81]]+_0x225d[82]+(_0x9608x21[_0x225d[76]][_0x9608x23][_0x225d[81]]===_0x225d[83]?_0x225d[84]+_0x9608x21[_0x225d[76]][_0x9608x23][_0x225d[50]]+_0x225d[84]:_0x9608x21[_0x225d[76]][_0x9608x23][_0x225d[50]])+_0x225d[85]};return _0x9608x22+_0x225d[86]}exports[_0x225d[87]]=function(_0x9608xc,_0x9608xd){return DefaultReport[_0x225d[44]](_0x9608xc[_0x225d[43]][_0x225d[42]],{include:[{all:true}]})[_0x225d[17]](function(_0x9608x15){if(!_0x9608x15){return _0x9608xd[_0x225d[30]](404)};return _0x9608xd[_0x225d[15]](_0x9608x15)})[_0x225d[14]](function(_0x9608xf){return handleError(_0x9608xd,_0x9608xf)})};exports[_0x225d[88]]=function(_0x9608xc,_0x9608xd){return DefaultReport[_0x225d[44]](_0x9608xc[_0x225d[43]][_0x225d[42]],{include:[{all:true}]})[_0x225d[17]](function(_0x9608x15){if(!_0x9608x15){return _0x9608xd[_0x225d[30]](404)};var _0x9608x24=_0x9608x15[_0x225d[38]];delete _0x9608x24[_0x225d[42]];delete _0x9608x24[_0x225d[89]];delete _0x9608x24[_0x225d[90]];_0x9608x24[_0x225d[91]]=_0x9608xc[_0x225d[92]][_0x225d[91]];_0x9608x24[_0x225d[93]]=_[_0x225d[94]](_0x9608x24.Fields,_0x225d[38]);_[_0x225d[56]](_0x9608x24.Fields,function(_0x9608x25){delete _0x9608x25[_0x225d[42]];delete _0x9608x25[_0x225d[95]];delete _0x9608x25[_0x225d[89]];delete _0x9608x25[_0x225d[90]]});return CustomReport[_0x225d[74]](_0x9608x24,{include:[{all:true}]})})[_0x225d[17]](function(){return _0x9608xd[_0x225d[30]](201)})[_0x225d[14]](function(_0x9608xf){console[_0x225d[23]](_0x9608xf);return handleError(_0x9608xd,_0x9608xf)})};exports[_0x225d[74]]=function(_0x9608xc,_0x9608xd){return DefaultReport[_0x225d[74]](_0x9608xc[_0x225d[92]])[_0x225d[17]](function(_0x9608x15){return _0x9608xd[_0x225d[16]](201)[_0x225d[15]](_0x9608x15)})[_0x225d[14]](function(_0x9608xf){return handleError(_0x9608xd,_0x9608xf)})};exports[_0x225d[96]]=function(_0x9608xc,_0x9608xd){if(_0x9608xc[_0x225d[92]][_0x225d[42]]){delete _0x9608xc[_0x225d[92]][_0x225d[42]]};return DefaultReport[_0x225d[44]](_0x9608xc[_0x225d[43]][_0x225d[42]])[_0x225d[17]](function(_0x9608x15){if(!_0x9608x15){return _0x9608xd[_0x225d[30]](404)};var _0x9608x26=_[_0x225d[97]](_0x9608x15,_0x9608xc[_0x225d[92]]);return _0x9608x26[_0x225d[98]]()})[_0x225d[17]](function(_0x9608x15){return _0x9608xd[_0x225d[16]](200)[_0x225d[15]](_0x9608x15)})[_0x225d[14]](function(_0x9608xf){return handleError(_0x9608xd,_0x9608xf)})};exports[_0x225d[99]]=function(_0x9608xc,_0x9608xd){return DefaultReport[_0x225d[44]](_0x9608xc[_0x225d[43]][_0x225d[42]])[_0x225d[17]](function(_0x9608x15){if(!_0x9608x15){return _0x9608xd[_0x225d[30]](404)};return _0x9608x15[_0x225d[99]]()})[_0x225d[17]](function(){return _0x9608xd[_0x225d[30]](204)})[_0x225d[14]](function(_0x9608xf){return handleError(_0x9608xd,_0x9608xf)})};function handleError(_0x9608xd,_0x9608xf){return _0x9608xd[_0x225d[16]](500)[_0x225d[15]](_0x9608xf)}
\ No newline at end of file
+var _0xb9f4=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x44\x65\x66\x61\x75\x6C\x74\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64","\x4D\x65\x74\x72\x69\x63","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\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","\x6D\x6F\x6D\x65\x6E\x74","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\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","\x65\x78\x70\x6F\x72\x74","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E\x73","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x6E\x61\x6D\x65","\x70\x61\x72\x65\x6E\x74","\x74\x61\x62\x6C\x65","\x66\x69\x6E\x64\x42\x79\x49\x64","\x65\x78\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\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","\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","\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","\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","\x66\x69\x65\x6C\x64\x73","\x70\x72\x65\x76\x69\x65\x77","\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","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\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","\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","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x66\x69\x6E\x64","\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","\x28","\x72\x75\x6C\x65\x73","\x6F\x70\x65\x72\x61\x74\x6F\x72","\x67\x72\x6F\x75\x70","\x66\x69\x65\x6C\x64","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E","\x20\x27","\x4C\x49\x4B\x45","\x25","\x27","\x29","\x73\x68\x6F\x77","\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","\x69\x73\x41\x72\x72\x61\x79","\x67\x65\x74\x54\x61\x62\x6C\x65","\x6B\x65\x79\x73","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63\x49\x64","\x67\x72\x6F\x75\x70\x42\x79","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x6E\x75\x6C\x6C","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63","\x5F","\x70\x75\x73\x68","\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","\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","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79"];_0xb9f4[0];var _=require(_0xb9f4[1]);var util=require(_0xb9f4[2]);var DefaultReport=require(_0xb9f4[4])[_0xb9f4[3]];var ReportField=require(_0xb9f4[4])[_0xb9f4[5]];var Metric=require(_0xb9f4[4])[_0xb9f4[6]];var sequelize=require(_0xb9f4[4])[_0xb9f4[7]];var CustomReport=require(_0xb9f4[4])[_0xb9f4[8]];var ExtractedReport=require(_0xb9f4[4])[_0xb9f4[9]];var extractUtils=require(_0xb9f4[10]);var reportBuildUtils=require(_0xb9f4[11]);var Util=require(_0xb9f4[12]);var moment=require(_0xb9f4[13]);var cp=require(_0xb9f4[14]);var sr=require(_0xb9f4[15]);var ReportTree=require(_0xb9f4[4])[_0xb9f4[16]];exports[_0xb9f4[17]]= function(_0x539fx10,_0x539fx11,_0x539fx12){return DefaultReport[_0xb9f4[24]](Util[_0xb9f4[23]](_0x539fx10[_0xb9f4[22]]))[_0xb9f4[21]](function(_0x539fx14){_0x539fx11[_0xb9f4[20]](200)[_0xb9f4[19]](_0x539fx14)})[_0xb9f4[18]](function(_0x539fx13){return handleError(_0x539fx11,_0x539fx13)})};exports[_0xb9f4[25]]= function(_0x539fx10,_0x539fx11){return DefaultReport[_0xb9f4[36]]({method:[_0xb9f4[35],{DefaultReportId:_0x539fx10[_0xb9f4[28]][_0xb9f4[27]]}]})[_0xb9f4[34]](_0x539fx10[_0xb9f4[28]][_0xb9f4[27]],{attributes:[_0xb9f4[29],_0xb9f4[30],_0xb9f4[31],_0xb9f4[32],_0xb9f4[33]]})[_0xb9f4[21]](function(_0x539fx15){if(!_0x539fx15){return _0x539fx11[_0xb9f4[26]](404)};return _0x539fx11[_0xb9f4[19]](_0x539fx15)})[_0xb9f4[18]](function(_0x539fx13){return handleError(_0x539fx11,_0x539fx13)})};exports[_0xb9f4[37]]= function(_0x539fx10,_0x539fx11){return Promise[_0xb9f4[40]]([])[_0xb9f4[21]](getQuery(_0x539fx10,_0x539fx11))[_0xb9f4[21]](function(_0x539fx16){_0x539fx11[_0xb9f4[20]](200)[_0xb9f4[19]]({query:_0x539fx16})})[_0xb9f4[18]](function(_0x539fx13){console[_0xb9f4[39]](_0xb9f4[38],_0x539fx13)})};function getQuery(_0x539fx10,_0x539fx11){var _0x539fx18;return function(){return DefaultReport[_0xb9f4[36]](_0xb9f4[56])[_0xb9f4[34]](_0x539fx10[_0xb9f4[28]][_0xb9f4[27]])[_0xb9f4[21]](function(_0x539fx15){console[_0xb9f4[39]](_0xb9f4[45]);if(!_0x539fx15){return _0x539fx11[_0xb9f4[26]](404)};if(_0x539fx10[_0xb9f4[22]][_0xb9f4[46]]&& _0x539fx10[_0xb9f4[22]][_0xb9f4[46]]=== _0xb9f4[47]){_0x539fx10[_0xb9f4[22]][_0xb9f4[48]]= moment()[_0xb9f4[50]](_0xb9f4[49]);_0x539fx10[_0xb9f4[22]][_0xb9f4[51]]= moment()[_0xb9f4[50]](_0xb9f4[49]);_0x539fx15[_0xb9f4[52]][_0xb9f4[33]]= _0x539fx15[_0xb9f4[52]][_0xb9f4[33]][_0xb9f4[55]](_0xb9f4[53],_0xb9f4[54])};delete _0x539fx10[_0xb9f4[22]][_0xb9f4[46]];_0x539fx18= _0x539fx15[_0xb9f4[52]];return _0x539fx18[_0xb9f4[33]]})[_0xb9f4[21]](reportBuildUtils[_0xb9f4[44]](_0x539fx10[_0xb9f4[43]]))[_0xb9f4[21]](function(_0x539fx19){return [_0x539fx19,_0x539fx18]})[_0xb9f4[42]](reportBuildUtils[_0xb9f4[41]](_0x539fx10[_0xb9f4[22]]))}}exports[_0xb9f4[57]]= function(_0x539fx10,_0x539fx11){var _0x539fx1a;return Promise[_0xb9f4[40]]([])[_0xb9f4[21]](getQuery(_0x539fx10,_0x539fx11))[_0xb9f4[21]](function(_0x539fx16){return sequelize[_0xb9f4[22]](_0x539fx16,{type:sequelize[_0xb9f4[68]][_0xb9f4[67]]})})[_0xb9f4[21]](function(_0x539fx1b){_0x539fx1a= _0x539fx1b[_0xb9f4[58]];if(_0x539fx10[_0xb9f4[22]][_0xb9f4[59]]){_0x539fx1b= _(_0x539fx1b)[_0xb9f4[63]](_0x539fx10[_0xb9f4[22]][_0xb9f4[62]]|| 0)[_0xb9f4[61]](_0x539fx10[_0xb9f4[22]][_0xb9f4[59]])[_0xb9f4[60]]()};_[_0xb9f4[66]](_0x539fx1b,function(_0x539fx1c){_[_0xb9f4[65]](_0x539fx1c,function(_0x539fx1d,_0x539fx1e){if(_0x539fx1d instanceof  Date){_0x539fx1c[_0x539fx1e]= moment(_0x539fx1d)[_0xb9f4[50]](_0xb9f4[64]).toString()}})});_0x539fx11[_0xb9f4[20]](200)[_0xb9f4[19]]({rows:_0x539fx1b,count:_0x539fx1a})})[_0xb9f4[18]](function(_0x539fx13){console[_0xb9f4[39]](_0x539fx13);return handleError(_0x539fx11,_0x539fx13)})};exports[_0xb9f4[69]]= function(_0x539fx10,_0x539fx11){docExtract(_0x539fx10,_0x539fx11,_0xb9f4[70])};exports[_0xb9f4[71]]= function(_0x539fx10,_0x539fx11){docExtract(_0x539fx10,_0x539fx11,_0xb9f4[72])};function docExtract(_0x539fx10,_0x539fx11,_0x539fx20){var _0x539fx15;DefaultReport[_0xb9f4[36]](_0xb9f4[56])[_0xb9f4[34]](_0x539fx10[_0xb9f4[28]][_0xb9f4[27]])[_0xb9f4[21]](function(_0x539fx18){if(!_0x539fx18){return _0x539fx11[_0xb9f4[26]](404)};_0x539fx15= _0x539fx18;return ReportTree[_0xb9f4[34]](1)})[_0xb9f4[21]](function(_0x539fx24){_0x539fx24= JSON[_0xb9f4[84]](_0x539fx24[_0xb9f4[83]]);var _0x539fx25=_[_0xb9f4[85]](_0x539fx24,{id:_0x539fx15[_0xb9f4[32]]});var _0x539fx26=getReportPath(_0x539fx25,_0x539fx24,_0x539fx15[_0xb9f4[31]]);if(_0x539fx10[_0xb9f4[22]][_0xb9f4[46]]&& _0x539fx10[_0xb9f4[22]][_0xb9f4[46]]=== _0xb9f4[47]){_0x539fx10[_0xb9f4[22]][_0xb9f4[48]]= moment()[_0xb9f4[50]](_0xb9f4[49]);_0x539fx10[_0xb9f4[22]][_0xb9f4[51]]= moment()[_0xb9f4[50]](_0xb9f4[49]);_0x539fx15[_0xb9f4[52]][_0xb9f4[33]]= _0x539fx15[_0xb9f4[52]][_0xb9f4[33]][_0xb9f4[55]](_0xb9f4[53],_0xb9f4[54])};delete _0x539fx10[_0xb9f4[22]][_0xb9f4[46]];return [_0x539fx15,ExtractedReport[_0xb9f4[91]]({name:_0x539fx26,startDate:_0x539fx10[_0xb9f4[22]][_0xb9f4[48]]?_0x539fx10[_0xb9f4[22]][_0xb9f4[48]]+ (_0x539fx10[_0xb9f4[22]][_0xb9f4[86]]?_0xb9f4[87]+ _0x539fx10[_0xb9f4[22]][_0xb9f4[86]]:_0xb9f4[88]):null,endDate:_0x539fx10[_0xb9f4[22]][_0xb9f4[51]]?_0x539fx10[_0xb9f4[22]][_0xb9f4[51]]+ (_0x539fx10[_0xb9f4[22]][_0xb9f4[89]]?_0xb9f4[87]+ _0x539fx10[_0xb9f4[22]][_0xb9f4[89]]:_0xb9f4[90]):null,output:_0x539fx20,UserId:_0x539fx10[_0xb9f4[43]][_0xb9f4[27]]})]})[_0xb9f4[42]](function(_0x539fx15,_0x539fx21){var _0x539fx22=cp[_0xb9f4[74]](__dirname+ _0xb9f4[73]);_0x539fx22[_0xb9f4[77]](_0xb9f4[80],function(_0x539fx23){console[_0xb9f4[39]](_0xb9f4[81],_0x539fx23);_0x539fx22[_0xb9f4[82]]()})[_0xb9f4[77]](_0xb9f4[78],function(){console[_0xb9f4[39]](_0xb9f4[79])})[_0xb9f4[77]](_0xb9f4[75],function(_0x539fx13){console[_0xb9f4[39]](_0xb9f4[76],_0x539fx13)});_0x539fx22[_0xb9f4[19]]({report:_0x539fx15,query:_0x539fx10[_0xb9f4[22]],extractedId:_0x539fx21[_0xb9f4[27]],user:_0x539fx10[_0xb9f4[43]],type:_0x539fx20})})[_0xb9f4[18]](function(_0x539fx13){console[_0xb9f4[39]](_0x539fx13);return handleError(_0x539fx11,_0x539fx13)});return _0x539fx11[_0xb9f4[26]](200)}function getReportPath(_0x539fx25,_0x539fx24,_0x539fx26){_0x539fx26= _0x539fx25[_0xb9f4[92]]+ _0xb9f4[93]+ _0x539fx26;if(_0x539fx25[_0xb9f4[32]]=== _0xb9f4[94]){return _0x539fx26}else {return getReportPath(_[_0xb9f4[85]](_0x539fx24,{id:_0x539fx25[_0xb9f4[32]]}),_0x539fx24,_0x539fx26)}}function getConditions(_0x539fx29){if(!_0x539fx29){return _0xb9f4[54]};for(var _0x539fx2a=_0xb9f4[95],_0x539fx2b=0;_0x539fx2b< _0x539fx29[_0xb9f4[96]][_0xb9f4[58]];_0x539fx2b++){_0x539fx2b> 0&& (_0x539fx2a+= _0xb9f4[87]+ _0x539fx29[_0xb9f4[97]]+ _0xb9f4[87]);_0x539fx2a+= _0x539fx29[_0xb9f4[96]][_0x539fx2b][_0xb9f4[98]]?getConditions(_0x539fx29[_0xb9f4[96]][_0x539fx2b][_0xb9f4[98]]):_0x539fx29[_0xb9f4[96]][_0x539fx2b][_0xb9f4[99]]+ _0xb9f4[87]+ _0x539fx29[_0xb9f4[96]][_0x539fx2b][_0xb9f4[100]]+ _0xb9f4[101]+ (_0x539fx29[_0xb9f4[96]][_0x539fx2b][_0xb9f4[100]]=== _0xb9f4[102]?_0xb9f4[103]+ _0x539fx29[_0xb9f4[96]][_0x539fx2b][_0xb9f4[60]]+ _0xb9f4[103]:_0x539fx29[_0xb9f4[96]][_0x539fx2b][_0xb9f4[60]])+ _0xb9f4[104]};return _0x539fx2a+ _0xb9f4[105]}exports[_0xb9f4[106]]= function(_0x539fx10,_0x539fx11){return DefaultReport[_0xb9f4[34]](_0x539fx10[_0xb9f4[28]][_0xb9f4[27]],{include:[{all:true}]})[_0xb9f4[21]](function(_0x539fx15){if(!_0x539fx15){return _0x539fx11[_0xb9f4[26]](404)};return _0x539fx11[_0xb9f4[19]](_0x539fx15)})[_0xb9f4[18]](function(_0x539fx13){return handleError(_0x539fx11,_0x539fx13)})};exports[_0xb9f4[107]]= function(_0x539fx10,_0x539fx11){var _0x539fx2c;return sequelize[_0xb9f4[112]](function(_0x539fx2d){return DefaultReport[_0xb9f4[36]]({method:[_0xb9f4[35],{DefaultReportId:_0x539fx10[_0xb9f4[28]][_0xb9f4[27]]}]})[_0xb9f4[34]](_0x539fx10[_0xb9f4[28]][_0xb9f4[27]])[_0xb9f4[21]](function(_0x539fx15){if(!_0x539fx15){return _0x539fx11[_0xb9f4[26]](404)};var _0x539fx2e=_0x539fx15[_0xb9f4[52]];console[_0xb9f4[39]](_0x539fx2e);delete _0x539fx2e[_0xb9f4[27]];delete _0x539fx2e[_0xb9f4[108]];delete _0x539fx2e[_0xb9f4[109]];_0x539fx2e[_0xb9f4[32]]= _0x539fx10[_0xb9f4[110]][_0xb9f4[32]];_0x539fx2c= _[_0xb9f4[111]](_0x539fx2e.Fields,_0xb9f4[52]);return CustomReport[_0xb9f4[91]](_0x539fx2e,{transaction:_0x539fx2d})})[_0xb9f4[21]](function(_0x539fx15){return [_0x539fx15,_0x539fx2c]})[_0xb9f4[42]](createCopyFields(_0x539fx2d))})[_0xb9f4[21]](function(){return _0x539fx11[_0xb9f4[26]](201)})[_0xb9f4[18]](function(_0x539fx13){console[_0xb9f4[39]](_0x539fx13);return handleError(_0x539fx11,_0x539fx13)})};function createCopyFields(_0x539fx2d){return function(_0x539fx15,_0x539fx30){if(_0x539fx30&& Array[_0xb9f4[113]](_0x539fx30)&& _0x539fx30[_0xb9f4[58]]){var _0x539fx31=reportBuildUtils[_0xb9f4[114]](_0x539fx15[_0xb9f4[33]]);if(_0x539fx31){var _0x539fx32;return _0x539fx31[_0xb9f4[129]]()[_0xb9f4[21]](function(_0x539fx33){_0x539fx32= _[_0xb9f4[115]](_0x539fx33);var _0x539fx34=[];var _0x539fx35=_[_0xb9f4[117]](_0x539fx30,_0xb9f4[116]);_[_0xb9f4[65]](_0x539fx35,function(_0x539fx36,_0x539fx1e){if(_0x539fx1e!== _0xb9f4[118]&& _0x539fx1e!== _0xb9f4[119]){_0x539fx36[0][_0xb9f4[122]][_0xb9f4[121]][_0xb9f4[66]](function(_0x539fx37){_0x539fx37[_0xb9f4[120]]= _0x539fx15[_0xb9f4[27]]});_0x539fx36[0][_0xb9f4[122]][_0xb9f4[31]]+= _0xb9f4[123]+ sr({length:5});_0x539fx34[_0xb9f4[124]](Metric[_0xb9f4[91]](_0x539fx36[0][_0xb9f4[122]][_0xb9f4[52]],{include:[{model:ReportField,as:_0xb9f4[121]}],transaction:_0x539fx2d}))}else {_0x539fx36[_0xb9f4[66]](function(_0x539fx37){if(_[_0xb9f4[125]](_0x539fx32,_0x539fx37[_0xb9f4[99]])|| _0x539fx37[_0xb9f4[126]]){_0x539fx37[_0xb9f4[120]]= _0x539fx15[_0xb9f4[27]];_0x539fx34[_0xb9f4[124]](ReportField[_0xb9f4[91]](_0x539fx37,{transaction:_0x539fx2d}))}else {throw  new sequelize.Error(_0xb9f4[127]+ _0x539fx37[_0xb9f4[99]]+ _0xb9f4[128])}})}});return _0x539fx34})[_0xb9f4[40]]()}else {throw  new sequelize.Error(_0xb9f4[130])}}}}exports[_0xb9f4[91]]= function(_0x539fx10,_0x539fx11){return DefaultReport[_0xb9f4[91]](_0x539fx10[_0xb9f4[110]])[_0xb9f4[21]](function(_0x539fx15){return _0x539fx11[_0xb9f4[20]](201)[_0xb9f4[19]](_0x539fx15)})[_0xb9f4[18]](function(_0x539fx13){return handleError(_0x539fx11,_0x539fx13)})};exports[_0xb9f4[131]]= function(_0x539fx10,_0x539fx11){if(_0x539fx10[_0xb9f4[110]][_0xb9f4[27]]){delete _0x539fx10[_0xb9f4[110]][_0xb9f4[27]]};return DefaultReport[_0xb9f4[34]](_0x539fx10[_0xb9f4[28]][_0xb9f4[27]])[_0xb9f4[21]](function(_0x539fx15){if(!_0x539fx15){return _0x539fx11[_0xb9f4[26]](404)};var _0x539fx38=_[_0xb9f4[132]](_0x539fx15,_0x539fx10[_0xb9f4[110]]);return _0x539fx38[_0xb9f4[133]]()})[_0xb9f4[21]](function(_0x539fx15){return _0x539fx11[_0xb9f4[20]](200)[_0xb9f4[19]](_0x539fx15)})[_0xb9f4[18]](function(_0x539fx13){return handleError(_0x539fx11,_0x539fx13)})};exports[_0xb9f4[134]]= function(_0x539fx10,_0x539fx11){return DefaultReport[_0xb9f4[34]](_0x539fx10[_0xb9f4[28]][_0xb9f4[27]])[_0xb9f4[21]](function(_0x539fx15){if(!_0x539fx15){return _0x539fx11[_0xb9f4[26]](404)};return _0x539fx15[_0xb9f4[134]]()})[_0xb9f4[21]](function(){return _0x539fx11[_0xb9f4[26]](204)})[_0xb9f4[18]](function(_0x539fx13){return handleError(_0x539fx11,_0x539fx13)})};function handleError(_0x539fx11,_0x539fx13){return _0x539fx11[_0xb9f4[20]](500)[_0xb9f4[19]](_0x539fx13)}
\ No newline at end of file