Built motion from commit c116dc8b.|2.6.30
[motion2.git] / server / services / routing / server / applications / gotoif.js
index e026ec5..42f8335 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12ff=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','message','validate','html-to-text','./utils','../../../../config/logger','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','stop','condition','priorityTrue'];(function(_0x32c36d,_0x426f5d){var _0xa933ab=function(_0x1a4cfe){while(--_0x1a4cfe){_0x32c36d['push'](_0x32c36d['shift']());}};_0xa933ab(++_0x426f5d);}(_0x12ff,0x9e));var _0xf12f=function(_0x30bef2,_0x3d4186){_0x30bef2=_0x30bef2-0x0;var _0x567d67=_0x12ff[_0x30bef2];return _0x567d67;};'use strict';var schema=require(_0xf12f('0x0'));var _=require('lodash');var htmlToText=require(_0xf12f('0x1'));var utils=require(_0xf12f('0x2'));var logger=require(_0xf12f('0x3'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xf12f('0x4')},'priorityTrue':{'type':_0xf12f('0x5'),'message':_0xf12f('0x6')},'priorityFalse':{'type':'number','message':_0xf12f('0x7')}});exports['consequence']=function(_0x10bce5,_0x58119e){return function(_0x528dc4){try{var _0x53125f={'condition':htmlToText[_0xf12f('0x8')](utils[_0xf12f('0x9')](_0x58119e[0x0],this),{'wordwrap':![]})[_0xf12f('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x58119e[0x1],'priorityFalse':_0x58119e[0x2]};var _0x422a75=gotoif[_0xf12f('0x0')](_0x53125f,{'typecast':!![]});if(_0x422a75[_0xf12f('0xb')]){logger['error'](_0xf12f('0xc'),_0x10bce5,_[_0xf12f('0xd')](_0x422a75,'message')['join'](',\x20'));_0x528dc4[_0xf12f('0xe')]();}else{try{var _0x928994=eval('('+_0x53125f[_0xf12f('0xf')]+')');var _0xaa6e5a=_0x928994?_0x53125f[_0xf12f('0x10')]:_0x53125f['priorityFalse'];logger[_0xf12f('0x11')](_0xf12f('0x12'),_0x10bce5,_0x53125f[_0xf12f('0xf')],_0x928994,_0xaa6e5a||_0xf12f('0x13'));if(_0xaa6e5a){var _0x450d0d=_[_0xf12f('0x14')](_0x528dc4['rules'](),{'p':_0xaa6e5a});if(_0x450d0d>=0x0){logger[_0xf12f('0x11')](_0xf12f('0x15'),_0x10bce5,_0xaa6e5a||'next',_0x450d0d);_0x528dc4[_0xf12f('0x13')](_0x450d0d);}else{logger[_0xf12f('0x11')](_0xf12f('0x16'),_0x10bce5,_0xaa6e5a||_0xf12f('0x13'));_0x528dc4[_0xf12f('0xe')]();}}else{_0x528dc4[_0xf12f('0x13')]();}}catch(_0x481580){logger[_0xf12f('0x17')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x10bce5,_0x481580[_0xf12f('0x18')]);_0x528dc4[_0xf12f('0xe')]();}}}catch(_0xf74abf){logger[_0xf12f('0x17')](_0xf12f('0xc'),_0x10bce5,JSON['stringify'](_0xf74abf));_0x528dc4[_0xf12f('0xe')]();}};};
\ No newline at end of file
+var _0xb9df=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','consequence','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','message','join','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','routing','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9df,0x123));var _0xfb9d=function(_0x5aca9d,_0xfccf0d){_0x5aca9d=_0x5aca9d-0x0;var _0x3f81eb=_0xb9df[_0x5aca9d];return _0x3f81eb;};'use strict';var schema=require(_0xfb9d('0x0'));var _=require(_0xfb9d('0x1'));var htmlToText=require(_0xfb9d('0x2'));var utils=require(_0xfb9d('0x3'));var logger=require('../../../../config/logger')(_0xfb9d('0x4'));var gotoif=schema({'condition':{'type':_0xfb9d('0x5'),'required':!![],'message':_0xfb9d('0x6')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xfb9d('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xfb9d('0x8')]=function(_0x79481a,_0x38ef36){return function(_0x26b9a8){try{var _0x526df3={'condition':htmlToText['fromString'](utils[_0xfb9d('0x9')](_0x38ef36[0x0],this),{'wordwrap':![]})[_0xfb9d('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x38ef36[0x1],'priorityFalse':_0x38ef36[0x2]};var _0x85e52e=gotoif['validate'](_0x526df3,{'typecast':!![]});if(_0x85e52e['length']){logger[_0xfb9d('0xb')](_0xfb9d('0xc'),_0x79481a,_['map'](_0x85e52e,_0xfb9d('0xd'))[_0xfb9d('0xe')](',\x20'));_0x26b9a8['stop']();}else{try{var _0x421627=eval('('+_0x526df3[_0xfb9d('0xf')]+')');var _0x2ad7be=_0x421627?_0x526df3[_0xfb9d('0x10')]:_0x526df3['priorityFalse'];logger['info'](_0xfb9d('0x11'),_0x79481a,_0x526df3[_0xfb9d('0xf')],_0x421627,_0x2ad7be||'next');if(_0x2ad7be){var _0x48e97b=_[_0xfb9d('0x12')](_0x26b9a8[_0xfb9d('0x13')](),{'p':_0x2ad7be});if(_0x48e97b>=0x0){logger[_0xfb9d('0x14')](_0xfb9d('0x15'),_0x79481a,_0x2ad7be||_0xfb9d('0x16'),_0x48e97b);_0x26b9a8[_0xfb9d('0x16')](_0x48e97b);}else{logger[_0xfb9d('0x14')](_0xfb9d('0x17'),_0x79481a,_0x2ad7be||_0xfb9d('0x16'));_0x26b9a8[_0xfb9d('0x18')]();}}else{_0x26b9a8['next']();}}catch(_0x58ab1d){logger[_0xfb9d('0xb')](_0xfb9d('0x19'),_0x79481a,_0x58ab1d[_0xfb9d('0xd')]);_0x26b9a8[_0xfb9d('0x18')]();}}}catch(_0x189ab2){logger[_0xfb9d('0xb')](_0xfb9d('0xc'),_0x79481a,JSON[_0xfb9d('0x1a')](_0x189ab2));_0x26b9a8[_0xfb9d('0x18')]();}};};
\ No newline at end of file