Built motion from commit 709aa6fb5ed03aa61bc373fcdbf622215d37d30b. Version 3.0.0...
[motion-next.git] / server / services / routing / lib / rule-engine.js
index 4ba274a..00497be 100644 (file)
@@ -1 +1 @@
-const a1163_0x51ed=['util','restart','init','isObject','consequence','asc','execute','filter','clone','concat','turn','length','name','isEqual','findRules','EventEmitter','toJSON','call','condition','rules','map','inherits','priority','isNil','result','push','events','prototype','isArray','nextTick','ruleRef','index_','matchPath','sync','parse','ignoreFactChanges','activeRules','lodash','noop','fromJSON','isString','matches','register','toString','prioritize'];(function(_0xc9da67,_0x51ed90){const _0x28a014=function(_0xca3b9c){while(--_0xca3b9c){_0xc9da67['push'](_0xc9da67['shift']());}};_0x28a014(++_0x51ed90);}(a1163_0x51ed,0x12b));const a1163_0x28a0=function(_0xc9da67,_0x51ed90){_0xc9da67=_0xc9da67-0x0;let _0x28a014=a1163_0x51ed[_0xc9da67];return _0x28a014;};const _0x407283=a1163_0x28a0;'use strict';const _=require(_0x407283('0x8')),util=require(_0x407283('0x10')),EventEmitter=require(_0x407283('0x2a'))[_0x407283('0x1f')];function RuleEngine(_0xca3b9c,_0x376ce2){const _0x2d86d1=_0x407283;return this['init'](),!_[_0x2d86d1('0x27')](_0xca3b9c)&&this['register'](_0xca3b9c),_0x376ce2&&(this['ignoreFactChanges']=_0x376ce2['ignoreFactChanges']),this;}util[_0x407283('0x25')](RuleEngine,EventEmitter),RuleEngine[_0x407283('0x2b')][_0x407283('0x12')]=function(){const _0x3aeaa5=_0x407283;this[_0x3aeaa5('0x23')]=[],this[_0x3aeaa5('0x7')]=[];},RuleEngine[_0x407283('0x2b')][_0x407283('0xd')]=function(_0x8ec65e){const _0x304166=_0x407283;if(Array[_0x304166('0x2c')](_0x8ec65e))this['rules']=this['rules'][_0x304166('0x19')](_0x8ec65e);else _0x8ec65e!==null&&_[_0x304166('0x13')](_0x8ec65e)&&this['rules'][_0x304166('0x29')](_0x8ec65e);this[_0x304166('0x4')]();},RuleEngine['prototype'][_0x407283('0x4')]=function(){const _0x4230bd=_0x407283;this[_0x4230bd('0x7')]=this[_0x4230bd('0x23')][_0x4230bd('0x17')](function(_0xef5eda){const _0x50f5b0=_0x4230bd;_[_0x50f5b0('0x27')](_0xef5eda['on'])&&(_0xef5eda['on']=!![]);if(_0xef5eda['on']===!![])return _0xef5eda;}),this[_0x4230bd('0x7')]=_['orderBy'](this[_0x4230bd('0x7')],['p'],[_0x4230bd('0x15')]);},RuleEngine[_0x407283('0x2b')][_0x407283('0x16')]=function(_0x2f1715,_0x5199fd){const _0x58af3d=_0x407283;let _0x409e44=![];_0x2f1715[_0x58af3d('0x28')]=!![];const _0xcef5ee=_[_0x58af3d('0x18')](_0x2f1715);let _0x5c78d7=_['clone'](_0x2f1715);const _0x50f149=this['activeRules'],_0x8b02c6=[],_0x29b73b=this[_0x58af3d('0x6')];(function _0x154235(_0x1681a3){const _0x34a2d0=_0x58af3d,_0x42e940={'rules':function(){return _0x50f149;},'rule':function(){return _0x50f149[_0x1681a3];},'when':function(_0x27685d){const _0x29e324=a1163_0x28a0;if(_0x27685d){const _0x300d25=_0x50f149[_0x1681a3][_0x29e324('0x14')];_0x300d25[_0x29e324('0x1')]=_0x50f149[_0x1681a3]['id']||_0x50f149[_0x1681a3][_0x29e324('0x1c')]||_0x29e324('0x2')+_0x1681a3,process[_0x29e324('0x0')](function(){const _0x34801f=_0x29e324;_0x8b02c6[_0x34801f('0x29')](_0x300d25['ruleRef']),_0x300d25[_0x34801f('0x21')](_0xcef5ee,_0x42e940);});}else process['nextTick'](function(){_0x42e940['next']();});},'restart':function(){return _0x154235(0x0);},'stop':function(){return _0x409e44=!![],_0x154235(0x0);},'next':function(_0x12b5c2){const _0x574363=a1163_0x28a0;!_0x29b73b&&!_[_0x574363('0x1d')](_0x5c78d7,_0xcef5ee)?(_0x5c78d7=_[_0x574363('0x18')](_0xcef5ee),process[_0x574363('0x0')](function(){const _0x1a8011=_0x574363;_0x42e940[_0x1a8011('0x11')]();})):process[_0x574363('0x0')](function(){const _0x5d2729=_0x574363;return _[_0x5d2729('0x27')](_0x12b5c2)?_0x154235(_0x1681a3+0x1):_0x154235(_0x12b5c2);});}};if(_0x1681a3<_0x50f149[_0x34a2d0('0x1b')]&&_0x409e44===![]){const _0x8d95b6=_0x50f149[_0x1681a3][_0x34a2d0('0x22')];_0x8d95b6[_0x34a2d0('0x21')](_0xcef5ee,_0x42e940);}else process[_0x34a2d0('0x0')](function(){const _0x3d4803=_0x34a2d0;return _0xcef5ee[_0x3d4803('0x3')]=_0x8b02c6,_0x5199fd?_0x5199fd(_0xcef5ee):_[_0x3d4803('0x9')]();});}(0x0));},RuleEngine['prototype'][_0x407283('0x1e')]=function(_0x42314c){const _0x4a23d9=_0x407283;if(_['isNil'](_0x42314c))return this[_0x4a23d9('0x23')];else{const _0x3ab1c5=_[_0x4a23d9('0xc')](_0x42314c);return _['filter'](this[_0x4a23d9('0x23')],_0x3ab1c5);}},RuleEngine[_0x407283('0x2b')][_0x407283('0x1a')]=function(_0x1b9372,_0x566037){const _0x5aae8a=_0x407283,_0x98c2bd=_0x1b9372==='on'||_0x1b9372==='ON'?!![]:![],_0x48506e=this[_0x5aae8a('0x1e')](_0x566037);for(let _0xf7f1ba=0x0,_0xaacb53=_0x48506e['length'];_0xf7f1ba<_0xaacb53;_0xf7f1ba+=0x1){_0x48506e[_0xf7f1ba]['on']=_0x98c2bd;}this[_0x5aae8a('0x4')]();},RuleEngine[_0x407283('0x2b')][_0x407283('0xf')]=function(_0x58e864,_0x4215fa){const _0x85d4d9=_0x407283;_0x58e864=parseInt(_0x58e864,0xa);const _0x34c8cb=this[_0x85d4d9('0x1e')](_0x4215fa);for(let _0x335195=0x0,_0x2734e2=_0x34c8cb[_0x85d4d9('0x1b')];_0x335195<_0x2734e2;_0x335195+=0x1){_0x34c8cb[_0x335195][_0x85d4d9('0x26')]=_0x58e864;}this[_0x85d4d9('0x4')]();},RuleEngine['prototype'][_0x407283('0x20')]=function(){const _0x5c389d=_0x407283;let _0x41368c=this[_0x5c389d('0x23')];if(_0x41368c instanceof Array)_0x41368c=_0x41368c[_0x5c389d('0x24')](function(_0x5ab257){const _0x101a10=_0x5c389d;return _0x5ab257[_0x101a10('0x22')]=_0x5ab257[_0x101a10('0x22')][_0x101a10('0xe')](),_0x5ab257[_0x101a10('0x14')]=_0x5ab257['consequence']['toString'](),_0x5ab257;});else!_[_0x5c389d('0x27')](_0x41368c)&&(_0x41368c['condition']=_0x41368c['condition']['toString'](),_0x41368c[_0x5c389d('0x14')]=_0x41368c['consequence'][_0x5c389d('0xe')]());return _0x41368c;},RuleEngine[_0x407283('0x2b')][_0x407283('0xa')]=function(_0x285ca6){const _0x5441d9=_0x407283;this[_0x5441d9('0x12')]();_[_0x5441d9('0xb')](_0x285ca6)&&(_0x285ca6=JSON[_0x5441d9('0x5')](_0x285ca6));if(_0x285ca6 instanceof Array)_0x285ca6=_0x285ca6[_0x5441d9('0x24')](function(_0x2ed663){const _0x2b52a3=_0x5441d9;return _0x2ed663[_0x2b52a3('0x22')]=eval('('+_0x2ed663['condition']+')'),_0x2ed663[_0x2b52a3('0x14')]=eval('('+_0x2ed663[_0x2b52a3('0x14')]+')'),_0x2ed663;});else _0x285ca6!==null&&typeof _0x285ca6=='object'&&(_0x285ca6[_0x5441d9('0x22')]=eval('('+_0x285ca6[_0x5441d9('0x22')]+')'),_0x285ca6[_0x5441d9('0x14')]=eval('('+_0x285ca6['consequence']+')'));this[_0x5441d9('0xd')](_0x285ca6);},module['exports']=RuleEngine;
\ No newline at end of file
+const a1163_0xcff0=['prioritize','events','length','isArray','inherits','priority','condition','orderBy','push','clone','result','noop','toJSON','prototype','sync','isString','findRules','util','ruleRef','consequence','exports','ignoreFactChanges','register','asc','object','restart','isNil','matches','lodash','init','activeRules','isObject','rules','toString','nextTick','matchPath','next','EventEmitter','execute','turn','map'];(function(_0x537469,_0xcff051){const _0xcb5cc7=function(_0xcee687){while(--_0xcee687){_0x537469['push'](_0x537469['shift']());}};_0xcb5cc7(++_0xcff051);}(a1163_0xcff0,0x1d2));const a1163_0xcb5c=function(_0x537469,_0xcff051){_0x537469=_0x537469-0x0;let _0xcb5cc7=a1163_0xcff0[_0x537469];return _0xcb5cc7;};const _0x3c5e58=a1163_0xcb5c;'use strict';const _=require(_0x3c5e58('0xd')),util=require(_0x3c5e58('0x2')),EventEmitter=require(_0x3c5e58('0x1b'))[_0x3c5e58('0x16')];function RuleEngine(_0xcee687,_0x1830c5){const _0x5980d2=_0x3c5e58;return this[_0x5980d2('0xe')](),!_[_0x5980d2('0xb')](_0xcee687)&&this[_0x5980d2('0x7')](_0xcee687),_0x1830c5&&(this[_0x5980d2('0x6')]=_0x1830c5[_0x5980d2('0x6')]),this;}util[_0x3c5e58('0x1e')](RuleEngine,EventEmitter),RuleEngine[_0x3c5e58('0x27')][_0x3c5e58('0xe')]=function(){const _0x5f324d=_0x3c5e58;this['rules']=[],this[_0x5f324d('0xf')]=[];},RuleEngine[_0x3c5e58('0x27')][_0x3c5e58('0x7')]=function(_0x3a4b74){const _0x5aa8e7=_0x3c5e58;if(Array[_0x5aa8e7('0x1d')](_0x3a4b74))this['rules']=this[_0x5aa8e7('0x11')]['concat'](_0x3a4b74);else _0x3a4b74!==null&&_[_0x5aa8e7('0x10')](_0x3a4b74)&&this[_0x5aa8e7('0x11')]['push'](_0x3a4b74);this[_0x5aa8e7('0x28')]();},RuleEngine['prototype'][_0x3c5e58('0x28')]=function(){const _0x25720d=_0x3c5e58;this[_0x25720d('0xf')]=this[_0x25720d('0x11')]['filter'](function(_0x14d628){const _0x226651=_0x25720d;_[_0x226651('0xb')](_0x14d628['on'])&&(_0x14d628['on']=!![]);if(_0x14d628['on']===!![])return _0x14d628;}),this[_0x25720d('0xf')]=_[_0x25720d('0x21')](this[_0x25720d('0xf')],['p'],[_0x25720d('0x8')]);},RuleEngine[_0x3c5e58('0x27')][_0x3c5e58('0x17')]=function(_0x228efb,_0xca2edf){const _0x45ec8f=_0x3c5e58;let _0x266d1e=![];_0x228efb[_0x45ec8f('0x24')]=!![];const _0x67926b=_[_0x45ec8f('0x23')](_0x228efb);let _0x1ef6d4=_['clone'](_0x228efb);const _0xda2bde=this['activeRules'],_0x355e72=[],_0x4ce407=this[_0x45ec8f('0x6')];(function _0x1fef65(_0x4424e3){const _0x531c34=_0x45ec8f,_0x308779={'rules':function(){return _0xda2bde;},'rule':function(){return _0xda2bde[_0x4424e3];},'when':function(_0x5e2bb6){const _0x4129ba=a1163_0xcb5c;if(_0x5e2bb6){const _0x2011b8=_0xda2bde[_0x4424e3][_0x4129ba('0x4')];_0x2011b8[_0x4129ba('0x3')]=_0xda2bde[_0x4424e3]['id']||_0xda2bde[_0x4424e3]['name']||'index_'+_0x4424e3,process['nextTick'](function(){const _0xef53ed=_0x4129ba;_0x355e72[_0xef53ed('0x22')](_0x2011b8[_0xef53ed('0x3')]),_0x2011b8['call'](_0x67926b,_0x308779);});}else process[_0x4129ba('0x13')](function(){const _0x1b8c31=_0x4129ba;_0x308779[_0x1b8c31('0x15')]();});},'restart':function(){return _0x1fef65(0x0);},'stop':function(){return _0x266d1e=!![],_0x1fef65(0x0);},'next':function(_0x15018c){const _0x5bbaf0=a1163_0xcb5c;!_0x4ce407&&!_['isEqual'](_0x1ef6d4,_0x67926b)?(_0x1ef6d4=_[_0x5bbaf0('0x23')](_0x67926b),process[_0x5bbaf0('0x13')](function(){const _0x503fc2=_0x5bbaf0;_0x308779[_0x503fc2('0xa')]();})):process['nextTick'](function(){const _0x17d7f8=_0x5bbaf0;return _[_0x17d7f8('0xb')](_0x15018c)?_0x1fef65(_0x4424e3+0x1):_0x1fef65(_0x15018c);});}};if(_0x4424e3<_0xda2bde[_0x531c34('0x1c')]&&_0x266d1e===![]){const _0x30e784=_0xda2bde[_0x4424e3][_0x531c34('0x20')];_0x30e784['call'](_0x67926b,_0x308779);}else process['nextTick'](function(){const _0x2f43e0=_0x531c34;return _0x67926b[_0x2f43e0('0x14')]=_0x355e72,_0xca2edf?_0xca2edf(_0x67926b):_[_0x2f43e0('0x25')]();});}(0x0));},RuleEngine[_0x3c5e58('0x27')][_0x3c5e58('0x1')]=function(_0x5cc5c5){const _0x14665c=_0x3c5e58;if(_['isNil'](_0x5cc5c5))return this[_0x14665c('0x11')];else{const _0x10897a=_[_0x14665c('0xc')](_0x5cc5c5);return _['filter'](this[_0x14665c('0x11')],_0x10897a);}},RuleEngine[_0x3c5e58('0x27')][_0x3c5e58('0x18')]=function(_0x268189,_0x3dda6a){const _0x57d85c=_0x3c5e58,_0x294bbc=_0x268189==='on'||_0x268189==='ON'?!![]:![],_0x4fa05b=this[_0x57d85c('0x1')](_0x3dda6a);for(let _0x11a9d5=0x0,_0x1b431c=_0x4fa05b['length'];_0x11a9d5<_0x1b431c;_0x11a9d5+=0x1){_0x4fa05b[_0x11a9d5]['on']=_0x294bbc;}this[_0x57d85c('0x28')]();},RuleEngine[_0x3c5e58('0x27')][_0x3c5e58('0x1a')]=function(_0x3d0084,_0x11dc54){const _0x27603d=_0x3c5e58;_0x3d0084=parseInt(_0x3d0084,0xa);const _0x5a7d1e=this[_0x27603d('0x1')](_0x11dc54);for(let _0x7b38af=0x0,_0x6b4ece=_0x5a7d1e['length'];_0x7b38af<_0x6b4ece;_0x7b38af+=0x1){_0x5a7d1e[_0x7b38af][_0x27603d('0x1f')]=_0x3d0084;}this[_0x27603d('0x28')]();},RuleEngine['prototype'][_0x3c5e58('0x26')]=function(){const _0x2e7aa9=_0x3c5e58;let _0x10eb6f=this[_0x2e7aa9('0x11')];if(_0x10eb6f instanceof Array)_0x10eb6f=_0x10eb6f[_0x2e7aa9('0x19')](function(_0x5c9e17){const _0x5a1317=_0x2e7aa9;return _0x5c9e17['condition']=_0x5c9e17['condition'][_0x5a1317('0x12')](),_0x5c9e17[_0x5a1317('0x4')]=_0x5c9e17['consequence'][_0x5a1317('0x12')](),_0x5c9e17;});else!_[_0x2e7aa9('0xb')](_0x10eb6f)&&(_0x10eb6f[_0x2e7aa9('0x20')]=_0x10eb6f['condition'][_0x2e7aa9('0x12')](),_0x10eb6f['consequence']=_0x10eb6f[_0x2e7aa9('0x4')][_0x2e7aa9('0x12')]());return _0x10eb6f;},RuleEngine['prototype']['fromJSON']=function(_0x3615af){const _0x45bdfd=_0x3c5e58;this[_0x45bdfd('0xe')]();_[_0x45bdfd('0x0')](_0x3615af)&&(_0x3615af=JSON['parse'](_0x3615af));if(_0x3615af instanceof Array)_0x3615af=_0x3615af[_0x45bdfd('0x19')](function(_0x3221d1){const _0x191d7b=_0x45bdfd;return _0x3221d1[_0x191d7b('0x20')]=eval('('+_0x3221d1[_0x191d7b('0x20')]+')'),_0x3221d1['consequence']=eval('('+_0x3221d1[_0x191d7b('0x4')]+')'),_0x3221d1;});else _0x3615af!==null&&typeof _0x3615af==_0x45bdfd('0x9')&&(_0x3615af[_0x45bdfd('0x20')]=eval('('+_0x3615af['condition']+')'),_0x3615af['consequence']=eval('('+_0x3615af['consequence']+')'));this[_0x45bdfd('0x7')](_0x3615af);},module[_0x3c5e58('0x5')]=RuleEngine;
\ No newline at end of file