Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / components / parsers / advancedSearch.js
index 57c2ae5..d31e7f4 100644 (file)
@@ -1 +1 @@
-const a835_0x4df9=['<>\x20?','castTo','>=\x20?','minutes','start','field','split','NOT\x20IN\x20?','CAST(','shift','lodash','\x20AS\x20','pop','BETWEEN\x20?\x20AND\x20?','utcOffset','replace','$endsWith','map','length','indexOf','[$or]','=\x20?','sqlOperator','parseSearch','<\x20?','\x20OR\x20','$lte','IN\x20?','$in','conditions','forEach','$eq','\x20IS\x20NULL)','$between','days','seconds','add','DATE','<=\x20?','startsWith','$ne','$gte','operator','and','$notIn','LIKE\x20?','$lt','value','$startsWith','moment','text','YYYY-MM-DD','>\x20?','includes','$gt','format','match','$substring'];(function(_0x584604,_0x4df9e2){const _0x5e39e4=function(_0x22be3a){while(--_0x22be3a){_0x584604['push'](_0x584604['shift']());}};_0x5e39e4(++_0x4df9e2);}(a835_0x4df9,0x11e));const a835_0x5e39=function(_0x584604,_0x4df9e2){_0x584604=_0x584604-0x0;let _0x5e39e4=a835_0x4df9[_0x584604];return _0x5e39e4;};const _0xae1442=a835_0x5e39;'use strict';const _=require(_0xae1442('0xe')),moment=require(_0xae1442('0x35'));exports[_0xae1442('0x1b')]=function(_0x22be3a){const _0x23ec68=_0xae1442,_0x29abab={'conditions':[]};_0x29abab[_0x23ec68('0x1a')]=_[_0x23ec68('0x2b')](_0x22be3a,_0x23ec68('0x18'))?'or':_0x23ec68('0x2f');const _0x1bd0dc=_0x22be3a[_0x23ec68('0x13')]('[$and]','')[_0x23ec68('0x13')]('[$or]','')[_0x23ec68('0xa')]('||');for(let _0x417a44=0x0;_0x417a44<_0x1bd0dc[_0x23ec68('0x16')];_0x417a44++){const _0x405966=_0x1bd0dc[_0x417a44][_0x23ec68('0xa')](':='),_0x4638d5=_0x405966[0x0],_0x264f57=_0x405966['slice'](0x1);_0x264f57[_0x23ec68('0x22')](function(_0x384f7c){const _0x5f6ff6=_0x23ec68,_0x9b05c1=_0x384f7c[_0x5f6ff6('0xa')]('[')[_0x5f6ff6('0xd')](),_0x1360bb=_0x384f7c[_0x5f6ff6('0x2')](/\[(.*?)\]/g);_0x1360bb['forEach'](function(_0x459ad2){const _0xf95bf2=_0x5f6ff6,_0xad1568=_0x459ad2['split']('[')['filter'](function(_0x866c48){const _0x1418d2=a835_0x5e39;return _0x866c48[_0x1418d2('0x17')](']')>-0x1;})[_0xf95bf2('0x15')](function(_0x20812d){const _0x4344b1=_0xf95bf2;return _0x20812d[_0x4344b1('0xa')](']')[0x0];})[0x0];_0x29abab[_0xf95bf2('0x21')]['push']({'field':_0x4638d5,'operator':_0x9b05c1,'value':_0xad1568});});});}return _0x29abab;},exports['buildExpression']=function(_0x46f84d,_0x4bd66a,_0x4ecb36){const _0x57f579=_0xae1442,_0x3df428={};if(_0x4bd66a===_0x57f579('0x29')){if(_0x4ecb36[_0x57f579('0x2e')]===_0x57f579('0x23'))_0x4ecb36[_0x57f579('0x2e')]=_0x57f579('0x25'),_0x4ecb36[_0x57f579('0x33')]+=','+_0x4ecb36[_0x57f579('0x33')];else _['includes']([_0x57f579('0x0'),_0x57f579('0x1e')],_0x4ecb36[_0x57f579('0x2e')])&&(_0x4ecb36[_0x57f579('0x33')]=moment(_0x4ecb36['value'])['add'](0x1,_0x57f579('0x26'))[_0x57f579('0x1')](_0x57f579('0x37')));}_0x4ecb36[_0x57f579('0x5')]?(_0x4bd66a=_0x4ecb36[_0x57f579('0x5')],_0x3df428['text']=_0x57f579('0xc')+_0x46f84d+'.'+_0x4ecb36[_0x57f579('0x9')]+_0x57f579('0xf')+_0x4ecb36[_0x57f579('0x5')]+')\x20'+parseOperator(_0x4ecb36[_0x57f579('0x2e')])):_0x3df428[_0x57f579('0x36')]=_0x46f84d+'.'+_0x4ecb36[_0x57f579('0x9')]+'\x20'+parseOperator(_0x4ecb36[_0x57f579('0x2e')]);if(_[_0x57f579('0x39')](['$ne',_0x57f579('0x30')],_0x4ecb36['operator']))_0x3df428[_0x57f579('0x36')]='('+_0x3df428[_0x57f579('0x36')]+_0x57f579('0x1d')+_0x46f84d+'.'+_0x4ecb36[_0x57f579('0x9')]+_0x57f579('0x24');return _0x3df428[_0x57f579('0x33')]=parseValue(_0x4bd66a,_0x4ecb36[_0x57f579('0x2e')],_0x4ecb36['value']),_0x3df428;};function parseOperator(_0x1ca0c0){const _0x385bd7=_0xae1442;let _0x3a025d;switch(_0x1ca0c0){case _0x385bd7('0x20'):_0x3a025d=_0x385bd7('0x1f');break;case _0x385bd7('0x30'):_0x3a025d=_0x385bd7('0xb');break;case'$eq':_0x3a025d=_0x385bd7('0x19');break;case _0x385bd7('0x2c'):_0x3a025d=_0x385bd7('0x4');break;case _0x385bd7('0x3'):case _0x385bd7('0x34'):case _0x385bd7('0x14'):_0x3a025d=_0x385bd7('0x31');break;case _0x385bd7('0x32'):_0x3a025d=_0x385bd7('0x1c');break;case _0x385bd7('0x0'):_0x3a025d=_0x385bd7('0x38');break;case'$lte':_0x3a025d=_0x385bd7('0x2a');break;case _0x385bd7('0x2d'):_0x3a025d=_0x385bd7('0x6');break;case _0x385bd7('0x25'):_0x3a025d=_0x385bd7('0x11');break;}return _0x3a025d;}function parseValue(_0x29a3c8,_0x4078f7,_0x5b8d82){const _0x2f3b52=_0xae1442;let _0x158db8={'start':undefined,'end':undefined};switch(_0x4078f7){case'$in':case'$notIn':_0x158db8[_0x2f3b52('0x8')]=_0x5b8d82[_0x2f3b52('0xa')](',');break;case _0x2f3b52('0x3'):_0x158db8[_0x2f3b52('0x8')]='%'+_0x5b8d82+'%';break;case _0x2f3b52('0x34'):_0x158db8[_0x2f3b52('0x8')]=_0x5b8d82+'%';break;case'$endsWith':_0x158db8['start']='%'+_0x5b8d82;break;case _0x2f3b52('0x25'):{const _0x1ecc69=_0xe09834[_0x2f3b52('0xa')](',');let _0xe09834=_0x1ecc69[_0x2f3b52('0xd')](),_0x5db281=_0x1ecc69[_0x2f3b52('0x10')]();_0x29a3c8===_0x2f3b52('0x29')&&(_0xe09834=moment(_0xe09834)[_0x2f3b52('0x12')](0x0,!![])[_0x2f3b52('0x1')](),_0x5db281=moment(_0x5db281)[_0x2f3b52('0x12')](0x0,!![])[_0x2f3b52('0x28')](0x17,'hours')['add'](0x3b,_0x2f3b52('0x7'))['add'](0x3b,_0x2f3b52('0x27'))[_0x2f3b52('0x1')]()),_0x158db8={'start':_0xe09834,'end':_0x5db281};}break;default:_0x158db8[_0x2f3b52('0x8')]=_0x5b8d82;break;}return _0x158db8;}
\ No newline at end of file
+const a835_0x46fe=['=\x20?','[$and]','conditions','shift','filter','replace','add','\x20IS\x20NULL)','$endsWith','buildExpression','$in','BETWEEN\x20?\x20AND\x20?','castTo','CAST(','match','utcOffset','$lt','<=\x20?','LIKE\x20?','split','$substring','$gte','[$or]','>=\x20?','$ne','YYYY-MM-DD','\x20OR\x20','start','forEach','seconds','text','$gt','parseSearch','operator','<\x20?','NOT\x20IN\x20?','$startsWith','sqlOperator','lodash','startsWith','$notIn','$eq','field','length','days','value','map','\x20AS\x20','moment','$between','format','$lte','includes'];(function(_0x45a53c,_0x46fe2a){const _0x50d84d=function(_0x14503f){while(--_0x14503f){_0x45a53c['push'](_0x45a53c['shift']());}};_0x50d84d(++_0x46fe2a);}(a835_0x46fe,0x1b5));const a835_0x50d8=function(_0x45a53c,_0x46fe2a){_0x45a53c=_0x45a53c-0x0;let _0x50d84d=a835_0x46fe[_0x45a53c];return _0x50d84d;};const _0x42a714=a835_0x50d8;'use strict';const _=require(_0x42a714('0x19')),moment=require(_0x42a714('0x23'));exports[_0x42a714('0x13')]=function(_0x14503f){const _0x24ae77=_0x42a714,_0x16166a={'conditions':[]};_0x16166a[_0x24ae77('0x18')]=_[_0x24ae77('0x1a')](_0x14503f,_0x24ae77('0x9'))?'or':'and';const _0x1e218d=_0x14503f[_0x24ae77('0x2d')](_0x24ae77('0x29'),'')[_0x24ae77('0x2d')](_0x24ae77('0x9'),'')['split']('||');for(let _0x2fb69e=0x0;_0x2fb69e<_0x1e218d[_0x24ae77('0x1e')];_0x2fb69e++){const _0xc63e16=_0x1e218d[_0x2fb69e][_0x24ae77('0x6')](':='),_0x1f58bb=_0xc63e16[0x0],_0x1f1471=_0xc63e16['slice'](0x1);_0x1f1471[_0x24ae77('0xf')](function(_0x2f8e86){const _0x254b14=_0x24ae77,_0x3b90a9=_0x2f8e86[_0x254b14('0x6')]('[')[_0x254b14('0x2b')](),_0x590740=_0x2f8e86[_0x254b14('0x1')](/\[(.*?)\]/g);_0x590740[_0x254b14('0xf')](function(_0x43f628){const _0x12db70=_0x254b14,_0x333f1a=_0x43f628['split']('[')[_0x12db70('0x2c')](function(_0x49e2a4){return _0x49e2a4['indexOf'](']')>-0x1;})[_0x12db70('0x21')](function(_0x265b9e){const _0x2ac2b2=_0x12db70;return _0x265b9e[_0x2ac2b2('0x6')](']')[0x0];})[0x0];_0x16166a[_0x12db70('0x2a')]['push']({'field':_0x1f58bb,'operator':_0x3b90a9,'value':_0x333f1a});});});}return _0x16166a;},exports[_0x42a714('0x31')]=function(_0x5171db,_0x354abf,_0x361f53){const _0x200718=_0x42a714,_0x483bf0={};if(_0x354abf==='DATE'){if(_0x361f53[_0x200718('0x14')]==='$eq')_0x361f53[_0x200718('0x14')]=_0x200718('0x24'),_0x361f53['value']+=','+_0x361f53[_0x200718('0x20')];else _[_0x200718('0x27')]([_0x200718('0x12'),_0x200718('0x26')],_0x361f53[_0x200718('0x14')])&&(_0x361f53[_0x200718('0x20')]=moment(_0x361f53[_0x200718('0x20')])[_0x200718('0x2e')](0x1,_0x200718('0x1f'))[_0x200718('0x25')](_0x200718('0xc')));}_0x361f53[_0x200718('0x34')]?(_0x354abf=_0x361f53['castTo'],_0x483bf0[_0x200718('0x11')]=_0x200718('0x0')+_0x5171db+'.'+_0x361f53['field']+_0x200718('0x22')+_0x361f53[_0x200718('0x34')]+')\x20'+parseOperator(_0x361f53['operator'])):_0x483bf0[_0x200718('0x11')]=_0x5171db+'.'+_0x361f53[_0x200718('0x1d')]+'\x20'+parseOperator(_0x361f53['operator']);if(_[_0x200718('0x27')]([_0x200718('0xb'),'$notIn'],_0x361f53[_0x200718('0x14')]))_0x483bf0[_0x200718('0x11')]='('+_0x483bf0['text']+_0x200718('0xd')+_0x5171db+'.'+_0x361f53[_0x200718('0x1d')]+_0x200718('0x2f');return _0x483bf0[_0x200718('0x20')]=parseValue(_0x354abf,_0x361f53[_0x200718('0x14')],_0x361f53[_0x200718('0x20')]),_0x483bf0;};function parseOperator(_0x819bfa){const _0xd7a7f2=_0x42a714;let _0x5a2a4a;switch(_0x819bfa){case _0xd7a7f2('0x32'):_0x5a2a4a='IN\x20?';break;case _0xd7a7f2('0x1b'):_0x5a2a4a=_0xd7a7f2('0x16');break;case _0xd7a7f2('0x1c'):_0x5a2a4a=_0xd7a7f2('0x28');break;case _0xd7a7f2('0xb'):_0x5a2a4a='<>\x20?';break;case _0xd7a7f2('0x7'):case _0xd7a7f2('0x17'):case _0xd7a7f2('0x30'):_0x5a2a4a=_0xd7a7f2('0x5');break;case _0xd7a7f2('0x3'):_0x5a2a4a=_0xd7a7f2('0x15');break;case'$gt':_0x5a2a4a='>\x20?';break;case _0xd7a7f2('0x26'):_0x5a2a4a=_0xd7a7f2('0x4');break;case _0xd7a7f2('0x8'):_0x5a2a4a=_0xd7a7f2('0xa');break;case'$between':_0x5a2a4a=_0xd7a7f2('0x33');break;}return _0x5a2a4a;}function parseValue(_0x22b466,_0xcf68bc,_0x5c214f){const _0x47c7db=_0x42a714;let _0x3bf516={'start':undefined,'end':undefined};switch(_0xcf68bc){case _0x47c7db('0x32'):case _0x47c7db('0x1b'):_0x3bf516['start']=_0x5c214f[_0x47c7db('0x6')](',');break;case'$substring':_0x3bf516[_0x47c7db('0xe')]='%'+_0x5c214f+'%';break;case _0x47c7db('0x17'):_0x3bf516[_0x47c7db('0xe')]=_0x5c214f+'%';break;case _0x47c7db('0x30'):_0x3bf516[_0x47c7db('0xe')]='%'+_0x5c214f;break;case _0x47c7db('0x24'):{const _0x28d919=_0x3d4417['split'](',');let _0x3d4417=_0x28d919[_0x47c7db('0x2b')](),_0x5227a2=_0x28d919['pop']();_0x22b466==='DATE'&&(_0x3d4417=moment(_0x3d4417)['utcOffset'](0x0,!![])['format'](),_0x5227a2=moment(_0x5227a2)[_0x47c7db('0x2')](0x0,!![])['add'](0x17,'hours')[_0x47c7db('0x2e')](0x3b,'minutes')[_0x47c7db('0x2e')](0x3b,_0x47c7db('0x10'))[_0x47c7db('0x25')]()),_0x3bf516={'start':_0x3d4417,'end':_0x5227a2};}break;default:_0x3bf516['start']=_0x5c214f;break;}return _0x3bf516;}
\ No newline at end of file