Built motion from commit ffdca78c.|2.6.24
[motion2.git] / server / services / agi / graph / index.js
index 23ad60a..52dfc25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x923c=['push','size','relations','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','vswitch','target','default','agicommand','menu','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','getsecretdigits','vertices','numberOfEdges','addVertex','edges','prototype'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0x923c,0x157));var _0xc923=function(_0x3fdef2,_0x5a0001){_0x3fdef2=_0x3fdef2-0x0;var _0x2e6a66=_0x923c[_0x3fdef2];return _0x2e6a66;};'use strict';var _=require(_0xc923('0x0'));var logger=require(_0xc923('0x1'))('agi');var verticesWithRetry=['menu','getdigits',_0xc923('0x2')];var Graph=function(){this[_0xc923('0x3')]={};this['edges']={};this[_0xc923('0x4')]=0x0;};Graph['prototype'][_0xc923('0x5')]=function(_0x579b7f){this[_0xc923('0x3')][_0x579b7f['id']]=_0x579b7f;this[_0xc923('0x6')][_0x579b7f['id']]=[];};Graph[_0xc923('0x7')]['addEdge']=function(_0x798775,_0x5ce7bc,_0x15965f){this[_0xc923('0x6')][_0x798775][_0xc923('0x8')]({'target':_0x5ce7bc,'condition':_0x15965f});this['numberOfEdges']+=0x1;};Graph['prototype'][_0xc923('0x9')]=function(){return _[_0xc923('0x9')](this[_0xc923('0x3')]);};Graph['prototype'][_0xc923('0xa')]=function(){return this[_0xc923('0x4')];};Graph[_0xc923('0x7')]['getVertex']=function(_0x191c32){return this[_0xc923('0x3')][_0x191c32];};Graph[_0xc923('0x7')][_0xc923('0xb')]=function(_0x36e49d,_0x174e7e){if(!this[_0xc923('0x3')][_0x36e49d]){return logger[_0xc923('0xc')](_0xc923('0xd'));}var _0x669b29=_0x174e7e(this[_0xc923('0x3')][_0x36e49d]);if(!_0x669b29){return logger[_0xc923('0xc')]('stop\x20traverse');}if(this['edges'][_0x36e49d][_0xc923('0xe')]===0x0){return logger[_0xc923('0xc')](_0xc923('0xf'));}for(var _0x4e88af=0x0,_0x366316=[],_0x4eb5ed=![];_0x4e88af<this[_0xc923('0x6')][_0x36e49d][_0xc923('0xe')];_0x4e88af+=0x1){if(this[_0xc923('0x6')][_0x36e49d][_0x4e88af][_0xc923('0x10')]){_0x366316=this['edges'][_0x36e49d][_0x4e88af][_0xc923('0x10')][_0xc923('0x11')](',');for(var _0x203860=0x0;_0x203860<_0x366316[_0xc923('0xe')];_0x203860+=0x1){if(this[_0xc923('0x3')][_0x36e49d]['agicommand']===_0xc923('0x12')&&_0x366316[_0x203860]==='-'){_0x4eb5ed=this['edges'][_0x36e49d][_0x4e88af][_0xc923('0x13')];logger[_0xc923('0xc')](_0xc923('0x14'),_0x366316[_0x203860],this[_0xc923('0x6')][_0x36e49d][_0x4e88af][_0xc923('0x13')]);}else if(this[_0xc923('0x3')][_0x36e49d][_0xc923('0x15')]===_0xc923('0x16')&&_0x366316[_0x203860]==='i'){_0x4eb5ed=this[_0xc923('0x6')][_0x36e49d][_0x4e88af][_0xc923('0x13')];logger[_0xc923('0xc')](_0xc923('0x17'),_0x366316[_0x203860],this[_0xc923('0x6')][_0x36e49d][_0x4e88af][_0xc923('0x13')]);}if(_0x366316[_0x203860]===_0x669b29){return this['traverseBFS'](this['edges'][_0x36e49d][_0x4e88af]['target'],_0x174e7e);}}}else{return this[_0xc923('0xb')](this['edges'][_0x36e49d][_0x4e88af][_0xc923('0x13')],_0x174e7e);}}if(_0x366316['length']){if(this[_0xc923('0x3')][_0x36e49d][_0xc923('0x15')]===_0xc923('0x12')){if(_0x4eb5ed){return this['traverseBFS'](_0x4eb5ed,_0x174e7e);}return logger['info']('default\x20on\x20switch\x20not\x20found');}else if(_[_0xc923('0x18')](verticesWithRetry,this[_0xc923('0x3')][_0x36e49d][_0xc923('0x15')])){if(_0x669b29==='-'){return logger[_0xc923('0xc')](_0xc923('0x19'));}if(_0x4eb5ed&&_0x669b29!=='t'){return this[_0xc923('0xb')](_0x4eb5ed,_0x174e7e);}return this[_0xc923('0xb')](_0x36e49d,_0x174e7e);}return logger[_0xc923('0xc')](_0xc923('0x1a'));}};module['exports']=Graph;
\ No newline at end of file
+var _0xc072=['includes','max\x20retry\x20reach','condition\x20not\x20found','exports','agi','menu','getdigits','vertices','edges','prototype','addVertex','addEdge','push','numberOfEdges','size','relations','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found'];(function(_0x5a6ac3,_0x4a57b6){var _0x54f5fe=function(_0x59dd89){while(--_0x59dd89){_0x5a6ac3['push'](_0x5a6ac3['shift']());}};_0x54f5fe(++_0x4a57b6);}(_0xc072,0x14e));var _0x2c07=function(_0x4865f0,_0x5431c7){_0x4865f0=_0x4865f0-0x0;var _0x22363f=_0xc072[_0x4865f0];return _0x22363f;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0x2c07('0x0'));var verticesWithRetry=[_0x2c07('0x1'),_0x2c07('0x2'),'getsecretdigits'];var Graph=function(){this[_0x2c07('0x3')]={};this[_0x2c07('0x4')]={};this['numberOfEdges']=0x0;};Graph[_0x2c07('0x5')][_0x2c07('0x6')]=function(_0x3bc164){this['vertices'][_0x3bc164['id']]=_0x3bc164;this[_0x2c07('0x4')][_0x3bc164['id']]=[];};Graph['prototype'][_0x2c07('0x7')]=function(_0x2266fc,_0x5c6e92,_0x21f74f){this['edges'][_0x2266fc][_0x2c07('0x8')]({'target':_0x5c6e92,'condition':_0x21f74f});this[_0x2c07('0x9')]+=0x1;};Graph[_0x2c07('0x5')][_0x2c07('0xa')]=function(){return _[_0x2c07('0xa')](this[_0x2c07('0x3')]);};Graph['prototype'][_0x2c07('0xb')]=function(){return this['numberOfEdges'];};Graph['prototype']['getVertex']=function(_0x12210e){return this[_0x2c07('0x3')][_0x12210e];};Graph['prototype'][_0x2c07('0xc')]=function(_0x2a9a8a,_0x59b262){if(!this['vertices'][_0x2a9a8a]){return logger['info'](_0x2c07('0xd'));}var _0x48b5ca=_0x59b262(this[_0x2c07('0x3')][_0x2a9a8a]);if(!_0x48b5ca){return logger[_0x2c07('0xe')](_0x2c07('0xf'));}if(this[_0x2c07('0x4')][_0x2a9a8a][_0x2c07('0x10')]===0x0){return logger[_0x2c07('0xe')](_0x2c07('0x11'));}for(var _0x2dd72b=0x0,_0x43165f=[],_0x374b20=![];_0x2dd72b<this[_0x2c07('0x4')][_0x2a9a8a][_0x2c07('0x10')];_0x2dd72b+=0x1){if(this[_0x2c07('0x4')][_0x2a9a8a][_0x2dd72b][_0x2c07('0x12')]){_0x43165f=this[_0x2c07('0x4')][_0x2a9a8a][_0x2dd72b]['condition'][_0x2c07('0x13')](',');for(var _0x387e5f=0x0;_0x387e5f<_0x43165f[_0x2c07('0x10')];_0x387e5f+=0x1){if(this[_0x2c07('0x3')][_0x2a9a8a][_0x2c07('0x14')]===_0x2c07('0x15')&&_0x43165f[_0x387e5f]==='-'){_0x374b20=this[_0x2c07('0x4')][_0x2a9a8a][_0x2dd72b][_0x2c07('0x16')];logger[_0x2c07('0xe')](_0x2c07('0x17'),_0x43165f[_0x387e5f],this[_0x2c07('0x4')][_0x2a9a8a][_0x2dd72b][_0x2c07('0x16')]);}else if(this[_0x2c07('0x3')][_0x2a9a8a][_0x2c07('0x14')]===_0x2c07('0x1')&&_0x43165f[_0x387e5f]==='i'){_0x374b20=this[_0x2c07('0x4')][_0x2a9a8a][_0x2dd72b][_0x2c07('0x16')];logger[_0x2c07('0xe')](_0x2c07('0x18'),_0x43165f[_0x387e5f],this[_0x2c07('0x4')][_0x2a9a8a][_0x2dd72b]['target']);}if(_0x43165f[_0x387e5f]===_0x48b5ca){return this['traverseBFS'](this['edges'][_0x2a9a8a][_0x2dd72b][_0x2c07('0x16')],_0x59b262);}}}else{return this[_0x2c07('0xc')](this[_0x2c07('0x4')][_0x2a9a8a][_0x2dd72b][_0x2c07('0x16')],_0x59b262);}}if(_0x43165f[_0x2c07('0x10')]){if(this[_0x2c07('0x3')][_0x2a9a8a][_0x2c07('0x14')]===_0x2c07('0x15')){if(_0x374b20){return this[_0x2c07('0xc')](_0x374b20,_0x59b262);}return logger['info'](_0x2c07('0x19'));}else if(_[_0x2c07('0x1a')](verticesWithRetry,this['vertices'][_0x2a9a8a][_0x2c07('0x14')])){if(_0x48b5ca==='-'){return logger[_0x2c07('0xe')](_0x2c07('0x1b'));}if(_0x374b20&&_0x48b5ca!=='t'){return this['traverseBFS'](_0x374b20,_0x59b262);}return this[_0x2c07('0xc')](_0x2a9a8a,_0x59b262);}return logger[_0x2c07('0xe')](_0x2c07('0x1c'));}};module[_0x2c07('0x1d')]=Graph;
\ No newline at end of file