Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.115/designer/js/definition-builder/diagram-builder/components/transitions/utils",["module","exports","require","liferay!frontend-js-dependencies-web$react-flow-renderer"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.getEdgeParams=function getEdgeParams(e,t){const r=getNodeIntersection(e,t),o=getNodeIntersection(t,e),n=getEdgePosition(e,r),i=getEdgePosition(t,o);return{sourcePos:n,sx:r.x,sy:r.y,targetPos:i,tx:o.x,ty:o.y}},t.createElements=function createElements(){const e=[],t={x:window.innerWidth/2,y:window.innerHeight/2};e.push({data:{label:"Target"},id:"target",position:t});for(let r=0;r<8;r++){const n=45*r*(Math.PI/180),i=250*Math.cos(n)+t.x,s=250*Math.sin(n)+t.y;e.push({data:{label:"Source"},id:"".concat(r),position:{x:i,y:s}}),e.push({arrowHeadType:o.ArrowHeadType.Arrow,id:"edge-".concat(r),source:"".concat(r),target:"target",type:"floating"})}return e};var o=r("liferay!frontend-js-dependencies-web$react-flow-renderer");function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function getNodeIntersection(e,t){const{height:r,position:o,width:n}=e.__rf,i=t.__rf.position,s=n/2,a=r/2,c=o.x+s,d=o.y+a,u=i.x+s,f=i.y+a,p=(u-c)/(2*s)-(f-d)/(2*a),y=(u-c)/(2*s)+(f-d)/(2*a),g=1/(Math.abs(p)+Math.abs(y)),l=g*p,b=g*y;return{x:s*(l+b)+c,y:a*(-l+b)+d}}function getEdgePosition(e,t){const r=_objectSpread(_objectSpread({},e.__rf.position),e.__rf),n=Math.round(r.x),i=Math.round(r.y),s=Math.round(t.x),a=Math.round(t.y);return s<=n+1?o.Position.Left:s>=n+r.width-1?o.Position.Right:a<=i+1?o.Position.Top:a>=r.y+r.height-1?o.Position.Bottom:o.Position.Top}}}));
//# sourceMappingURL=utils.js.map