Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / services / agi / graph / index.js
index 06efce5..f9683cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef52=['agicommand','vswitch','target','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split'];(function(_0x1af4fc,_0x46facd){var _0xb9473c=function(_0x2e06f6){while(--_0x2e06f6){_0x1af4fc['push'](_0x1af4fc['shift']());}};_0xb9473c(++_0x46facd);}(_0xef52,0xdc));var _0x2ef5=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0xef52[_0x39780c];return _0x53c19b;};'use strict';var _=require(_0x2ef5('0x0'));var logger=require(_0x2ef5('0x1'))('agi');var verticesWithRetry=[_0x2ef5('0x2'),'getdigits',_0x2ef5('0x3')];var Graph=function(){this[_0x2ef5('0x4')]={};this[_0x2ef5('0x5')]={};this[_0x2ef5('0x6')]=0x0;};Graph[_0x2ef5('0x7')][_0x2ef5('0x8')]=function(_0x1f57db){this[_0x2ef5('0x4')][_0x1f57db['id']]=_0x1f57db;this[_0x2ef5('0x5')][_0x1f57db['id']]=[];};Graph['prototype'][_0x2ef5('0x9')]=function(_0x19b87e,_0x2d6347,_0x391a74){this[_0x2ef5('0x5')][_0x19b87e][_0x2ef5('0xa')]({'target':_0x2d6347,'condition':_0x391a74});this[_0x2ef5('0x6')]+=0x1;};Graph['prototype'][_0x2ef5('0xb')]=function(){return _['size'](this[_0x2ef5('0x4')]);};Graph[_0x2ef5('0x7')][_0x2ef5('0xc')]=function(){return this[_0x2ef5('0x6')];};Graph[_0x2ef5('0x7')][_0x2ef5('0xd')]=function(_0x30223f){return this[_0x2ef5('0x4')][_0x30223f];};Graph[_0x2ef5('0x7')]['traverseBFS']=function(_0x1a8c02,_0x29cb6e){if(!this[_0x2ef5('0x4')][_0x1a8c02]){return logger[_0x2ef5('0xe')](_0x2ef5('0xf'));}var _0x2cc147=_0x29cb6e(this['vertices'][_0x1a8c02]);if(!_0x2cc147){return logger[_0x2ef5('0xe')](_0x2ef5('0x10'));}if(this[_0x2ef5('0x5')][_0x1a8c02][_0x2ef5('0x11')]===0x0){return logger[_0x2ef5('0xe')]('no\x20edge/s\x20available');}for(var _0x2fd6fc=0x0,_0x585655=[],_0x1c4f5d=![];_0x2fd6fc<this['edges'][_0x1a8c02]['length'];_0x2fd6fc+=0x1){if(this['edges'][_0x1a8c02][_0x2fd6fc][_0x2ef5('0x12')]){_0x585655=this['edges'][_0x1a8c02][_0x2fd6fc][_0x2ef5('0x12')][_0x2ef5('0x13')](',');for(var _0x431b1b=0x0;_0x431b1b<_0x585655[_0x2ef5('0x11')];_0x431b1b+=0x1){if(this[_0x2ef5('0x4')][_0x1a8c02][_0x2ef5('0x14')]===_0x2ef5('0x15')&&_0x585655[_0x431b1b]==='-'){_0x1c4f5d=this[_0x2ef5('0x5')][_0x1a8c02][_0x2fd6fc][_0x2ef5('0x16')];logger['info']('default',_0x585655[_0x431b1b],this[_0x2ef5('0x5')][_0x1a8c02][_0x2fd6fc]['target']);}else if(this[_0x2ef5('0x4')][_0x1a8c02][_0x2ef5('0x14')]===_0x2ef5('0x2')&&_0x585655[_0x431b1b]==='i'){_0x1c4f5d=this['edges'][_0x1a8c02][_0x2fd6fc][_0x2ef5('0x16')];logger['info'](_0x2ef5('0x17'),_0x585655[_0x431b1b],this[_0x2ef5('0x5')][_0x1a8c02][_0x2fd6fc][_0x2ef5('0x16')]);}if(_0x585655[_0x431b1b]===_0x2cc147){return this[_0x2ef5('0x18')](this[_0x2ef5('0x5')][_0x1a8c02][_0x2fd6fc][_0x2ef5('0x16')],_0x29cb6e);}}}else{return this['traverseBFS'](this['edges'][_0x1a8c02][_0x2fd6fc]['target'],_0x29cb6e);}}if(_0x585655[_0x2ef5('0x11')]){if(this['vertices'][_0x1a8c02]['agicommand']==='vswitch'){if(_0x1c4f5d){return this[_0x2ef5('0x18')](_0x1c4f5d,_0x29cb6e);}return logger[_0x2ef5('0xe')](_0x2ef5('0x19'));}else if(_[_0x2ef5('0x1a')](verticesWithRetry,this['vertices'][_0x1a8c02][_0x2ef5('0x14')])){if(_0x2cc147==='-'){return logger[_0x2ef5('0xe')](_0x2ef5('0x1b'));}if(_0x1c4f5d&&_0x2cc147!=='t'){return this[_0x2ef5('0x18')](_0x1c4f5d,_0x29cb6e);}return this[_0x2ef5('0x18')](_0x1a8c02,_0x29cb6e);}return logger[_0x2ef5('0xe')](_0x2ef5('0x1c'));}};module[_0x2ef5('0x1d')]=Graph;
\ No newline at end of file
+var _0xdcb4=['agicommand','vswitch','target','default','invalid','traverseBFS','includes','exports','lodash','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','push','size','info','no\x20vertex\x20found','stop\x20traverse','length','condition'];(function(_0x1cf135,_0x519b1c){var _0x588b36=function(_0x245b73){while(--_0x245b73){_0x1cf135['push'](_0x1cf135['shift']());}};_0x588b36(++_0x519b1c);}(_0xdcb4,0x64));var _0x4dcb=function(_0x42f387,_0xdcab22){_0x42f387=_0x42f387-0x0;var _0x322270=_0xdcb4[_0x42f387];return _0x322270;};'use strict';var _=require(_0x4dcb('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=[_0x4dcb('0x1'),'getdigits',_0x4dcb('0x2')];var Graph=function(){this[_0x4dcb('0x3')]={};this[_0x4dcb('0x4')]={};this[_0x4dcb('0x5')]=0x0;};Graph[_0x4dcb('0x6')][_0x4dcb('0x7')]=function(_0x1d78a9){this[_0x4dcb('0x3')][_0x1d78a9['id']]=_0x1d78a9;this[_0x4dcb('0x4')][_0x1d78a9['id']]=[];};Graph[_0x4dcb('0x6')]['addEdge']=function(_0x1b20d9,_0x179233,_0xfc4888){this[_0x4dcb('0x4')][_0x1b20d9][_0x4dcb('0x8')]({'target':_0x179233,'condition':_0xfc4888});this[_0x4dcb('0x5')]+=0x1;};Graph[_0x4dcb('0x6')][_0x4dcb('0x9')]=function(){return _[_0x4dcb('0x9')](this[_0x4dcb('0x3')]);};Graph[_0x4dcb('0x6')]['relations']=function(){return this[_0x4dcb('0x5')];};Graph['prototype']['getVertex']=function(_0x5b9f91){return this[_0x4dcb('0x3')][_0x5b9f91];};Graph[_0x4dcb('0x6')]['traverseBFS']=function(_0x3f3af9,_0x121ae9){if(!this['vertices'][_0x3f3af9]){return logger[_0x4dcb('0xa')](_0x4dcb('0xb'));}var _0x1b58a6=_0x121ae9(this[_0x4dcb('0x3')][_0x3f3af9]);if(!_0x1b58a6){return logger[_0x4dcb('0xa')](_0x4dcb('0xc'));}if(this[_0x4dcb('0x4')][_0x3f3af9][_0x4dcb('0xd')]===0x0){return logger['info']('no\x20edge/s\x20available');}for(var _0x33f0c4=0x0,_0x3151f1=[],_0x6995d=![];_0x33f0c4<this[_0x4dcb('0x4')][_0x3f3af9][_0x4dcb('0xd')];_0x33f0c4+=0x1){if(this['edges'][_0x3f3af9][_0x33f0c4][_0x4dcb('0xe')]){_0x3151f1=this['edges'][_0x3f3af9][_0x33f0c4][_0x4dcb('0xe')]['split'](',');for(var _0x2b25f1=0x0;_0x2b25f1<_0x3151f1[_0x4dcb('0xd')];_0x2b25f1+=0x1){if(this[_0x4dcb('0x3')][_0x3f3af9][_0x4dcb('0xf')]===_0x4dcb('0x10')&&_0x3151f1[_0x2b25f1]==='-'){_0x6995d=this['edges'][_0x3f3af9][_0x33f0c4][_0x4dcb('0x11')];logger['info'](_0x4dcb('0x12'),_0x3151f1[_0x2b25f1],this[_0x4dcb('0x4')][_0x3f3af9][_0x33f0c4][_0x4dcb('0x11')]);}else if(this['vertices'][_0x3f3af9][_0x4dcb('0xf')]===_0x4dcb('0x1')&&_0x3151f1[_0x2b25f1]==='i'){_0x6995d=this['edges'][_0x3f3af9][_0x33f0c4][_0x4dcb('0x11')];logger[_0x4dcb('0xa')](_0x4dcb('0x13'),_0x3151f1[_0x2b25f1],this[_0x4dcb('0x4')][_0x3f3af9][_0x33f0c4][_0x4dcb('0x11')]);}if(_0x3151f1[_0x2b25f1]===_0x1b58a6){return this[_0x4dcb('0x14')](this['edges'][_0x3f3af9][_0x33f0c4][_0x4dcb('0x11')],_0x121ae9);}}}else{return this[_0x4dcb('0x14')](this[_0x4dcb('0x4')][_0x3f3af9][_0x33f0c4][_0x4dcb('0x11')],_0x121ae9);}}if(_0x3151f1[_0x4dcb('0xd')]){if(this[_0x4dcb('0x3')][_0x3f3af9][_0x4dcb('0xf')]===_0x4dcb('0x10')){if(_0x6995d){return this[_0x4dcb('0x14')](_0x6995d,_0x121ae9);}return logger['info']('default\x20on\x20switch\x20not\x20found');}else if(_[_0x4dcb('0x15')](verticesWithRetry,this['vertices'][_0x3f3af9]['agicommand'])){if(_0x1b58a6==='-'){return logger['info']('max\x20retry\x20reach');}if(_0x6995d&&_0x1b58a6!=='t'){return this[_0x4dcb('0x14')](_0x6995d,_0x121ae9);}return this[_0x4dcb('0x14')](_0x3f3af9,_0x121ae9);}return logger[_0x4dcb('0xa')]('condition\x20not\x20found');}};module[_0x4dcb('0x16')]=Graph;
\ No newline at end of file