Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / services / agi / graph / index.js
1 'use strict';const a1219_0x3148=['menu','condition\x20not\x20found','vswitch','numberOfEdges','getsecretdigits','default\x20on\x20switch\x20not\x20found','push','41733sftpSm','size','lodash','length','vertices','20489YHNgqd','agi','567410jgtYNu','getVertex','@config/logger','4ptqZch','159249bBxDoh','439720pzrCTV','68652lDiMde','traverseBFS','condition','no\x20vertex\x20found','invalid','stop\x20traverse','info','includes','exports','159705YxpqjE','agicommand','target','edges','getdigits'];const a1219_0x19b6=function(_0x212825,_0x558c67){_0x212825=_0x212825-0x96;let _0x31485e=a1219_0x3148[_0x212825];return _0x31485e;};const a1219_0x5e3f4b=a1219_0x19b6;(function(_0x9d1ad6,_0x30c570){const _0x48e1f0=a1219_0x19b6;while(!![]){try{const _0x4c04a3=parseInt(_0x48e1f0(0x97))+parseInt(_0x48e1f0(0xb3))*-parseInt(_0x48e1f0(0x96))+parseInt(_0x48e1f0(0xa2))+-parseInt(_0x48e1f0(0x98))+parseInt(_0x48e1f0(0xb5))+-parseInt(_0x48e1f0(0x99))+parseInt(_0x48e1f0(0xae));if(_0x4c04a3===_0x30c570)break;else _0x9d1ad6['push'](_0x9d1ad6['shift']());}catch(_0x3a7963){_0x9d1ad6['push'](_0x9d1ad6['shift']());}}}(a1219_0x3148,0x52769));const _=require(a1219_0x5e3f4b(0xb0)),logger=require(a1219_0x5e3f4b(0xb7))(a1219_0x5e3f4b(0xb4)),verticesWithRetry=[a1219_0x5e3f4b(0xa7),a1219_0x5e3f4b(0xa6),a1219_0x5e3f4b(0xab)];class Graph{constructor(){const _0x38c285=a1219_0x5e3f4b;this[_0x38c285(0xb2)]={},this[_0x38c285(0xa5)]={},this['numberOfEdges']=0x0;}['addVertex'](_0xd007bd){const _0xb5dff=a1219_0x5e3f4b;this[_0xb5dff(0xb2)][_0xd007bd['id']]=_0xd007bd,this[_0xb5dff(0xa5)][_0xd007bd['id']]=[];}['addEdge'](_0x4ffe5c,_0x469a93,_0x4ab0ee){const _0x2b8721=a1219_0x5e3f4b;this[_0x2b8721(0xa5)][_0x4ffe5c][_0x2b8721(0xad)]({'target':_0x469a93,'condition':_0x4ab0ee}),this['numberOfEdges']+=0x1;}[a1219_0x5e3f4b(0xaf)](){return _['size'](this['vertices']);}['relations'](){const _0x3c9a12=a1219_0x5e3f4b;return this[_0x3c9a12(0xaa)];}[a1219_0x5e3f4b(0xb6)](_0x4b65f3){const _0x4f6205=a1219_0x5e3f4b;return this[_0x4f6205(0xb2)][_0x4b65f3];}async[a1219_0x5e3f4b(0x9a)](_0x2f3619,_0x458683){const _0x170626=a1219_0x5e3f4b;if(!this['vertices'][_0x2f3619])return logger[_0x170626(0x9f)](_0x170626(0x9c)),null;const _0x447ade=await _0x458683(this[_0x170626(0xb2)][_0x2f3619]);if(!_0x447ade)return logger[_0x170626(0x9f)](_0x170626(0x9e)),null;if(this['edges'][_0x2f3619][_0x170626(0xb1)]===0x0)return logger[_0x170626(0x9f)]('no\x20edge/s\x20available'),null;let _0x42e2fa=![],_0x5d13a9=[];for(let _0x29e5b6=0x0;_0x29e5b6<this[_0x170626(0xa5)][_0x2f3619][_0x170626(0xb1)];_0x29e5b6++){if(this['edges'][_0x2f3619][_0x29e5b6][_0x170626(0x9b)]){_0x5d13a9=this['edges'][_0x2f3619][_0x29e5b6][_0x170626(0x9b)]['split'](',');for(let _0x128605=0x0;_0x128605<_0x5d13a9['length'];_0x128605++){if(this['vertices'][_0x2f3619][_0x170626(0xa3)]===_0x170626(0xa9)&&_0x5d13a9[_0x128605]==='-')_0x42e2fa=this[_0x170626(0xa5)][_0x2f3619][_0x29e5b6][_0x170626(0xa4)],logger[_0x170626(0x9f)]('default',_0x42e2fa,_0x5d13a9[_0x128605],this[_0x170626(0xa5)][_0x2f3619][_0x29e5b6]['target']);else this[_0x170626(0xb2)][_0x2f3619][_0x170626(0xa3)]===_0x170626(0xa7)&&_0x5d13a9[_0x128605]==='i'&&(_0x42e2fa=this[_0x170626(0xa5)][_0x2f3619][_0x29e5b6]['target'],logger[_0x170626(0x9f)](_0x170626(0x9d),_0x42e2fa,_0x5d13a9[_0x128605],this['edges'][_0x2f3619][_0x29e5b6][_0x170626(0xa4)]));if(_0x5d13a9[_0x128605]===_0x447ade)return this[_0x170626(0x9a)](this[_0x170626(0xa5)][_0x2f3619][_0x29e5b6][_0x170626(0xa4)],_0x458683);}}else return this[_0x170626(0x9a)](this['edges'][_0x2f3619][_0x29e5b6][_0x170626(0xa4)],_0x458683);}if(_0x5d13a9['length']){if(this[_0x170626(0xb2)][_0x2f3619][_0x170626(0xa3)]===_0x170626(0xa9)){if(_0x42e2fa)return this['traverseBFS'](_0x42e2fa,_0x458683);return logger[_0x170626(0x9f)](_0x170626(0xac)),null;}else{if(_[_0x170626(0xa0)](verticesWithRetry,this[_0x170626(0xb2)][_0x2f3619][_0x170626(0xa3)])){if(_0x447ade==='-')return logger[_0x170626(0x9f)]('max\x20retry\x20reach'),null;if(_0x42e2fa&&_0x447ade!=='t')return this[_0x170626(0x9a)](_0x42e2fa,_0x458683);return this[_0x170626(0x9a)](_0x2f3619,_0x458683);}}return logger['info'](_0x170626(0xa8)),null;}}}module[a1219_0x5e3f4b(0xa1)]=Graph;