Built motion from commit da617fac.|2.6.6
[motion2.git] / server / services / routing / server / applications / gotoif.js
index a5075ec..7d928c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ca7=['findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','info'];(function(_0x3bc850,_0x4b4f87){var _0x40d2e4=function(_0x5883fe){while(--_0x5883fe){_0x3bc850['push'](_0x3bc850['shift']());}};_0x40d2e4(++_0x4b4f87);}(_0x5ca7,0x114));var _0x75ca=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x5ca7[_0x4709c0];return _0x13348b;};'use strict';var schema=require(_0x75ca('0x0'));var _=require(_0x75ca('0x1'));var htmlToText=require(_0x75ca('0x2'));var utils=require(_0x75ca('0x3'));var logger=require('../../../../config/logger')(_0x75ca('0x4'));var gotoif=schema({'condition':{'type':_0x75ca('0x5'),'required':!![],'message':_0x75ca('0x6')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x75ca('0x7'),'message':_0x75ca('0x8')}});exports[_0x75ca('0x9')]=function(_0x4bf5f6,_0x5957fa){return function(_0x4746e0){try{var _0x462ec={'condition':htmlToText[_0x75ca('0xa')](utils[_0x75ca('0xb')](_0x5957fa[0x0],this),{'wordwrap':![]})[_0x75ca('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5957fa[0x1],'priorityFalse':_0x5957fa[0x2]};var _0x5ed17c=gotoif[_0x75ca('0x0')](_0x462ec,{'typecast':!![]});if(_0x5ed17c[_0x75ca('0xd')]){logger['error'](_0x75ca('0xe'),_0x4bf5f6,_['map'](_0x5ed17c,_0x75ca('0xf'))[_0x75ca('0x10')](',\x20'));_0x4746e0[_0x75ca('0x11')]();}else{try{var _0x253fd4=eval('('+_0x462ec[_0x75ca('0x12')]+')');var _0xcf070e=_0x253fd4?_0x462ec[_0x75ca('0x13')]:_0x462ec['priorityFalse'];logger[_0x75ca('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x4bf5f6,_0x462ec[_0x75ca('0x12')],_0x253fd4,_0xcf070e||'next');if(_0xcf070e){var _0x44c396=_[_0x75ca('0x15')](_0x4746e0['rules'](),{'p':_0xcf070e});if(_0x44c396>=0x0){logger[_0x75ca('0x14')](_0x75ca('0x16'),_0x4bf5f6,_0xcf070e||_0x75ca('0x17'),_0x44c396);_0x4746e0[_0x75ca('0x17')](_0x44c396);}else{logger[_0x75ca('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4bf5f6,_0xcf070e||_0x75ca('0x17'));_0x4746e0[_0x75ca('0x11')]();}}else{_0x4746e0['next']();}}catch(_0x56fe81){logger[_0x75ca('0x18')](_0x75ca('0x19'),_0x4bf5f6,_0x56fe81[_0x75ca('0xf')]);_0x4746e0['stop']();}}}catch(_0x126ccb){logger['error'](_0x75ca('0xe'),_0x4bf5f6,JSON[_0x75ca('0x1a')](_0x126ccb));_0x4746e0[_0x75ca('0x11')]();}};};
\ No newline at end of file
+var _0xb32e=['validate','lodash','./utils','../../../../config/logger','routing','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','stop','priorityTrue','priorityFalse','info','condition','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify'];(function(_0x59b058,_0x5f4c38){var _0x5cb986=function(_0x54ee4c){while(--_0x54ee4c){_0x59b058['push'](_0x59b058['shift']());}};_0x5cb986(++_0x5f4c38);}(_0xb32e,0x145));var _0xeb32=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb32e[_0x122ef9];return _0x42fba0;};'use strict';var schema=require(_0xeb32('0x0'));var _=require(_0xeb32('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xeb32('0x2'));var logger=require(_0xeb32('0x3'))(_0xeb32('0x4'));var gotoif=schema({'condition':{'type':_0xeb32('0x5'),'required':!![],'message':_0xeb32('0x6')},'priorityTrue':{'type':_0xeb32('0x7'),'message':_0xeb32('0x8')},'priorityFalse':{'type':'number','message':_0xeb32('0x9')}});exports[_0xeb32('0xa')]=function(_0x3b35a0,_0x2d4347){return function(_0xd95531){try{var _0x1b13f7={'condition':htmlToText[_0xeb32('0xb')](utils['getMustacheRender'](_0x2d4347[0x0],this),{'wordwrap':![]})[_0xeb32('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2d4347[0x1],'priorityFalse':_0x2d4347[0x2]};var _0x50b996=gotoif['validate'](_0x1b13f7,{'typecast':!![]});if(_0x50b996[_0xeb32('0xd')]){logger[_0xeb32('0xe')](_0xeb32('0xf'),_0x3b35a0,_['map'](_0x50b996,'message')['join'](',\x20'));_0xd95531[_0xeb32('0x10')]();}else{try{var _0x44d3fd=eval('('+_0x1b13f7['condition']+')');var _0x246f54=_0x44d3fd?_0x1b13f7[_0xeb32('0x11')]:_0x1b13f7[_0xeb32('0x12')];logger[_0xeb32('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x3b35a0,_0x1b13f7[_0xeb32('0x14')],_0x44d3fd,_0x246f54||'next');if(_0x246f54){var _0x4a158b=_['findIndex'](_0xd95531[_0xeb32('0x15')](),{'p':_0x246f54});if(_0x4a158b>=0x0){logger[_0xeb32('0x13')](_0xeb32('0x16'),_0x3b35a0,_0x246f54||_0xeb32('0x17'),_0x4a158b);_0xd95531[_0xeb32('0x17')](_0x4a158b);}else{logger[_0xeb32('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x3b35a0,_0x246f54||_0xeb32('0x17'));_0xd95531[_0xeb32('0x10')]();}}else{_0xd95531[_0xeb32('0x17')]();}}catch(_0x18844f){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3b35a0,_0x18844f['message']);_0xd95531[_0xeb32('0x10')]();}}}catch(_0x5e5a05){logger[_0xeb32('0xe')]('[%s][GOTOIF]\x20%s',_0x3b35a0,JSON[_0xeb32('0x18')](_0x5e5a05));_0xd95531[_0xeb32('0x10')]();}};};
\ No newline at end of file