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