Built motion from commit 21186556.|2.6.19
[motion2.git] / server / services / agi / graph / index.js
index 5ca8b8e..6a41c61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f09=['relations','getVertex','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target','default','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices','numberOfEdges','prototype','addVertex','edges','push','size'];(function(_0x1bf96d,_0x1ee9bb){var _0x469774=function(_0xeb9399){while(--_0xeb9399){_0x1bf96d['push'](_0x1bf96d['shift']());}};_0x469774(++_0x1ee9bb);}(_0x3f09,0xa2));var _0x93f0=function(_0x347cee,_0x4c36f6){_0x347cee=_0x347cee-0x0;var _0x26d403=_0x3f09[_0x347cee];return _0x26d403;};'use strict';var _=require(_0x93f0('0x0'));var logger=require(_0x93f0('0x1'))('agi');var verticesWithRetry=[_0x93f0('0x2'),_0x93f0('0x3'),_0x93f0('0x4')];var Graph=function(){this[_0x93f0('0x5')]={};this['edges']={};this[_0x93f0('0x6')]=0x0;};Graph[_0x93f0('0x7')][_0x93f0('0x8')]=function(_0x18d915){this[_0x93f0('0x5')][_0x18d915['id']]=_0x18d915;this['edges'][_0x18d915['id']]=[];};Graph[_0x93f0('0x7')]['addEdge']=function(_0x5f36ca,_0x209105,_0x22127f){this[_0x93f0('0x9')][_0x5f36ca][_0x93f0('0xa')]({'target':_0x209105,'condition':_0x22127f});this['numberOfEdges']+=0x1;};Graph[_0x93f0('0x7')][_0x93f0('0xb')]=function(){return _['size'](this['vertices']);};Graph[_0x93f0('0x7')][_0x93f0('0xc')]=function(){return this['numberOfEdges'];};Graph[_0x93f0('0x7')][_0x93f0('0xd')]=function(_0x57bd9d){return this[_0x93f0('0x5')][_0x57bd9d];};Graph[_0x93f0('0x7')][_0x93f0('0xe')]=function(_0x5e763d,_0x4e9d57){if(!this['vertices'][_0x5e763d]){return logger[_0x93f0('0xf')](_0x93f0('0x10'));}var _0x5afcd6=_0x4e9d57(this[_0x93f0('0x5')][_0x5e763d]);if(!_0x5afcd6){return logger['info']('stop\x20traverse');}if(this[_0x93f0('0x9')][_0x5e763d][_0x93f0('0x11')]===0x0){return logger[_0x93f0('0xf')](_0x93f0('0x12'));}for(var _0x3ba433=0x0,_0x2b6ff7=[],_0x18ddb9=![];_0x3ba433<this[_0x93f0('0x9')][_0x5e763d]['length'];_0x3ba433+=0x1){if(this[_0x93f0('0x9')][_0x5e763d][_0x3ba433][_0x93f0('0x13')]){_0x2b6ff7=this[_0x93f0('0x9')][_0x5e763d][_0x3ba433][_0x93f0('0x13')]['split'](',');for(var _0x5f22aa=0x0;_0x5f22aa<_0x2b6ff7[_0x93f0('0x11')];_0x5f22aa+=0x1){if(this[_0x93f0('0x5')][_0x5e763d][_0x93f0('0x14')]===_0x93f0('0x15')&&_0x2b6ff7[_0x5f22aa]==='-'){_0x18ddb9=this[_0x93f0('0x9')][_0x5e763d][_0x3ba433][_0x93f0('0x16')];logger[_0x93f0('0xf')](_0x93f0('0x17'),_0x2b6ff7[_0x5f22aa],this[_0x93f0('0x9')][_0x5e763d][_0x3ba433][_0x93f0('0x16')]);}else if(this[_0x93f0('0x5')][_0x5e763d][_0x93f0('0x14')]==='menu'&&_0x2b6ff7[_0x5f22aa]==='i'){_0x18ddb9=this[_0x93f0('0x9')][_0x5e763d][_0x3ba433][_0x93f0('0x16')];logger[_0x93f0('0xf')](_0x93f0('0x18'),_0x2b6ff7[_0x5f22aa],this[_0x93f0('0x9')][_0x5e763d][_0x3ba433]['target']);}if(_0x2b6ff7[_0x5f22aa]===_0x5afcd6){return this[_0x93f0('0xe')](this['edges'][_0x5e763d][_0x3ba433]['target'],_0x4e9d57);}}}else{return this[_0x93f0('0xe')](this[_0x93f0('0x9')][_0x5e763d][_0x3ba433][_0x93f0('0x16')],_0x4e9d57);}}if(_0x2b6ff7[_0x93f0('0x11')]){if(this[_0x93f0('0x5')][_0x5e763d][_0x93f0('0x14')]===_0x93f0('0x15')){if(_0x18ddb9){return this[_0x93f0('0xe')](_0x18ddb9,_0x4e9d57);}return logger[_0x93f0('0xf')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0x93f0('0x19')](verticesWithRetry,this[_0x93f0('0x5')][_0x5e763d][_0x93f0('0x14')])){if(_0x5afcd6==='-'){return logger['info'](_0x93f0('0x1a'));}if(_0x18ddb9&&_0x5afcd6!=='t'){return this['traverseBFS'](_0x18ddb9,_0x4e9d57);}return this[_0x93f0('0xe')](_0x5e763d,_0x4e9d57);}return logger[_0x93f0('0xf')](_0x93f0('0x1b'));}};module[_0x93f0('0x1c')]=Graph;
\ No newline at end of file
+var _0xeeb6=['relations','getVertex','traverseBFS','info','stop\x20traverse','length','condition','agicommand','vswitch','default','target','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','numberOfEdges','prototype','addVertex','edges','push','size'];(function(_0x347c3e,_0x19727c){var _0x432b42=function(_0xd5f123){while(--_0xd5f123){_0x347c3e['push'](_0x347c3e['shift']());}};_0x432b42(++_0x19727c);}(_0xeeb6,0x1eb));var _0x6eeb=function(_0x70588,_0x2e21dd){_0x70588=_0x70588-0x0;var _0x1981d8=_0xeeb6[_0x70588];return _0x1981d8;};'use strict';var _=require(_0x6eeb('0x0'));var logger=require(_0x6eeb('0x1'))(_0x6eeb('0x2'));var verticesWithRetry=[_0x6eeb('0x3'),_0x6eeb('0x4'),_0x6eeb('0x5')];var Graph=function(){this[_0x6eeb('0x6')]={};this['edges']={};this[_0x6eeb('0x7')]=0x0;};Graph[_0x6eeb('0x8')][_0x6eeb('0x9')]=function(_0x269e0f){this[_0x6eeb('0x6')][_0x269e0f['id']]=_0x269e0f;this[_0x6eeb('0xa')][_0x269e0f['id']]=[];};Graph[_0x6eeb('0x8')]['addEdge']=function(_0x58bf65,_0x5bd6e9,_0x1bda57){this[_0x6eeb('0xa')][_0x58bf65][_0x6eeb('0xb')]({'target':_0x5bd6e9,'condition':_0x1bda57});this[_0x6eeb('0x7')]+=0x1;};Graph['prototype'][_0x6eeb('0xc')]=function(){return _[_0x6eeb('0xc')](this[_0x6eeb('0x6')]);};Graph[_0x6eeb('0x8')][_0x6eeb('0xd')]=function(){return this[_0x6eeb('0x7')];};Graph[_0x6eeb('0x8')][_0x6eeb('0xe')]=function(_0x53e448){return this[_0x6eeb('0x6')][_0x53e448];};Graph[_0x6eeb('0x8')][_0x6eeb('0xf')]=function(_0x194169,_0x4572b1){if(!this[_0x6eeb('0x6')][_0x194169]){return logger[_0x6eeb('0x10')]('no\x20vertex\x20found');}var _0x4fd642=_0x4572b1(this[_0x6eeb('0x6')][_0x194169]);if(!_0x4fd642){return logger[_0x6eeb('0x10')](_0x6eeb('0x11'));}if(this[_0x6eeb('0xa')][_0x194169][_0x6eeb('0x12')]===0x0){return logger[_0x6eeb('0x10')]('no\x20edge/s\x20available');}for(var _0x1c6d52=0x0,_0x4fcb59=[],_0x17006d=![];_0x1c6d52<this[_0x6eeb('0xa')][_0x194169][_0x6eeb('0x12')];_0x1c6d52+=0x1){if(this[_0x6eeb('0xa')][_0x194169][_0x1c6d52][_0x6eeb('0x13')]){_0x4fcb59=this['edges'][_0x194169][_0x1c6d52][_0x6eeb('0x13')]['split'](',');for(var _0x34afe9=0x0;_0x34afe9<_0x4fcb59[_0x6eeb('0x12')];_0x34afe9+=0x1){if(this[_0x6eeb('0x6')][_0x194169][_0x6eeb('0x14')]===_0x6eeb('0x15')&&_0x4fcb59[_0x34afe9]==='-'){_0x17006d=this['edges'][_0x194169][_0x1c6d52]['target'];logger[_0x6eeb('0x10')](_0x6eeb('0x16'),_0x4fcb59[_0x34afe9],this[_0x6eeb('0xa')][_0x194169][_0x1c6d52][_0x6eeb('0x17')]);}else if(this['vertices'][_0x194169]['agicommand']===_0x6eeb('0x3')&&_0x4fcb59[_0x34afe9]==='i'){_0x17006d=this[_0x6eeb('0xa')][_0x194169][_0x1c6d52]['target'];logger[_0x6eeb('0x10')](_0x6eeb('0x18'),_0x4fcb59[_0x34afe9],this[_0x6eeb('0xa')][_0x194169][_0x1c6d52][_0x6eeb('0x17')]);}if(_0x4fcb59[_0x34afe9]===_0x4fd642){return this['traverseBFS'](this['edges'][_0x194169][_0x1c6d52][_0x6eeb('0x17')],_0x4572b1);}}}else{return this['traverseBFS'](this['edges'][_0x194169][_0x1c6d52][_0x6eeb('0x17')],_0x4572b1);}}if(_0x4fcb59[_0x6eeb('0x12')]){if(this[_0x6eeb('0x6')][_0x194169][_0x6eeb('0x14')]===_0x6eeb('0x15')){if(_0x17006d){return this[_0x6eeb('0xf')](_0x17006d,_0x4572b1);}return logger[_0x6eeb('0x10')](_0x6eeb('0x19'));}else if(_['includes'](verticesWithRetry,this[_0x6eeb('0x6')][_0x194169][_0x6eeb('0x14')])){if(_0x4fd642==='-'){return logger[_0x6eeb('0x10')](_0x6eeb('0x1a'));}if(_0x17006d&&_0x4fd642!=='t'){return this[_0x6eeb('0xf')](_0x17006d,_0x4572b1);}return this['traverseBFS'](_0x194169,_0x4572b1);}return logger[_0x6eeb('0x10')]('condition\x20not\x20found');}};module[_0x6eeb('0x1b')]=Graph;
\ No newline at end of file