UNPKG

@typecad/typecad

Version:

🤖programmatically 💥create 🛰️hardware

1 lines 2.01 kB
function a8_0x399d(_0x508da3,_0x399d33){const _0x54389e=a8_0x508d();return a8_0x399d=function(_0xc09066,_0x420d01){_0xc09066=_0xc09066-0x0;let _0x5b75c4=_0x54389e[_0xc09066];return _0x5b75c4;},a8_0x399d(_0x508da3,_0x399d33);}function a8_0x508d(){const _0x287892=['#components','length','via','viaData','number','has','push'];a8_0x508d=function(){return _0x287892;};return a8_0x508d();}const normalizeNetName=_0x37b923=>{if(typeof _0x37b923!=='string')return undefined;let _0x3ac388=_0x37b923['trim']()['toLowerCase']();if(!_0x3ac388)return undefined;return _0x3ac388['startsWith']('/')&&(_0x3ac388=_0x3ac388['substring'](0x1)),_0x3ac388;},pushComponents=(_0x191dc4,_0x5c5dbd)=>{Array['isArray'](_0x191dc4)&&_0x5c5dbd['push'](..._0x191dc4);};export function collectManualViaFreeLocations(_0x53b28c,_0x5009bb){function _0x2ea14a(_0x1d0f7f,_0x3f9bc6){return a8_0x399d(_0x3f9bc6- -0x47,_0x1d0f7f);}const _0x162f5f=normalizeNetName(_0x5009bb);if(!_0x162f5f)return[];const _0x42b970=[];pushComponents(_0x53b28c?.['_getComponents']?.(),_0x42b970);const _0x3794ee=_0x53b28c;pushComponents(_0x3794ee?_0x3794ee[_0x2ea14a(-0x45,-0x47)]:undefined,_0x42b970),pushComponents(_0x53b28c?.['_getStagedComponents']?.(),_0x42b970),pushComponents(_0x3794ee?_0x3794ee['#stagedComponents']:undefined,_0x42b970);if(_0x42b970[_0x2ea14a(-0x42,-0x46)]===0x0)return[];const _0x57b513=new Set(),_0x580c51=[];for(const _0x5a5a7e of _0x42b970){if(!_0x5a5a7e||_0x5a5a7e[_0x2ea14a(-0x42,-0x45)]!==!![])continue;const _0x165500=_0x5a5a7e[_0x2ea14a(-0x43,-0x44)],_0x19e8a6=_0x165500?.['at'];if(!_0x19e8a6||typeof _0x19e8a6['x']!==_0x2ea14a(-0x45,-0x43)||typeof _0x19e8a6['y']!=='number')continue;const _0x5ad49a=normalizeNetName(_0x165500?.['net']);if(_0x5ad49a!==_0x162f5f)continue;const _0xd6ee0a=_0x19e8a6['x']['toFixed'](0x4)+':'+_0x19e8a6['y']['toFixed'](0x4);if(_0x57b513[_0x2ea14a(-0x41,-0x42)](_0xd6ee0a))continue;_0x57b513['add'](_0xd6ee0a),_0x580c51[_0x2ea14a(-0x43,-0x41)]({'x':_0x19e8a6['x'],'y':_0x19e8a6['y']});}return _0x580c51;}