Built motion from commit a5685af.|0.0.128
[motion.git] / server / api / custom_report / custom_report.controller.js
index 2207763..386fc5a 100644 (file)
@@ -1 +1 @@
-var _0x6106=["\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","\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","\x69\x6E\x64\x65\x78","\x6E\x61\x6D\x65","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x70\x61\x72\x65\x6E\x74","\x70\x65\x72\x5F\x70\x61\x67\x65","\x71\x75\x65\x72\x79","\x70\x61\x67\x65","\x6F\x72\x64\x65\x72","\x25\x73\x20\x25\x73","\x73\x6F\x72\x74\x5F\x62\x79","\x73\x6F\x72\x74\x5F\x6F\x72\x64\x65\x72","\x41\x53\x43","\x66\x6F\x72\x6D\x61\x74","\x24\x6F\x72","\x77\x68\x65\x72\x65","\x25","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x24","\x72\x6F\x6C\x65","\x73\x70\x6C\x69\x74","\x70\x61\x72\x73\x65","\x66\x6F\x72\x4F\x77\x6E","\x63\x6C\x69\x65\x6E\x74\x51\x75\x65\x72\x79","\x24\x6C\x69\x6B\x65","\x66\x6F\x72\x49\x6E","\x53\x6F\x6D\x65\x74\x68\x69\x6E\x67\x20\x62\x6C\x65\x77\x20\x75\x70\x21","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x63\x61\x74\x63\x68","\x63\x6F\x75\x6E\x74","\x63\x65\x69\x6C","\x6F\x66\x66\x73\x65\x74","\x25\x73\x3A\x2F\x2F\x25\x73\x25\x73\x3F\x70\x61\x67\x65\x3D\x25\x64","\x70\x72\x6F\x74\x6F\x63\x6F\x6C","\x68\x6F\x73\x74","\x68\x65\x61\x64\x65\x72\x73","\x62\x61\x73\x65\x55\x72\x6C","\x72\x6F\x77\x73","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x70\x72\x65\x76\x69\x65\x77","\x6C\x6F\x67","\x6C\x65\x6E\x67\x74\x68","\x73\x70\x72\x65\x61\x64","\x61\x6C\x6C","\x66\x6F\x75\x6E\x64\x20\x72\x65\x70\x6F\x72\x74","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x75\x69\x50\x61\x67\x69\x6E\x61\x74\x69\x6F\x6E","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\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","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x62\x6F\x64\x79","\x65\x6E\x64\x44\x61\x74\x65","\x4D\x45\x53\x53\x41\x47\x45\x5F\x53\x54\x41\x52\x54\x5F\x4F\x52\x5F\x45\x4E\x44\x5F\x44\x41\x54\x45\x5F\x4D\x49\x53\x53\x49\x4E\x47","\x65\x78\x74\x72\x61\x63\x74","\x63\x72\x65\x61\x74\x65","\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","\x46\x69\x65\x6C\x64\x73","\x70\x6C\x75\x63\x6B","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x69\x6D\x70\x6F\x72\x74","","\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x4F\x55\x4E\x54\x28\x44\x49\x53\x54\x49\x4E\x43\x54\x20\x25\x73\x29","\x66\x69\x65\x6C\x64","\x43\x4F\x55\x4E\x54\x20\x44\x49\x53\x54\x49\x4E\x43\x54","\x47\x52\x4F\x55\x50\x5F\x43\x4F\x4E\x43\x41\x54\x28\x25\x73\x20\x4F\x52\x44\x45\x52\x20\x42\x59\x20\x25\x73\x20\x41\x53\x43\x29","\x47\x52\x4F\x55\x50\x5F\x43\x4F\x4E\x43\x41\x54\x20\x41\x53\x43","\x47\x52\x4F\x55\x50\x5F\x43\x4F\x4E\x43\x41\x54\x28\x25\x73\x20\x4F\x52\x44\x45\x52\x20\x42\x59\x20\x25\x73\x20\x44\x45\x53\x43\x29","\x47\x52\x4F\x55\x50\x5F\x43\x4F\x4E\x43\x41\x54\x20\x44\x45\x53\x43","\x25\x73\x28\x25\x73\x29","\x25\x73\x20\x41\x53\x20\x27\x25\x73\x27","\x61\x6C\x69\x61\x73","\x67\x72\x6F\x75\x70\x42\x79","\x6F\x72\x64\x65\x72\x42\x79","\x67\x72\x6F\x75\x70","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E\x73","\x20","\x2C","\x6A\x6F\x69\x6E","\x2C\x43\x4F\x55\x4E\x54\x28\x2A\x29","\x20\x46\x52\x4F\x4D\x20","\x74\x61\x62\x6C\x65","\x28\x29","\x20\x57\x48\x45\x52\x45\x20","\x70\x65\x72\x50\x61\x67\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74\x20\x3E\x3D\x20\x27","\x27","\x63\x72\x65\x61\x74\x65\x64\x41\x74\x20\x3C\x3D\x20\x27","\x66\x69\x6E\x64","\x20\x4C\x49\x4B\x45\x20\x27\x25","\x25\x27","\x20\x41\x4E\x44\x20","\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20","\x20\x4F\x52\x44\x45\x52\x20\x42\x59\x20","\x20\x4C\x49\x4D\x49\x54\x20","\x20\x4F\x46\x46\x53\x45\x54\x20","\x28","\x72\x75\x6C\x65\x73","\x6F\x70\x65\x72\x61\x74\x6F\x72","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E","\x20\x27","\x4C\x49\x4B\x45","\x76\x61\x6C\x75\x65","\x29","\x75\x70\x64\x61\x74\x65","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79"];_0x6106[0];var _=require(_0x6106[1]);var util=require(_0x6106[2]);var sequelize=require(_0x6106[4])[_0x6106[3]];var CustomReport=require(_0x6106[4])[_0x6106[5]];var ReportField=require(_0x6106[4])[_0x6106[6]];var ExtractedReport=require(_0x6106[4])[_0x6106[7]];var extractUtils=require(_0x6106[8]);exports[_0x6106[9]]=function(_0xf9a9x8,_0xf9a9x9,_0xf9a9xa){var _0xf9a9xb=[_0x6106[10],_0x6106[11],_0x6106[12]];var _0xf9a9xc=_0xf9a9x8[_0x6106[14]][_0x6106[13]]?parseInt(_0xf9a9x8[_0x6106[14]][_0x6106[13]],10):100;var _0xf9a9xd=_0xf9a9x8[_0x6106[14]][_0x6106[15]]?parseInt(_0xf9a9x8[_0x6106[14]][_0x6106[15]],10):0;var _0xf9a9xe={where:{},limit:_0xf9a9xc,offset:_0xf9a9xd*_0xf9a9xc};_[_0x6106[34]](_0xf9a9x8[_0x6106[14]],function(_0xf9a9xf,_0xf9a9x10){switch(_0xf9a9x10){case _0x6106[13]:;case _0x6106[15]:break ;;case _0x6106[18]:_0xf9a9xe[_0x6106[16]]=util[_0x6106[21]](_0x6106[17],_0xf9a9x8[_0x6106[14]][_0x6106[18]],_0xf9a9x8[_0x6106[14]][_0x6106[19]]||_0x6106[20])||null;break ;;case _0x6106[19]:break ;;case _0x6106[27]:_0xf9a9xe[_0x6106[23]][_0x6106[22]]=[];_0xf9a9xb[_0x6106[26]](function(_0xf9a9x11){var _0xf9a9x12={};_0xf9a9x12[_0xf9a9x11]={$like:_0x6106[24]+_0xf9a9xf+_0x6106[24]};_0xf9a9xe[_0x6106[23]][_0x6106[22]][_0x6106[25]](_0xf9a9x12);});break ;;case _0x6106[28]:_0xf9a9xe[_0x6106[23]][_0x6106[28]]={$or:_0xf9a9xf[_0x6106[29]](/[\s,]+/)};break ;;case _0x6106[32]:var _0xf9a9x13=JSON[_0x6106[30]](_0xf9a9xf);_[_0x6106[31]](_0xf9a9x13,function(_0xf9a9x14,_0xf9a9x15){_0xf9a9xe[_0x6106[23]][_0xf9a9x15]=_0xf9a9x14});break ;;default:_0xf9a9xe[_0x6106[23]][_0xf9a9x10]={$like:{}};_0xf9a9xe[_0x6106[23]][_0xf9a9x10][_0x6106[33]]=_0x6106[24]+_0xf9a9xf+_0x6106[24];;}});CustomReport[_0x6106[49]](_0xf9a9xe)[_0x6106[48]](function(_0xf9a9x17){var _0xf9a9x18=Math[_0x6106[40]](_0xf9a9x17[_0x6106[39]]/_0xf9a9xc);var _0xf9a9x19=_0xf9a9x18>(_0xf9a9xe[_0x6106[41]]+1)?util[_0x6106[21]](_0x6106[42],_0xf9a9x8[_0x6106[43]],_0xf9a9x8[_0x6106[45]][_0x6106[44]],_0xf9a9x8[_0x6106[46]],_0xf9a9xd+1):null;var _0xf9a9x1a=_0xf9a9xd>0?util[_0x6106[21]](_0x6106[42],_0xf9a9x8[_0x6106[43]],_0xf9a9x8[_0x6106[45]][_0x6106[44]],_0xf9a9x8[_0x6106[46]],_0xf9a9xd-1):null;_0xf9a9x9[_0x6106[37]](200)[_0x6106[36]]({count:_0xf9a9x17[_0x6106[39]],rows:_0xf9a9x17[_0x6106[47]],next_page:_0xf9a9x19,previous_page:_0xf9a9x1a,total_pages:_0xf9a9x18});})[_0x6106[38]](function(_0xf9a9x16){_0xf9a9x9[_0x6106[37]](500)[_0x6106[36]]({error:_0x6106[35]})});};exports[_0x6106[50]]=function(_0xf9a9x8,_0xf9a9x9){CustomReport[_0x6106[63]](_0xf9a9x8[_0x6106[62]][_0x6106[61]],{include:[{all:true}]})[_0x6106[48]](function(_0xf9a9x1d){console[_0x6106[51]](_0x6106[55]);if(!_0xf9a9x1d){return _0xf9a9x9[_0x6106[56]](404)};var _0xf9a9xe=buildReport(_0xf9a9x1d[_0x6106[57]],_0xf9a9x8[_0x6106[14]]);var _0xf9a9x1e=[sequelize[_0x6106[14]](_0xf9a9xe,{type:sequelize[_0x6106[59]][_0x6106[58]]})];if(_0xf9a9x8[_0x6106[14]][_0x6106[60]]){var _0xf9a9x1f=buildReport(_0xf9a9x1d[_0x6106[57]],_0xf9a9x8[_0x6106[14]],true);_0xf9a9x1e[_0x6106[25]](sequelize[_0x6106[14]](_0xf9a9x1f,{type:sequelize[_0x6106[59]][_0x6106[58]]}));};return _0xf9a9x1e;})[_0x6106[54]]()[_0x6106[53]](function(_0xf9a9x1b,_0xf9a9x1c){console[_0x6106[51]](_0xf9a9x1b[_0x6106[52]]);console[_0x6106[51]](_0xf9a9x1c);_0xf9a9x9[_0x6106[37]](200)[_0x6106[36]]({rows:_0xf9a9x1b,count:_0xf9a9x1c?_0xf9a9x1c[0]:null});})[_0x6106[38]](function(_0xf9a9x16){console[_0x6106[51]](_0xf9a9x16);return handleError(_0xf9a9x9,_0xf9a9x16);})};exports[_0x6106[64]]=function(_0xf9a9x8,_0xf9a9x9){docExtract(_0xf9a9x8,_0xf9a9x9,_0x6106[65])};exports[_0x6106[66]]=function(_0xf9a9x8,_0xf9a9x9){docExtract(_0xf9a9x8,_0xf9a9x9,_0x6106[67])};function docExtract(_0xf9a9x8,_0xf9a9x9,_0xf9a9x21){if(!_0xf9a9x8[_0x6106[69]][_0x6106[68]]||!_0xf9a9x8[_0x6106[69]][_0x6106[70]]){return _0xf9a9x9[_0x6106[37]](500)[_0x6106[36]]({message:_0x6106[71]})};CustomReport[_0x6106[63]](_0xf9a9x8[_0x6106[62]][_0x6106[61]],{include:[{all:true}]})[_0x6106[48]](function(_0xf9a9x1d){if(!_0xf9a9x1d){return _0xf9a9x9[_0x6106[56]](404)};return [_0xf9a9x1d,ExtractedReport[_0x6106[73]]({name:_0xf9a9x1d[_0x6106[10]],startDate:_0xf9a9x8[_0x6106[69]][_0x6106[68]],endDate:_0xf9a9x8[_0x6106[69]][_0x6106[70]],output:_0xf9a9x21})];})[_0x6106[53]](function(_0xf9a9x1d,_0xf9a9x22){extractUtils[_0x6106[72]+_0xf9a9x21](_0xf9a9x1d,_0xf9a9x8[_0x6106[69]][_0x6106[68]],_0xf9a9x8[_0x6106[69]][_0x6106[70]],_0xf9a9x22[_0x6106[61]])})[_0x6106[38]](function(_0xf9a9x16){console[_0x6106[51]](_0xf9a9x16);return handleError(_0xf9a9x9,_0xf9a9x16);});return _0xf9a9x9[_0x6106[56]](200);}exports[_0x6106[74]]=function(_0xf9a9x8,_0xf9a9x9){CustomReport[_0x6106[63]](_0xf9a9x8[_0x6106[62]][_0x6106[61]],{include:[{all:true}]})[_0x6106[48]](function(_0xf9a9x1d){if(!_0xf9a9x1d){return _0xf9a9x9[_0x6106[56]](404)};return _0xf9a9x9[_0x6106[36]](_0xf9a9x1d);})[_0x6106[38]](function(_0xf9a9x16){return handleError(_0xf9a9x9,_0xf9a9x16)})};exports[_0x6106[75]]=function(_0xf9a9x8,_0xf9a9x9){CustomReport[_0x6106[63]](_0xf9a9x8[_0x6106[62]][_0x6106[61]],{include:[{all:true}]})[_0x6106[48]](function(_0xf9a9x1d){if(!_0xf9a9x1d){return _0xf9a9x9[_0x6106[56]](404)};var _0xf9a9x23=_0xf9a9x1d[_0x6106[57]];delete _0xf9a9x23[_0x6106[61]];delete _0xf9a9x23[_0x6106[76]];delete _0xf9a9x23[_0x6106[77]];_0xf9a9x23[_0x6106[12]]=_0xf9a9x8[_0x6106[69]][_0x6106[12]];_0xf9a9x23[_0x6106[78]]=_[_0x6106[79]](_0xf9a9x23.Fields,_0x6106[57]);_[_0x6106[26]](_0xf9a9x23.Fields,function(_0xf9a9x24){delete _0xf9a9x24[_0x6106[61]];delete _0xf9a9x24[_0x6106[80]];delete _0xf9a9x24[_0x6106[76]];delete _0xf9a9x24[_0x6106[77]];});return CustomReport[_0x6106[73]](_0xf9a9x23,{include:[{all:true}]});})[_0x6106[48]](function(){return _0xf9a9x9[_0x6106[56]](201)})[_0x6106[38]](function(_0xf9a9x16){console[_0x6106[51]](_0xf9a9x16);return handleError(_0xf9a9x9,_0xf9a9x16);})};exports[_0x6106[81]]=function(_0xf9a9x8,_0xf9a9x9){CustomReport[_0x6106[73]](_0xf9a9x8[_0x6106[69]],{include:[{all:true}]})[_0x6106[48]](function(_0xf9a9x1d){return _0xf9a9x9[_0x6106[37]](201)[_0x6106[36]](_0xf9a9x1d)})[_0x6106[38]](function(_0xf9a9x16){return handleError(_0xf9a9x9,_0xf9a9x16)})};function buildReport(_0xf9a9x1d,_0xf9a9xe,_0xf9a9x26){var _0xf9a9x27=[],_0xf9a9x28=[],_0xf9a9x29=[];_[_0x6106[26]](_0xf9a9x1d.Fields,function(_0xf9a9x24){var _0xf9a9x2a=_0x6106[82];if(_0xf9a9x24[_0x6106[83]]){switch(_0xf9a9x24[_0x6106[83]]){case _0x6106[86]:_0xf9a9x2a=util[_0x6106[21]](_0x6106[84],_0xf9a9x24[_0x6106[85]]);break ;;case _0x6106[88]:_0xf9a9x2a=util[_0x6106[21]](_0x6106[87],_0xf9a9x24[_0x6106[85]],_0xf9a9x24[_0x6106[85]]);break ;;case _0x6106[90]:_0xf9a9x2a=util[_0x6106[21]](_0x6106[89],_0xf9a9x24[_0x6106[85]],_0xf9a9x24[_0x6106[85]]);break ;;default:_0xf9a9x2a=util[_0x6106[21]](_0x6106[91],_0xf9a9x24[_0x6106[83]],_0xf9a9x24[_0x6106[85]]);;}}else {_0xf9a9x2a=_0xf9a9x24[_0x6106[85]]};_0xf9a9x27[_0x6106[25]](util[_0x6106[21]](_0x6106[92],_0xf9a9x2a,_0xf9a9x24[_0x6106[93]]));if(_0xf9a9x24[_0x6106[94]]){_0xf9a9x28[_0x6106[25]](_0xf9a9x24[_0x6106[85]])};if(_0xf9a9x24[_0x6106[95]]){_0xf9a9x29[_0x6106[25]](util[_0x6106[21]](_0x6106[17],_0xf9a9x24[_0x6106[85]],_0xf9a9x24[_0x6106[95]]))};});var _0xf9a9x2b=getConditions(JSON[_0x6106[30]](_0xf9a9x1d[_0x6106[97]])[_0x6106[96]]);var _0xf9a9x2c=_0x6106[58];_0xf9a9x2c+=_0x6106[98]+_0xf9a9x27[_0x6106[100]](_0x6106[99]);if(_0xf9a9x26){_0xf9a9x2c+=_0x6106[101]};_0xf9a9x2c+=_0x6106[102]+_0xf9a9x1d[_0x6106[103]];_0xf9a9x2c+=_0xf9a9x2b!==_0x6106[104]?_0x6106[105]+_0xf9a9x2b:_0x6106[82];var _0xf9a9x2d=false;var _0xf9a9x2e=false;var _0xf9a9x2f,_0xf9a9x30;var _0xf9a9x31=[];if(_0xf9a9xe){_[_0x6106[31]](_0xf9a9xe,function(_0xf9a9xf,_0xf9a9x10){switch(_0xf9a9x10){case _0x6106[15]:if(_0xf9a9xe[_0x6106[106]]){_0xf9a9x2d=parseInt(_0xf9a9xe[_0x6106[106]],10);_0xf9a9x2e=parseInt(_0xf9a9xf,10)*_0xf9a9x2d;};break ;;case _0x6106[106]:_0xf9a9x2d=parseInt(_0xf9a9xf,10);break ;;case _0x6106[68]:_0xf9a9x31[_0x6106[25]](_0x6106[107]+_0xf9a9xf+_0x6106[108]);break ;;case _0x6106[70]:_0xf9a9x31[_0x6106[25]](_0x6106[109]+_0xf9a9xf+_0x6106[108]);break ;;case _0x6106[60]:break ;;default:var _0xf9a9x32=_[_0x6106[110]](_0xf9a9x1d.Fields,{alias:_0xf9a9x10})[_0x6106[85]];if(_0xf9a9x32){_0xf9a9x31[_0x6106[25]](_0xf9a9x32+_0x6106[111]+_0xf9a9xf+_0x6106[112])}else {_0xf9a9x31[_0x6106[25]](_0xf9a9x10+_0x6106[111]+_0xf9a9xf+_0x6106[112])};;}})};if(_0xf9a9x31[_0x6106[52]]){_0xf9a9x2c+=((_0xf9a9x2b!==_0x6106[104])?_0x6106[113]:_0x6106[105])+_0xf9a9x31[_0x6106[100]](_0x6106[113])};_0xf9a9x2c+=_0xf9a9x28[_0x6106[52]]?_0x6106[114]+_0xf9a9x28[_0x6106[100]](_0x6106[99]):_0x6106[82];_0xf9a9x2c+=_0xf9a9x29[_0x6106[52]]?_0x6106[115]+_0xf9a9x29[_0x6106[100]](_0x6106[99]):_0x6106[82];_0xf9a9x2c+=_0xf9a9x2d&&!_0xf9a9x26?_0x6106[116]+_0xf9a9x2d:_0x6106[82];_0xf9a9x2c+=_0xf9a9x2e&&!_0xf9a9x26?_0x6106[117]+_0xf9a9x2e:_0x6106[82];console[_0x6106[51]](_0xf9a9x2c);return _0xf9a9x2c;}function getConditions(_0xf9a9x34){if(!_0xf9a9x34){return _0x6106[82]};for(var _0xf9a9x35=_0x6106[118],_0xf9a9x36=0;_0xf9a9x36<_0xf9a9x34[_0x6106[119]][_0x6106[52]];_0xf9a9x36++){_0xf9a9x36>0&&(_0xf9a9x35+=_0x6106[98]+_0xf9a9x34[_0x6106[120]]+_0x6106[98]);_0xf9a9x35+=_0xf9a9x34[_0x6106[119]][_0xf9a9x36][_0x6106[96]]?getConditions(_0xf9a9x34[_0x6106[119]][_0xf9a9x36][_0x6106[96]]):_0xf9a9x34[_0x6106[119]][_0xf9a9x36][_0x6106[85]]+_0x6106[98]+_0xf9a9x34[_0x6106[119]][_0xf9a9x36][_0x6106[121]]+_0x6106[122]+(_0xf9a9x34[_0x6106[119]][_0xf9a9x36][_0x6106[121]]===_0x6106[123]?_0x6106[24]+_0xf9a9x34[_0x6106[119]][_0xf9a9x36][_0x6106[124]]+_0x6106[24]:_0xf9a9x34[_0x6106[119]][_0xf9a9x36][_0x6106[124]])+_0x6106[108];};return _0xf9a9x35+_0x6106[125];}exports[_0x6106[73]]=function(_0xf9a9x8,_0xf9a9x9){CustomReport[_0x6106[73]](_0xf9a9x8[_0x6106[69]])[_0x6106[48]](function(_0xf9a9x1d){return _0xf9a9x9[_0x6106[37]](201)[_0x6106[36]](_0xf9a9x1d)})[_0x6106[38]](function(_0xf9a9x16){return handleError(_0xf9a9x9,_0xf9a9x16)})};exports[_0x6106[126]]=function(_0xf9a9x8,_0xf9a9x9){if(_0xf9a9x8[_0x6106[69]][_0x6106[61]]){delete _0xf9a9x8[_0x6106[69]][_0x6106[61]]};ReportField[_0x6106[128]]({where:{CustomReportId:_0xf9a9x8[_0x6106[62]][_0x6106[61]]}})[_0x6106[48]](function(){return ReportField[_0x6106[127]](_0xf9a9x8[_0x6106[69]].Fields)})[_0x6106[48]](function(){delete _0xf9a9x8[_0x6106[69]][_0x6106[78]];return CustomReport[_0x6106[126]](_0xf9a9x8[_0x6106[69]],{where:{id:_0xf9a9x8[_0x6106[62]][_0x6106[61]]}});})[_0x6106[48]](function(){return _0xf9a9x9[_0x6106[56]](200)})[_0x6106[38]](function(_0xf9a9x16){console[_0x6106[51]](_0xf9a9x16);return handleError(_0xf9a9x9,_0xf9a9x16);});};exports[_0x6106[128]]=function(_0xf9a9x8,_0xf9a9x9){CustomReport[_0x6106[63]](_0xf9a9x8[_0x6106[62]][_0x6106[61]])[_0x6106[48]](function(_0xf9a9x1d){if(!_0xf9a9x1d){return _0xf9a9x9[_0x6106[56]](404)};_0xf9a9x1d[_0x6106[128]]()[_0x6106[48]](function(){return _0xf9a9x9[_0x6106[56]](204)})[_0x6106[38]](function(_0xf9a9x16){return handleError(_0xf9a9x9,_0xf9a9x16)});})[_0x6106[38]](function(_0xf9a9x16){return handleError(_0xf9a9x9,_0xf9a9x16)})};exports[_0x6106[129]]=function(_0xf9a9x8,_0xf9a9x9){CustomReport[_0x6106[128]]({where:{id:_0xf9a9x8[_0x6106[14]][_0x6106[61]]},individualHooks:true})[_0x6106[48]](function(){return _0xf9a9x9[_0x6106[56]](204)})[_0x6106[38]](function(_0xf9a9x16){return handleError(_0xf9a9x9,_0xf9a9x16)})};function handleError(_0xf9a9x9,_0xf9a9x16){return _0xf9a9x9[_0x6106[37]](500)[_0x6106[36]](_0xf9a9x16)}
\ No newline at end of file
+var _0xad3c=["\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","\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","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x70\x61\x72\x65\x6E\x74","\x66\x69\x6E\x64","\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","\x64\x65\x73\x74\x72\x6F\x79","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x69\x73\x41\x72\x72\x61\x79","\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","\x70\x75\x73\x68","\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"];_0xad3c[0];var _=require(_0xad3c[1]);var util=require(_0xad3c[2]);var sequelize=require(_0xad3c[4])[_0xad3c[3]];var CustomReport=require(_0xad3c[4])[_0xad3c[5]];var ReportField=require(_0xad3c[4])[_0xad3c[6]];var Metric=require(_0xad3c[4])[_0xad3c[7]];var ExtractedReport=require(_0xad3c[4])[_0xad3c[8]];var extractUtils=require(_0xad3c[9]);var reportBuildUtils=require(_0xad3c[10]);var Util=require(_0xad3c[11]);var sr=require(_0xad3c[12]);var moment=require(_0xad3c[13]);var cp=require(_0xad3c[14]);var ReportTree=require(_0xad3c[4])[_0xad3c[15]];exports[_0xad3c[16]]= function(_0x4351xf,_0x4351x10,_0x4351x11){return CustomReport[_0xad3c[23]](Util[_0xad3c[22]](_0x4351xf[_0xad3c[21]]))[_0xad3c[20]](function(_0x4351x13){_0x4351x10[_0xad3c[19]](200)[_0xad3c[18]](_0x4351x13)})[_0xad3c[17]](function(_0x4351x12){return handleError(_0x4351x10,_0x4351x12)})};exports[_0xad3c[24]]= function(_0x4351xf,_0x4351x10){return Promise[_0xad3c[27]]([])[_0xad3c[20]](getQuery(_0x4351xf,_0x4351x10))[_0xad3c[20]](function(_0x4351x14){_0x4351x10[_0xad3c[19]](200)[_0xad3c[18]]({query:_0x4351x14})})[_0xad3c[17]](function(_0x4351x12){console[_0xad3c[26]](_0xad3c[25],_0x4351x12)})};function getQuery(_0x4351xf,_0x4351x10){var _0x4351x16;return function(){return CustomReport[_0xad3c[49]](_0xad3c[48])[_0xad3c[47]](_0x4351xf[_0xad3c[46]][_0xad3c[45]])[_0xad3c[20]](function(_0x4351x18){console[_0xad3c[26]](_0xad3c[32]);if(!_0x4351x18){return _0x4351x10[_0xad3c[33]](404)};if(_0x4351xf[_0xad3c[21]][_0xad3c[34]]&& _0x4351xf[_0xad3c[21]][_0xad3c[34]]=== _0xad3c[35]){_0x4351xf[_0xad3c[21]][_0xad3c[36]]= moment()[_0xad3c[38]](_0xad3c[37]);_0x4351xf[_0xad3c[21]][_0xad3c[39]]= moment()[_0xad3c[38]](_0xad3c[37]);_0x4351x18[_0xad3c[41]][_0xad3c[40]]= _0x4351x18[_0xad3c[41]][_0xad3c[40]][_0xad3c[44]](_0xad3c[42],_0xad3c[43])};delete _0x4351xf[_0xad3c[21]][_0xad3c[34]];_0x4351x16= _0x4351x18[_0xad3c[41]];return _0x4351x16[_0xad3c[40]]})[_0xad3c[20]](reportBuildUtils[_0xad3c[31]](_0x4351xf[_0xad3c[30]]))[_0xad3c[20]](function(_0x4351x17){return [_0x4351x17,_0x4351x16]})[_0xad3c[29]](reportBuildUtils[_0xad3c[28]](_0x4351xf[_0xad3c[21]]))}}exports[_0xad3c[50]]= function(_0x4351xf,_0x4351x10){var _0x4351x19;return Promise[_0xad3c[27]]([])[_0xad3c[20]](getQuery(_0x4351xf,_0x4351x10))[_0xad3c[20]](function(_0x4351x14){return _0x4351x14?sequelize[_0xad3c[21]](_0x4351x14,{type:sequelize[_0xad3c[61]][_0xad3c[60]]}):[]})[_0xad3c[20]](function(_0x4351x1a){_0x4351x19= _0x4351x1a[_0xad3c[51]];if(_0x4351xf[_0xad3c[21]][_0xad3c[52]]){_0x4351x1a= _(_0x4351x1a)[_0xad3c[56]](_0x4351xf[_0xad3c[21]][_0xad3c[55]]|| 0)[_0xad3c[54]](_0x4351xf[_0xad3c[21]][_0xad3c[52]])[_0xad3c[53]]()};_[_0xad3c[59]](_0x4351x1a,function(_0x4351x1b){_[_0xad3c[58]](_0x4351x1b,function(_0x4351x1c,_0x4351x1d){if(_0x4351x1c instanceof  Date){_0x4351x1b[_0x4351x1d]= moment(_0x4351x1c)[_0xad3c[38]](_0xad3c[57]).toString()}})});_0x4351x10[_0xad3c[19]](200)[_0xad3c[18]]({rows:_0x4351x1a,count:_0x4351x19})})[_0xad3c[17]](function(_0x4351x12){console[_0xad3c[26]](_0x4351x12);return handleError(_0x4351x10,_0x4351x12)})};exports[_0xad3c[62]]= function(_0x4351xf,_0x4351x10){docExtract(_0x4351xf,_0x4351x10,_0xad3c[63])};exports[_0xad3c[64]]= function(_0x4351xf,_0x4351x10){docExtract(_0x4351xf,_0x4351x10,_0xad3c[65])};function docExtract(_0x4351xf,_0x4351x10,_0x4351x1f){var _0x4351x18;CustomReport[_0xad3c[49]](_0xad3c[48])[_0xad3c[47]](_0x4351xf[_0xad3c[46]][_0xad3c[45]])[_0xad3c[20]](function(_0x4351x16){if(!_0x4351x16){return _0x4351x10[_0xad3c[33]](404)};_0x4351x18= _0x4351x16;return ReportTree[_0xad3c[47]](2)})[_0xad3c[20]](function(_0x4351x23){_0x4351x23= JSON[_0xad3c[77]](_0x4351x23[_0xad3c[76]]);var _0x4351x24=_[_0xad3c[79]](_0x4351x23,{id:_0x4351x18[_0xad3c[78]]});var _0x4351x25=getReportPath(_0x4351x24,_0x4351x23,_0x4351x18[_0xad3c[80]]);if(_0x4351xf[_0xad3c[21]][_0xad3c[34]]&& _0x4351xf[_0xad3c[21]][_0xad3c[34]]=== _0xad3c[35]){_0x4351xf[_0xad3c[21]][_0xad3c[36]]= moment()[_0xad3c[38]](_0xad3c[37]);_0x4351xf[_0xad3c[21]][_0xad3c[39]]= moment()[_0xad3c[38]](_0xad3c[37]);_0x4351x18[_0xad3c[41]][_0xad3c[40]]= _0x4351x18[_0xad3c[41]][_0xad3c[40]][_0xad3c[44]](_0xad3c[42],_0xad3c[43])};delete _0x4351xf[_0xad3c[21]][_0xad3c[34]];return [_0x4351x18,ExtractedReport[_0xad3c[86]]({name:_0x4351x25,startDate:_0x4351xf[_0xad3c[21]][_0xad3c[36]]?_0x4351xf[_0xad3c[21]][_0xad3c[36]]+ (_0x4351xf[_0xad3c[21]][_0xad3c[81]]?_0xad3c[82]+ _0x4351xf[_0xad3c[21]][_0xad3c[81]]:_0xad3c[83]):null,endDate:_0x4351xf[_0xad3c[21]][_0xad3c[39]]?_0x4351xf[_0xad3c[21]][_0xad3c[39]]+ (_0x4351xf[_0xad3c[21]][_0xad3c[84]]?_0xad3c[82]+ _0x4351xf[_0xad3c[21]][_0xad3c[84]]:_0xad3c[85]):null,output:_0x4351x1f,UserId:_0x4351xf[_0xad3c[30]][_0xad3c[45]]})]})[_0xad3c[29]](function(_0x4351x18,_0x4351x20){var _0x4351x21=cp[_0xad3c[67]](__dirname+ _0xad3c[66]);_0x4351x21[_0xad3c[70]](_0xad3c[73],function(_0x4351x22){console[_0xad3c[26]](_0xad3c[74],_0x4351x22);_0x4351x21[_0xad3c[75]]()})[_0xad3c[70]](_0xad3c[71],function(){console[_0xad3c[26]](_0xad3c[72])})[_0xad3c[70]](_0xad3c[68],function(_0x4351x12){console[_0xad3c[26]](_0xad3c[69],_0x4351x12)});_0x4351x21[_0xad3c[18]]({report:_0x4351x18,query:_0x4351xf[_0xad3c[21]],extractedId:_0x4351x20[_0xad3c[45]],user:_0x4351xf[_0xad3c[30]],type:_0x4351x1f})})[_0xad3c[17]](function(_0x4351x12){console[_0xad3c[26]](_0x4351x12);return handleError(_0x4351x10,_0x4351x12)});return _0x4351x10[_0xad3c[33]](200)}function getReportPath(_0x4351x24,_0x4351x23,_0x4351x25){_0x4351x25= _0x4351x24[_0xad3c[87]]+ _0xad3c[88]+ _0x4351x25;if(_0x4351x24[_0xad3c[78]]=== _0xad3c[89]){return _0x4351x25}else {return getReportPath(_[_0xad3c[79]](_0x4351x23,{id:_0x4351x24[_0xad3c[78]]}),_0x4351x23,_0x4351x25)}}exports[_0xad3c[90]]= function(_0x4351xf,_0x4351x10){return CustomReport[_0xad3c[49]](_0xad3c[48])[_0xad3c[47]](_0x4351xf[_0xad3c[46]][_0xad3c[45]])[_0xad3c[20]](function(_0x4351x18){if(!_0x4351x18){return _0x4351x10[_0xad3c[33]](404)};return _0x4351x10[_0xad3c[18]](_0x4351x18)})[_0xad3c[17]](function(_0x4351x12){return handleError(_0x4351x10,_0x4351x12)})};exports[_0xad3c[91]]= function(_0x4351xf,_0x4351x10){return CustomReport[_0xad3c[49]]({method:[_0xad3c[94],{CustomReportId:_0x4351xf[_0xad3c[46]][_0xad3c[45]]}]})[_0xad3c[47]](_0x4351xf[_0xad3c[46]][_0xad3c[45]],{attributes:[_0xad3c[92],_0xad3c[93],_0xad3c[80],_0xad3c[78],_0xad3c[40]]})[_0xad3c[20]](function(_0x4351x18){if(!_0x4351x18){return _0x4351x10[_0xad3c[33]](404)};return _0x4351x10[_0xad3c[18]](_0x4351x18)})[_0xad3c[17]](function(_0x4351x12){return handleError(_0x4351x10,_0x4351x12)})};exports[_0xad3c[95]]= function(_0x4351xf,_0x4351x10){var _0x4351x27;return sequelize[_0xad3c[100]](function(_0x4351x28){return CustomReport[_0xad3c[49]](_0xad3c[48])[_0xad3c[47]](_0x4351xf[_0xad3c[46]][_0xad3c[45]])[_0xad3c[20]](function(_0x4351x18){if(!_0x4351x18){return _0x4351x10[_0xad3c[33]](404)};var _0x4351x29=_0x4351x18[_0xad3c[41]];delete _0x4351x29[_0xad3c[45]];delete _0x4351x29[_0xad3c[96]];delete _0x4351x29[_0xad3c[97]];_0x4351x29[_0xad3c[78]]= _0x4351xf[_0xad3c[98]][_0xad3c[78]];_0x4351x27= _[_0xad3c[99]](_0x4351x29.Fields,_0xad3c[41]);return CustomReport[_0xad3c[86]](_0x4351x29,{transaction:_0x4351x28})})[_0xad3c[20]](function(_0x4351x18){return [_0x4351x18,_0x4351x27]})[_0xad3c[29]](createFields(_0x4351x28))})[_0xad3c[20]](function(){return _0x4351x10[_0xad3c[33]](201)})[_0xad3c[17]](function(_0x4351x12){console[_0xad3c[26]](_0x4351x12);return handleError(_0x4351x10,_0x4351x12)})};exports[_0xad3c[86]]= function(_0x4351xf,_0x4351x10){var _0x4351x16;return sequelize[_0xad3c[100]](function(_0x4351x28){return CustomReport[_0xad3c[86]](_0x4351xf[_0xad3c[98]],{transaction:_0x4351x28})[_0xad3c[20]](function(_0x4351x18){_0x4351x16= _0x4351x18;return [_0x4351x16,_0x4351xf[_0xad3c[98]][_0xad3c[101]]]})[_0xad3c[29]](createFields(_0x4351x28))})[_0xad3c[20]](function(){return _0x4351x10[_0xad3c[19]](201)[_0xad3c[18]](_0x4351x16)})[_0xad3c[17]](function(_0x4351x12){console[_0xad3c[26]](_0x4351x12);return handleError(_0x4351x10,_0x4351x12)})};exports[_0xad3c[102]]= function(_0x4351xf,_0x4351x10){var _0x4351x16;return sequelize[_0xad3c[100]](function(_0x4351x28){return CustomReport[_0xad3c[86]](_0x4351xf[_0xad3c[98]],{transaction:_0x4351x28})[_0xad3c[20]](function(_0x4351x18){_0x4351x16= _0x4351x18;return [_0x4351x16,_0x4351xf[_0xad3c[98]][_0xad3c[101]]]})[_0xad3c[29]](createImportFields(_0x4351x28))})[_0xad3c[20]](function(){return _0x4351x10[_0xad3c[19]](201)[_0xad3c[18]](_0x4351x16)})[_0xad3c[17]](function(_0x4351x12){console[_0xad3c[26]](_0x4351x12);return handleError(_0x4351x10,_0x4351x12)})};exports[_0xad3c[103]]= function(_0x4351xf,_0x4351x10,_0x4351x11){if(_0x4351xf[_0xad3c[98]][_0xad3c[45]]){delete _0x4351xf[_0xad3c[98]][_0xad3c[45]]};var _0x4351x16;return sequelize[_0xad3c[100]](function(_0x4351x28){return CustomReport[_0xad3c[47]](_0x4351xf[_0xad3c[46]][_0xad3c[45]])[_0xad3c[20]](function(_0x4351x18){if(!_0x4351x18){return _0x4351x10[_0xad3c[33]](404)};var _0x4351x2a=_[_0xad3c[105]](_0x4351x18,_0x4351xf[_0xad3c[98]]);return _0x4351x18[_0xad3c[106]]({transaction:_0x4351x28})})[_0xad3c[20]](function(_0x4351x18){_0x4351x16= _0x4351x18;if(_0x4351xf[_0xad3c[98]][_0xad3c[101]]){return ReportField[_0xad3c[104]]({where:{CustomReportId:_0x4351xf[_0xad3c[46]][_0xad3c[45]]},transaction:_0x4351x28})}})[_0xad3c[20]](function(){return [_0x4351x16,_0x4351xf[_0xad3c[98]][_0xad3c[101]]]})[_0xad3c[29]](createFields(_0x4351x28))})[_0xad3c[20]](function(){return _0x4351x10[_0xad3c[33]](200)})[_0xad3c[17]](function(_0x4351x12){console[_0xad3c[26]](_0x4351x12);return handleError(_0x4351x10,_0x4351x12)})};function createFields(_0x4351x28){return function(_0x4351x18,_0x4351x2c){if(_0x4351x2c&& Array[_0xad3c[107]](_0x4351x2c)&& _0x4351x2c[_0xad3c[51]]){var _0x4351x2d=reportBuildUtils[_0xad3c[108]](_0x4351x18[_0xad3c[40]]);if(_0x4351x2d){var _0x4351x2e;return _0x4351x2d[_0xad3c[122]]()[_0xad3c[20]](function(_0x4351x33){_0x4351x2e= _[_0xad3c[120]](_0x4351x33);return Metric[_0xad3c[121]]()})[_0xad3c[20]](function(_0x4351x2f){var _0x4351x30=[];_0x4351x2f= _[_0xad3c[99]](_0x4351x2f,_0xad3c[41]);_0x4351x2c[_0xad3c[59]](function(_0x4351x31){_0x4351x31[_0xad3c[109]]= _0x4351x18[_0xad3c[45]];if(_0x4351x31[_0xad3c[110]]){var _0x4351x32=_[_0xad3c[79]](_0x4351x2f,{id:_0x4351x31[_0xad3c[110]]});if(_0x4351x32){_0x4351x31[_0xad3c[111]]= _0x4351x32[_0xad3c[112]];_0x4351x30[_0xad3c[113]](ReportField[_0xad3c[86]](_0x4351x31,{transaction:_0x4351x28}))}else {throw  new sequelize.Error(_0xad3c[114]+ _0x4351x31[_0xad3c[110]]+ _0xad3c[115])}}else {if(_[_0xad3c[116]](_0x4351x2e,_0x4351x31[_0xad3c[111]])|| _0x4351x31[_0xad3c[117]]){_0x4351x30[_0xad3c[113]](ReportField[_0xad3c[86]](_0x4351x31,{transaction:_0x4351x28}))}else {throw  new sequelize.Error(_0xad3c[118]+ _0x4351x31[_0xad3c[111]]+ _0xad3c[119])}}});return _0x4351x30})[_0xad3c[27]]()}else {throw  new sequelize.Error(_0xad3c[123])}}}}function createImportFields(_0x4351x28){return function(_0x4351x18,_0x4351x2c){if(_0x4351x2c&& Array[_0xad3c[107]](_0x4351x2c)&& _0x4351x2c[_0xad3c[51]]){var _0x4351x2d=reportBuildUtils[_0xad3c[108]](_0x4351x18[_0xad3c[40]]);if(_0x4351x2d){var _0x4351x2e;return _0x4351x2d[_0xad3c[122]]()[_0xad3c[20]](function(_0x4351x33){_0x4351x2e= _[_0xad3c[120]](_0x4351x33);var _0x4351x30=[];var _0x4351x35;if(_[_0xad3c[126]](_0x4351x2c,function(_0x4351x31){return _[_0xad3c[125]](_0x4351x31,_0xad3c[124])})){_0x4351x35= _0xad3c[127]}else {if(_[_0xad3c[126]](_0x4351x2c,function(_0x4351x31){return _[_0xad3c[125]](_0x4351x31,_0xad3c[110])})){_0x4351x35= _0xad3c[7]}else {throw  new sequelize.Error(_0xad3c[128])}};var _0x4351x36=_[_0xad3c[130]](_0x4351x2c,_0x4351x35+ _0xad3c[129]);_[_0xad3c[58]](_0x4351x36,function(_0x4351x37,_0x4351x1d){if(_0x4351x1d!== _0xad3c[131]&& _0x4351x1d!== _0xad3c[132]){_0x4351x37[0][_0x4351x35][_0xad3c[133]][_0xad3c[59]](function(_0x4351x31){_0x4351x31[_0xad3c[109]]= _0x4351x18[_0xad3c[45]]});_0x4351x37[0][_0x4351x35][_0xad3c[80]]+= _0xad3c[134]+ sr({length:5});_0x4351x30[_0xad3c[113]](Metric[_0xad3c[86]](_0x4351x37[0][_0x4351x35],{include:[{model:ReportField,as:_0xad3c[133]}],transaction:_0x4351x28}))}else {_0x4351x37[_0xad3c[59]](function(_0x4351x31){if(_[_0xad3c[116]](_0x4351x2e,_0x4351x31[_0xad3c[111]])|| _0x4351x31[_0xad3c[117]]){_0x4351x31[_0xad3c[109]]= _0x4351x18[_0xad3c[45]];_0x4351x30[_0xad3c[113]](ReportField[_0xad3c[86]](_0x4351x31,{transaction:_0x4351x28}))}else {throw  new sequelize.Error(_0xad3c[118]+ _0x4351x31[_0xad3c[111]]+ _0xad3c[119])}})}});return _0x4351x30})[_0xad3c[27]]()}else {throw  new sequelize.Error(_0xad3c[123])}}}}exports[_0xad3c[104]]= function(_0x4351xf,_0x4351x10){return CustomReport[_0xad3c[47]](_0x4351xf[_0xad3c[46]][_0xad3c[45]])[_0xad3c[20]](function(_0x4351x18){if(!_0x4351x18){return _0x4351x10[_0xad3c[33]](404)};return _0x4351x18[_0xad3c[104]]()})[_0xad3c[20]](function(){return _0x4351x10[_0xad3c[33]](204)})[_0xad3c[17]](function(_0x4351x12){return handleError(_0x4351x10,_0x4351x12)})};exports[_0xad3c[135]]= function(_0x4351xf,_0x4351x10){return CustomReport[_0xad3c[104]]({where:{id:_0x4351xf[_0xad3c[21]][_0xad3c[136]]},individualHooks:true})[_0xad3c[20]](function(){return _0x4351x10[_0xad3c[33]](204)})[_0xad3c[17]](function(_0x4351x12){return handleError(_0x4351x10,_0x4351x12)})};function handleError(_0x4351x10,_0x4351x12){return _0x4351x10[_0xad3c[19]](500)[_0xad3c[18]](_0x4351x12)}
\ No newline at end of file