Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / services / routing / lib / rule-engine.js
index cc3cc03..7bf3dab 100644 (file)
@@ -1 +1 @@
-const a1327_0x4014=['register','priority','lodash','EventEmitter','ignoreFactChanges','findRules','map','isString','isObject','init','fromJSON','call','isArray','matchPath','rules','toString','isEqual','consequence','restart','sync','object','activeRules','prioritize','exports','result','push','ruleRef','orderBy','condition','events','prototype','nextTick','noop','next','asc','matches','isNil','filter','inherits','concat','name','parse','clone','length'];(function(_0x645295,_0xfcee5){const _0x4014ab=function(_0x46cb77){while(--_0x46cb77){_0x645295['push'](_0x645295['shift']());}};_0x4014ab(++_0xfcee5);}(a1327_0x4014,0xa3));const a1327_0x46cb=function(_0x645295,_0xfcee5){_0x645295=_0x645295-0xc9;let _0x4014ab=a1327_0x4014[_0x645295];return _0x4014ab;};const a1327_0x4bf5e6=a1327_0x46cb;'use strict';const _=require(a1327_0x4bf5e6(0xd8)),util=require('util'),EventEmitter=require(a1327_0x4bf5e6(0xf3))[a1327_0x4bf5e6(0xd9)];function RuleEngine(_0x203179,_0x3a3ae0){const _0x382d98=a1327_0x4bf5e6;return this['init'](),!_[_0x382d98(0xce)](_0x203179)&&this[_0x382d98(0xd6)](_0x203179),_0x3a3ae0&&(this[_0x382d98(0xda)]=_0x3a3ae0[_0x382d98(0xda)]),this;}util[a1327_0x4bf5e6(0xd0)](RuleEngine,EventEmitter),RuleEngine[a1327_0x4bf5e6(0xf4)][a1327_0x4bf5e6(0xdf)]=function(){const _0x239e8f=a1327_0x4bf5e6;this[_0x239e8f(0xe4)]=[],this[_0x239e8f(0xeb)]=[];},RuleEngine[a1327_0x4bf5e6(0xf4)][a1327_0x4bf5e6(0xd6)]=function(_0x375d9d){const _0x5a31bd=a1327_0x4bf5e6;if(Array[_0x5a31bd(0xe2)](_0x375d9d))this[_0x5a31bd(0xe4)]=this['rules'][_0x5a31bd(0xd1)](_0x375d9d);else _0x375d9d!==null&&_[_0x5a31bd(0xde)](_0x375d9d)&&this[_0x5a31bd(0xe4)][_0x5a31bd(0xef)](_0x375d9d);this[_0x5a31bd(0xe9)]();},RuleEngine[a1327_0x4bf5e6(0xf4)][a1327_0x4bf5e6(0xe9)]=function(){const _0x232c8f=a1327_0x4bf5e6;this[_0x232c8f(0xeb)]=this[_0x232c8f(0xe4)][_0x232c8f(0xcf)](function(_0x1bf66d){const _0x4aad23=_0x232c8f;_[_0x4aad23(0xce)](_0x1bf66d['on'])&&(_0x1bf66d['on']=!![]);if(_0x1bf66d['on']===!![])return _0x1bf66d;}),this[_0x232c8f(0xeb)]=_[_0x232c8f(0xf1)](this['activeRules'],['p'],[_0x232c8f(0xcc)]);},RuleEngine[a1327_0x4bf5e6(0xf4)]['execute']=function(_0x394ba0,_0x46cbd6){const _0x24c83e=a1327_0x4bf5e6;let _0x2bc0cb=![];_0x394ba0[_0x24c83e(0xee)]=!![];const _0x509a6b=_[_0x24c83e(0xd4)](_0x394ba0);let _0x100a21=_['clone'](_0x394ba0);const _0x224729=this[_0x24c83e(0xeb)],_0x3f01f3=[],_0x213b4a=this[_0x24c83e(0xda)];(function _0x424e93(_0x26d65e){const _0x3c5b0c=_0x24c83e,_0xc3b622={'rules':function(){return _0x224729;},'rule':function(){return _0x224729[_0x26d65e];},'when':function(_0x57ba94){const _0xc0a90f=a1327_0x46cb;if(_0x57ba94){const _0x4474f3=_0x224729[_0x26d65e][_0xc0a90f(0xe7)];_0x4474f3['ruleRef']=_0x224729[_0x26d65e]['id']||_0x224729[_0x26d65e][_0xc0a90f(0xd2)]||'index_'+_0x26d65e,process[_0xc0a90f(0xc9)](function(){const _0x46a605=_0xc0a90f;_0x3f01f3[_0x46a605(0xef)](_0x4474f3[_0x46a605(0xf0)]),_0x4474f3['call'](_0x509a6b,_0xc3b622);});}else process[_0xc0a90f(0xc9)](function(){const _0x509b46=_0xc0a90f;_0xc3b622[_0x509b46(0xcb)]();});},'restart':function(){return _0x424e93(0x0);},'stop':function(){return _0x2bc0cb=!![],_0x424e93(0x0);},'next':function(_0x14ea82){const _0x46662e=a1327_0x46cb;!_0x213b4a&&!_[_0x46662e(0xe6)](_0x100a21,_0x509a6b)?(_0x100a21=_[_0x46662e(0xd4)](_0x509a6b),process[_0x46662e(0xc9)](function(){const _0x46252b=_0x46662e;_0xc3b622[_0x46252b(0xe8)]();})):process['nextTick'](function(){const _0x3610ad=_0x46662e;return _[_0x3610ad(0xce)](_0x14ea82)?_0x424e93(_0x26d65e+0x1):_0x424e93(_0x14ea82);});}};if(_0x26d65e<_0x224729[_0x3c5b0c(0xd5)]&&_0x2bc0cb===![]){const _0x2518b9=_0x224729[_0x26d65e][_0x3c5b0c(0xf2)];_0x2518b9[_0x3c5b0c(0xe1)](_0x509a6b,_0xc3b622);}else process[_0x3c5b0c(0xc9)](function(){const _0x1765b8=_0x3c5b0c;return _0x509a6b[_0x1765b8(0xe3)]=_0x3f01f3,_0x46cbd6?_0x46cbd6(_0x509a6b):_[_0x1765b8(0xca)]();});}(0x0));},RuleEngine[a1327_0x4bf5e6(0xf4)][a1327_0x4bf5e6(0xdb)]=function(_0x25733e){const _0x26b392=a1327_0x4bf5e6;if(_[_0x26b392(0xce)](_0x25733e))return this[_0x26b392(0xe4)];else{const _0x3b78bf=_[_0x26b392(0xcd)](_0x25733e);return _[_0x26b392(0xcf)](this[_0x26b392(0xe4)],_0x3b78bf);}},RuleEngine[a1327_0x4bf5e6(0xf4)]['turn']=function(_0x3da614,_0x6390c){const _0x332921=a1327_0x4bf5e6,_0x313831=_0x3da614==='on'||_0x3da614==='ON'?!![]:![],_0x4b87be=this[_0x332921(0xdb)](_0x6390c);for(let _0x1d8156=0x0,_0x33d8ff=_0x4b87be[_0x332921(0xd5)];_0x1d8156<_0x33d8ff;_0x1d8156+=0x1){_0x4b87be[_0x1d8156]['on']=_0x313831;}this[_0x332921(0xe9)]();},RuleEngine[a1327_0x4bf5e6(0xf4)][a1327_0x4bf5e6(0xec)]=function(_0x47f995,_0x5705f1){const _0x5dc65b=a1327_0x4bf5e6;_0x47f995=parseInt(_0x47f995,0xa);const _0x216fc1=this[_0x5dc65b(0xdb)](_0x5705f1);for(let _0x3175f1=0x0,_0x4aa843=_0x216fc1[_0x5dc65b(0xd5)];_0x3175f1<_0x4aa843;_0x3175f1+=0x1){_0x216fc1[_0x3175f1][_0x5dc65b(0xd7)]=_0x47f995;}this[_0x5dc65b(0xe9)]();},RuleEngine[a1327_0x4bf5e6(0xf4)]['toJSON']=function(){const _0x27e3e3=a1327_0x4bf5e6;let _0x29b915=this[_0x27e3e3(0xe4)];if(_0x29b915 instanceof Array)_0x29b915=_0x29b915[_0x27e3e3(0xdc)](function(_0x521748){const _0x5cc9b1=_0x27e3e3;return _0x521748[_0x5cc9b1(0xf2)]=_0x521748['condition'][_0x5cc9b1(0xe5)](),_0x521748[_0x5cc9b1(0xe7)]=_0x521748[_0x5cc9b1(0xe7)][_0x5cc9b1(0xe5)](),_0x521748;});else!_[_0x27e3e3(0xce)](_0x29b915)&&(_0x29b915[_0x27e3e3(0xf2)]=_0x29b915['condition'][_0x27e3e3(0xe5)](),_0x29b915['consequence']=_0x29b915[_0x27e3e3(0xe7)]['toString']());return _0x29b915;},RuleEngine[a1327_0x4bf5e6(0xf4)][a1327_0x4bf5e6(0xe0)]=function(_0x204865){const _0x3c780d=a1327_0x4bf5e6;this['init']();_[_0x3c780d(0xdd)](_0x204865)&&(_0x204865=JSON[_0x3c780d(0xd3)](_0x204865));if(_0x204865 instanceof Array)_0x204865=_0x204865[_0x3c780d(0xdc)](function(_0x2eb188){const _0xb24b0e=_0x3c780d;return _0x2eb188[_0xb24b0e(0xf2)]=eval('('+_0x2eb188['condition']+')'),_0x2eb188['consequence']=eval('('+_0x2eb188['consequence']+')'),_0x2eb188;});else _0x204865!==null&&typeof _0x204865==_0x3c780d(0xea)&&(_0x204865[_0x3c780d(0xf2)]=eval('('+_0x204865['condition']+')'),_0x204865[_0x3c780d(0xe7)]=eval('('+_0x204865[_0x3c780d(0xe7)]+')'));this['register'](_0x204865);},module[a1327_0x4bf5e6(0xed)]=RuleEngine;
\ No newline at end of file
+const a1331_0x18c2=['EventEmitter','prioritize','init','priority','isEqual','isNil','push','toString','prototype','noop','consequence','index_','call','execute','isObject','rules','lodash','name','toJSON','concat','nextTick','sync','turn','isArray','orderBy','findRules','ruleRef','inherits','events','filter','condition','register','restart','map','activeRules','length','clone','matchPath','ignoreFactChanges','next','exports'];(function(_0x432961,_0x3bc60){const _0x18c2e8=function(_0x485a00){while(--_0x485a00){_0x432961['push'](_0x432961['shift']());}};_0x18c2e8(++_0x3bc60);}(a1331_0x18c2,0x19a));const a1331_0x485a=function(_0x432961,_0x3bc60){_0x432961=_0x432961-0x1bf;let _0x18c2e8=a1331_0x18c2[_0x432961];return _0x18c2e8;};const a1331_0xbf4c25=a1331_0x485a;'use strict';const _=require(a1331_0xbf4c25(0x1cf)),util=require('util'),EventEmitter=require(a1331_0xbf4c25(0x1db))[a1331_0xbf4c25(0x1bf)];function RuleEngine(_0x468527,_0x291fa0){const _0x34a568=a1331_0xbf4c25;return this[_0x34a568(0x1c1)](),!_[_0x34a568(0x1c4)](_0x468527)&&this[_0x34a568(0x1de)](_0x468527),_0x291fa0&&(this[_0x34a568(0x1e5)]=_0x291fa0[_0x34a568(0x1e5)]),this;}util[a1331_0xbf4c25(0x1da)](RuleEngine,EventEmitter),RuleEngine['prototype'][a1331_0xbf4c25(0x1c1)]=function(){const _0x415c30=a1331_0xbf4c25;this[_0x415c30(0x1ce)]=[],this[_0x415c30(0x1e1)]=[];},RuleEngine['prototype']['register']=function(_0x14a723){const _0x10afd7=a1331_0xbf4c25;if(Array[_0x10afd7(0x1d6)](_0x14a723))this[_0x10afd7(0x1ce)]=this[_0x10afd7(0x1ce)][_0x10afd7(0x1d2)](_0x14a723);else _0x14a723!==null&&_[_0x10afd7(0x1cd)](_0x14a723)&&this['rules'][_0x10afd7(0x1c5)](_0x14a723);this['sync']();},RuleEngine[a1331_0xbf4c25(0x1c7)][a1331_0xbf4c25(0x1d4)]=function(){const _0x2141d8=a1331_0xbf4c25;this[_0x2141d8(0x1e1)]=this[_0x2141d8(0x1ce)]['filter'](function(_0x9820d3){const _0x305d0a=_0x2141d8;_[_0x305d0a(0x1c4)](_0x9820d3['on'])&&(_0x9820d3['on']=!![]);if(_0x9820d3['on']===!![])return _0x9820d3;}),this['activeRules']=_[_0x2141d8(0x1d7)](this[_0x2141d8(0x1e1)],['p'],['asc']);},RuleEngine[a1331_0xbf4c25(0x1c7)][a1331_0xbf4c25(0x1cc)]=function(_0x179066,_0x16541c){const _0x352df7=a1331_0xbf4c25;let _0x40cee3=![];_0x179066['result']=!![];const _0x5963ef=_['clone'](_0x179066);let _0x3fd9bb=_[_0x352df7(0x1e3)](_0x179066);const _0x53e9df=this['activeRules'],_0x25cb19=[],_0x48a287=this['ignoreFactChanges'];(function _0x5ab94b(_0x4f2192){const _0x528443=_0x352df7,_0x47bca5={'rules':function(){return _0x53e9df;},'rule':function(){return _0x53e9df[_0x4f2192];},'when':function(_0xc1162f){const _0x382404=a1331_0x485a;if(_0xc1162f){const _0x3509b5=_0x53e9df[_0x4f2192][_0x382404(0x1c9)];_0x3509b5[_0x382404(0x1d9)]=_0x53e9df[_0x4f2192]['id']||_0x53e9df[_0x4f2192][_0x382404(0x1d0)]||_0x382404(0x1ca)+_0x4f2192,process[_0x382404(0x1d3)](function(){const _0x1d8fd3=_0x382404;_0x25cb19[_0x1d8fd3(0x1c5)](_0x3509b5['ruleRef']),_0x3509b5[_0x1d8fd3(0x1cb)](_0x5963ef,_0x47bca5);});}else process['nextTick'](function(){const _0x3878a7=_0x382404;_0x47bca5[_0x3878a7(0x1e6)]();});},'restart':function(){return _0x5ab94b(0x0);},'stop':function(){return _0x40cee3=!![],_0x5ab94b(0x0);},'next':function(_0x4b610e){const _0x398fbd=a1331_0x485a;!_0x48a287&&!_[_0x398fbd(0x1c3)](_0x3fd9bb,_0x5963ef)?(_0x3fd9bb=_['clone'](_0x5963ef),process[_0x398fbd(0x1d3)](function(){const _0x2d0e19=_0x398fbd;_0x47bca5[_0x2d0e19(0x1df)]();})):process[_0x398fbd(0x1d3)](function(){const _0x53c20=_0x398fbd;return _[_0x53c20(0x1c4)](_0x4b610e)?_0x5ab94b(_0x4f2192+0x1):_0x5ab94b(_0x4b610e);});}};if(_0x4f2192<_0x53e9df[_0x528443(0x1e2)]&&_0x40cee3===![]){const _0x715bfd=_0x53e9df[_0x4f2192][_0x528443(0x1dd)];_0x715bfd['call'](_0x5963ef,_0x47bca5);}else process[_0x528443(0x1d3)](function(){const _0x187a7c=_0x528443;return _0x5963ef[_0x187a7c(0x1e4)]=_0x25cb19,_0x16541c?_0x16541c(_0x5963ef):_[_0x187a7c(0x1c8)]();});}(0x0));},RuleEngine[a1331_0xbf4c25(0x1c7)][a1331_0xbf4c25(0x1d8)]=function(_0x271653){const _0x52b22d=a1331_0xbf4c25;if(_[_0x52b22d(0x1c4)](_0x271653))return this[_0x52b22d(0x1ce)];else{const _0x5cf8b5=_['matches'](_0x271653);return _[_0x52b22d(0x1dc)](this[_0x52b22d(0x1ce)],_0x5cf8b5);}},RuleEngine[a1331_0xbf4c25(0x1c7)][a1331_0xbf4c25(0x1d5)]=function(_0x494b36,_0x5a5172){const _0x5584ef=_0x494b36==='on'||_0x494b36==='ON'?!![]:![],_0x33b4f9=this['findRules'](_0x5a5172);for(let _0x3335da=0x0,_0x3381ce=_0x33b4f9['length'];_0x3335da<_0x3381ce;_0x3335da+=0x1){_0x33b4f9[_0x3335da]['on']=_0x5584ef;}this['sync']();},RuleEngine[a1331_0xbf4c25(0x1c7)][a1331_0xbf4c25(0x1c0)]=function(_0x1aa843,_0x31f8dc){const _0x5273a2=a1331_0xbf4c25;_0x1aa843=parseInt(_0x1aa843,0xa);const _0x228d2c=this[_0x5273a2(0x1d8)](_0x31f8dc);for(let _0x46707c=0x0,_0x476c98=_0x228d2c['length'];_0x46707c<_0x476c98;_0x46707c+=0x1){_0x228d2c[_0x46707c][_0x5273a2(0x1c2)]=_0x1aa843;}this[_0x5273a2(0x1d4)]();},RuleEngine['prototype'][a1331_0xbf4c25(0x1d1)]=function(){const _0x2834ef=a1331_0xbf4c25;let _0x549c9a=this[_0x2834ef(0x1ce)];if(_0x549c9a instanceof Array)_0x549c9a=_0x549c9a[_0x2834ef(0x1e0)](function(_0x14000d){const _0x2feb5d=_0x2834ef;return _0x14000d[_0x2feb5d(0x1dd)]=_0x14000d[_0x2feb5d(0x1dd)][_0x2feb5d(0x1c6)](),_0x14000d[_0x2feb5d(0x1c9)]=_0x14000d['consequence']['toString'](),_0x14000d;});else!_[_0x2834ef(0x1c4)](_0x549c9a)&&(_0x549c9a['condition']=_0x549c9a['condition'][_0x2834ef(0x1c6)](),_0x549c9a[_0x2834ef(0x1c9)]=_0x549c9a[_0x2834ef(0x1c9)][_0x2834ef(0x1c6)]());return _0x549c9a;},RuleEngine['prototype']['fromJSON']=function(_0xb4a678){const _0x311fbe=a1331_0xbf4c25;this[_0x311fbe(0x1c1)]();_['isString'](_0xb4a678)&&(_0xb4a678=JSON['parse'](_0xb4a678));if(_0xb4a678 instanceof Array)_0xb4a678=_0xb4a678['map'](function(_0xc2f280){const _0x3e0522=_0x311fbe;return _0xc2f280[_0x3e0522(0x1dd)]=eval('('+_0xc2f280[_0x3e0522(0x1dd)]+')'),_0xc2f280['consequence']=eval('('+_0xc2f280[_0x3e0522(0x1c9)]+')'),_0xc2f280;});else _0xb4a678!==null&&typeof _0xb4a678=='object'&&(_0xb4a678[_0x311fbe(0x1dd)]=eval('('+_0xb4a678[_0x311fbe(0x1dd)]+')'),_0xb4a678['consequence']=eval('('+_0xb4a678[_0x311fbe(0x1c9)]+')'));this[_0x311fbe(0x1de)](_0xb4a678);},module[a1331_0xbf4c25(0x1e7)]=RuleEngine;
\ No newline at end of file