Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / services / routing / server / applications / gotoif.js
index 766bc68..d313f40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5735=['message','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','./utils','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x5735,0xbd));var _0x5573=function(_0x308e4f,_0x134e25){_0x308e4f=_0x308e4f-0x0;var _0x17ab35=_0x5735[_0x308e4f];return _0x17ab35;};'use strict';var schema=require(_0x5573('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0x5573('0x1'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':_0x5573('0x2'),'required':!![],'message':_0x5573('0x3')},'priorityTrue':{'type':_0x5573('0x4'),'message':_0x5573('0x5')},'priorityFalse':{'type':'number','message':_0x5573('0x6')}});exports[_0x5573('0x7')]=function(_0x4e450d,_0x476109){return function(_0x45a6a3){try{var _0x3dbe49={'condition':htmlToText[_0x5573('0x8')](utils['getMustacheRender'](_0x476109[0x0],this),{'wordwrap':![]})[_0x5573('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x476109[0x1],'priorityFalse':_0x476109[0x2]};var _0x254b2b=gotoif[_0x5573('0x0')](_0x3dbe49,{'typecast':!![]});if(_0x254b2b[_0x5573('0xa')]){logger[_0x5573('0xb')](_0x5573('0xc'),_0x4e450d,_[_0x5573('0xd')](_0x254b2b,_0x5573('0xe'))[_0x5573('0xf')](',\x20'));_0x45a6a3[_0x5573('0x10')]();}else{try{var _0x3d5b08=eval('('+_0x3dbe49['condition']+')');var _0x362bbc=_0x3d5b08?_0x3dbe49[_0x5573('0x11')]:_0x3dbe49[_0x5573('0x12')];logger[_0x5573('0x13')](_0x5573('0x14'),_0x4e450d,_0x3dbe49[_0x5573('0x15')],_0x3d5b08,_0x362bbc||'next');if(_0x362bbc){var _0x3f090b=_[_0x5573('0x16')](_0x45a6a3[_0x5573('0x17')](),{'p':_0x362bbc});if(_0x3f090b>=0x0){logger['info'](_0x5573('0x18'),_0x4e450d,_0x362bbc||_0x5573('0x19'),_0x3f090b);_0x45a6a3[_0x5573('0x19')](_0x3f090b);}else{logger[_0x5573('0x13')](_0x5573('0x1a'),_0x4e450d,_0x362bbc||_0x5573('0x19'));_0x45a6a3['stop']();}}else{_0x45a6a3[_0x5573('0x19')]();}}catch(_0x181cd6){logger['error'](_0x5573('0x1b'),_0x4e450d,_0x181cd6['message']);_0x45a6a3[_0x5573('0x10')]();}}}catch(_0x52fea8){logger[_0x5573('0xb')]('[%s][GOTOIF]\x20%s',_0x4e450d,JSON[_0x5573('0x1c')](_0x52fea8));_0x45a6a3[_0x5573('0x10')]();}};};
\ No newline at end of file
+var _0x6364=['lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','getMustacheRender','replace','validate','length','error','[%s][GOTOIF]\x20%s','map','join','condition','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0x6364,0xae));var _0x4636=function(_0x52bd66,_0x226b74){_0x52bd66=_0x52bd66-0x0;var _0x61f4f8=_0x6364[_0x52bd66];return _0x61f4f8;};'use strict';var schema=require('validate');var _=require(_0x4636('0x0'));var htmlToText=require(_0x4636('0x1'));var utils=require(_0x4636('0x2'));var logger=require(_0x4636('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x4636('0x4'),'required':!![],'message':_0x4636('0x5')},'priorityTrue':{'type':_0x4636('0x6'),'message':_0x4636('0x7')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x4636('0x8')]=function(_0x28f0d6,_0x43b293){return function(_0xcd23a4){try{var _0x3dae25={'condition':htmlToText['fromString'](utils[_0x4636('0x9')](_0x43b293[0x0],this),{'wordwrap':![]})[_0x4636('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x43b293[0x1],'priorityFalse':_0x43b293[0x2]};var _0x124f60=gotoif[_0x4636('0xb')](_0x3dae25,{'typecast':!![]});if(_0x124f60[_0x4636('0xc')]){logger[_0x4636('0xd')](_0x4636('0xe'),_0x28f0d6,_[_0x4636('0xf')](_0x124f60,'message')[_0x4636('0x10')](',\x20'));_0xcd23a4['stop']();}else{try{var _0x179536=eval('('+_0x3dae25[_0x4636('0x11')]+')');var _0x3021e0=_0x179536?_0x3dae25['priorityTrue']:_0x3dae25[_0x4636('0x12')];logger['info'](_0x4636('0x13'),_0x28f0d6,_0x3dae25['condition'],_0x179536,_0x3021e0||_0x4636('0x14'));if(_0x3021e0){var _0xd4d26c=_['findIndex'](_0xcd23a4[_0x4636('0x15')](),{'p':_0x3021e0});if(_0xd4d26c>=0x0){logger[_0x4636('0x16')](_0x4636('0x17'),_0x28f0d6,_0x3021e0||'next',_0xd4d26c);_0xcd23a4[_0x4636('0x14')](_0xd4d26c);}else{logger[_0x4636('0x16')](_0x4636('0x18'),_0x28f0d6,_0x3021e0||_0x4636('0x14'));_0xcd23a4[_0x4636('0x19')]();}}else{_0xcd23a4[_0x4636('0x14')]();}}catch(_0x53f6a6){logger[_0x4636('0xd')](_0x4636('0x1a'),_0x28f0d6,_0x53f6a6[_0x4636('0x1b')]);_0xcd23a4['stop']();}}}catch(_0x4fee3f){logger[_0x4636('0xd')]('[%s][GOTOIF]\x20%s',_0x28f0d6,JSON[_0x4636('0x1c')](_0x4fee3f));_0xcd23a4[_0x4636('0x19')]();}};};
\ No newline at end of file