Built motion from commit 43538d75.|2.5.35
[motion2.git] / server / services / routing / server / applications / gotoif.js
index 93aff9b..a78e95d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa71c=['html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','length','error','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash'];(function(_0x222c5,_0x5c5deb){var _0x24426b=function(_0x2630cd){while(--_0x2630cd){_0x222c5['push'](_0x222c5['shift']());}};_0x24426b(++_0x5c5deb);}(_0xa71c,0xb2));var _0xca71=function(_0x3234f6,_0x49ce08){_0x3234f6=_0x3234f6-0x0;var _0x3b78d9=_0xa71c[_0x3234f6];return _0x3b78d9;};'use strict';var schema=require(_0xca71('0x0'));var _=require(_0xca71('0x1'));var htmlToText=require(_0xca71('0x2'));var utils=require(_0xca71('0x3'));var logger=require(_0xca71('0x4'))(_0xca71('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xca71('0x6')},'priorityTrue':{'type':_0xca71('0x7'),'message':_0xca71('0x8')},'priorityFalse':{'type':'number','message':_0xca71('0x9')}});exports[_0xca71('0xa')]=function(_0x2dc1d6,_0x295b86){return function(_0xce1482){try{var _0x51f770={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x295b86[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x295b86[0x1],'priorityFalse':_0x295b86[0x2]};var _0x4ceeb9=gotoif[_0xca71('0x0')](_0x51f770,{'typecast':!![]});if(_0x4ceeb9[_0xca71('0xb')]){logger[_0xca71('0xc')]('[%s][GOTOIF]\x20%s',_0x2dc1d6,_[_0xca71('0xd')](_0x4ceeb9,_0xca71('0xe'))[_0xca71('0xf')](',\x20'));_0xce1482[_0xca71('0x10')]();}else{try{var _0x4ca206=eval('('+_0x51f770[_0xca71('0x11')]+')');var _0x215c8f=_0x4ca206?_0x51f770[_0xca71('0x12')]:_0x51f770[_0xca71('0x13')];logger[_0xca71('0x14')](_0xca71('0x15'),_0x2dc1d6,_0x51f770[_0xca71('0x11')],_0x4ca206,_0x215c8f||_0xca71('0x16'));if(_0x215c8f){var _0x29c114=_[_0xca71('0x17')](_0xce1482[_0xca71('0x18')](),{'p':_0x215c8f});if(_0x29c114>=0x0){logger['info'](_0xca71('0x19'),_0x2dc1d6,_0x215c8f||_0xca71('0x16'),_0x29c114);_0xce1482['next'](_0x29c114);}else{logger[_0xca71('0x14')](_0xca71('0x1a'),_0x2dc1d6,_0x215c8f||_0xca71('0x16'));_0xce1482[_0xca71('0x10')]();}}else{_0xce1482[_0xca71('0x16')]();}}catch(_0x1e1c38){logger[_0xca71('0xc')](_0xca71('0x1b'),_0x2dc1d6,_0x1e1c38['message']);_0xce1482[_0xca71('0x10')]();}}}catch(_0x5293d3){logger[_0xca71('0xc')](_0xca71('0x1c'),_0x2dc1d6,JSON[_0xca71('0x1d')](_0x5293d3));_0xce1482[_0xca71('0x10')]();}};};
\ No newline at end of file
+var _0xd93b=['./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd93b,0x15c));var _0xbd93=function(_0x3ac027,_0x122bd2){_0x3ac027=_0x3ac027-0x0;var _0x3e98e9=_0xd93b[_0x3ac027];return _0x3e98e9;};'use strict';var schema=require(_0xbd93('0x0'));var _=require(_0xbd93('0x1'));var htmlToText=require(_0xbd93('0x2'));var utils=require(_0xbd93('0x3'));var logger=require(_0xbd93('0x4'))(_0xbd93('0x5'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xbd93('0x6')},'priorityTrue':{'type':_0xbd93('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xbd93('0x7'),'message':_0xbd93('0x8')}});exports['consequence']=function(_0x2be3c8,_0x30ed59){return function(_0x5cb1ca){try{var _0xa891f9={'condition':htmlToText[_0xbd93('0x9')](utils[_0xbd93('0xa')](_0x30ed59[0x0],this),{'wordwrap':![]})[_0xbd93('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x30ed59[0x1],'priorityFalse':_0x30ed59[0x2]};var _0x46f219=gotoif['validate'](_0xa891f9,{'typecast':!![]});if(_0x46f219[_0xbd93('0xc')]){logger[_0xbd93('0xd')](_0xbd93('0xe'),_0x2be3c8,_[_0xbd93('0xf')](_0x46f219,_0xbd93('0x10'))[_0xbd93('0x11')](',\x20'));_0x5cb1ca[_0xbd93('0x12')]();}else{try{var _0xdaf2d2=eval('('+_0xa891f9['condition']+')');var _0x59fe4c=_0xdaf2d2?_0xa891f9['priorityTrue']:_0xa891f9[_0xbd93('0x13')];logger['info'](_0xbd93('0x14'),_0x2be3c8,_0xa891f9[_0xbd93('0x15')],_0xdaf2d2,_0x59fe4c||_0xbd93('0x16'));if(_0x59fe4c){var _0x590f5e=_['findIndex'](_0x5cb1ca['rules'](),{'p':_0x59fe4c});if(_0x590f5e>=0x0){logger[_0xbd93('0x17')](_0xbd93('0x18'),_0x2be3c8,_0x59fe4c||'next',_0x590f5e);_0x5cb1ca[_0xbd93('0x16')](_0x590f5e);}else{logger[_0xbd93('0x17')](_0xbd93('0x19'),_0x2be3c8,_0x59fe4c||_0xbd93('0x16'));_0x5cb1ca['stop']();}}else{_0x5cb1ca[_0xbd93('0x16')]();}}catch(_0x4b6519){logger[_0xbd93('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x2be3c8,_0x4b6519[_0xbd93('0x10')]);_0x5cb1ca[_0xbd93('0x12')]();}}}catch(_0x4be531){logger[_0xbd93('0xd')](_0xbd93('0xe'),_0x2be3c8,JSON[_0xbd93('0x1a')](_0x4be531));_0x5cb1ca['stop']();}};};
\ No newline at end of file