@elyra/canvas 13.19.0 → 13.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{canvas-controller-4d841ec9.js → canvas-controller-5c4a4558.js} +2 -2
- package/dist/{canvas-controller-4d841ec9.js.map → canvas-controller-5c4a4558.js.map} +1 -1
- package/dist/{canvas-controller-792555e4.js → canvas-controller-69fd6358.js} +2 -2
- package/dist/{canvas-controller-792555e4.js.map → canvas-controller-69fd6358.js.map} +1 -1
- package/dist/{common-canvas-9febc182.js → common-canvas-8fc6d1da.js} +2 -2
- package/dist/{common-canvas-9febc182.js.map → common-canvas-8fc6d1da.js.map} +1 -1
- package/dist/{common-canvas-1ac3023c.js → common-canvas-c34234ae.js} +2 -2
- package/dist/{common-canvas-1ac3023c.js.map → common-canvas-c34234ae.js.map} +1 -1
- package/dist/{common-canvas-utils-6a327226.js → common-canvas-utils-102c436a.js} +2 -2
- package/dist/common-canvas-utils-102c436a.js.map +1 -0
- package/dist/{common-canvas-utils-cc218b20.js → common-canvas-utils-ebff8d75.js} +2 -2
- package/dist/common-canvas-utils-ebff8d75.js.map +1 -0
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/{common-properties-046463c8.js → common-properties-06f47705.js} +2 -2
- package/dist/{common-properties-046463c8.js.map → common-properties-06f47705.js.map} +1 -1
- package/dist/{common-properties-6afe4d9d.js → common-properties-22734770.js} +2 -2
- package/dist/{common-properties-6afe4d9d.js.map → common-properties-22734770.js.map} +1 -1
- package/dist/{context-menu-wrapper-2e821b41.js → context-menu-wrapper-a77cd3e2.js} +2 -2
- package/dist/{context-menu-wrapper-2e821b41.js.map → context-menu-wrapper-a77cd3e2.js.map} +1 -1
- package/dist/{context-menu-wrapper-399932e6.js → context-menu-wrapper-fdd9cff8.js} +2 -2
- package/dist/{context-menu-wrapper-399932e6.js.map → context-menu-wrapper-fdd9cff8.js.map} +1 -1
- package/dist/{keyboard-utils-75346513.js → keyboard-utils-743ff1e5.js} +2 -2
- package/dist/{keyboard-utils-75346513.js.map → keyboard-utils-743ff1e5.js.map} +1 -1
- package/dist/{keyboard-utils-18c50c59.js → keyboard-utils-c840d7f0.js} +2 -2
- package/dist/{keyboard-utils-18c50c59.js.map → keyboard-utils-c840d7f0.js.map} +1 -1
- package/dist/lib/canvas-controller.es.js +1 -1
- package/dist/lib/canvas-controller.js +1 -1
- package/dist/lib/canvas.es.js +1 -1
- package/dist/lib/canvas.js +1 -1
- package/dist/lib/context-menu.es.js +1 -1
- package/dist/lib/context-menu.js +1 -1
- package/dist/lib/properties.es.js +1 -1
- package/dist/lib/properties.js +1 -1
- package/dist/{toolbar-1b5673c8.js → toolbar-7667a259.js} +2 -2
- package/dist/{toolbar-1b5673c8.js.map → toolbar-7667a259.js.map} +1 -1
- package/dist/{toolbar-2b16e11d.js → toolbar-7c577092.js} +2 -2
- package/dist/{toolbar-2b16e11d.js.map → toolbar-7c577092.js.map} +1 -1
- package/package.json +1 -1
- package/src/common-canvas/common-canvas-utils.js +2 -2
- package/src/common-canvas/svg-canvas-renderer.js +8 -7
- package/stats.html +1 -1
- package/dist/common-canvas-utils-6a327226.js.map +0 -1
- package/dist/common-canvas-utils-cc218b20.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common-canvas-utils-6a327226.js","sources":["../node_modules/lodash/_baseSet.js","../node_modules/lodash/set.js","../node_modules/lodash/isNumber.js","../src/common-canvas/common-canvas-utils.js"],"sourcesContent":["var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nmodule.exports = baseSet;\n","var baseSet = require('./_baseSet');\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint no-bitwise: \"off\" */\n\n// This class contains utility functions that may be used for both the canvas\n// objects stored in redux and also the copy of canvas objects maintained by\n// the CanvasRender objects.\n\nimport { get, has, isNumber, set } from \"lodash\";\nimport { ASSOCIATION_LINK, ASSOC_STRAIGHT, COMMENT_LINK, NODE_LINK,\n\tLINK_TYPE_STRAIGHT, SUPER_NODE, NORTH, SOUTH, EAST, WEST,\n\tPORT_DISPLAY_IMAGE, PORT_WIDTH_DEFAULT, PORT_HEIGHT_DEFAULT,\n} from \"../common-canvas/constants/canvas-constants.js\";\n\nexport default class CanvasUtils {\n\n\tstatic getObjectPositions(objects) {\n\t\tconst objectPositions = {};\n\t\tobjects.forEach((obj) => {\n\t\t\tobjectPositions[obj.id] = { x_pos: obj.x_pos, y_pos: obj.y_pos };\n\t\t});\n\t\treturn objectPositions;\n\t}\n\n\tstatic getLinkPositions(links) {\n\t\tconst positions = {};\n\t\tlinks.forEach((l) => {\n\t\t\tif (l.srcPos) {\n\t\t\t\tset(positions[l.id], \"srcPos.x_pos\", l.srcPos.x_pos);\n\t\t\t\tset(positions[l.id], \"srcPos.y_pos\", l.srcPos.y_pos);\n\t\t\t}\n\t\t\tif (l.trgPos) {\n\t\t\t\tif (!positions[l.id]) {\n\t\t\t\t\tpositions[l.id] = {};\n\t\t\t\t}\n\t\t\t\tset(positions[l.id], \"trgPos.x_pos\", l.trgPos.x_pos);\n\t\t\t\tset(positions[l.id], \"trgPos.y_pos\", l.trgPos.y_pos);\n\t\t\t}\n\t\t});\n\t\treturn positions;\n\t}\n\n\tstatic moveSurroundingObjects(supernode, objects, nodeSizingDirection, newWidth, newHeight, updateNodePos) {\n\t\tconst newObjectPositions = {};\n\t\tconst incWidth = newWidth - supernode.width;\n\t\tconst incHeight = newHeight - supernode.height;\n\t\tconst superCenterX = supernode.x_pos + (supernode.width / 2);\n\t\tconst superCenterY = supernode.y_pos + (supernode.height / 2);\n\n\t\tobjects.forEach((obj) => {\n\t\t\tif (obj.id === supernode.id) {\n\t\t\t\treturn; // Ignore the supernode\n\t\t\t}\n\n\t\t\tconst deltas = this.getMoveDeltas(\n\t\t\t\tobj.x_pos + (obj.width / 2), // Center of obj horizontally\n\t\t\t\tobj.y_pos + (obj.height / 2), // Center of obj vertically\n\t\t\t\tnodeSizingDirection, superCenterX, superCenterY, incWidth, incHeight);\n\n\t\t\tif (deltas.xDelta !== 0 || deltas.yDelta !== 0) {\n\t\t\t\tnewObjectPositions[obj.id] = {\n\t\t\t\t\tid: obj.id,\n\t\t\t\t\tx_pos: obj.x_pos + deltas.xDelta,\n\t\t\t\t\ty_pos: obj.y_pos + deltas.yDelta,\n\t\t\t\t\twidth: obj.width,\n\t\t\t\t\theight: obj.height\n\t\t\t\t};\n\n\t\t\t\tif (updateNodePos) {\n\t\t\t\t\tobj.x_pos += deltas.xDelta;\n\t\t\t\t\tobj.y_pos += deltas.yDelta;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn newObjectPositions;\n\t}\n\n\tstatic moveSurroundingDetachedLinks(supernode, links, nodeSizingDirection, newWidth, newHeight, updateLinkPos) {\n\t\tconst newLinkPositions = {};\n\t\tconst incWidth = newWidth - supernode.width;\n\t\tconst incHeight = newHeight - supernode.height;\n\t\tconst superCenterX = supernode.x_pos + (supernode.width / 2);\n\t\tconst superCenterY = supernode.y_pos + (supernode.height / 2);\n\n\t\tlinks.forEach((link) => {\n\t\t\t// If link has 'srcPos' it is detached at source end.\n\t\t\tif (link.srcPos) {\n\t\t\t\tconst deltas = this.getMoveDeltas(link.srcPos.x_pos, link.srcPos.y_pos,\n\t\t\t\t\tnodeSizingDirection, superCenterX, superCenterY, incWidth, incHeight);\n\n\t\t\t\tif (deltas.xDelta !== 0 || deltas.yDelta !== 0) {\n\t\t\t\t\tif (!newLinkPositions[link.id]) {\n\t\t\t\t\t\tnewLinkPositions[link.id] = { id: link.id };\n\t\t\t\t\t}\n\t\t\t\t\tset(newLinkPositions[link.id], \"srcPos.x_pos\", link.srcPos.x_pos + deltas.xDelta);\n\t\t\t\t\tset(newLinkPositions[link.id], \"srcPos.y_pos\", link.srcPos.y_pos + deltas.yDelta);\n\n\t\t\t\t\tif (updateLinkPos) {\n\t\t\t\t\t\tlink.srcPos.x_pos += deltas.xDelta;\n\t\t\t\t\t\tlink.srcPos.y_pos += deltas.yDelta;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If link has 'trgPos' it is detached at target end.\n\t\t\tif (link.trgPos) {\n\t\t\t\tconst deltas = this.getMoveDeltas(link.trgPos.x_pos, link.trgPos.y_pos,\n\t\t\t\t\tnodeSizingDirection, superCenterX, superCenterY, incWidth, incHeight);\n\n\t\t\t\tif (deltas.xDelta !== 0 || deltas.yDelta !== 0) {\n\t\t\t\t\tif (!newLinkPositions[link.id]) {\n\t\t\t\t\t\tnewLinkPositions[link.id] = { id: link.id };\n\t\t\t\t\t}\n\t\t\t\t\tset(newLinkPositions[link.id], \"trgPos.x_pos\", link.trgPos.x_pos + deltas.xDelta);\n\t\t\t\t\tset(newLinkPositions[link.id], \"trgPos.y_pos\", link.trgPos.y_pos + deltas.yDelta);\n\t\t\t\t}\n\t\t\t\tif (updateLinkPos) {\n\t\t\t\t\tlink.trgPos.x_pos += deltas.xDelta;\n\t\t\t\t\tlink.trgPos.y_pos += deltas.yDelta;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn newLinkPositions;\n\t}\n\n\tstatic getMoveDeltas(xPos, yPos, nodeSizingDirection, superCenterX, superCenterY, incWidth, incHeight) {\n\t\tlet xDelta = 0;\n\t\tlet yDelta = 0;\n\n\t\tif (nodeSizingDirection.indexOf(\"n\") > -1 && yPos < superCenterY - 20) {\n\t\t\tyDelta = -incHeight;\n\n\t\t} else if (nodeSizingDirection.indexOf(\"s\") > -1 && yPos > superCenterY + 20) {\n\t\t\tyDelta = incHeight;\n\t\t}\n\n\t\tif (nodeSizingDirection.indexOf(\"w\") > -1 && xPos < superCenterX - 20) {\n\t\t\txDelta = -incWidth;\n\n\t\t} else if (nodeSizingDirection.indexOf(\"e\") > -1 && xPos > superCenterX + 20) {\n\t\t\txDelta = incWidth;\n\t\t}\n\t\treturn { xDelta, yDelta };\n\t}\n\n\t// Returns the expanded width for the supernode passed in. This might be\n\t// stored in the supernode itself or, if not, it needs to be calculated.\n\t// It may not be assigned to the supernode to allow the extended width to\n\t// change based on the node type selected (this is more for use in the test\n\t// harness than in a real application).\n\tstatic getSupernodeExpandedWidth(supernode, canvasLayout) {\n\t\treturn supernode.expanded_width ? supernode.expanded_width : Math.max(canvasLayout.supernodeDefaultWidth, supernode.width);\n\t}\n\n\t// Returns the expanded height for the supernode passed in. This might be\n\t// stored in the supernode itself or, if not, it needs to be calculated.\n\t// It may not be assigned to the supernode to allow the extended height to\n\t// change based on the node type selected (this is more for use in the test\n\t// harness than in a real application).\n\tstatic getSupernodeExpandedHeight(supernode, canvasLayout) {\n\t\treturn supernode.expanded_height ? supernode.expanded_height : Math.max(canvasLayout.supernodeDefaultHeight, supernode.height);\n\t}\n\n\t// ---------------------------------------------------------------------------\n\t// The methods below calculate the padding needed to display connection lines\n\t// ---------------------------------------------------------------------------\n\n\t// Returns the maximum padding needed to display any elbow lines, that emanate\n\t// from the node passed in, to the set of target nodes passed in.\n\tstatic getNodePaddingToTargetNodes(node, targetNodes, links, linkType) {\n\t\tlet padding = 0;\n\t\tif (linkType === \"Elbow\") {\n\t\t\tconst maxIncrement = this.getCountOfLinksToTargetNodes(node, targetNodes, links) * node.layout.minInitialLineIncrement;\n\t\t\tpadding = node.layout.minInitialLine + node.layout.minFinalLine + maxIncrement;\n\t\t} else {\n\t\t\tpadding = 2 * node.layout.minInitialLine;\n\t\t}\n\t\treturn padding;\n\t}\n\n\t// Returns the count of links from the node passed in to the set of target\n\t// nodes passed in.\n\tstatic getCountOfLinksToTargetNodes(node, targetNodes, links) {\n\t\tlet count = 0;\n\t\tif (node.outputs && node.outputs.length > 0) {\n\t\t\tnode.outputs.forEach((output) => {\n\t\t\t\tif (this.isNodeOutputLinkedToTargetNodes(node, output, targetNodes, links)) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn count;\n\t}\n\n\t// Returns true if the node and output passed in are linked to any of the\n\t// target nodes passed in.\n\tstatic isNodeOutputLinkedToTargetNodes(node, output, targetNodes, links) {\n\t\tlet state = false;\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.srcNodeId === node.id && link.srcNodePortId === output.id && this.isTargetNode(link.trgNodeId, targetNodes)) {\n\t\t\t\tstate = true;\n\t\t\t}\n\t\t});\n\t\treturn state;\n\t}\n\n\t// Returns true if the node identified by targetNodeId is in the set\n\t// of target nodes passed in.\n\tstatic isTargetNode(trgNodeId, targetNodes) {\n\t\treturn targetNodes.findIndex((tn) => tn.id === trgNodeId) > -1;\n\t}\n\n\t// Returns an array of decorations that is a combination of the two input\n\t// arrays where the decorations from the overlayDecs array are overlaid on\n\t// top of those from the baseDecs array.\n\tstatic getCombinedDecorations(baseDecs = [], overlayDecs = []) {\n\t\tconst decs = baseDecs.map((bd) => {\n\t\t\tconst objDec = overlayDecs.find((od) => od.id === bd.id);\n\t\t\tif (objDec) {\n\t\t\t\treturn Object.assign({}, bd, objDec);\n\t\t\t}\n\t\t\treturn bd;\n\t\t});\n\n\t\tif (overlayDecs) {\n\t\t\toverlayDecs.forEach((od) => {\n\t\t\t\tconst index = baseDecs.findIndex((bd) => bd.id === od.id);\n\t\t\t\tif (index === -1) {\n\t\t\t\t\tdecs.push(od);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn decs;\n\t}\n\n\t// Returns whether user platform is Mac.\n\tstatic isMacintosh() {\n\t\treturn navigator.platform.indexOf(\"Mac\") > -1;\n\t}\n\n\t// Stops propagation of events and prevents any default behavior from\n\t// being executed. evnt can be either a regular event object OR the\n\t// d3event object provided by d3.\n\tstatic stopPropagationAndPreventDefault(evnt) {\n\t\tevnt.stopPropagation();\n\t\tevnt.preventDefault();\n\t}\n\n\t// Returns a snap-to-grid value for the value passed in based on a grid\n\t// size defined by the gridSize passed in.\n\tstatic snapToGrid(value, gridSize) {\n\t\tconst div = value / gridSize;\n\t\tlet abs = Math.trunc(div);\n\t\tconst remainder = div - abs;\n\n\t\tif (remainder > 0.5) {\n\t\t\tabs++;\n\t\t}\n\n\t\treturn abs * gridSize;\n\t}\n\n\t// Returns the coordinate position along the edge of a rectangle where a\n\t// straight line should be drawn from. The line's direction originates from an\n\t// arbitrary point (origin) within the rectangle and goes to an arbitrary\n\t// point (end) outside the rectangle. The rectangle is described by the\n\t// first four paramters. The gap is an additional spacing around the\n\t// rectangle used to separate the start of the line from the\n\t// rectangle/node boundary. The origin of the line's direction is described by\n\t// originX and originY. The end point of the line is described by endX and endY.\n\tstatic getOuterCoord(x, y, w, h, gap, originX, originY, endX, endY) {\n\t\tconst topEdge = y - gap;\n\t\tconst leftEdge = x - gap;\n\t\tconst rightEdge = x + w + gap;\n\t\tconst bottomEdge = y + h + gap;\n\n\t\t// The origin may not be in the center of the node rectangle so offset left\n\t\t// and right may be different and also top and bottom.\n\t\tconst originTopOffsetY = originY - topEdge;\n\t\tconst originLeftOffsetX = originX - leftEdge;\n\t\tconst originRightOffsetX = rightEdge - originX;\n\t\tconst originBottomOffsetY = bottomEdge - originY;\n\n\t\tconst originToEndX = originX - endX;\n\t\tconst originToEndY = originY - endY;\n\n\t\tvar startPointX;\n\t\tvar startPointY;\n\t\tlet dir = NORTH;\n\n\t\tif (originToEndX === 0) {\n\t\t\tstartPointX = originX;\n\t\t\tstartPointY = (endY < originY) ? topEdge : bottomEdge;\n\t\t\tdir = originToEndY > 0 ? NORTH : SOUTH;\n\n\t\t} else if (endX > originX) {\n\t\t\tconst topRightRatio = originTopOffsetY / (originX - rightEdge);\n\t\t\tconst botRightRatio = (originY - bottomEdge) / (originX - rightEdge);\n\t\t\tconst ratioRight = originToEndY / originToEndX;\n\n\t\t\t// North\n\t\t\tif (ratioRight < topRightRatio) {\n\t\t\t\tstartPointX = originX - (originTopOffsetY / ratioRight);\n\t\t\t\tstartPointY = topEdge;\n\t\t\t// South\n\t\t\t} else if (ratioRight > botRightRatio) {\n\t\t\t\tstartPointX = originX + (originBottomOffsetY / ratioRight);\n\t\t\t\tstartPointY = bottomEdge;\n\t\t\t\tdir = SOUTH;\n\t\t\t// East\n\t\t\t} else {\n\t\t\t\tstartPointX = rightEdge;\n\t\t\t\tstartPointY = originY + (originRightOffsetX * ratioRight);\n\t\t\t\tdir = EAST;\n\t\t\t}\n\t\t// End point is to the left of center\n\t\t} else {\n\t\t\tconst topLeftRatio = originTopOffsetY / originLeftOffsetX;\n\t\t\tconst botLeftRatio = (originY - bottomEdge) / originLeftOffsetX;\n\t\t\tconst ratioLeft = originToEndY / originToEndX;\n\n\t\t\t// North\n\t\t\tif (ratioLeft > topLeftRatio) {\n\t\t\t\tstartPointX = originX - (originTopOffsetY / ratioLeft);\n\t\t\t\tstartPointY = topEdge;\n\t\t\t// South\n\t\t\t} else if (ratioLeft < botLeftRatio) {\n\t\t\t\tstartPointX = originX + (originBottomOffsetY / ratioLeft);\n\t\t\t\tstartPointY = bottomEdge;\n\t\t\t\tdir = SOUTH;\n\t\t\t// West\n\t\t\t} else {\n\t\t\t\tstartPointX = leftEdge;\n\t\t\t\tstartPointY = originY - (originLeftOffsetX * ratioLeft);\n\t\t\t\tdir = WEST;\n\t\t\t}\n\t\t}\n\n\t\treturn { x: startPointX, y: startPointY, originX, originY, dir };\n\t}\n\n\t// Assisted by WCA@IBM\n\t// Latest GenAI contribution: ibm/granite-20b-code-instruct-v2\n\t// Returns the angle between two points where the angle\n\t// returned is always positive. The angle starts at the 3 o'clock\n\t// position which is 0 degrees and increases in a clock-wise\n\t// direction.\n\tstatic calculateAngle(x1, y1, x2, y2) {\n\t\tconst dx = x2 - x1;\n\t\tconst dy = y2 - y1;\n\t\tconst angle = Math.atan2(dy, dx);\n\t\tlet angleInDegrees = angle * (180 / Math.PI);\n\t\tif (angleInDegrees < 0) {\n\t\t\tangleInDegrees += 360;\n\t\t}\n\t\treturn angleInDegrees;\n\t}\n\n\t// Returns a direction NORTH, SOUTH, EAST or WEST which is the direction\n\t// from the origin position within the rectangle described by x, y, w and h\n\t// to the end position described by endX and endY.\n\tstatic getDir(x, y, w, h, originX, originY, endX, endY) {\n\t\tconst bottomEdge = y + h;\n\n\t\t// The origin may not be in the center of the node rectangle so offset left\n\t\t// and right may be different and also top and bottom.\n\t\tconst originTopOffsetY = originY - y;\n\t\tconst originLeftOffsetX = originX - x;\n\n\t\tconst originToEndX = originX - endX;\n\t\tconst originToEndY = originY - endY;\n\n\t\tlet dir = \"\";\n\n\t\tif (originToEndX === 0) {\n\t\t\tdir = (endY < originY) ? NORTH : SOUTH;\n\n\t\t} else if (endX > originX) {\n\t\t\tconst rightEdge = x + w;\n\t\t\tconst topRightRatio = originTopOffsetY / (originX - rightEdge);\n\t\t\tconst botRightRatio = (originY - bottomEdge) / (originX - rightEdge);\n\t\t\tconst ratioRight = originToEndY / originToEndX;\n\n\t\t\tif (ratioRight < topRightRatio) {\n\t\t\t\tdir = NORTH;\n\t\t\t} else if (ratioRight > botRightRatio) {\n\t\t\t\tdir = SOUTH;\n\t\t\t} else {\n\t\t\t\tdir = EAST;\n\t\t\t}\n\t\t// End point is to the left of center\n\t\t} else {\n\t\t\tconst topLeftRatio = originTopOffsetY / originLeftOffsetX;\n\t\t\tconst botLeftRatio = (originY - bottomEdge) / originLeftOffsetX;\n\t\t\tconst ratioLeft = originToEndY / originToEndX;\n\n\t\t\tif (ratioLeft > topLeftRatio) {\n\t\t\t\tdir = NORTH;\n\t\t\t} else if (ratioLeft < botLeftRatio) {\n\t\t\t\tdir = SOUTH;\n\t\t\t} else {\n\t\t\t\tdir = WEST;\n\t\t\t}\n\t\t}\n\n\t\treturn dir;\n\t}\n\n\t// Returns a direction (n, s, e or w) of a port at the\n\t// x, y position on a node. This is the direction that\n\t// would be taken by an outgoing link from a source node\n\t// or an incoming link to a target node.\n\tstatic getPortDir(x, y, node) {\n\t\tconst halfNodeWidth = (node.width / 2);\n\t\tconst halfNodeHeight = (node.height / 2);\n\t\tconst xFromCenter = x - halfNodeWidth;\n\t\tconst yFromCenter = y - halfNodeHeight;\n\t\t// In the center horizontally\n\t\tif (xFromCenter === 0) {\n\t\t\tif (yFromCenter > 0) {\n\t\t\t\treturn SOUTH;\n\t\t\t}\n\t\t\treturn NORTH;\n\n\t\t// To the right\n\t\t} else if (xFromCenter > 0) {\n\t\t\tconst angleToRight = Math.atan(yFromCenter / xFromCenter);\n\t\t\tconst angleToBottomRight = Math.atan(halfNodeHeight / halfNodeWidth);\n\t\t\tconst angleTopRight = -angleToBottomRight;\n\t\t\tif (angleToRight === 0) {\n\t\t\t\treturn EAST;\n\t\t\t} else if (angleToRight < angleTopRight) {\n\t\t\t\treturn NORTH;\n\t\t\t} else if (angleToRight > angleToBottomRight) {\n\t\t\t\treturn SOUTH;\n\t\t\t}\n\t\t\treturn EAST;\n\n\t\t}\n\t\t// To the left\n\t\tconst angleToLeft = Math.atan(yFromCenter / xFromCenter);\n\t\tconst angleToTopLeft = Math.atan(halfNodeHeight / halfNodeWidth);\n\t\tconst angleToBottomLeft = -angleToTopLeft;\n\t\tif (angleToLeft === 0) {\n\t\t\treturn WEST;\n\t\t} else if (angleToLeft > angleToTopLeft) {\n\t\t\treturn NORTH;\n\t\t} else if (angleToLeft < angleToBottomLeft) {\n\t\t\treturn SOUTH;\n\t\t}\n\t\treturn WEST;\n\t}\n\n\n\t// Returns true if the line described by x1, y1, x2, y2 either intersects or\n\t// is fully inside the rectangle described by rx1, ry1, rx2, ry2.\n\tstatic lineIntersectRectangle(x1, y1, x2, y2, rx1, ry1, rx2, ry2) {\n\t\tconst insideLine = this.lineInside(x1, y1, x2, y2, rx1, ry1, rx2, ry2);\n\t\tconst intersectTop = this.linesIntersect(x1, y1, x2, y2, rx1, ry1, rx2, ry1);\n\t\tconst intersectLeft = this.linesIntersect(x1, y1, x2, y2, rx1, ry1, rx1, ry2);\n\t\tconst intersectRight = this.linesIntersect(x1, y1, x2, y2, rx2, ry1, rx2, ry2);\n\t\tconst intersectBottom = this.linesIntersect(x1, y1, x2, y2, rx1, ry2, rx2, ry2);\n\n\t\treturn insideLine || intersectTop || intersectLeft || intersectRight || intersectBottom;\n\t}\n\n\t// Returns true if the line described by x1, y1, x2, y2 is inside the\n\t// rectangle described by rx1, ry1, rx2, ry2.\n\tstatic lineInside(x1, y1, x2, y2, rx1, ry1, rx2, ry2) {\n\t\treturn x1 >= rx1 && x1 <= rx2 && y1 >= ry1 && y1 <= ry2 &&\n\t\t\tx2 >= rx1 && x2 <= rx2 && y2 >= ry1 && y2 <= ry2;\n\t}\n\n\t// Returns an object containing x, y coordinate of the intersection point\n\t// if the line described by x1, y1 to x2, y2 crosses the line described by\n\t// x3, y3 to x4, y4. Returns a null if the lines do not cross.\n\t// See http://www.jeffreythompson.org/collision-detection/line-line.php\n\tstatic linesIntersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n\t\t// calculate the distance to intersection point\n\t\tconst a = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1));\n\t\tconst b = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1));\n\n\t\t// If a and b are between 0-1, lines intersect, so return the intersection point.\n\t\tif (a >= 0 && a <= 1 && b >= 0 && b <= 1) {\n\t\t\treturn {\n\t\t\t\tx: x1 + (a * (x2 - x1)),\n\t\t\t\ty: y1 + (a * (y2 - y1))\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns true if the distance between the two positions is smaller than\n\t// 3px which is considered to be a tiny movement. This can be used to define\n\t// whether a mouse pointer gesture is considered to be a click on an object or, if\n\t// outside the 3px distance, a drag.\n\tstatic isTinyMovement(startPos, endPos) {\n\t\treturn CanvasUtils.isInside(startPos, endPos, 3);\n\t}\n\n\t// Returns true if the distance from point 1 to point 2 is less than the\n\t// distance passed in.\n\tstatic isInside(point1, point2, distance) {\n\t\treturn Math.sqrt(Math.pow(point1.x - point2.x, 2) + Math.pow(point1.y - point2.y, 2)) < distance;\n\t}\n\n\t// Returns the distance from the start point to finish point of the link line.\n\tstatic getLinkDistance(link) {\n\t\tconst x = link.x2 - link.x1;\n\t\tconst y = link.y2 - link.y1;\n\n\t\treturn Math.sqrt((x * x) + (y * y));\n\t}\n\n\t// Return the center point of a quadratic bezier curve where p0 is the\n\t// start point, p1 is the control point and p2 is the end point.\n\t// This works for either the x or y coordinate.\n\tstatic getCenterPointQuadBezier(p0, p1, p2) {\n\t\tconst t = 0.5;\n\t\treturn (1 - t) * (1 - t) * p0 + 2 * (1 - t) * t * p1 + t * t * p2;\n\t}\n\n\t// Return the center point of a cubic bezier curve where p0 is the\n\t// start point, p1 and p2 are the control points and p3 is the end point.\n\t// This works for either the x or y coordinate.\n\tstatic getCenterPointCubicBezier(p0, p1, p2, p3) {\n\t\tconst t = 0.5;\n\t\treturn (1 - t) * (1 - t) * (1 - t) * p0 + 3 * (1 - t) * (1 - t) * t * p1 + 3 * (1 - t) * t * t * p2 + t * t * t * p3;\n\t}\n\n\t// Returns true if the node passed in should be resizeable. All nodes are resizabele\n\t// except binding nodes in a sub-flow when enableResizableNodes is switched on.\n\tstatic isNodeResizable(node, config) {\n\t\tif (!config.enableEditingActions ||\n\t\t\t\tthis.isSuperBindingNode(node) ||\n\t\t\t\t(!config.enableResizableNodes && !this.isExpandedSupernode(node))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t// Returns true if a link of type `type` can be created between the two\n\t// node/port combinations provided given the set of current links provided.\n\tstatic isConnectionAllowed(srcNodePortId, trgNodePortId, srcNode, trgNode, links, type, selfRefLinkAllowed) {\n\t\tif (type === ASSOCIATION_LINK) {\n\t\t\treturn this.isAssocConnectionAllowed(srcNode, trgNode, links);\n\t\t}\n\t\treturn this.isDataConnectionAllowed(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed);\n\t}\n\n\t// Returns true if a node-node data link can be created between the two\n\t// node/port combinations provided on a canvas where detached links are\n\t// allowed, given the set of current link provided.\n\tstatic isConnectionAllowedWithDetachedLinks(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed) {\n\t\tif (srcNode && trgNode && srcNode.id === trgNode.id && !selfRefLinkAllowed) { // Cannot connect to ourselves.\n\t\t\treturn false;\n\t\t}\n\n\t\tif (srcNode && trgNode && this.linkAlreadyExists(srcNodePortId, trgNodePortId, srcNode, trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if a connection is allowed to the source node and port\n\t// passed in given the set of current links.\n\tstatic isSrcConnectionAllowedWithDetachedLinks(srcNodePortId, srcNode, links) {\n\t\tif (srcNode && !this.doesNodeHaveOutputPorts(srcNode)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (srcNode && this.isSrcCardinalityAtMax(srcNodePortId, srcNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if a connection is allowed to the target node and port\n\t// passed in given the set of current links.\n\tstatic isTrgConnectionAllowedWithDetachedLinks(trgNodePortId, trgNode, links) {\n\t\tif (trgNode && !this.doesNodeHaveInputPorts(trgNode)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (trgNode && this.isTrgCardinalityAtMax(trgNodePortId, trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if the node has input ports.\n\tstatic doesNodeHaveInputPorts(node) {\n\t\treturn node.inputs && node.inputs.length > 0;\n\t}\n\n\t// Returns true if the node has output ports.\n\tstatic doesNodeHaveOutputPorts(node) {\n\t\treturn node.outputs && node.outputs.length > 0;\n\t}\n\n\t// Returns true if an existing link to the target node and port can be\n\t// replaced with a new link from the srcNode to the trgNode and trgPortId.\n\tstatic isDataLinkReplacementAllowed(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed) {\n\n\t\tif (!this.isDataConnectionAllowedNoCardinality(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Link replacement is only allowed when the input port has a maximum\n\t\t// cardinality of one.\n\t\tif (this.getMaxCardinality(trgNodePortId, trgNode.inputs) !== 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!this.isTrgCardinalityAtMax(trgNodePortId, trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t// Returns true if a regular node-node data link can be created between the\n\t// two node/port combinations provided, given the current set of links\n\t// passed in.\n\tstatic isDataConnectionAllowed(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed) {\n\n\t\tif (!this.isDataConnectionAllowedNoCardinality(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.isCardinalityAtMax(srcNodePortId, trgNodePortId, srcNode, trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if a regular node-node data link can be created between the\n\t// two node/port combinations provided, without checking on cardinalities of\n\t// the source or target nodes.\n\tstatic isDataConnectionAllowedNoCardinality(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed) {\n\n\t\tif (!srcNode || !trgNode) { // Source or target are not valid.\n\t\t\treturn false;\n\t\t}\n\n\t\tif (srcNode.id === trgNode.id && !selfRefLinkAllowed) { // Cannot connect to ourselves.\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!this.doesNodeHaveInputPorts(trgNode)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.linkAlreadyExists(srcNodePortId, trgNodePortId, srcNode, trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if an association link can be created between two nodes\n\t// identified by the objects provided.\n\tstatic isAssocConnectionAllowed(srcNode, trgNode, links) {\n\t\tif (!srcNode || !trgNode) { // Source or target are not valid.\n\t\t\treturn false;\n\t\t}\n\n\t\tif (srcNode.id === trgNode.id) { // Cannot connect to ourselves, currently.\n\t\t\treturn false;\n\t\t}\n\n\t\t// We don't check if the association link already exists because it makes\n\t\t// sense, for some applications, that multiple connections bewteen nodes are\n\t\t// allowed. Uncomment this code if we decide to add a config variable\n\t\t// to allow this in the future.\n\t\t// if (this.assocLinkAlreadyExists(srcNode, trgNode, links)) {\n\t\t// \treturn false;\n\t\t// }\n\n\t\treturn true;\n\t}\n\n\t// Note - Uncomment this function if in the future we decide to enfore\n\t// preventing multiple association links to be created by providing a config\n\t// variable..\n\t// Returns true if an association link already exists between the two nodes\n\t// passed in given the set of links passed in.\n\t// static assocLinkAlreadyExists(srcNode, trgNode, links) {\n\t// \tlet exists = false;\n\t//\n\t// \tlinks.forEach((link) => {\n\t// \t\tif ((link.srcNodeId === srcNode.id && link.trgNodeId === trgNode.id) ||\n\t// \t\t\t\t(link.srcNodeId === trgNode.id && link.trgNodeId === srcNode.id)) {\n\t// \t\t\texists = true;\n\t// \t\t}\n\t// \t});\n\t// \treturn exists;\n\t// }\n\n\t// Returns true if the source node passed in is available to be linked to the\n\t// target node and port passed in. trgNode and trgPortId may be undefined if\n\t// the call is being made while a detached link is being manipulated.\n\tstatic isSrcNodeAvailable(srcNode, trgNode, trgNodePortId, links) {\n\t\t// Don't disable the target node\n\t\tif (trgNode && trgNode.id === srcNode.id) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!this.doesNodeHaveOutputPorts(srcNode)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.areAllSrcNodePortsCardinalityAtMax(srcNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if the targt node passed in is available to be linked to the\n\t// source node and port passed in. srcNode and srcPortId may be undefined if\n\t// the call is being made while a detached link is being manipulated.\n\tstatic isTrgNodeAvailable(trgNode, srcNode, srcNodePortId, links) {\n\t\t// Don't disable the source node\n\t\tif (srcNode && srcNode.id === trgNode.id) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!this.doesNodeHaveInputPorts(trgNode)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.areAllTrgNodePortsCardinalityAtMax(trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if a link already exists from the source node and port to\n\t// the target node and port passed in given the set of links passd in.\n\tstatic linkAlreadyExists(srcNodePortId, trgNodePortId, srcNode, trgNode, links) {\n\t\tlet exists = false;\n\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.srcNodeId === srcNode.id &&\n\t\t\t\t\t(!link.srcNodePortId || link.srcNodePortId === srcNodePortId) &&\n\t\t\t\t\tlink.trgNodeId === trgNode.id &&\n\t\t\t\t\t(!link.trgNodePortId || link.trgNodePortId === trgNodePortId)) {\n\t\t\t\texists = true;\n\t\t\t}\n\t\t});\n\t\treturn exists;\n\t}\n\n\t// Returns true if all the ports of the source node are at maximum cardinality.\n\tstatic areAllSrcNodePortsCardinalityAtMax(srcNode, links) {\n\t\tif (srcNode && srcNode.outputs) {\n\t\t\tconst index = srcNode.outputs.findIndex((output) => !this.isSrcCardinalityAtMax(output.id, srcNode, links));\n\t\t\treturn index === -1;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// Returns true if all the ports of the target node are at maximum cardinality.\n\tstatic areAllTrgNodePortsCardinalityAtMax(trgNode, links) {\n\t\tif (trgNode && trgNode.inputs) {\n\t\t\tconst index = trgNode.inputs.findIndex((input) => !this.isTrgCardinalityAtMax(input.id, trgNode, links));\n\t\t\treturn index === -1;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// Returns true if the object passed in is a node which has at least one\n\t// input port and one output port.\n\tstatic hasInputAndOutputPorts(obj) {\n\t\treturn (this.isNode(obj) && obj.inputs && obj.inputs.length > 0 && obj.outputs && obj.outputs.length > 0);\n\t}\n\n\t// Returns true if either the cardinality of the default input port or\n\t// the default output port of the node passed in is maxed out based on\n\t// the array of links passed in.\n\tstatic isNodeDefaultPortsCardinalityAtMax(node, links) {\n\t\treturn this.isCardinalityAtMax(null, null, node, node, links);\n\t}\n\n\t// Returns true if the cardinality is maxed out for the source and target\n\t// nodes and ports passed in. This means any additional connection would\n\t// not be allowed from either node/port combination.\n\tstatic isCardinalityAtMax(srcPortId, trgPortId, srcNode, trgNode, links) {\n\t\treturn this.isSrcCardinalityAtMax(srcPortId, srcNode, links) ||\n\t\t\tthis.isTrgCardinalityAtMax(trgPortId, trgNode, links);\n\t}\n\n\t// Returns true if the cardinality is maxed out for the source node and port\n\t// passed in. This means any additional connection would not be allowed\n\t// from this source node/port combination.\n\tstatic isSrcCardinalityAtMax(portId, srcNode, links) {\n\t\tconst srcPortId = portId ? portId : this.getDefaultOutputPortId(srcNode);\n\t\tvar srcCount = 0;\n\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.type === NODE_LINK) {\n\t\t\t\tif (link.srcNodeId === srcNode.id && srcPortId) {\n\t\t\t\t\tif (link.srcNodePortId === srcPortId ||\n\t\t\t\t\t\t\t(!link.srcNodePortId && this.isFirstPort(srcNode.outputs, srcPortId))) {\n\t\t\t\t\t\tsrcCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tconst maxCard = this.getMaxCardinality(srcPortId, srcNode.outputs);\n\t\tif (maxCard !== null && // Might be 0! So test explicitley for non null.\n\t\t\t\tmaxCard !== -1 && // -1 indicates an infinite numder of ports are allowed\n\t\t\t\tsrcCount >= maxCard) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t// Returns true if the cardinality is maxed out for the taget node and port\n\t// passed in. This means any additional connection would not be allowed\n\t// to this target node/port combination.\n\tstatic isTrgCardinalityAtMax(portId, trgNode, links) {\n\t\tconst trgPortId = portId ? portId : this.getDefaultInputPortId(trgNode);\n\t\tvar trgCount = 0;\n\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.type === NODE_LINK) {\n\t\t\t\tif (link.trgNodeId === trgNode.id && trgPortId) {\n\t\t\t\t\tif (link.trgNodePortId === trgPortId ||\n\t\t\t\t\t\t\t(!link.trgNodePortId && this.isFirstPort(trgNode.inputs, trgPortId))) {\n\t\t\t\t\t\ttrgCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tconst maxCard = this.getMaxCardinality(trgPortId, trgNode.inputs);\n\t\tif (maxCard !== null && // Might be 0! Yes believe it or not someone does set it to zero. So test explicitley for non null.\n\t\t\t\tmaxCard !== -1 && // -1 indicates an infinite numder of ports are allowed\n\t\t\t\ttrgCount >= maxCard) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t// Returns true if the portId passed in specifies the first port in the\n\t// port array.\n\tstatic isFirstPort(portArray, portId) {\n\t\tconst index = this.getPortIndex(portArray, portId);\n\n\t\tif (index === 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// Returns the index of the port ID passed in, in the\n\t// port array passed in.\n\tstatic getPortIndex(portArray, portId) {\n\t\treturn portArray.findIndex((port) => port.id === portId);\n\t}\n\n\t// Returns a source port Id if one exists in the link, otherwise defaults\n\t// to the first available port on the source node.\n\tstatic getSourcePortId(link, srcNode) {\n\t\tvar srcPortId;\n\t\tif (link.srcNodePortId) {\n\t\t\tsrcPortId = link.srcNodePortId;\n\t\t} else if (srcNode.outputs && srcNode.outputs.length > 0) {\n\t\t\tsrcPortId = srcNode.outputs[0].id;\n\t\t} else {\n\t\t\tsrcPortId = null;\n\t\t}\n\t\treturn srcPortId;\n\t}\n\n\t// Returns a target port Id if one exists in the link, otherwise defaults\n\t// to the first available port on the target node.\n\tstatic getTargetPortId(link, trgNode) {\n\t\tvar trgPortId;\n\t\tif (link.trgNodePortId) {\n\t\t\ttrgPortId = link.trgNodePortId;\n\t\t} else if (trgNode.inputs && trgNode.inputs.length > 0) {\n\t\t\ttrgPortId = trgNode.inputs[0].id;\n\t\t} else {\n\t\t\ttrgPortId = null;\n\t\t}\n\t\treturn trgPortId;\n\t}\n\n\n\t// Returns the port referenced by srcPortId from the node referenced\n\t// by srcNode.\n\tstatic getOutputPort(srcPortId, srcNode) {\n\t\tif (srcNode && srcNode.outputs) {\n\t\t\treturn srcNode.outputs.find((p) => p.id === srcPortId);\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns the port referenced by trgPortId from the node referenced\n\t// by trgNode.\n\tstatic getInputPort(trgPortId, trgNode) {\n\t\tif (trgNode && trgNode.inputs) {\n\t\t\treturn trgNode.inputs.find((p) => p.id === trgPortId);\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns the port from the port array indicated by the portId or null\n\t// if no port can be found.\n\tstatic getPort(portId, portArray) {\n\t\tif (portArray && portArray.length > 0) {\n\t\t\tconst index = portArray.findIndex((port) => port.id === portId);\n\n\t\t\tif (index > -1) {\n\t\t\t\treturn portArray[index];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns the maximum cardinality, if one exists, for the port ID passed in\n\t// from the array of ports provided.\n\tstatic getMaxCardinality(portId, ports) {\n\t\tconst port = this.getPort(portId, ports);\n\t\tif (port &&\n\t\t\t\tport.cardinality) {\n\t\t\treturn Number(port.cardinality.max);\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns true if a connection is allowed from a comment to a target node,\n\t// given the set of links passed in. At the moment this is only restricted\n\t// if a current link exists between the two.\n\tstatic isCommentLinkConnectionAllowed(commentId, trgNodeId, links) {\n\t\treturn !this.commentLinkAlreadyExists(commentId, trgNodeId, links);\n\t}\n\n\t// Returns true if a comment link already exists from the source comment\n\t// to the target node, given the set of links passed in.\n\tstatic commentLinkAlreadyExists(commentId, trgNodeId, links) {\n\t\tlet exists = false;\n\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.srcNodeId === commentId &&\n\t\t\t\t\tlink.trgNodeId === trgNodeId) {\n\t\t\t\texists = true;\n\t\t\t}\n\t\t});\n\t\treturn exists;\n\t}\n\n\t// Returns an object containing two arrays: old links and new links. There is\n\t// one new link in the new links array for each old link in the old links\n\t// array. The new links have their properties adjusted so they are attached\n\t// to the first found output or input port, that is not maxed out with respect\n\t// to its maximum cardinality, of the provided node. The allDataLinks\n\t// parameter is the array of all node-node data links on the canvas.\n\tstatic getDetachedLinksToUpdate(node, detachedLinks, allNodeDataLinks) {\n\t\tconst newLinks = [];\n\t\tconst oldLinks = [];\n\t\tdetachedLinks.forEach((link) => {\n\t\t\tif (link.nodeOverSrcPos && link.srcPos && node.outputs && node.outputs.length > 0) {\n\t\t\t\tlet connected = false;\n\t\t\t\tnode.outputs.forEach((output) => {\n\t\t\t\t\tif (connected === false &&\n\t\t\t\t\t\t\tthis.isSrcConnectionAllowedWithDetachedLinks(output.id, node, this.getReplacedLinks(allNodeDataLinks, newLinks))) {\n\t\t\t\t\t\tconst newLink = Object.assign({}, link, { srcNodeId: node.id, srcNodePortId: output.id });\n\t\t\t\t\t\tdelete newLink.srcPos;\n\t\t\t\t\t\tnewLinks.push(newLink);\n\t\t\t\t\t\toldLinks.push(link);\n\t\t\t\t\t\tconnected = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t} else if (link.nodeOverTrgPos && link.trgPos && node.inputs && node.inputs.length > 0) {\n\t\t\t\tlet connected = false;\n\t\t\t\tnode.inputs.forEach((input) => {\n\t\t\t\t\tif (connected === false &&\n\t\t\t\t\t\t\tthis.isTrgConnectionAllowedWithDetachedLinks(input.id, node, this.getReplacedLinks(allNodeDataLinks, newLinks))) {\n\t\t\t\t\t\tconst newLink = Object.assign({}, link, { trgNodeId: node.id, trgNodePortId: input.id });\n\t\t\t\t\t\tdelete newLink.trgPos;\n\t\t\t\t\t\tnewLinks.push(newLink);\n\t\t\t\t\t\toldLinks.push(link);\n\t\t\t\t\t\tconnected = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\treturn { newLinks, oldLinks };\n\t}\n\n\t// Returns an array which is a copy of the allNodeDataLinks array but with\n\t// any elements replaced from the newLinks array if those elements have the same ID.\n\tstatic getReplacedLinks(allNodeDataLinks, newLinks) {\n\t\treturn allNodeDataLinks.map((link) => {\n\t\t\tconst index = newLinks.findIndex((nl) => nl.id === link.id);\n\t\t\treturn index > -1 ? newLinks[index] : link;\n\t\t});\n\t}\n\n\t// Returns an array of selected object IDs for nodes, comments and links\n\t// that are within the region (inReg) provided. Links are only included if\n\t// includeLinks is truthy.\n\tstatic selectInRegion(inReg, pipeline, includeLinks, linkType, enableAssocLinkType) {\n\t\tconst region = {\n\t\t\tx1: inReg.x,\n\t\t\ty1: inReg.y,\n\t\t\tx2: inReg.x + inReg.width,\n\t\t\ty2: inReg.y + inReg.height\n\t\t};\n\n\t\tvar regionSelections = [];\n\t\tfor (const node of pipeline.nodes) {\n\t\t\tif (!this.isSuperBindingNode(node) && // Don't include binding nodes in select\n\t\t\t\t\tregion.x1 < node.x_pos + node.width &&\n\t\t\t\t\tregion.x2 > node.x_pos &&\n\t\t\t\t\tregion.y1 < node.y_pos + node.height &&\n\t\t\t\t\tregion.y2 > node.y_pos) {\n\t\t\t\tregionSelections.push(node.id);\n\t\t\t}\n\t\t}\n\t\tfor (const comment of pipeline.comments) {\n\t\t\tif (region.x1 < comment.x_pos + comment.width &&\n\t\t\t\t\tregion.x2 > comment.x_pos &&\n\t\t\t\t\tregion.y1 < comment.y_pos + comment.height &&\n\t\t\t\t\tregion.y2 > comment.y_pos) {\n\t\t\t\tregionSelections.push(comment.id);\n\t\t\t}\n\t\t}\n\t\tif (includeLinks) {\n\t\t\tfor (const link of pipeline.links) {\n\t\t\t\t// For straight links we check to see if the link line intersects (or\n\t\t\t\t// is fully inside) the selection region.\n\t\t\t\tif ((link.type === NODE_LINK && linkType === LINK_TYPE_STRAIGHT) ||\n\t\t\t\t\t\tlink.type === COMMENT_LINK ||\n\t\t\t\t\t\t(link.type === ASSOCIATION_LINK && enableAssocLinkType === ASSOC_STRAIGHT)) {\n\t\t\t\t\tif (this.lineIntersectRectangle(link.x1, link.y1, link.x2, link.y2, region.x1, region.y1, region.x2, region.y2)) {\n\t\t\t\t\t\tregionSelections.push(link.id);\n\t\t\t\t\t}\n\t\t\t\t// For elbow and curved lines we just check to see if the start or\n\t\t\t\t// end coordinates of the lines are inside the selection region or not.\n\t\t\t\t// TODO: This approach means any selection region that only touches the\n\t\t\t\t// link line will not select the line if it is elbow or curve. If any\n\t\t\t\t// host app wants more acurate collision detection between the line and\n\t\t\t\t// the selection region with these line types, this would need to be\n\t\t\t\t// improved, perhaps using a library like this:\n\t\t\t\t// https://github.com/thelonious/kld-intersections\n\t\t\t\t} else if (this.isPosInArea({ x_pos: link.x1, y_pos: link.y1 }, region, 0) ||\n\t\t\t\t\t\t\t\t\t\tthis.isPosInArea({ x_pos: link.x2, y_pos: link.y2 }, region, 0)) {\n\t\t\t\t\tregionSelections.push(link.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn regionSelections;\n\t}\n\n\t// Return true if the position provided is within the area provided.\n\tstatic isPosInArea(pos, area, pad) {\n\t\treturn pos.x_pos > area.x1 - pad &&\n\t\t\tpos.x_pos < area.x2 + pad &&\n\t\t\tpos.y_pos > area.y1 - pad &&\n\t\t\tpos.y_pos < area.y2 + pad;\n\t}\n\n\t// Returns a sting that describes the basic type of\n\t// the object passed in.\n\tstatic getObjectTypeName(obj) {\n\t\tif (this.isNode(obj)) {\n\t\t\treturn \"node\";\n\t\t} else if (this.isComment(obj)) {\n\t\t\treturn \"comment\";\n\t\t} else if (this.isLink(obj)) {\n\t\t\treturn \"link\";\n\t\t}\n\t\treturn \"\";\n\t}\n\n\t// Returns truthy if the object passed in is a node (and not a comment).\n\t// Comments don't have a type property.\n\tstatic isNode(obj) {\n\t\treturn obj.type && !this.isLink(obj);\n\t}\n\n\t// Returns true if the object passed in is a link.\n\tstatic isLink(obj) {\n\t\treturn obj.type && (obj.type === NODE_LINK || obj.type === COMMENT_LINK || obj.type === ASSOCIATION_LINK);\n\t}\n\n\t// Returns truthy if the object passed in is a comment.\n\t// Comments don't have a type property.\n\tstatic isComment(obj) {\n\t\treturn !obj.type;\n\t}\n\n\tstatic isSupernode(node) {\n\t\treturn node.type === SUPER_NODE;\n\t}\n\n\tstatic isExpanded(node) {\n\t\treturn node.is_expanded === true;\n\t}\n\n\tstatic isExpandedSupernode(node) {\n\t\treturn this.isSupernode(node) && this.isExpanded(node);\n\t}\n\n\tstatic isCollapsedSupernode(node) {\n\t\treturn this.isSupernode(node) && !this.isExpanded(node);\n\t}\n\t// Returns true if the node passed in is a binding node in a subflow\n\t// for a supernode.\n\tstatic isSuperBindingNode(d) {\n\t\treturn d.isSupernodeInputBinding || d.isSupernodeOutputBinding;\n\t}\n\n\t// Returns an object containing the dimensions of an imaginary rectangle\n\t// surrounding the nodes and comments and links passed in or an object with\n\t// all properties set to zero if no valid objects were provided.\n\t// nodeHighlightGap may be 0 or undefined. If it is undefined we use the\n\t// nodeHighlightGap in the node's layout.\n\t// If allLinks is set to true, we include the start and end coordinates of all\n\t// links passed in. If set to false (or is undefined), we only inlcude\n\t// the unconnected ends of semi-detached or fully-detached links. That is,\n\t// where the link has a srcPos and/or a trgPos field.\n\tstatic getCanvasDimensions(nodes, comments, links, commentHighlightGap, nodeHighlightGap, allLinks) {\n\t\tvar canvLeft = Infinity;\n\t\tlet canvTop = Infinity;\n\t\tvar canvRight = -Infinity;\n\t\tvar canvBottom = -Infinity;\n\n\t\tif (nodes) {\n\t\t\tnodes.forEach((d) => {\n\t\t\t\tif (this.isSuperBindingNode(d)) { // Always ignore Supernode binding nodes\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst nodeGap = nodeHighlightGap === 0 ? 0 : d.layout.nodeHighlightGap;\n\t\t\t\tcanvLeft = Math.min(canvLeft, d.x_pos - nodeGap);\n\t\t\t\tcanvTop = Math.min(canvTop, d.y_pos - nodeGap);\n\t\t\t\tcanvRight = Math.max(canvRight, d.x_pos + d.width + nodeGap);\n\t\t\t\tcanvBottom = Math.max(canvBottom, d.y_pos + d.height + nodeGap);\n\t\t\t});\n\t\t}\n\n\t\tif (comments) {\n\t\t\tcomments.forEach((d) => {\n\t\t\t\tcanvLeft = Math.min(canvLeft, d.x_pos - commentHighlightGap);\n\t\t\t\tcanvTop = Math.min(canvTop, d.y_pos - commentHighlightGap);\n\t\t\t\tcanvRight = Math.max(canvRight, d.x_pos + d.width + commentHighlightGap);\n\t\t\t\tcanvBottom = Math.max(canvBottom, d.y_pos + d.height + commentHighlightGap);\n\t\t\t});\n\t\t}\n\n\t\t// Take into account semi-detached and fully-detached links, if any.\n\t\tif (links) {\n\t\t\tlinks.forEach((link) => {\n\t\t\t\tif (allLinks) {\n\t\t\t\t\tcanvLeft = Math.min(canvLeft, link.x1);\n\t\t\t\t\tcanvTop = Math.min(canvTop, link.y1);\n\t\t\t\t\tcanvRight = Math.max(canvRight, link.x1);\n\t\t\t\t\tcanvBottom = Math.max(canvBottom, link.y1);\n\n\t\t\t\t\tcanvLeft = Math.min(canvLeft, link.x2);\n\t\t\t\t\tcanvTop = Math.min(canvTop, link.y2);\n\t\t\t\t\tcanvRight = Math.max(canvRight, link.x2);\n\t\t\t\t\tcanvBottom = Math.max(canvBottom, link.y2);\n\t\t\t\t} else {\n\t\t\t\t\tif (link.srcPos) {\n\t\t\t\t\t\tcanvLeft = Math.min(canvLeft, link.srcPos.x_pos);\n\t\t\t\t\t\tcanvTop = Math.min(canvTop, link.srcPos.y_pos);\n\t\t\t\t\t\tcanvRight = Math.max(canvRight, link.srcPos.x_pos);\n\t\t\t\t\t\tcanvBottom = Math.max(canvBottom, link.srcPos.y_pos);\n\t\t\t\t\t}\n\t\t\t\t\tif (link.trgPos) {\n\t\t\t\t\t\tcanvLeft = Math.min(canvLeft, link.trgPos.x_pos);\n\t\t\t\t\t\tcanvTop = Math.min(canvTop, link.trgPos.y_pos);\n\t\t\t\t\t\tcanvRight = Math.max(canvRight, link.trgPos.x_pos);\n\t\t\t\t\t\tcanvBottom = Math.max(canvBottom, link.trgPos.y_pos);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst canvWidth = canvRight - canvLeft;\n\t\tconst canvHeight = canvBottom - canvTop;\n\n\t\tif (canvLeft === Infinity || canvTop === Infinity ||\n\t\t\t\tcanvRight === -Infinity || canvBottom === -Infinity) {\n\t\t\treturn { left: 0, top: 0, right: 0, bottom: 0, width: 0, height: 0 };\n\t\t}\n\n\t\treturn {\n\t\t\tleft: canvLeft,\n\t\t\ttop: canvTop,\n\t\t\tright: canvRight,\n\t\t\tbottom: canvBottom,\n\t\t\twidth: canvWidth,\n\t\t\theight: canvHeight\n\t\t};\n\t}\n\n\t// Returns a subset of links from the links passed in which connect to\n\t// the target node and port passed in.\n\tstatic getDataLinksConnectedTo(trgPortId, trgNode, links) {\n\t\tconst defTrgPortId = this.getDefaultInputPortId(trgNode);\n\n\t\treturn links.filter((link) => {\n\t\t\tif (link.type === NODE_LINK) {\n\t\t\t\tconst linkTrgPortId = link.trgNodePortId || defTrgPortId;\n\t\t\t\treturn link.trgNodeId === trgNode.id && linkTrgPortId === trgPortId;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t}\n\n\t// Returns the default input port ID for the node, which will be the ID of\n\t// the first port, or null if there are no inputs.\n\tstatic getDefaultInputPortId(node) {\n\t\treturn (node.inputs && node.inputs.length > 0 ? node.inputs[0].id : null);\n\t}\n\n\t// Returns the default output port ID for the node, which will be the ID of\n\t// the first port, or null if there are no outputs.\n\tstatic getDefaultOutputPortId(node) {\n\t\treturn (node.outputs && node.outputs.length > 0 ? node.outputs[0].id : null);\n\t}\n\n\t// Returns a full style string value that can be applied as an in-line style to\n\t// the representation of the object in the DOM. The style is based either\n\t// on the 'style' or 'style_temp' property of the object.\n\t// Parameters:\n\t// d - The object\n\t// part - A string of the part of the object to be styled. eg 'body' or 'image'\n\t// This is dependent on the style spec in eiether the 'style' or\n\t// 'temp_style' property.\n\t// type = Either 'hover' or 'default'\n\tstatic getObjectStyle(d, part, type) {\n\t\tif (!d.style && !d.style_temp) {\n\t\t\treturn null;\n\t\t}\n\t\tlet style = null;\n\n\t\tif (type === \"hover\") {\n\t\t\tstyle = this.getStyleValue(d, part, \"default\") + \";\" + this.getStyleValue(d, part, \"hover\");\n\n\t\t} else if (type === \"default\") {\n\t\t\tstyle = this.getStyleValue(d, part, \"default\");\n\t\t}\n\t\treturn style;\n\t}\n\n\tstatic getStyleValue(d, part, type) {\n\t\tconst style = get(d, `style_temp.${part}.${type}`, null);\n\t\tif (style !== null) {\n\t\t\treturn style;\n\t\t}\n\t\treturn get(d, `style.${part}.${type}`, null);\n\t}\n\n\t// Returns a subset array of supernodes from the nodes passed in.\n\tstatic filterSupernodes(inNodes) {\n\t\treturn inNodes.filter((n) => n.type === SUPER_NODE);\n\t}\n\n\t// Returns a source position object, with x_pos and y_pos fields, that\n\t// decribes where a link line would be drawn from if the link's source node\n\t// did not exist. This is useful when doing operations (such as delete or\n\t// cut/copy) that cause semi-detached or fully detached links to be created.\n\tstatic getSrcPos(link, apiPipeline) {\n\t\tlet trgCenterX;\n\t\tlet trgCenterY;\n\t\tif (link.trgNodeId) {\n\t\t\tconst trgNode = apiPipeline.getNode(link.trgNodeId);\n\t\t\ttrgCenterX = trgNode.x_pos + (trgNode.width / 2);\n\t\t\ttrgCenterY = trgNode.y_pos + (trgNode.height / 2);\n\t\t} else {\n\t\t\ttrgCenterX = link.trgPos.x_pos;\n\t\t\ttrgCenterY = link.trgPos.y_pos;\n\t\t}\n\n\t\tconst srcNode = apiPipeline.getNode(link.srcNodeId);\n\t\tlet srcCenterX;\n\t\tlet srcCenterY;\n\n\t\tif (srcNode.layout && srcNode.layout.drawNodeLinkLineFromTo === \"image_center\") {\n\t\t\tsrcCenterX = srcNode.x_pos + srcNode.layout.imagePosX + (srcNode.layout.imageWidth / 2);\n\t\t\tsrcCenterY = srcNode.y_pos + srcNode.layout.imagePosY + (srcNode.layout.imageHeight / 2);\n\n\t\t} else {\n\t\t\tsrcCenterX = srcNode.x_pos + (srcNode.width / 2);\n\t\t\tsrcCenterY = srcNode.y_pos + (srcNode.height / 2);\n\t\t}\n\n\t\tconst startPos = this.getOuterCoord(\n\t\t\tsrcNode.x_pos, srcNode.y_pos, srcNode.width, srcNode.height, 0,\n\t\t\tsrcCenterX, srcCenterY, trgCenterX, trgCenterY);\n\n\t\treturn { x_pos: startPos.x, y_pos: startPos.y };\n\t}\n\n\t// Returns a target position object, with x_pos and y_pos fields, that\n\t// decribes where a link line would be drawn from if the link's target node\n\t// did not exist. This is useful when doing operations (such as delete or\n\t// cut/copy) that cause semi-detached or fully detached links to be created.\n\tstatic getTrgPos(link, apiPipeline) {\n\t\tlet srcCenterX;\n\t\tlet srcCenterY;\n\t\tif (link.srcNodeId) {\n\t\t\tconst srcNode = apiPipeline.getNode(link.srcNodeId);\n\t\t\tsrcCenterX = srcNode.x_pos + (srcNode.width / 2);\n\t\t\tsrcCenterY = srcNode.y_pos + (srcNode.height / 2);\n\t\t} else {\n\t\t\tsrcCenterX = link.srcPos.x_pos;\n\t\t\tsrcCenterY = link.srcPos.y_pos;\n\t\t}\n\n\t\tconst trgNode = apiPipeline.getNode(link.trgNodeId);\n\t\tlet trgCenterX;\n\t\tlet trgCenterY;\n\n\t\tif (trgNode.layout && trgNode.layout.drawNodeLinkLineFromTo === \"image_center\") {\n\t\t\ttrgCenterX = trgNode.x_pos + trgNode.layout.imagePosX + (trgNode.layout.imageWidth / 2);\n\t\t\ttrgCenterY = trgNode.y_pos + trgNode.layout.imagePosY + (trgNode.layout.imageHeight / 2);\n\n\t\t} else {\n\t\t\ttrgCenterX = trgNode.x_pos + (trgNode.width / 2);\n\t\t\ttrgCenterY = trgNode.y_pos + (trgNode.height / 2);\n\t\t}\n\n\t\tconst startPos = this.getOuterCoord(\n\t\t\ttrgNode.x_pos, trgNode.y_pos, trgNode.width, trgNode.height, 0,\n\t\t\ttrgCenterX, trgCenterY, srcCenterX, srcCenterY);\n\n\t\treturn { x_pos: startPos.x, y_pos: startPos.y };\n\t}\n\n\t// Returns a concatenation of the two input arrays making sure there are no\n\t// duplicates (based on ID) in the returned array.\n\tstatic concatUniqueBasedOnId(newLinks, currentLinks) {\n\t\tconst outLinks = currentLinks;\n\t\tnewLinks.forEach((nl) => {\n\t\t\tif (!currentLinks.some((cl) => cl.id === nl.id)) {\n\t\t\t\toutLinks.push(nl);\n\t\t\t}\n\t\t});\n\t\treturn outLinks;\n\t}\n\n\t// Returns the color class in the className parameter, if one is found,\n\t// otherwise returns null.\n\tstatic getBkgColorClass(className) {\n\t\tif (className === \"bkg-col-white-0\" ||\n\t\t\t\tclassName === \"bkg-col-yellow-20\" ||\n\t\t\t\tclassName === \"bkg-col-gray-20\" ||\n\t\t\t\tclassName === \"bkg-col-green-20\" ||\n\t\t\t\tclassName === \"bkg-col-teal-20\" ||\n\t\t\t\tclassName === \"bkg-col-cyan-20\" ||\n\t\t\t\tclassName === \"bkg-col-red-50\" ||\n\t\t\t\tclassName === \"bkg-col-orange-40\" ||\n\t\t\t\tclassName === \"bkg-col-gray-50\" ||\n\t\t\t\tclassName === \"bkg-col-green-50\" ||\n\t\t\t\tclassName === \"bkg-col-teal-50\" ||\n\t\t\t\tclassName === \"bkg-col-cyan-50\") {\n\t\t\treturn className;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns true if the hex passed in is for a dark color where 'dark'\n\t// is defined as a color that would require white text to be used\n\t// if the hex color was a background color.\n\tstatic isDarkColor(hex) {\n\t\tconst c = hex.substring(1); // strip #\n\t\tconst rgb = parseInt(c, 16); // convert rrggbb to decimal\n\n\t\tconst r = (rgb >> 16) & 0xff; // extract red\n\t\tconst g = (rgb >> 8) & 0xff; // extract green\n\t\tconst b = (rgb >> 0) & 0xff; // extract blue\n\n\t\tconst luma = 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709\n\t\treturn (luma < 108);\n\t}\n\n\t// Applies the outlineStyle format or border-xxx CSS styles to the D3 comment\n\t// selection passed in, if one exists, in the formats array passed in.\n\tstatic applyOutlineStyle(commentSel, formats) {\n\t\tif (formats?.length > 0) {\n\t\t\tformats.forEach((f) => {\n\t\t\t\tif (f.type === \"outlineStyle\" ||\n\t\t\t\t\tf.type.startsWith(\"border\")) { // Only apply outline and border style to outer <div>\n\t\t\t\t\tconst { field, value } = CanvasUtils.convertFormat(f);\n\t\t\t\t\tcommentSel.style(field, value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t// Applies all formats from the formats array, that are not outlineStyle or\n\t// border-xxx CSS styles, to the D3 comment selection passed in.\n\tstatic applyNonOutlineStyle(commentSel, formats) {\n\t\tif (formats?.length > 0) {\n\t\t\tformats.forEach((f) => {\n\t\t\t\tif (f.type !== \"outlineStyle\" &&\n\t\t\t\t\t!f.type.startsWith(\"border\")) { // Only apply outline and border style to outer <div>\n\t\t\t\t\tconst { field, value } = CanvasUtils.convertFormat(f);\n\t\t\t\t\tcommentSel.style(field, value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t// Returns an object contaiing the start and end positions\n\t// of any current selection in the domNode passed in. The\n\t// DOM node is expected to contain text which is stored in a\n\t// set of child nodes that are text objects.\n\tstatic getSelectionPositions(domNode) {\n\t\tconst sel = window.getSelection();\n\t\tlet anchorPos;\n\t\tlet focusPos;\n\t\tlet runningLen = 0;\n\t\tdomNode.childNodes.forEach((cn) => {\n\t\t\tif (cn.nodeValue) {\n\t\t\t\tconst textLen = cn.nodeValue.length;\n\t\t\t\tif (cn === sel.anchorNode) {\n\t\t\t\t\tanchorPos = runningLen + sel.anchorOffset;\n\t\t\t\t}\n\t\t\t\tif (cn === sel.focusNode) {\n\t\t\t\t\tfocusPos = runningLen + sel.focusOffset;\n\t\t\t\t}\n\t\t\t\trunningLen += textLen;\n\t\t\t}\n\t\t});\n\t\treturn { start: Math.min(anchorPos, focusPos), end: Math.max(anchorPos, focusPos) };\n\t}\n\n\t// Selects the entire contents of the DOM node passed in.\n\tstatic selectNodeContents(domNode) {\n\t\tvar range = document.createRange();\n\t\trange.selectNodeContents(domNode);\n\n\t\tvar sel = window.getSelection();\n\t\tsel.removeAllRanges();\n\t\tsel.addRange(range);\n\t}\n\n\t// Selects the range of characters in the text DOM node passed in\n\t// between the start and end positions passed in. The DOM node is\n\t// expected to contain text which is stored in a set of child nodes\n\t// that are text objects. selection is an optional object containing\n\t// the current selection which is provided by the Cypress test cases.\n\tstatic selectNodeRange(domNode, start, end, selection) {\n\t\tconst range = document.createRange();\n\n\t\tlet startTextNode;\n\t\tlet endTextNode;\n\t\tlet startTextPos;\n\t\tlet endTextPos;\n\t\tlet runningLen = 0;\n\t\tdomNode.childNodes.forEach((cn) => {\n\t\t\tconst textLen = cn.nodeValue.length;\n\t\t\trunningLen += textLen;\n\t\t\tif (start <= runningLen && !startTextNode) {\n\t\t\t\tstartTextNode = cn;\n\t\t\t\tstartTextPos = textLen - (runningLen - start);\n\t\t\t}\n\t\t\tif (end <= runningLen && !endTextNode) {\n\t\t\t\tendTextNode = cn;\n\t\t\t\tendTextPos = textLen - (runningLen - end);\n\t\t\t}\n\t\t});\n\n\t\trange.setStart(startTextNode, startTextPos);\n\t\trange.setEnd(endTextNode, endTextPos);\n\n\t\tconst sel = selection ? selection : window.getSelection();\n\t\tsel.removeAllRanges();\n\t\tsel.addRange(range);\n\t}\n\n\t// Returns an object containing a CSS field and value that\n\t// can be applied to a <div> contining text based on the\n\t// format type and action passed in.\n\tstatic convertFormat(format) {\n\t\tswitch (format.type) {\n\t\tcase \"bold\":\n\t\t\treturn { field: \"font-weight\", value: \"600\" };\n\n\t\tcase \"italics\":\n\t\t\treturn { field: \"font-style\", value: \"italic\" };\n\n\t\tcase \"fontType\": {\n\t\t\tconst fontFamily = this.getFontFamily(format.value);\n\t\t\treturn { field: \"font-family\", value: fontFamily };\n\t\t}\n\n\t\tcase \"textDecoration\": {\n\t\t\tswitch (format.value) {\n\t\t\tdefault:\n\t\t\tcase \"strikethrough\":\n\t\t\t\treturn { field: \"text-decoration\", value: \"line-through\" };\n\t\t\tcase \"underline\":\n\t\t\t\treturn { field: \"text-decoration\", value: \"underline\" };\n\t\t\tcase \"strikethrough underline\":\n\t\t\tcase \"underline strikethrough\":\n\t\t\t\treturn { field: \"text-decoration\", value: \"underline line-through\" };\n\t\t\t}\n\t\t}\n\n\t\tcase \"textColor\": {\n\t\t\treturn { field: \"color\", value: format.value };\n\t\t}\n\n\t\tcase \"backgroundColor\": {\n\t\t\treturn { field: \"background-color\", value: format.value };\n\t\t}\n\n\t\tcase \"textSize\": {\n\t\t\tconst size = format.value.substring(10);\n\t\t\treturn { field: \"font-size\", value: `${size}px` };\n\t\t}\n\n\t\tcase \"outlineStyle\": {\n\t\t\tswitch (format.value) {\n\t\t\tdefault:\n\t\t\tcase \"outline-solid\":\n\t\t\t\treturn { field: \"border-style\", value: \"solid\" };\n\t\t\tcase \"outline-none\":\n\t\t\t\treturn { field: \"border-style\", value: \"none\" };\n\t\t\t}\n\t\t}\n\n\t\tcase \"alignHorizontally\": {\n\t\t\tswitch (format.value) {\n\t\t\tdefault:\n\t\t\tcase \"align-left\":\n\t\t\t\treturn { field: \"text-align\", value: \"left\" };\n\t\t\tcase \"align-center\":\n\t\t\t\treturn { field: \"text-align\", value: \"center\" };\n\t\t\tcase \"align-right\":\n\t\t\t\treturn { field: \"text-align\", value: \"right\" };\n\t\t\t}\n\t\t}\n\n\t\tcase \"alignVertically\": {\n\t\t\tswitch (format.value) {\n\t\t\tdefault:\n\t\t\tcase \"align-top\":\n\t\t\t\treturn { field: \"vertical-align\", value: \"top\" };\n\t\t\tcase \"align-middle\":\n\t\t\t\treturn { field: \"vertical-align\", value: \"middle\" };\n\t\t\tcase \"align-bottom\":\n\t\t\t\treturn { field: \"vertical-align\", value: \"bottom\" };\n\t\t\t}\n\t\t}\n\n\t\tdefault:\n\t\t\treturn { field: format.type, value: format.value };\n\t\t}\n\t}\n\n\t// Returns a font family for the font action passed in.\n\tstatic getFontFamily(action) {\n\t\tswitch (action) {\n\t\tdefault:\n\t\tcase (\"font-ibm-plex-sans\"): return \"\\\"IBM Plex Sans\\\", sans-serif\";\n\t\tcase (\"font-ibm-plex-serif\"): return \"\\\"IBM Plex Serif\\\", serif\";\n\t\tcase (\"font-ibm-plex-sans-condensed\"): return \"IBM Plex Sans Condensed\";\n\t\tcase (\"font-ibm-plex-mono\"): return \"\\\"IBM Plex Mono\\\", monospace\";\n\t\tcase (\"font-arial\"): return \"\\\"Arial\\\", sans-serif\";\n\t\tcase (\"font-comic-sans-ms\"): return \"\\\"Comic Sans MS\\\", sans-serif\";\n\t\tcase (\"font-gill-sans\"): return \"\\\"Gill Sans\\\", sans-serif\";\n\t\tcase (\"font-helvetica-neue\"): return \"\\\"Helvetica Neue\\\", sans-serif\";\n\t\tcase (\"font-times-new-roman\"): return \"\\\"Times New Roman\\\", serif\";\n\t\tcase (\"font-verdana\"): return \"\\\"Verdana\\\", sans-serif\";\n\t\t}\n\t}\n\n\t// Returns the element passed in, or an ancestor of the element, if either\n\t// contains the classNames passed in. Otherwise it returns null if the\n\t// className cannot be found. For example, if this element is a child of the\n\t// node group object and \"d3-node-group\" is passed in, this function will\n\t// find the group element.\n\tstatic getParentElementWithClass(element, className) {\n\t\tlet el = element;\n\t\tlet foundElement = null;\n\n\t\twhile (el) {\n\t\t\t// No need to proceed if we find either of these. Stopping at svg-area\n\t\t\t// prevents the search transitioning from a sub-flow to a parent flow.\n\t\t\tif (this.isClassNameIncluded(el, \"d3-new-connection-guide\") ||\n\t\t\t\t\tthis.isClassNameIncluded(el, \"svg-area\")) {\n\t\t\t\tel = null;\n\n\t\t\t} else if (this.isClassNameIncluded(el, className)) {\n\t\t\t\tfoundElement = el;\n\t\t\t\tel = null;\n\t\t\t} else {\n\t\t\t\tel = el.parentNode;\n\t\t\t}\n\t\t}\n\t\treturn foundElement;\n\t}\n\n\t// Returns true if the class name passed in is one of the classes assigned\n\t// to the element passed in.\n\tstatic isClassNameIncluded(el, className) {\n\t\treturn el.classList && el.classList.contains(className);\n\t}\n\n\t// Returns the ID of the pipeline referenced by the supernode\n\t// passed in.\n\tstatic getSupernodePipelineId(supernode) {\n\t\tif (supernode.type === SUPER_NODE &&\n\t\t\t\thas(supernode, \"subflow_ref.pipeline_id_ref\")) {\n\t\t\treturn supernode.subflow_ref.pipeline_id_ref;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Convert now deprecated layout fields to the port positions arrays. The layout fields are\n\t// expected to provided in pairs. For example: inputPortTopPosX and inputPortTopPosY. However,\n\t// if they are not and only one of the pair is provided the functions in svg-canvas-utils.nodes.js\n\t// that calculate a x, y coordinate for the port will default to 0 if a value provided is undefined.\n\t// TODO - Remove this in a future major release.\n\tstatic convertPortPosInfo(layout) {\n\t\tconst newLayout = layout;\n\n\t\tif (!layout) {\n\t\t\treturn newLayout;\n\t\t}\n\n\t\t// If custom fields exist for input ports, write the values into the\n\t\t// inputPortPositions array and delete the redundant fields.\n\t\tif (isNumber(newLayout.inputPortTopPosX) || isNumber(newLayout.inputPortTopPosY)) {\n\t\t\tnewLayout.inputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.inputPortTopPosX, y_pos: newLayout.inputPortTopPosY, pos: \"topLeft\" }\n\t\t\t];\n\t\t\tdelete newLayout.inputPortTopPosX;\n\t\t\tdelete newLayout.inputPortTopPosY;\n\n\t\t} else if (isNumber(newLayout.inputPortBottomPosX) || isNumber(newLayout.inputPortBottomPosY)) {\n\t\t\tnewLayout.inputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.inputPortBottomPosX, y_pos: newLayout.inputPortBottomPosY, pos: \"bottomLeft\" }\n\t\t\t];\n\t\t\tdelete newLayout.inputPortBottomPosX;\n\t\t\tdelete newLayout.inputPortBottomPosY;\n\n\t\t} else if (isNumber(newLayout.inputPortLeftPosX) || isNumber(newLayout.inputPortLeftPosY)) {\n\t\t\tnewLayout.inputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.inputPortLeftPosX, y_pos: newLayout.inputPortLeftPosY, pos: \"topLeft\" }\n\t\t\t];\n\t\t\tdelete newLayout.inputPortLeftPosX;\n\t\t\tdelete newLayout.inputPortLeftPosY;\n\t\t}\n\n\t\t// If custom fields exist for output ports, write the values into the\n\t\t// outputPortPositions array and delete the redundant fields.\n\t\tif (isNumber(newLayout.outputPortTopPosX) || isNumber(newLayout.outputPortTopPosY)) {\n\t\t\tnewLayout.outputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.outputPortTopPosX, y_pos: newLayout.outputPortTopPosY, pos: \"topLeft\" }\n\t\t\t];\n\t\t\tdelete newLayout.outputPortTopPosX;\n\t\t\tdelete newLayout.outputPortTopPosY;\n\n\t\t} else if (isNumber(newLayout.outputPortBottomPosX) || isNumber(newLayout.outputPortBottomPosY)) {\n\t\t\tnewLayout.outputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.outputPortBottomPosX, y_pos: newLayout.outputPortBottomPosY, pos: \"bottomLeft\" }\n\t\t\t];\n\t\t\tdelete newLayout.outputPortBottomPosX;\n\t\t\tdelete newLayout.outputPortBottomPosY;\n\n\t\t} else if (isNumber(newLayout.outputPortRightPosX) || isNumber(newLayout.outputPortRightPosY)) {\n\t\t\tconst pos = newLayout.outputPortRightPosition || \"topRight\";\n\t\t\tnewLayout.outputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.outputPortRightPosX, y_pos: newLayout.outputPortRightPosY, pos: pos }\n\t\t\t];\n\t\t\tdelete newLayout.outputPortRightPosX;\n\t\t\tdelete newLayout.outputPortRightPosY;\n\t\t}\n\t\treturn newLayout;\n\t}\n\n\t// Convert now deprecated layout fields to the port objects arrays.\n\t// TODO - Remove this in a future major release.\n\tstatic convertPortDisplayInfo(layout) {\n\t\tconst newLayout = layout;\n\n\t\tif (!layout) {\n\t\t\treturn newLayout;\n\t\t}\n\n\t\t// If custom fields exist for input object info, write the values into the\n\t\t// inputPortDisplayObjects array.\n\t\tif (newLayout.inputPortObject === PORT_DISPLAY_IMAGE) {\n\t\t\tnewLayout.inputPortDisplayObjects = [\n\t\t\t\t{ type: PORT_DISPLAY_IMAGE,\n\t\t\t\t\tsrc: newLayout.inputPortImage,\n\t\t\t\t\theight: newLayout.inputPortHeight || PORT_HEIGHT_DEFAULT,\n\t\t\t\t\twidth: newLayout.inputPortWidth || PORT_WIDTH_DEFAULT\n\t\t\t\t}\n\t\t\t];\n\t\t}\n\n\t\tif (newLayout.inputPortGuideObject === PORT_DISPLAY_IMAGE) {\n\t\t\tnewLayout.inputPortGuideObjects = [\n\t\t\t\t{ type: PORT_DISPLAY_IMAGE,\n\t\t\t\t\tsrc: newLayout.inputPortGuideImage,\n\t\t\t\t\theight: newLayout.inputPortHeight || PORT_HEIGHT_DEFAULT,\n\t\t\t\t\twidth: newLayout.inputPortWidth || PORT_WIDTH_DEFAULT\n\t\t\t\t}\n\t\t\t];\n\t\t}\n\n\t\t// If custom fields exist for output object info, write the values into the\n\t\t// outputPortDisplayObjects array.\n\t\tif (newLayout.outputPortObject === PORT_DISPLAY_IMAGE) {\n\t\t\tnewLayout.outputPortDisplayObjects = [\n\t\t\t\t{ type: PORT_DISPLAY_IMAGE,\n\t\t\t\t\tsrc: newLayout.outputPortImage,\n\t\t\t\t\theight: newLayout.outputPortHeight || PORT_HEIGHT_DEFAULT,\n\t\t\t\t\twidth: newLayout.outputPortWidth || PORT_WIDTH_DEFAULT,\n\t\t\t\t}\n\t\t\t];\n\t\t}\n\n\t\tif (newLayout.outputPortGuideObject === PORT_DISPLAY_IMAGE) {\n\t\t\tnewLayout.outputPortGuideObjects = [\n\t\t\t\t{ type: PORT_DISPLAY_IMAGE,\n\t\t\t\t\tsrc: newLayout.outputPortGuideImage,\n\t\t\t\t\theight: newLayout.outputPortHeight || PORT_HEIGHT_DEFAULT,\n\t\t\t\t\twidth: newLayout.outputPortWidth || PORT_WIDTH_DEFAULT\n\t\t\t\t}\n\t\t\t];\n\t\t}\n\n\t\treturn newLayout;\n\t}\n}\n"],"names":["assignValue","require$$0","_assignValue","castPath","require$$1","_castPath","isIndex","require$$2","_isIndex","isObject","require$$3","isObject_1","toKey","require$$4","_baseSet","object","path","value","customizer","index","length","lastIndex","nested","key","newValue","objValue","undefined","baseSet","set_1","baseGetTag","_baseGetTag","isObjectLike","isNumber_1","_createForOfIteratorHelper","r","e","t","Symbol","iterator","Array","isArray","a","_arrayLikeToArray","toString","call","slice","constructor","name","from","test","_unsupportedIterableToArray","_n","F","s","n","done","f","TypeError","o","u","next","CanvasUtils","_classCallCheck","_createClass","objects","objectPositions","forEach","obj","id","x_pos","y_pos","links","positions","l","srcPos","_set","trgPos","supernode","nodeSizingDirection","newWidth","newHeight","updateNodePos","_this","this","newObjectPositions","incWidth","width","incHeight","height","superCenterX","superCenterY","deltas","getMoveDeltas","xDelta","yDelta","updateLinkPos","_this2","newLinkPositions","link","xPos","yPos","indexOf","canvasLayout","expanded_width","Math","max","supernodeDefaultWidth","expanded_height","supernodeDefaultHeight","node","targetNodes","linkType","padding","maxIncrement","getCountOfLinksToTargetNodes","layout","minInitialLineIncrement","minInitialLine","minFinalLine","_this3","count","outputs","output","isNodeOutputLinkedToTargetNodes","_this4","state","srcNodeId","srcNodePortId","isTargetNode","trgNodeId","findIndex","tn","baseDecs","arguments","overlayDecs","decs","map","bd","objDec","find","od","Object","assign","push","navigator","platform","evnt","stopPropagation","preventDefault","gridSize","div","abs","trunc","x","y","w","h","gap","originX","originY","endX","endY","startPointX","startPointY","topEdge","leftEdge","rightEdge","bottomEdge","originTopOffsetY","originLeftOffsetX","originRightOffsetX","originBottomOffsetY","originToEndX","originToEndY","dir","NORTH","SOUTH","ratioRight","EAST","ratioLeft","WEST","x1","y1","x2","y2","dx","dy","angleInDegrees","atan2","PI","botRightRatio","botLeftRatio","halfNodeWidth","halfNodeHeight","xFromCenter","yFromCenter","angleToRight","atan","angleToBottomRight","angleTopRight","angleToLeft","angleToTopLeft","angleToBottomLeft","rx1","ry1","rx2","ry2","insideLine","lineInside","intersectTop","linesIntersect","intersectLeft","intersectRight","intersectBottom","x3","y3","x4","y4","b","startPos","endPos","isInside","point1","point2","distance","sqrt","pow","p0","p1","p2","p3","config","enableEditingActions","isSuperBindingNode","enableResizableNodes","isExpandedSupernode","trgNodePortId","srcNode","trgNode","type","selfRefLinkAllowed","ASSOCIATION_LINK","isAssocConnectionAllowed","isDataConnectionAllowed","linkAlreadyExists","doesNodeHaveOutputPorts","isSrcCardinalityAtMax","doesNodeHaveInputPorts","isTrgCardinalityAtMax","inputs","isDataConnectionAllowedNoCardinality","getMaxCardinality","isCardinalityAtMax","areAllSrcNodePortsCardinalityAtMax","areAllTrgNodePortsCardinalityAtMax","exists","_this5","_this6","input","isNode","srcPortId","trgPortId","portId","_this7","getDefaultOutputPortId","srcCount","NODE_LINK","isFirstPort","maxCard","_this8","getDefaultInputPortId","trgCount","portArray","getPortIndex","port","p","ports","getPort","cardinality","Number","commentId","commentLinkAlreadyExists","detachedLinks","allNodeDataLinks","_this9","newLinks","oldLinks","nodeOverSrcPos","connected","isSrcConnectionAllowedWithDetachedLinks","getReplacedLinks","newLink","nodeOverTrgPos","isTrgConnectionAllowedWithDetachedLinks","nl","inReg","pipeline","includeLinks","enableAssocLinkType","_step","region","regionSelections","_iterator","nodes","err","_step2","_iterator2","comments","comment","_step3","_iterator3","LINK_TYPE_STRAIGHT","COMMENT_LINK","ASSOC_STRAIGHT","lineIntersectRectangle","isPosInArea","pos","area","pad","isComment","isLink","SUPER_NODE","is_expanded","isSupernode","isExpanded","d","isSupernodeInputBinding","isSupernodeOutputBinding","commentHighlightGap","nodeHighlightGap","allLinks","_this10","canvLeft","Infinity","canvTop","canvRight","canvBottom","nodeGap","min","left","top","right","bottom","defTrgPortId","filter","linkTrgPortId","part","style","style_temp","getStyleValue","_get","concat","inNodes","apiPipeline","trgCenterX","trgCenterY","getNode","srcCenterX","srcCenterY","drawNodeLinkLineFromTo","imagePosX","imageWidth","imagePosY","imageHeight","getOuterCoord","currentLinks","outLinks","some","cl","className","hex","c","substring","rgb","parseInt","commentSel","formats","startsWith","_CanvasUtils$convertF","convertFormat","field","_CanvasUtils$convertF2","domNode","anchorPos","focusPos","sel","window","getSelection","runningLen","childNodes","cn","nodeValue","textLen","anchorNode","anchorOffset","focusNode","focusOffset","start","end","range","document","createRange","selectNodeContents","removeAllRanges","addRange","selection","startTextNode","endTextNode","startTextPos","endTextPos","setStart","setEnd","format","getFontFamily","size","action","element","el","foundElement","isClassNameIncluded","parentNode","classList","contains","_has","subflow_ref","pipeline_id_ref","newLayout","_isNumber","inputPortTopPosX","inputPortTopPosY","inputPortPositions","inputPortBottomPosX","inputPortBottomPosY","inputPortLeftPosX","inputPortLeftPosY","outputPortTopPosX","outputPortTopPosY","outputPortPositions","outputPortBottomPosX","outputPortBottomPosY","outputPortRightPosX","outputPortRightPosY","outputPortRightPosition","inputPortObject","PORT_DISPLAY_IMAGE","inputPortDisplayObjects","src","inputPortImage","inputPortHeight","PORT_HEIGHT_DEFAULT","inputPortWidth","PORT_WIDTH_DEFAULT","inputPortGuideObject","inputPortGuideObjects","inputPortGuideImage","outputPortObject","outputPortDisplayObjects","outputPortImage","outputPortHeight","outputPortWidth","outputPortGuideObject","outputPortGuideObjects","outputPortGuideImage"],"mappings":"mIAAIA,EAAcC,EAAyBC,aACvCC,EAAWC,EAAsBC,UACjCC,EAAUC,EAAqBC,SAC/BC,EAAWC,EAAqBC,WAChCC,EAAQC,EAAAA,OA8CZ,IAAAC,EAlCA,SAAiBC,EAAQC,EAAMC,EAAOC,GACpC,IAAKT,EAASM,GACZ,OAAOA,EAST,IALA,IAAII,GAAS,EACTC,GAHJJ,EAAOb,EAASa,EAAMD,IAGJK,OACdC,EAAYD,EAAS,EACrBE,EAASP,EAEI,MAAVO,KAAoBH,EAAQC,GAAQ,CACzC,IAAIG,EAAMX,EAAMI,EAAKG,IACjBK,EAAWP,EAEf,GAAY,cAARM,GAA+B,gBAARA,GAAiC,cAARA,EAClD,OAAOR,EAGT,GAAII,GAASE,EAAW,CACtB,IAAII,EAAWH,EAAOC,QAELG,KADjBF,EAAWN,EAAaA,EAAWO,EAAUF,EAAKD,QAAUI,KAE1DF,EAAWf,EAASgB,GAChBA,EACCnB,EAAQU,EAAKG,EAAQ,IAAM,GAAK,CAAA,EAExC,CACDnB,EAAYsB,EAAQC,EAAKC,GACzBF,EAASA,EAAOC,EACjB,CACD,OAAOR,CACT,EChDIY,EAAU1B,EAkCd,IAAA2B,EAJA,SAAab,EAAQC,EAAMC,GACzB,OAAiB,MAAVF,EAAiBA,EAASY,EAAQZ,EAAQC,EAAMC,EACzD,EChCIY,EAAa5B,EAAwB6B,YACrCC,EAAe3B,EAAAA,eAoCnB,IAAA4B,EALA,SAAkBf,GAChB,MAAuB,iBAATA,GACXc,EAAad,IA9BF,mBA8BYY,EAAWZ,EACvC,ECfA,SAAAgB,EAAAC,EAAAC,OAAAC,EAAA,oBAAAC,QAAAH,EAAAG,OAAAC,WAAAJ,EAAAE,cAAAA,IAAAA,EAAAG,CAAAA,GAAAA,MAAAC,QAAAN,KAAAE,EAAA,SAAAF,EAAAO,GAAA,GAAAP,EAA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6M,EAAkBA,mBACzBE,IAAKpB,EAAUqB,eACfvW,OAAQkV,EAAUsB,iBAAmBC,EAAmBA,oBACxD3W,MAAOoV,EAAUwB,gBAAkBC,EAAAA,sBAKlCzB,EAAU0B,uBAAyBR,uBACtClB,EAAU2B,sBAAwB,CACjC,CAAEtN,KAAM6M,EAAkBA,mBACzBE,IAAKpB,EAAU4B,oBACf9W,OAAQkV,EAAUsB,iBAAmBC,EAAmBA,oBACxD3W,MAAOoV,EAAUwB,gBAAkBC,EAAAA,sBAOlCzB,EAAU6B,mBAAqBX,uBAClClB,EAAU8B,yBAA2B,CACpC,CAAEzN,KAAM6M,EAAkBA,mBACzBE,IAAKpB,EAAU+B,gBACfjX,OAAQkV,EAAUgC,kBAAoBT,EAAmBA,oBACzD3W,MAAOoV,EAAUiC,iBAAmBR,EAAAA,sBAKnCzB,EAAUkC,wBAA0BhB,uBACvClB,EAAUmC,uBAAyB,CAClC,CAAE9N,KAAM6M,EAAkBA,mBACzBE,IAAKpB,EAAUoC,qBACftX,OAAQkV,EAAUgC,kBAAoBT,EAAmBA,oBACzD3W,MAAOoV,EAAUiC,iBAAmBR,EAAAA,sBAKhCzB,GA/CCA,CAgDT,IAAC,CAtsD8B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common-canvas-utils-cc218b20.js","sources":["../node_modules/lodash/_baseSet.js","../node_modules/lodash/set.js","../node_modules/lodash/isNumber.js","../src/common-canvas/common-canvas-utils.js"],"sourcesContent":["var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nmodule.exports = baseSet;\n","var baseSet = require('./_baseSet');\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n","/*\n * Copyright 2017-2024 Elyra Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint no-bitwise: \"off\" */\n\n// This class contains utility functions that may be used for both the canvas\n// objects stored in redux and also the copy of canvas objects maintained by\n// the CanvasRender objects.\n\nimport { get, has, isNumber, set } from \"lodash\";\nimport { ASSOCIATION_LINK, ASSOC_STRAIGHT, COMMENT_LINK, NODE_LINK,\n\tLINK_TYPE_STRAIGHT, SUPER_NODE, NORTH, SOUTH, EAST, WEST,\n\tPORT_DISPLAY_IMAGE, PORT_WIDTH_DEFAULT, PORT_HEIGHT_DEFAULT,\n} from \"../common-canvas/constants/canvas-constants.js\";\n\nexport default class CanvasUtils {\n\n\tstatic getObjectPositions(objects) {\n\t\tconst objectPositions = {};\n\t\tobjects.forEach((obj) => {\n\t\t\tobjectPositions[obj.id] = { x_pos: obj.x_pos, y_pos: obj.y_pos };\n\t\t});\n\t\treturn objectPositions;\n\t}\n\n\tstatic getLinkPositions(links) {\n\t\tconst positions = {};\n\t\tlinks.forEach((l) => {\n\t\t\tif (l.srcPos) {\n\t\t\t\tset(positions[l.id], \"srcPos.x_pos\", l.srcPos.x_pos);\n\t\t\t\tset(positions[l.id], \"srcPos.y_pos\", l.srcPos.y_pos);\n\t\t\t}\n\t\t\tif (l.trgPos) {\n\t\t\t\tif (!positions[l.id]) {\n\t\t\t\t\tpositions[l.id] = {};\n\t\t\t\t}\n\t\t\t\tset(positions[l.id], \"trgPos.x_pos\", l.trgPos.x_pos);\n\t\t\t\tset(positions[l.id], \"trgPos.y_pos\", l.trgPos.y_pos);\n\t\t\t}\n\t\t});\n\t\treturn positions;\n\t}\n\n\tstatic moveSurroundingObjects(supernode, objects, nodeSizingDirection, newWidth, newHeight, updateNodePos) {\n\t\tconst newObjectPositions = {};\n\t\tconst incWidth = newWidth - supernode.width;\n\t\tconst incHeight = newHeight - supernode.height;\n\t\tconst superCenterX = supernode.x_pos + (supernode.width / 2);\n\t\tconst superCenterY = supernode.y_pos + (supernode.height / 2);\n\n\t\tobjects.forEach((obj) => {\n\t\t\tif (obj.id === supernode.id) {\n\t\t\t\treturn; // Ignore the supernode\n\t\t\t}\n\n\t\t\tconst deltas = this.getMoveDeltas(\n\t\t\t\tobj.x_pos + (obj.width / 2), // Center of obj horizontally\n\t\t\t\tobj.y_pos + (obj.height / 2), // Center of obj vertically\n\t\t\t\tnodeSizingDirection, superCenterX, superCenterY, incWidth, incHeight);\n\n\t\t\tif (deltas.xDelta !== 0 || deltas.yDelta !== 0) {\n\t\t\t\tnewObjectPositions[obj.id] = {\n\t\t\t\t\tid: obj.id,\n\t\t\t\t\tx_pos: obj.x_pos + deltas.xDelta,\n\t\t\t\t\ty_pos: obj.y_pos + deltas.yDelta,\n\t\t\t\t\twidth: obj.width,\n\t\t\t\t\theight: obj.height\n\t\t\t\t};\n\n\t\t\t\tif (updateNodePos) {\n\t\t\t\t\tobj.x_pos += deltas.xDelta;\n\t\t\t\t\tobj.y_pos += deltas.yDelta;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn newObjectPositions;\n\t}\n\n\tstatic moveSurroundingDetachedLinks(supernode, links, nodeSizingDirection, newWidth, newHeight, updateLinkPos) {\n\t\tconst newLinkPositions = {};\n\t\tconst incWidth = newWidth - supernode.width;\n\t\tconst incHeight = newHeight - supernode.height;\n\t\tconst superCenterX = supernode.x_pos + (supernode.width / 2);\n\t\tconst superCenterY = supernode.y_pos + (supernode.height / 2);\n\n\t\tlinks.forEach((link) => {\n\t\t\t// If link has 'srcPos' it is detached at source end.\n\t\t\tif (link.srcPos) {\n\t\t\t\tconst deltas = this.getMoveDeltas(link.srcPos.x_pos, link.srcPos.y_pos,\n\t\t\t\t\tnodeSizingDirection, superCenterX, superCenterY, incWidth, incHeight);\n\n\t\t\t\tif (deltas.xDelta !== 0 || deltas.yDelta !== 0) {\n\t\t\t\t\tif (!newLinkPositions[link.id]) {\n\t\t\t\t\t\tnewLinkPositions[link.id] = { id: link.id };\n\t\t\t\t\t}\n\t\t\t\t\tset(newLinkPositions[link.id], \"srcPos.x_pos\", link.srcPos.x_pos + deltas.xDelta);\n\t\t\t\t\tset(newLinkPositions[link.id], \"srcPos.y_pos\", link.srcPos.y_pos + deltas.yDelta);\n\n\t\t\t\t\tif (updateLinkPos) {\n\t\t\t\t\t\tlink.srcPos.x_pos += deltas.xDelta;\n\t\t\t\t\t\tlink.srcPos.y_pos += deltas.yDelta;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If link has 'trgPos' it is detached at target end.\n\t\t\tif (link.trgPos) {\n\t\t\t\tconst deltas = this.getMoveDeltas(link.trgPos.x_pos, link.trgPos.y_pos,\n\t\t\t\t\tnodeSizingDirection, superCenterX, superCenterY, incWidth, incHeight);\n\n\t\t\t\tif (deltas.xDelta !== 0 || deltas.yDelta !== 0) {\n\t\t\t\t\tif (!newLinkPositions[link.id]) {\n\t\t\t\t\t\tnewLinkPositions[link.id] = { id: link.id };\n\t\t\t\t\t}\n\t\t\t\t\tset(newLinkPositions[link.id], \"trgPos.x_pos\", link.trgPos.x_pos + deltas.xDelta);\n\t\t\t\t\tset(newLinkPositions[link.id], \"trgPos.y_pos\", link.trgPos.y_pos + deltas.yDelta);\n\t\t\t\t}\n\t\t\t\tif (updateLinkPos) {\n\t\t\t\t\tlink.trgPos.x_pos += deltas.xDelta;\n\t\t\t\t\tlink.trgPos.y_pos += deltas.yDelta;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn newLinkPositions;\n\t}\n\n\tstatic getMoveDeltas(xPos, yPos, nodeSizingDirection, superCenterX, superCenterY, incWidth, incHeight) {\n\t\tlet xDelta = 0;\n\t\tlet yDelta = 0;\n\n\t\tif (nodeSizingDirection.indexOf(\"n\") > -1 && yPos < superCenterY - 20) {\n\t\t\tyDelta = -incHeight;\n\n\t\t} else if (nodeSizingDirection.indexOf(\"s\") > -1 && yPos > superCenterY + 20) {\n\t\t\tyDelta = incHeight;\n\t\t}\n\n\t\tif (nodeSizingDirection.indexOf(\"w\") > -1 && xPos < superCenterX - 20) {\n\t\t\txDelta = -incWidth;\n\n\t\t} else if (nodeSizingDirection.indexOf(\"e\") > -1 && xPos > superCenterX + 20) {\n\t\t\txDelta = incWidth;\n\t\t}\n\t\treturn { xDelta, yDelta };\n\t}\n\n\t// Returns the expanded width for the supernode passed in. This might be\n\t// stored in the supernode itself or, if not, it needs to be calculated.\n\t// It may not be assigned to the supernode to allow the extended width to\n\t// change based on the node type selected (this is more for use in the test\n\t// harness than in a real application).\n\tstatic getSupernodeExpandedWidth(supernode, canvasLayout) {\n\t\treturn supernode.expanded_width ? supernode.expanded_width : Math.max(canvasLayout.supernodeDefaultWidth, supernode.width);\n\t}\n\n\t// Returns the expanded height for the supernode passed in. This might be\n\t// stored in the supernode itself or, if not, it needs to be calculated.\n\t// It may not be assigned to the supernode to allow the extended height to\n\t// change based on the node type selected (this is more for use in the test\n\t// harness than in a real application).\n\tstatic getSupernodeExpandedHeight(supernode, canvasLayout) {\n\t\treturn supernode.expanded_height ? supernode.expanded_height : Math.max(canvasLayout.supernodeDefaultHeight, supernode.height);\n\t}\n\n\t// ---------------------------------------------------------------------------\n\t// The methods below calculate the padding needed to display connection lines\n\t// ---------------------------------------------------------------------------\n\n\t// Returns the maximum padding needed to display any elbow lines, that emanate\n\t// from the node passed in, to the set of target nodes passed in.\n\tstatic getNodePaddingToTargetNodes(node, targetNodes, links, linkType) {\n\t\tlet padding = 0;\n\t\tif (linkType === \"Elbow\") {\n\t\t\tconst maxIncrement = this.getCountOfLinksToTargetNodes(node, targetNodes, links) * node.layout.minInitialLineIncrement;\n\t\t\tpadding = node.layout.minInitialLine + node.layout.minFinalLine + maxIncrement;\n\t\t} else {\n\t\t\tpadding = 2 * node.layout.minInitialLine;\n\t\t}\n\t\treturn padding;\n\t}\n\n\t// Returns the count of links from the node passed in to the set of target\n\t// nodes passed in.\n\tstatic getCountOfLinksToTargetNodes(node, targetNodes, links) {\n\t\tlet count = 0;\n\t\tif (node.outputs && node.outputs.length > 0) {\n\t\t\tnode.outputs.forEach((output) => {\n\t\t\t\tif (this.isNodeOutputLinkedToTargetNodes(node, output, targetNodes, links)) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn count;\n\t}\n\n\t// Returns true if the node and output passed in are linked to any of the\n\t// target nodes passed in.\n\tstatic isNodeOutputLinkedToTargetNodes(node, output, targetNodes, links) {\n\t\tlet state = false;\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.srcNodeId === node.id && link.srcNodePortId === output.id && this.isTargetNode(link.trgNodeId, targetNodes)) {\n\t\t\t\tstate = true;\n\t\t\t}\n\t\t});\n\t\treturn state;\n\t}\n\n\t// Returns true if the node identified by targetNodeId is in the set\n\t// of target nodes passed in.\n\tstatic isTargetNode(trgNodeId, targetNodes) {\n\t\treturn targetNodes.findIndex((tn) => tn.id === trgNodeId) > -1;\n\t}\n\n\t// Returns an array of decorations that is a combination of the two input\n\t// arrays where the decorations from the overlayDecs array are overlaid on\n\t// top of those from the baseDecs array.\n\tstatic getCombinedDecorations(baseDecs = [], overlayDecs = []) {\n\t\tconst decs = baseDecs.map((bd) => {\n\t\t\tconst objDec = overlayDecs.find((od) => od.id === bd.id);\n\t\t\tif (objDec) {\n\t\t\t\treturn Object.assign({}, bd, objDec);\n\t\t\t}\n\t\t\treturn bd;\n\t\t});\n\n\t\tif (overlayDecs) {\n\t\t\toverlayDecs.forEach((od) => {\n\t\t\t\tconst index = baseDecs.findIndex((bd) => bd.id === od.id);\n\t\t\t\tif (index === -1) {\n\t\t\t\t\tdecs.push(od);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn decs;\n\t}\n\n\t// Returns whether user platform is Mac.\n\tstatic isMacintosh() {\n\t\treturn navigator.platform.indexOf(\"Mac\") > -1;\n\t}\n\n\t// Stops propagation of events and prevents any default behavior from\n\t// being executed. evnt can be either a regular event object OR the\n\t// d3event object provided by d3.\n\tstatic stopPropagationAndPreventDefault(evnt) {\n\t\tevnt.stopPropagation();\n\t\tevnt.preventDefault();\n\t}\n\n\t// Returns a snap-to-grid value for the value passed in based on a grid\n\t// size defined by the gridSize passed in.\n\tstatic snapToGrid(value, gridSize) {\n\t\tconst div = value / gridSize;\n\t\tlet abs = Math.trunc(div);\n\t\tconst remainder = div - abs;\n\n\t\tif (remainder > 0.5) {\n\t\t\tabs++;\n\t\t}\n\n\t\treturn abs * gridSize;\n\t}\n\n\t// Returns the coordinate position along the edge of a rectangle where a\n\t// straight line should be drawn from. The line's direction originates from an\n\t// arbitrary point (origin) within the rectangle and goes to an arbitrary\n\t// point (end) outside the rectangle. The rectangle is described by the\n\t// first four paramters. The gap is an additional spacing around the\n\t// rectangle used to separate the start of the line from the\n\t// rectangle/node boundary. The origin of the line's direction is described by\n\t// originX and originY. The end point of the line is described by endX and endY.\n\tstatic getOuterCoord(x, y, w, h, gap, originX, originY, endX, endY) {\n\t\tconst topEdge = y - gap;\n\t\tconst leftEdge = x - gap;\n\t\tconst rightEdge = x + w + gap;\n\t\tconst bottomEdge = y + h + gap;\n\n\t\t// The origin may not be in the center of the node rectangle so offset left\n\t\t// and right may be different and also top and bottom.\n\t\tconst originTopOffsetY = originY - topEdge;\n\t\tconst originLeftOffsetX = originX - leftEdge;\n\t\tconst originRightOffsetX = rightEdge - originX;\n\t\tconst originBottomOffsetY = bottomEdge - originY;\n\n\t\tconst originToEndX = originX - endX;\n\t\tconst originToEndY = originY - endY;\n\n\t\tvar startPointX;\n\t\tvar startPointY;\n\t\tlet dir = NORTH;\n\n\t\tif (originToEndX === 0) {\n\t\t\tstartPointX = originX;\n\t\t\tstartPointY = (endY < originY) ? topEdge : bottomEdge;\n\t\t\tdir = originToEndY > 0 ? NORTH : SOUTH;\n\n\t\t} else if (endX > originX) {\n\t\t\tconst topRightRatio = originTopOffsetY / (originX - rightEdge);\n\t\t\tconst botRightRatio = (originY - bottomEdge) / (originX - rightEdge);\n\t\t\tconst ratioRight = originToEndY / originToEndX;\n\n\t\t\t// North\n\t\t\tif (ratioRight < topRightRatio) {\n\t\t\t\tstartPointX = originX - (originTopOffsetY / ratioRight);\n\t\t\t\tstartPointY = topEdge;\n\t\t\t// South\n\t\t\t} else if (ratioRight > botRightRatio) {\n\t\t\t\tstartPointX = originX + (originBottomOffsetY / ratioRight);\n\t\t\t\tstartPointY = bottomEdge;\n\t\t\t\tdir = SOUTH;\n\t\t\t// East\n\t\t\t} else {\n\t\t\t\tstartPointX = rightEdge;\n\t\t\t\tstartPointY = originY + (originRightOffsetX * ratioRight);\n\t\t\t\tdir = EAST;\n\t\t\t}\n\t\t// End point is to the left of center\n\t\t} else {\n\t\t\tconst topLeftRatio = originTopOffsetY / originLeftOffsetX;\n\t\t\tconst botLeftRatio = (originY - bottomEdge) / originLeftOffsetX;\n\t\t\tconst ratioLeft = originToEndY / originToEndX;\n\n\t\t\t// North\n\t\t\tif (ratioLeft > topLeftRatio) {\n\t\t\t\tstartPointX = originX - (originTopOffsetY / ratioLeft);\n\t\t\t\tstartPointY = topEdge;\n\t\t\t// South\n\t\t\t} else if (ratioLeft < botLeftRatio) {\n\t\t\t\tstartPointX = originX + (originBottomOffsetY / ratioLeft);\n\t\t\t\tstartPointY = bottomEdge;\n\t\t\t\tdir = SOUTH;\n\t\t\t// West\n\t\t\t} else {\n\t\t\t\tstartPointX = leftEdge;\n\t\t\t\tstartPointY = originY - (originLeftOffsetX * ratioLeft);\n\t\t\t\tdir = WEST;\n\t\t\t}\n\t\t}\n\n\t\treturn { x: startPointX, y: startPointY, originX, originY, dir };\n\t}\n\n\t// Assisted by WCA@IBM\n\t// Latest GenAI contribution: ibm/granite-20b-code-instruct-v2\n\t// Returns the angle between two points where the angle\n\t// returned is always positive. The angle starts at the 3 o'clock\n\t// position which is 0 degrees and increases in a clock-wise\n\t// direction.\n\tstatic calculateAngle(x1, y1, x2, y2) {\n\t\tconst dx = x2 - x1;\n\t\tconst dy = y2 - y1;\n\t\tconst angle = Math.atan2(dy, dx);\n\t\tlet angleInDegrees = angle * (180 / Math.PI);\n\t\tif (angleInDegrees < 0) {\n\t\t\tangleInDegrees += 360;\n\t\t}\n\t\treturn angleInDegrees;\n\t}\n\n\t// Returns a direction NORTH, SOUTH, EAST or WEST which is the direction\n\t// from the origin position within the rectangle described by x, y, w and h\n\t// to the end position described by endX and endY.\n\tstatic getDir(x, y, w, h, originX, originY, endX, endY) {\n\t\tconst bottomEdge = y + h;\n\n\t\t// The origin may not be in the center of the node rectangle so offset left\n\t\t// and right may be different and also top and bottom.\n\t\tconst originTopOffsetY = originY - y;\n\t\tconst originLeftOffsetX = originX - x;\n\n\t\tconst originToEndX = originX - endX;\n\t\tconst originToEndY = originY - endY;\n\n\t\tlet dir = \"\";\n\n\t\tif (originToEndX === 0) {\n\t\t\tdir = (endY < originY) ? NORTH : SOUTH;\n\n\t\t} else if (endX > originX) {\n\t\t\tconst rightEdge = x + w;\n\t\t\tconst topRightRatio = originTopOffsetY / (originX - rightEdge);\n\t\t\tconst botRightRatio = (originY - bottomEdge) / (originX - rightEdge);\n\t\t\tconst ratioRight = originToEndY / originToEndX;\n\n\t\t\tif (ratioRight < topRightRatio) {\n\t\t\t\tdir = NORTH;\n\t\t\t} else if (ratioRight > botRightRatio) {\n\t\t\t\tdir = SOUTH;\n\t\t\t} else {\n\t\t\t\tdir = EAST;\n\t\t\t}\n\t\t// End point is to the left of center\n\t\t} else {\n\t\t\tconst topLeftRatio = originTopOffsetY / originLeftOffsetX;\n\t\t\tconst botLeftRatio = (originY - bottomEdge) / originLeftOffsetX;\n\t\t\tconst ratioLeft = originToEndY / originToEndX;\n\n\t\t\tif (ratioLeft > topLeftRatio) {\n\t\t\t\tdir = NORTH;\n\t\t\t} else if (ratioLeft < botLeftRatio) {\n\t\t\t\tdir = SOUTH;\n\t\t\t} else {\n\t\t\t\tdir = WEST;\n\t\t\t}\n\t\t}\n\n\t\treturn dir;\n\t}\n\n\t// Returns a direction (n, s, e or w) of a port at the\n\t// x, y position on a node. This is the direction that\n\t// would be taken by an outgoing link from a source node\n\t// or an incoming link to a target node.\n\tstatic getPortDir(x, y, node) {\n\t\tconst halfNodeWidth = (node.width / 2);\n\t\tconst halfNodeHeight = (node.height / 2);\n\t\tconst xFromCenter = x - halfNodeWidth;\n\t\tconst yFromCenter = y - halfNodeHeight;\n\t\t// In the center horizontally\n\t\tif (xFromCenter === 0) {\n\t\t\tif (yFromCenter > 0) {\n\t\t\t\treturn SOUTH;\n\t\t\t}\n\t\t\treturn NORTH;\n\n\t\t// To the right\n\t\t} else if (xFromCenter > 0) {\n\t\t\tconst angleToRight = Math.atan(yFromCenter / xFromCenter);\n\t\t\tconst angleToBottomRight = Math.atan(halfNodeHeight / halfNodeWidth);\n\t\t\tconst angleTopRight = -angleToBottomRight;\n\t\t\tif (angleToRight === 0) {\n\t\t\t\treturn EAST;\n\t\t\t} else if (angleToRight < angleTopRight) {\n\t\t\t\treturn NORTH;\n\t\t\t} else if (angleToRight > angleToBottomRight) {\n\t\t\t\treturn SOUTH;\n\t\t\t}\n\t\t\treturn EAST;\n\n\t\t}\n\t\t// To the left\n\t\tconst angleToLeft = Math.atan(yFromCenter / xFromCenter);\n\t\tconst angleToTopLeft = Math.atan(halfNodeHeight / halfNodeWidth);\n\t\tconst angleToBottomLeft = -angleToTopLeft;\n\t\tif (angleToLeft === 0) {\n\t\t\treturn WEST;\n\t\t} else if (angleToLeft > angleToTopLeft) {\n\t\t\treturn NORTH;\n\t\t} else if (angleToLeft < angleToBottomLeft) {\n\t\t\treturn SOUTH;\n\t\t}\n\t\treturn WEST;\n\t}\n\n\n\t// Returns true if the line described by x1, y1, x2, y2 either intersects or\n\t// is fully inside the rectangle described by rx1, ry1, rx2, ry2.\n\tstatic lineIntersectRectangle(x1, y1, x2, y2, rx1, ry1, rx2, ry2) {\n\t\tconst insideLine = this.lineInside(x1, y1, x2, y2, rx1, ry1, rx2, ry2);\n\t\tconst intersectTop = this.linesIntersect(x1, y1, x2, y2, rx1, ry1, rx2, ry1);\n\t\tconst intersectLeft = this.linesIntersect(x1, y1, x2, y2, rx1, ry1, rx1, ry2);\n\t\tconst intersectRight = this.linesIntersect(x1, y1, x2, y2, rx2, ry1, rx2, ry2);\n\t\tconst intersectBottom = this.linesIntersect(x1, y1, x2, y2, rx1, ry2, rx2, ry2);\n\n\t\treturn insideLine || intersectTop || intersectLeft || intersectRight || intersectBottom;\n\t}\n\n\t// Returns true if the line described by x1, y1, x2, y2 is inside the\n\t// rectangle described by rx1, ry1, rx2, ry2.\n\tstatic lineInside(x1, y1, x2, y2, rx1, ry1, rx2, ry2) {\n\t\treturn x1 >= rx1 && x1 <= rx2 && y1 >= ry1 && y1 <= ry2 &&\n\t\t\tx2 >= rx1 && x2 <= rx2 && y2 >= ry1 && y2 <= ry2;\n\t}\n\n\t// Returns an object containing x, y coordinate of the intersection point\n\t// if the line described by x1, y1 to x2, y2 crosses the line described by\n\t// x3, y3 to x4, y4. Returns a null if the lines do not cross.\n\t// See http://www.jeffreythompson.org/collision-detection/line-line.php\n\tstatic linesIntersect(x1, y1, x2, y2, x3, y3, x4, y4) {\n\t\t// calculate the distance to intersection point\n\t\tconst a = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1));\n\t\tconst b = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / ((y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1));\n\n\t\t// If a and b are between 0-1, lines intersect, so return the intersection point.\n\t\tif (a >= 0 && a <= 1 && b >= 0 && b <= 1) {\n\t\t\treturn {\n\t\t\t\tx: x1 + (a * (x2 - x1)),\n\t\t\t\ty: y1 + (a * (y2 - y1))\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns true if the distance between the two positions is smaller than\n\t// 3px which is considered to be a tiny movement. This can be used to define\n\t// whether a mouse pointer gesture is considered to be a click on an object or, if\n\t// outside the 3px distance, a drag.\n\tstatic isTinyMovement(startPos, endPos) {\n\t\treturn CanvasUtils.isInside(startPos, endPos, 3);\n\t}\n\n\t// Returns true if the distance from point 1 to point 2 is less than the\n\t// distance passed in.\n\tstatic isInside(point1, point2, distance) {\n\t\treturn Math.sqrt(Math.pow(point1.x - point2.x, 2) + Math.pow(point1.y - point2.y, 2)) < distance;\n\t}\n\n\t// Returns the distance from the start point to finish point of the link line.\n\tstatic getLinkDistance(link) {\n\t\tconst x = link.x2 - link.x1;\n\t\tconst y = link.y2 - link.y1;\n\n\t\treturn Math.sqrt((x * x) + (y * y));\n\t}\n\n\t// Return the center point of a quadratic bezier curve where p0 is the\n\t// start point, p1 is the control point and p2 is the end point.\n\t// This works for either the x or y coordinate.\n\tstatic getCenterPointQuadBezier(p0, p1, p2) {\n\t\tconst t = 0.5;\n\t\treturn (1 - t) * (1 - t) * p0 + 2 * (1 - t) * t * p1 + t * t * p2;\n\t}\n\n\t// Return the center point of a cubic bezier curve where p0 is the\n\t// start point, p1 and p2 are the control points and p3 is the end point.\n\t// This works for either the x or y coordinate.\n\tstatic getCenterPointCubicBezier(p0, p1, p2, p3) {\n\t\tconst t = 0.5;\n\t\treturn (1 - t) * (1 - t) * (1 - t) * p0 + 3 * (1 - t) * (1 - t) * t * p1 + 3 * (1 - t) * t * t * p2 + t * t * t * p3;\n\t}\n\n\t// Returns true if the node passed in should be resizeable. All nodes are resizabele\n\t// except binding nodes in a sub-flow when enableResizableNodes is switched on.\n\tstatic isNodeResizable(node, config) {\n\t\tif (!config.enableEditingActions ||\n\t\t\t\tthis.isSuperBindingNode(node) ||\n\t\t\t\t(!config.enableResizableNodes && !this.isExpandedSupernode(node))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t// Returns true if a link of type `type` can be created between the two\n\t// node/port combinations provided given the set of current links provided.\n\tstatic isConnectionAllowed(srcNodePortId, trgNodePortId, srcNode, trgNode, links, type, selfRefLinkAllowed) {\n\t\tif (type === ASSOCIATION_LINK) {\n\t\t\treturn this.isAssocConnectionAllowed(srcNode, trgNode, links);\n\t\t}\n\t\treturn this.isDataConnectionAllowed(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed);\n\t}\n\n\t// Returns true if a node-node data link can be created between the two\n\t// node/port combinations provided on a canvas where detached links are\n\t// allowed, given the set of current link provided.\n\tstatic isConnectionAllowedWithDetachedLinks(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed) {\n\t\tif (srcNode && trgNode && srcNode.id === trgNode.id && !selfRefLinkAllowed) { // Cannot connect to ourselves.\n\t\t\treturn false;\n\t\t}\n\n\t\tif (srcNode && trgNode && this.linkAlreadyExists(srcNodePortId, trgNodePortId, srcNode, trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if a connection is allowed to the source node and port\n\t// passed in given the set of current links.\n\tstatic isSrcConnectionAllowedWithDetachedLinks(srcNodePortId, srcNode, links) {\n\t\tif (srcNode && !this.doesNodeHaveOutputPorts(srcNode)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (srcNode && this.isSrcCardinalityAtMax(srcNodePortId, srcNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if a connection is allowed to the target node and port\n\t// passed in given the set of current links.\n\tstatic isTrgConnectionAllowedWithDetachedLinks(trgNodePortId, trgNode, links) {\n\t\tif (trgNode && !this.doesNodeHaveInputPorts(trgNode)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (trgNode && this.isTrgCardinalityAtMax(trgNodePortId, trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if the node has input ports.\n\tstatic doesNodeHaveInputPorts(node) {\n\t\treturn node.inputs && node.inputs.length > 0;\n\t}\n\n\t// Returns true if the node has output ports.\n\tstatic doesNodeHaveOutputPorts(node) {\n\t\treturn node.outputs && node.outputs.length > 0;\n\t}\n\n\t// Returns true if an existing link to the target node and port can be\n\t// replaced with a new link from the srcNode to the trgNode and trgPortId.\n\tstatic isDataLinkReplacementAllowed(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed) {\n\n\t\tif (!this.isDataConnectionAllowedNoCardinality(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Link replacement is only allowed when the input port has a maximum\n\t\t// cardinality of one.\n\t\tif (this.getMaxCardinality(trgNodePortId, trgNode.inputs) !== 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!this.isTrgCardinalityAtMax(trgNodePortId, trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t// Returns true if a regular node-node data link can be created between the\n\t// two node/port combinations provided, given the current set of links\n\t// passed in.\n\tstatic isDataConnectionAllowed(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed) {\n\n\t\tif (!this.isDataConnectionAllowedNoCardinality(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.isCardinalityAtMax(srcNodePortId, trgNodePortId, srcNode, trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if a regular node-node data link can be created between the\n\t// two node/port combinations provided, without checking on cardinalities of\n\t// the source or target nodes.\n\tstatic isDataConnectionAllowedNoCardinality(srcNodePortId, trgNodePortId, srcNode, trgNode, links, selfRefLinkAllowed) {\n\n\t\tif (!srcNode || !trgNode) { // Source or target are not valid.\n\t\t\treturn false;\n\t\t}\n\n\t\tif (srcNode.id === trgNode.id && !selfRefLinkAllowed) { // Cannot connect to ourselves.\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!this.doesNodeHaveInputPorts(trgNode)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.linkAlreadyExists(srcNodePortId, trgNodePortId, srcNode, trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if an association link can be created between two nodes\n\t// identified by the objects provided.\n\tstatic isAssocConnectionAllowed(srcNode, trgNode, links) {\n\t\tif (!srcNode || !trgNode) { // Source or target are not valid.\n\t\t\treturn false;\n\t\t}\n\n\t\tif (srcNode.id === trgNode.id) { // Cannot connect to ourselves, currently.\n\t\t\treturn false;\n\t\t}\n\n\t\t// We don't check if the association link already exists because it makes\n\t\t// sense, for some applications, that multiple connections bewteen nodes are\n\t\t// allowed. Uncomment this code if we decide to add a config variable\n\t\t// to allow this in the future.\n\t\t// if (this.assocLinkAlreadyExists(srcNode, trgNode, links)) {\n\t\t// \treturn false;\n\t\t// }\n\n\t\treturn true;\n\t}\n\n\t// Note - Uncomment this function if in the future we decide to enfore\n\t// preventing multiple association links to be created by providing a config\n\t// variable..\n\t// Returns true if an association link already exists between the two nodes\n\t// passed in given the set of links passed in.\n\t// static assocLinkAlreadyExists(srcNode, trgNode, links) {\n\t// \tlet exists = false;\n\t//\n\t// \tlinks.forEach((link) => {\n\t// \t\tif ((link.srcNodeId === srcNode.id && link.trgNodeId === trgNode.id) ||\n\t// \t\t\t\t(link.srcNodeId === trgNode.id && link.trgNodeId === srcNode.id)) {\n\t// \t\t\texists = true;\n\t// \t\t}\n\t// \t});\n\t// \treturn exists;\n\t// }\n\n\t// Returns true if the source node passed in is available to be linked to the\n\t// target node and port passed in. trgNode and trgPortId may be undefined if\n\t// the call is being made while a detached link is being manipulated.\n\tstatic isSrcNodeAvailable(srcNode, trgNode, trgNodePortId, links) {\n\t\t// Don't disable the target node\n\t\tif (trgNode && trgNode.id === srcNode.id) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!this.doesNodeHaveOutputPorts(srcNode)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.areAllSrcNodePortsCardinalityAtMax(srcNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if the targt node passed in is available to be linked to the\n\t// source node and port passed in. srcNode and srcPortId may be undefined if\n\t// the call is being made while a detached link is being manipulated.\n\tstatic isTrgNodeAvailable(trgNode, srcNode, srcNodePortId, links) {\n\t\t// Don't disable the source node\n\t\tif (srcNode && srcNode.id === trgNode.id) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!this.doesNodeHaveInputPorts(trgNode)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.areAllTrgNodePortsCardinalityAtMax(trgNode, links)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// Returns true if a link already exists from the source node and port to\n\t// the target node and port passed in given the set of links passd in.\n\tstatic linkAlreadyExists(srcNodePortId, trgNodePortId, srcNode, trgNode, links) {\n\t\tlet exists = false;\n\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.srcNodeId === srcNode.id &&\n\t\t\t\t\t(!link.srcNodePortId || link.srcNodePortId === srcNodePortId) &&\n\t\t\t\t\tlink.trgNodeId === trgNode.id &&\n\t\t\t\t\t(!link.trgNodePortId || link.trgNodePortId === trgNodePortId)) {\n\t\t\t\texists = true;\n\t\t\t}\n\t\t});\n\t\treturn exists;\n\t}\n\n\t// Returns true if all the ports of the source node are at maximum cardinality.\n\tstatic areAllSrcNodePortsCardinalityAtMax(srcNode, links) {\n\t\tif (srcNode && srcNode.outputs) {\n\t\t\tconst index = srcNode.outputs.findIndex((output) => !this.isSrcCardinalityAtMax(output.id, srcNode, links));\n\t\t\treturn index === -1;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// Returns true if all the ports of the target node are at maximum cardinality.\n\tstatic areAllTrgNodePortsCardinalityAtMax(trgNode, links) {\n\t\tif (trgNode && trgNode.inputs) {\n\t\t\tconst index = trgNode.inputs.findIndex((input) => !this.isTrgCardinalityAtMax(input.id, trgNode, links));\n\t\t\treturn index === -1;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// Returns true if the object passed in is a node which has at least one\n\t// input port and one output port.\n\tstatic hasInputAndOutputPorts(obj) {\n\t\treturn (this.isNode(obj) && obj.inputs && obj.inputs.length > 0 && obj.outputs && obj.outputs.length > 0);\n\t}\n\n\t// Returns true if either the cardinality of the default input port or\n\t// the default output port of the node passed in is maxed out based on\n\t// the array of links passed in.\n\tstatic isNodeDefaultPortsCardinalityAtMax(node, links) {\n\t\treturn this.isCardinalityAtMax(null, null, node, node, links);\n\t}\n\n\t// Returns true if the cardinality is maxed out for the source and target\n\t// nodes and ports passed in. This means any additional connection would\n\t// not be allowed from either node/port combination.\n\tstatic isCardinalityAtMax(srcPortId, trgPortId, srcNode, trgNode, links) {\n\t\treturn this.isSrcCardinalityAtMax(srcPortId, srcNode, links) ||\n\t\t\tthis.isTrgCardinalityAtMax(trgPortId, trgNode, links);\n\t}\n\n\t// Returns true if the cardinality is maxed out for the source node and port\n\t// passed in. This means any additional connection would not be allowed\n\t// from this source node/port combination.\n\tstatic isSrcCardinalityAtMax(portId, srcNode, links) {\n\t\tconst srcPortId = portId ? portId : this.getDefaultOutputPortId(srcNode);\n\t\tvar srcCount = 0;\n\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.type === NODE_LINK) {\n\t\t\t\tif (link.srcNodeId === srcNode.id && srcPortId) {\n\t\t\t\t\tif (link.srcNodePortId === srcPortId ||\n\t\t\t\t\t\t\t(!link.srcNodePortId && this.isFirstPort(srcNode.outputs, srcPortId))) {\n\t\t\t\t\t\tsrcCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tconst maxCard = this.getMaxCardinality(srcPortId, srcNode.outputs);\n\t\tif (maxCard !== null && // Might be 0! So test explicitley for non null.\n\t\t\t\tmaxCard !== -1 && // -1 indicates an infinite numder of ports are allowed\n\t\t\t\tsrcCount >= maxCard) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t// Returns true if the cardinality is maxed out for the taget node and port\n\t// passed in. This means any additional connection would not be allowed\n\t// to this target node/port combination.\n\tstatic isTrgCardinalityAtMax(portId, trgNode, links) {\n\t\tconst trgPortId = portId ? portId : this.getDefaultInputPortId(trgNode);\n\t\tvar trgCount = 0;\n\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.type === NODE_LINK) {\n\t\t\t\tif (link.trgNodeId === trgNode.id && trgPortId) {\n\t\t\t\t\tif (link.trgNodePortId === trgPortId ||\n\t\t\t\t\t\t\t(!link.trgNodePortId && this.isFirstPort(trgNode.inputs, trgPortId))) {\n\t\t\t\t\t\ttrgCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tconst maxCard = this.getMaxCardinality(trgPortId, trgNode.inputs);\n\t\tif (maxCard !== null && // Might be 0! Yes believe it or not someone does set it to zero. So test explicitley for non null.\n\t\t\t\tmaxCard !== -1 && // -1 indicates an infinite numder of ports are allowed\n\t\t\t\ttrgCount >= maxCard) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t// Returns true if the portId passed in specifies the first port in the\n\t// port array.\n\tstatic isFirstPort(portArray, portId) {\n\t\tconst index = this.getPortIndex(portArray, portId);\n\n\t\tif (index === 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t// Returns the index of the port ID passed in, in the\n\t// port array passed in.\n\tstatic getPortIndex(portArray, portId) {\n\t\treturn portArray.findIndex((port) => port.id === portId);\n\t}\n\n\t// Returns a source port Id if one exists in the link, otherwise defaults\n\t// to the first available port on the source node.\n\tstatic getSourcePortId(link, srcNode) {\n\t\tvar srcPortId;\n\t\tif (link.srcNodePortId) {\n\t\t\tsrcPortId = link.srcNodePortId;\n\t\t} else if (srcNode.outputs && srcNode.outputs.length > 0) {\n\t\t\tsrcPortId = srcNode.outputs[0].id;\n\t\t} else {\n\t\t\tsrcPortId = null;\n\t\t}\n\t\treturn srcPortId;\n\t}\n\n\t// Returns a target port Id if one exists in the link, otherwise defaults\n\t// to the first available port on the target node.\n\tstatic getTargetPortId(link, trgNode) {\n\t\tvar trgPortId;\n\t\tif (link.trgNodePortId) {\n\t\t\ttrgPortId = link.trgNodePortId;\n\t\t} else if (trgNode.inputs && trgNode.inputs.length > 0) {\n\t\t\ttrgPortId = trgNode.inputs[0].id;\n\t\t} else {\n\t\t\ttrgPortId = null;\n\t\t}\n\t\treturn trgPortId;\n\t}\n\n\n\t// Returns the port referenced by srcPortId from the node referenced\n\t// by srcNode.\n\tstatic getOutputPort(srcPortId, srcNode) {\n\t\tif (srcNode && srcNode.outputs) {\n\t\t\treturn srcNode.outputs.find((p) => p.id === srcPortId);\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns the port referenced by trgPortId from the node referenced\n\t// by trgNode.\n\tstatic getInputPort(trgPortId, trgNode) {\n\t\tif (trgNode && trgNode.inputs) {\n\t\t\treturn trgNode.inputs.find((p) => p.id === trgPortId);\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns the port from the port array indicated by the portId or null\n\t// if no port can be found.\n\tstatic getPort(portId, portArray) {\n\t\tif (portArray && portArray.length > 0) {\n\t\t\tconst index = portArray.findIndex((port) => port.id === portId);\n\n\t\t\tif (index > -1) {\n\t\t\t\treturn portArray[index];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns the maximum cardinality, if one exists, for the port ID passed in\n\t// from the array of ports provided.\n\tstatic getMaxCardinality(portId, ports) {\n\t\tconst port = this.getPort(portId, ports);\n\t\tif (port &&\n\t\t\t\tport.cardinality) {\n\t\t\treturn Number(port.cardinality.max);\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns true if a connection is allowed from a comment to a target node,\n\t// given the set of links passed in. At the moment this is only restricted\n\t// if a current link exists between the two.\n\tstatic isCommentLinkConnectionAllowed(commentId, trgNodeId, links) {\n\t\treturn !this.commentLinkAlreadyExists(commentId, trgNodeId, links);\n\t}\n\n\t// Returns true if a comment link already exists from the source comment\n\t// to the target node, given the set of links passed in.\n\tstatic commentLinkAlreadyExists(commentId, trgNodeId, links) {\n\t\tlet exists = false;\n\n\t\tlinks.forEach((link) => {\n\t\t\tif (link.srcNodeId === commentId &&\n\t\t\t\t\tlink.trgNodeId === trgNodeId) {\n\t\t\t\texists = true;\n\t\t\t}\n\t\t});\n\t\treturn exists;\n\t}\n\n\t// Returns an object containing two arrays: old links and new links. There is\n\t// one new link in the new links array for each old link in the old links\n\t// array. The new links have their properties adjusted so they are attached\n\t// to the first found output or input port, that is not maxed out with respect\n\t// to its maximum cardinality, of the provided node. The allDataLinks\n\t// parameter is the array of all node-node data links on the canvas.\n\tstatic getDetachedLinksToUpdate(node, detachedLinks, allNodeDataLinks) {\n\t\tconst newLinks = [];\n\t\tconst oldLinks = [];\n\t\tdetachedLinks.forEach((link) => {\n\t\t\tif (link.nodeOverSrcPos && link.srcPos && node.outputs && node.outputs.length > 0) {\n\t\t\t\tlet connected = false;\n\t\t\t\tnode.outputs.forEach((output) => {\n\t\t\t\t\tif (connected === false &&\n\t\t\t\t\t\t\tthis.isSrcConnectionAllowedWithDetachedLinks(output.id, node, this.getReplacedLinks(allNodeDataLinks, newLinks))) {\n\t\t\t\t\t\tconst newLink = Object.assign({}, link, { srcNodeId: node.id, srcNodePortId: output.id });\n\t\t\t\t\t\tdelete newLink.srcPos;\n\t\t\t\t\t\tnewLinks.push(newLink);\n\t\t\t\t\t\toldLinks.push(link);\n\t\t\t\t\t\tconnected = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t} else if (link.nodeOverTrgPos && link.trgPos && node.inputs && node.inputs.length > 0) {\n\t\t\t\tlet connected = false;\n\t\t\t\tnode.inputs.forEach((input) => {\n\t\t\t\t\tif (connected === false &&\n\t\t\t\t\t\t\tthis.isTrgConnectionAllowedWithDetachedLinks(input.id, node, this.getReplacedLinks(allNodeDataLinks, newLinks))) {\n\t\t\t\t\t\tconst newLink = Object.assign({}, link, { trgNodeId: node.id, trgNodePortId: input.id });\n\t\t\t\t\t\tdelete newLink.trgPos;\n\t\t\t\t\t\tnewLinks.push(newLink);\n\t\t\t\t\t\toldLinks.push(link);\n\t\t\t\t\t\tconnected = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\treturn { newLinks, oldLinks };\n\t}\n\n\t// Returns an array which is a copy of the allNodeDataLinks array but with\n\t// any elements replaced from the newLinks array if those elements have the same ID.\n\tstatic getReplacedLinks(allNodeDataLinks, newLinks) {\n\t\treturn allNodeDataLinks.map((link) => {\n\t\t\tconst index = newLinks.findIndex((nl) => nl.id === link.id);\n\t\t\treturn index > -1 ? newLinks[index] : link;\n\t\t});\n\t}\n\n\t// Returns an array of selected object IDs for nodes, comments and links\n\t// that are within the region (inReg) provided. Links are only included if\n\t// includeLinks is truthy.\n\tstatic selectInRegion(inReg, pipeline, includeLinks, linkType, enableAssocLinkType) {\n\t\tconst region = {\n\t\t\tx1: inReg.x,\n\t\t\ty1: inReg.y,\n\t\t\tx2: inReg.x + inReg.width,\n\t\t\ty2: inReg.y + inReg.height\n\t\t};\n\n\t\tvar regionSelections = [];\n\t\tfor (const node of pipeline.nodes) {\n\t\t\tif (!this.isSuperBindingNode(node) && // Don't include binding nodes in select\n\t\t\t\t\tregion.x1 < node.x_pos + node.width &&\n\t\t\t\t\tregion.x2 > node.x_pos &&\n\t\t\t\t\tregion.y1 < node.y_pos + node.height &&\n\t\t\t\t\tregion.y2 > node.y_pos) {\n\t\t\t\tregionSelections.push(node.id);\n\t\t\t}\n\t\t}\n\t\tfor (const comment of pipeline.comments) {\n\t\t\tif (region.x1 < comment.x_pos + comment.width &&\n\t\t\t\t\tregion.x2 > comment.x_pos &&\n\t\t\t\t\tregion.y1 < comment.y_pos + comment.height &&\n\t\t\t\t\tregion.y2 > comment.y_pos) {\n\t\t\t\tregionSelections.push(comment.id);\n\t\t\t}\n\t\t}\n\t\tif (includeLinks) {\n\t\t\tfor (const link of pipeline.links) {\n\t\t\t\t// For straight links we check to see if the link line intersects (or\n\t\t\t\t// is fully inside) the selection region.\n\t\t\t\tif ((link.type === NODE_LINK && linkType === LINK_TYPE_STRAIGHT) ||\n\t\t\t\t\t\tlink.type === COMMENT_LINK ||\n\t\t\t\t\t\t(link.type === ASSOCIATION_LINK && enableAssocLinkType === ASSOC_STRAIGHT)) {\n\t\t\t\t\tif (this.lineIntersectRectangle(link.x1, link.y1, link.x2, link.y2, region.x1, region.y1, region.x2, region.y2)) {\n\t\t\t\t\t\tregionSelections.push(link.id);\n\t\t\t\t\t}\n\t\t\t\t// For elbow and curved lines we just check to see if the start or\n\t\t\t\t// end coordinates of the lines are inside the selection region or not.\n\t\t\t\t// TODO: This approach means any selection region that only touches the\n\t\t\t\t// link line will not select the line if it is elbow or curve. If any\n\t\t\t\t// host app wants more acurate collision detection between the line and\n\t\t\t\t// the selection region with these line types, this would need to be\n\t\t\t\t// improved, perhaps using a library like this:\n\t\t\t\t// https://github.com/thelonious/kld-intersections\n\t\t\t\t} else if (this.isPosInArea({ x_pos: link.x1, y_pos: link.y1 }, region, 0) ||\n\t\t\t\t\t\t\t\t\t\tthis.isPosInArea({ x_pos: link.x2, y_pos: link.y2 }, region, 0)) {\n\t\t\t\t\tregionSelections.push(link.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn regionSelections;\n\t}\n\n\t// Return true if the position provided is within the area provided.\n\tstatic isPosInArea(pos, area, pad) {\n\t\treturn pos.x_pos > area.x1 - pad &&\n\t\t\tpos.x_pos < area.x2 + pad &&\n\t\t\tpos.y_pos > area.y1 - pad &&\n\t\t\tpos.y_pos < area.y2 + pad;\n\t}\n\n\t// Returns a sting that describes the basic type of\n\t// the object passed in.\n\tstatic getObjectTypeName(obj) {\n\t\tif (this.isNode(obj)) {\n\t\t\treturn \"node\";\n\t\t} else if (this.isComment(obj)) {\n\t\t\treturn \"comment\";\n\t\t} else if (this.isLink(obj)) {\n\t\t\treturn \"link\";\n\t\t}\n\t\treturn \"\";\n\t}\n\n\t// Returns truthy if the object passed in is a node (and not a comment).\n\t// Comments don't have a type property.\n\tstatic isNode(obj) {\n\t\treturn obj.type && !this.isLink(obj);\n\t}\n\n\t// Returns true if the object passed in is a link.\n\tstatic isLink(obj) {\n\t\treturn obj.type && (obj.type === NODE_LINK || obj.type === COMMENT_LINK || obj.type === ASSOCIATION_LINK);\n\t}\n\n\t// Returns truthy if the object passed in is a comment.\n\t// Comments don't have a type property.\n\tstatic isComment(obj) {\n\t\treturn !obj.type;\n\t}\n\n\tstatic isSupernode(node) {\n\t\treturn node.type === SUPER_NODE;\n\t}\n\n\tstatic isExpanded(node) {\n\t\treturn node.is_expanded === true;\n\t}\n\n\tstatic isExpandedSupernode(node) {\n\t\treturn this.isSupernode(node) && this.isExpanded(node);\n\t}\n\n\tstatic isCollapsedSupernode(node) {\n\t\treturn this.isSupernode(node) && !this.isExpanded(node);\n\t}\n\t// Returns true if the node passed in is a binding node in a subflow\n\t// for a supernode.\n\tstatic isSuperBindingNode(d) {\n\t\treturn d.isSupernodeInputBinding || d.isSupernodeOutputBinding;\n\t}\n\n\t// Returns an object containing the dimensions of an imaginary rectangle\n\t// surrounding the nodes and comments and links passed in or an object with\n\t// all properties set to zero if no valid objects were provided.\n\t// nodeHighlightGap may be 0 or undefined. If it is undefined we use the\n\t// nodeHighlightGap in the node's layout.\n\t// If allLinks is set to true, we include the start and end coordinates of all\n\t// links passed in. If set to false (or is undefined), we only inlcude\n\t// the unconnected ends of semi-detached or fully-detached links. That is,\n\t// where the link has a srcPos and/or a trgPos field.\n\tstatic getCanvasDimensions(nodes, comments, links, commentHighlightGap, nodeHighlightGap, allLinks) {\n\t\tvar canvLeft = Infinity;\n\t\tlet canvTop = Infinity;\n\t\tvar canvRight = -Infinity;\n\t\tvar canvBottom = -Infinity;\n\n\t\tif (nodes) {\n\t\t\tnodes.forEach((d) => {\n\t\t\t\tif (this.isSuperBindingNode(d)) { // Always ignore Supernode binding nodes\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst nodeGap = nodeHighlightGap === 0 ? 0 : d.layout.nodeHighlightGap;\n\t\t\t\tcanvLeft = Math.min(canvLeft, d.x_pos - nodeGap);\n\t\t\t\tcanvTop = Math.min(canvTop, d.y_pos - nodeGap);\n\t\t\t\tcanvRight = Math.max(canvRight, d.x_pos + d.width + nodeGap);\n\t\t\t\tcanvBottom = Math.max(canvBottom, d.y_pos + d.height + nodeGap);\n\t\t\t});\n\t\t}\n\n\t\tif (comments) {\n\t\t\tcomments.forEach((d) => {\n\t\t\t\tcanvLeft = Math.min(canvLeft, d.x_pos - commentHighlightGap);\n\t\t\t\tcanvTop = Math.min(canvTop, d.y_pos - commentHighlightGap);\n\t\t\t\tcanvRight = Math.max(canvRight, d.x_pos + d.width + commentHighlightGap);\n\t\t\t\tcanvBottom = Math.max(canvBottom, d.y_pos + d.height + commentHighlightGap);\n\t\t\t});\n\t\t}\n\n\t\t// Take into account semi-detached and fully-detached links, if any.\n\t\tif (links) {\n\t\t\tlinks.forEach((link) => {\n\t\t\t\tif (allLinks) {\n\t\t\t\t\tcanvLeft = Math.min(canvLeft, link.x1);\n\t\t\t\t\tcanvTop = Math.min(canvTop, link.y1);\n\t\t\t\t\tcanvRight = Math.max(canvRight, link.x1);\n\t\t\t\t\tcanvBottom = Math.max(canvBottom, link.y1);\n\n\t\t\t\t\tcanvLeft = Math.min(canvLeft, link.x2);\n\t\t\t\t\tcanvTop = Math.min(canvTop, link.y2);\n\t\t\t\t\tcanvRight = Math.max(canvRight, link.x2);\n\t\t\t\t\tcanvBottom = Math.max(canvBottom, link.y2);\n\t\t\t\t} else {\n\t\t\t\t\tif (link.srcPos) {\n\t\t\t\t\t\tcanvLeft = Math.min(canvLeft, link.srcPos.x_pos);\n\t\t\t\t\t\tcanvTop = Math.min(canvTop, link.srcPos.y_pos);\n\t\t\t\t\t\tcanvRight = Math.max(canvRight, link.srcPos.x_pos);\n\t\t\t\t\t\tcanvBottom = Math.max(canvBottom, link.srcPos.y_pos);\n\t\t\t\t\t}\n\t\t\t\t\tif (link.trgPos) {\n\t\t\t\t\t\tcanvLeft = Math.min(canvLeft, link.trgPos.x_pos);\n\t\t\t\t\t\tcanvTop = Math.min(canvTop, link.trgPos.y_pos);\n\t\t\t\t\t\tcanvRight = Math.max(canvRight, link.trgPos.x_pos);\n\t\t\t\t\t\tcanvBottom = Math.max(canvBottom, link.trgPos.y_pos);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst canvWidth = canvRight - canvLeft;\n\t\tconst canvHeight = canvBottom - canvTop;\n\n\t\tif (canvLeft === Infinity || canvTop === Infinity ||\n\t\t\t\tcanvRight === -Infinity || canvBottom === -Infinity) {\n\t\t\treturn { left: 0, top: 0, right: 0, bottom: 0, width: 0, height: 0 };\n\t\t}\n\n\t\treturn {\n\t\t\tleft: canvLeft,\n\t\t\ttop: canvTop,\n\t\t\tright: canvRight,\n\t\t\tbottom: canvBottom,\n\t\t\twidth: canvWidth,\n\t\t\theight: canvHeight\n\t\t};\n\t}\n\n\t// Returns a subset of links from the links passed in which connect to\n\t// the target node and port passed in.\n\tstatic getDataLinksConnectedTo(trgPortId, trgNode, links) {\n\t\tconst defTrgPortId = this.getDefaultInputPortId(trgNode);\n\n\t\treturn links.filter((link) => {\n\t\t\tif (link.type === NODE_LINK) {\n\t\t\t\tconst linkTrgPortId = link.trgNodePortId || defTrgPortId;\n\t\t\t\treturn link.trgNodeId === trgNode.id && linkTrgPortId === trgPortId;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t}\n\n\t// Returns the default input port ID for the node, which will be the ID of\n\t// the first port, or null if there are no inputs.\n\tstatic getDefaultInputPortId(node) {\n\t\treturn (node.inputs && node.inputs.length > 0 ? node.inputs[0].id : null);\n\t}\n\n\t// Returns the default output port ID for the node, which will be the ID of\n\t// the first port, or null if there are no outputs.\n\tstatic getDefaultOutputPortId(node) {\n\t\treturn (node.outputs && node.outputs.length > 0 ? node.outputs[0].id : null);\n\t}\n\n\t// Returns a full style string value that can be applied as an in-line style to\n\t// the representation of the object in the DOM. The style is based either\n\t// on the 'style' or 'style_temp' property of the object.\n\t// Parameters:\n\t// d - The object\n\t// part - A string of the part of the object to be styled. eg 'body' or 'image'\n\t// This is dependent on the style spec in eiether the 'style' or\n\t// 'temp_style' property.\n\t// type = Either 'hover' or 'default'\n\tstatic getObjectStyle(d, part, type) {\n\t\tif (!d.style && !d.style_temp) {\n\t\t\treturn null;\n\t\t}\n\t\tlet style = null;\n\n\t\tif (type === \"hover\") {\n\t\t\tstyle = this.getStyleValue(d, part, \"default\") + \";\" + this.getStyleValue(d, part, \"hover\");\n\n\t\t} else if (type === \"default\") {\n\t\t\tstyle = this.getStyleValue(d, part, \"default\");\n\t\t}\n\t\treturn style;\n\t}\n\n\tstatic getStyleValue(d, part, type) {\n\t\tconst style = get(d, `style_temp.${part}.${type}`, null);\n\t\tif (style !== null) {\n\t\t\treturn style;\n\t\t}\n\t\treturn get(d, `style.${part}.${type}`, null);\n\t}\n\n\t// Returns a subset array of supernodes from the nodes passed in.\n\tstatic filterSupernodes(inNodes) {\n\t\treturn inNodes.filter((n) => n.type === SUPER_NODE);\n\t}\n\n\t// Returns a source position object, with x_pos and y_pos fields, that\n\t// decribes where a link line would be drawn from if the link's source node\n\t// did not exist. This is useful when doing operations (such as delete or\n\t// cut/copy) that cause semi-detached or fully detached links to be created.\n\tstatic getSrcPos(link, apiPipeline) {\n\t\tlet trgCenterX;\n\t\tlet trgCenterY;\n\t\tif (link.trgNodeId) {\n\t\t\tconst trgNode = apiPipeline.getNode(link.trgNodeId);\n\t\t\ttrgCenterX = trgNode.x_pos + (trgNode.width / 2);\n\t\t\ttrgCenterY = trgNode.y_pos + (trgNode.height / 2);\n\t\t} else {\n\t\t\ttrgCenterX = link.trgPos.x_pos;\n\t\t\ttrgCenterY = link.trgPos.y_pos;\n\t\t}\n\n\t\tconst srcNode = apiPipeline.getNode(link.srcNodeId);\n\t\tlet srcCenterX;\n\t\tlet srcCenterY;\n\n\t\tif (srcNode.layout && srcNode.layout.drawNodeLinkLineFromTo === \"image_center\") {\n\t\t\tsrcCenterX = srcNode.x_pos + srcNode.layout.imagePosX + (srcNode.layout.imageWidth / 2);\n\t\t\tsrcCenterY = srcNode.y_pos + srcNode.layout.imagePosY + (srcNode.layout.imageHeight / 2);\n\n\t\t} else {\n\t\t\tsrcCenterX = srcNode.x_pos + (srcNode.width / 2);\n\t\t\tsrcCenterY = srcNode.y_pos + (srcNode.height / 2);\n\t\t}\n\n\t\tconst startPos = this.getOuterCoord(\n\t\t\tsrcNode.x_pos, srcNode.y_pos, srcNode.width, srcNode.height, 0,\n\t\t\tsrcCenterX, srcCenterY, trgCenterX, trgCenterY);\n\n\t\treturn { x_pos: startPos.x, y_pos: startPos.y };\n\t}\n\n\t// Returns a target position object, with x_pos and y_pos fields, that\n\t// decribes where a link line would be drawn from if the link's target node\n\t// did not exist. This is useful when doing operations (such as delete or\n\t// cut/copy) that cause semi-detached or fully detached links to be created.\n\tstatic getTrgPos(link, apiPipeline) {\n\t\tlet srcCenterX;\n\t\tlet srcCenterY;\n\t\tif (link.srcNodeId) {\n\t\t\tconst srcNode = apiPipeline.getNode(link.srcNodeId);\n\t\t\tsrcCenterX = srcNode.x_pos + (srcNode.width / 2);\n\t\t\tsrcCenterY = srcNode.y_pos + (srcNode.height / 2);\n\t\t} else {\n\t\t\tsrcCenterX = link.srcPos.x_pos;\n\t\t\tsrcCenterY = link.srcPos.y_pos;\n\t\t}\n\n\t\tconst trgNode = apiPipeline.getNode(link.trgNodeId);\n\t\tlet trgCenterX;\n\t\tlet trgCenterY;\n\n\t\tif (trgNode.layout && trgNode.layout.drawNodeLinkLineFromTo === \"image_center\") {\n\t\t\ttrgCenterX = trgNode.x_pos + trgNode.layout.imagePosX + (trgNode.layout.imageWidth / 2);\n\t\t\ttrgCenterY = trgNode.y_pos + trgNode.layout.imagePosY + (trgNode.layout.imageHeight / 2);\n\n\t\t} else {\n\t\t\ttrgCenterX = trgNode.x_pos + (trgNode.width / 2);\n\t\t\ttrgCenterY = trgNode.y_pos + (trgNode.height / 2);\n\t\t}\n\n\t\tconst startPos = this.getOuterCoord(\n\t\t\ttrgNode.x_pos, trgNode.y_pos, trgNode.width, trgNode.height, 0,\n\t\t\ttrgCenterX, trgCenterY, srcCenterX, srcCenterY);\n\n\t\treturn { x_pos: startPos.x, y_pos: startPos.y };\n\t}\n\n\t// Returns a concatenation of the two input arrays making sure there are no\n\t// duplicates (based on ID) in the returned array.\n\tstatic concatUniqueBasedOnId(newLinks, currentLinks) {\n\t\tconst outLinks = currentLinks;\n\t\tnewLinks.forEach((nl) => {\n\t\t\tif (!currentLinks.some((cl) => cl.id === nl.id)) {\n\t\t\t\toutLinks.push(nl);\n\t\t\t}\n\t\t});\n\t\treturn outLinks;\n\t}\n\n\t// Returns the color class in the className parameter, if one is found,\n\t// otherwise returns null.\n\tstatic getBkgColorClass(className) {\n\t\tif (className === \"bkg-col-white-0\" ||\n\t\t\t\tclassName === \"bkg-col-yellow-20\" ||\n\t\t\t\tclassName === \"bkg-col-gray-20\" ||\n\t\t\t\tclassName === \"bkg-col-green-20\" ||\n\t\t\t\tclassName === \"bkg-col-teal-20\" ||\n\t\t\t\tclassName === \"bkg-col-cyan-20\" ||\n\t\t\t\tclassName === \"bkg-col-red-50\" ||\n\t\t\t\tclassName === \"bkg-col-orange-40\" ||\n\t\t\t\tclassName === \"bkg-col-gray-50\" ||\n\t\t\t\tclassName === \"bkg-col-green-50\" ||\n\t\t\t\tclassName === \"bkg-col-teal-50\" ||\n\t\t\t\tclassName === \"bkg-col-cyan-50\") {\n\t\t\treturn className;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Returns true if the hex passed in is for a dark color where 'dark'\n\t// is defined as a color that would require white text to be used\n\t// if the hex color was a background color.\n\tstatic isDarkColor(hex) {\n\t\tconst c = hex.substring(1); // strip #\n\t\tconst rgb = parseInt(c, 16); // convert rrggbb to decimal\n\n\t\tconst r = (rgb >> 16) & 0xff; // extract red\n\t\tconst g = (rgb >> 8) & 0xff; // extract green\n\t\tconst b = (rgb >> 0) & 0xff; // extract blue\n\n\t\tconst luma = 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709\n\t\treturn (luma < 108);\n\t}\n\n\t// Applies the outlineStyle format or border-xxx CSS styles to the D3 comment\n\t// selection passed in, if one exists, in the formats array passed in.\n\tstatic applyOutlineStyle(commentSel, formats) {\n\t\tif (formats?.length > 0) {\n\t\t\tformats.forEach((f) => {\n\t\t\t\tif (f.type === \"outlineStyle\" ||\n\t\t\t\t\tf.type.startsWith(\"border\")) { // Only apply outline and border style to outer <div>\n\t\t\t\t\tconst { field, value } = CanvasUtils.convertFormat(f);\n\t\t\t\t\tcommentSel.style(field, value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t// Applies all formats from the formats array, that are not outlineStyle or\n\t// border-xxx CSS styles, to the D3 comment selection passed in.\n\tstatic applyNonOutlineStyle(commentSel, formats) {\n\t\tif (formats?.length > 0) {\n\t\t\tformats.forEach((f) => {\n\t\t\t\tif (f.type !== \"outlineStyle\" &&\n\t\t\t\t\t!f.type.startsWith(\"border\")) { // Only apply outline and border style to outer <div>\n\t\t\t\t\tconst { field, value } = CanvasUtils.convertFormat(f);\n\t\t\t\t\tcommentSel.style(field, value);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t// Returns an object contaiing the start and end positions\n\t// of any current selection in the domNode passed in. The\n\t// DOM node is expected to contain text which is stored in a\n\t// set of child nodes that are text objects.\n\tstatic getSelectionPositions(domNode) {\n\t\tconst sel = window.getSelection();\n\t\tlet anchorPos;\n\t\tlet focusPos;\n\t\tlet runningLen = 0;\n\t\tdomNode.childNodes.forEach((cn) => {\n\t\t\tif (cn.nodeValue) {\n\t\t\t\tconst textLen = cn.nodeValue.length;\n\t\t\t\tif (cn === sel.anchorNode) {\n\t\t\t\t\tanchorPos = runningLen + sel.anchorOffset;\n\t\t\t\t}\n\t\t\t\tif (cn === sel.focusNode) {\n\t\t\t\t\tfocusPos = runningLen + sel.focusOffset;\n\t\t\t\t}\n\t\t\t\trunningLen += textLen;\n\t\t\t}\n\t\t});\n\t\treturn { start: Math.min(anchorPos, focusPos), end: Math.max(anchorPos, focusPos) };\n\t}\n\n\t// Selects the entire contents of the DOM node passed in.\n\tstatic selectNodeContents(domNode) {\n\t\tvar range = document.createRange();\n\t\trange.selectNodeContents(domNode);\n\n\t\tvar sel = window.getSelection();\n\t\tsel.removeAllRanges();\n\t\tsel.addRange(range);\n\t}\n\n\t// Selects the range of characters in the text DOM node passed in\n\t// between the start and end positions passed in. The DOM node is\n\t// expected to contain text which is stored in a set of child nodes\n\t// that are text objects. selection is an optional object containing\n\t// the current selection which is provided by the Cypress test cases.\n\tstatic selectNodeRange(domNode, start, end, selection) {\n\t\tconst range = document.createRange();\n\n\t\tlet startTextNode;\n\t\tlet endTextNode;\n\t\tlet startTextPos;\n\t\tlet endTextPos;\n\t\tlet runningLen = 0;\n\t\tdomNode.childNodes.forEach((cn) => {\n\t\t\tconst textLen = cn.nodeValue.length;\n\t\t\trunningLen += textLen;\n\t\t\tif (start <= runningLen && !startTextNode) {\n\t\t\t\tstartTextNode = cn;\n\t\t\t\tstartTextPos = textLen - (runningLen - start);\n\t\t\t}\n\t\t\tif (end <= runningLen && !endTextNode) {\n\t\t\t\tendTextNode = cn;\n\t\t\t\tendTextPos = textLen - (runningLen - end);\n\t\t\t}\n\t\t});\n\n\t\trange.setStart(startTextNode, startTextPos);\n\t\trange.setEnd(endTextNode, endTextPos);\n\n\t\tconst sel = selection ? selection : window.getSelection();\n\t\tsel.removeAllRanges();\n\t\tsel.addRange(range);\n\t}\n\n\t// Returns an object containing a CSS field and value that\n\t// can be applied to a <div> contining text based on the\n\t// format type and action passed in.\n\tstatic convertFormat(format) {\n\t\tswitch (format.type) {\n\t\tcase \"bold\":\n\t\t\treturn { field: \"font-weight\", value: \"600\" };\n\n\t\tcase \"italics\":\n\t\t\treturn { field: \"font-style\", value: \"italic\" };\n\n\t\tcase \"fontType\": {\n\t\t\tconst fontFamily = this.getFontFamily(format.value);\n\t\t\treturn { field: \"font-family\", value: fontFamily };\n\t\t}\n\n\t\tcase \"textDecoration\": {\n\t\t\tswitch (format.value) {\n\t\t\tdefault:\n\t\t\tcase \"strikethrough\":\n\t\t\t\treturn { field: \"text-decoration\", value: \"line-through\" };\n\t\t\tcase \"underline\":\n\t\t\t\treturn { field: \"text-decoration\", value: \"underline\" };\n\t\t\tcase \"strikethrough underline\":\n\t\t\tcase \"underline strikethrough\":\n\t\t\t\treturn { field: \"text-decoration\", value: \"underline line-through\" };\n\t\t\t}\n\t\t}\n\n\t\tcase \"textColor\": {\n\t\t\treturn { field: \"color\", value: format.value };\n\t\t}\n\n\t\tcase \"backgroundColor\": {\n\t\t\treturn { field: \"background-color\", value: format.value };\n\t\t}\n\n\t\tcase \"textSize\": {\n\t\t\tconst size = format.value.substring(10);\n\t\t\treturn { field: \"font-size\", value: `${size}px` };\n\t\t}\n\n\t\tcase \"outlineStyle\": {\n\t\t\tswitch (format.value) {\n\t\t\tdefault:\n\t\t\tcase \"outline-solid\":\n\t\t\t\treturn { field: \"border-style\", value: \"solid\" };\n\t\t\tcase \"outline-none\":\n\t\t\t\treturn { field: \"border-style\", value: \"none\" };\n\t\t\t}\n\t\t}\n\n\t\tcase \"alignHorizontally\": {\n\t\t\tswitch (format.value) {\n\t\t\tdefault:\n\t\t\tcase \"align-left\":\n\t\t\t\treturn { field: \"text-align\", value: \"left\" };\n\t\t\tcase \"align-center\":\n\t\t\t\treturn { field: \"text-align\", value: \"center\" };\n\t\t\tcase \"align-right\":\n\t\t\t\treturn { field: \"text-align\", value: \"right\" };\n\t\t\t}\n\t\t}\n\n\t\tcase \"alignVertically\": {\n\t\t\tswitch (format.value) {\n\t\t\tdefault:\n\t\t\tcase \"align-top\":\n\t\t\t\treturn { field: \"vertical-align\", value: \"top\" };\n\t\t\tcase \"align-middle\":\n\t\t\t\treturn { field: \"vertical-align\", value: \"middle\" };\n\t\t\tcase \"align-bottom\":\n\t\t\t\treturn { field: \"vertical-align\", value: \"bottom\" };\n\t\t\t}\n\t\t}\n\n\t\tdefault:\n\t\t\treturn { field: format.type, value: format.value };\n\t\t}\n\t}\n\n\t// Returns a font family for the font action passed in.\n\tstatic getFontFamily(action) {\n\t\tswitch (action) {\n\t\tdefault:\n\t\tcase (\"font-ibm-plex-sans\"): return \"\\\"IBM Plex Sans\\\", sans-serif\";\n\t\tcase (\"font-ibm-plex-serif\"): return \"\\\"IBM Plex Serif\\\", serif\";\n\t\tcase (\"font-ibm-plex-sans-condensed\"): return \"IBM Plex Sans Condensed\";\n\t\tcase (\"font-ibm-plex-mono\"): return \"\\\"IBM Plex Mono\\\", monospace\";\n\t\tcase (\"font-arial\"): return \"\\\"Arial\\\", sans-serif\";\n\t\tcase (\"font-comic-sans-ms\"): return \"\\\"Comic Sans MS\\\", sans-serif\";\n\t\tcase (\"font-gill-sans\"): return \"\\\"Gill Sans\\\", sans-serif\";\n\t\tcase (\"font-helvetica-neue\"): return \"\\\"Helvetica Neue\\\", sans-serif\";\n\t\tcase (\"font-times-new-roman\"): return \"\\\"Times New Roman\\\", serif\";\n\t\tcase (\"font-verdana\"): return \"\\\"Verdana\\\", sans-serif\";\n\t\t}\n\t}\n\n\t// Returns the element passed in, or an ancestor of the element, if either\n\t// contains the classNames passed in. Otherwise it returns null if the\n\t// className cannot be found. For example, if this element is a child of the\n\t// node group object and \"d3-node-group\" is passed in, this function will\n\t// find the group element.\n\tstatic getParentElementWithClass(element, className) {\n\t\tlet el = element;\n\t\tlet foundElement = null;\n\n\t\twhile (el) {\n\t\t\t// No need to proceed if we find either of these. Stopping at svg-area\n\t\t\t// prevents the search transitioning from a sub-flow to a parent flow.\n\t\t\tif (this.isClassNameIncluded(el, \"d3-new-connection-guide\") ||\n\t\t\t\t\tthis.isClassNameIncluded(el, \"svg-area\")) {\n\t\t\t\tel = null;\n\n\t\t\t} else if (this.isClassNameIncluded(el, className)) {\n\t\t\t\tfoundElement = el;\n\t\t\t\tel = null;\n\t\t\t} else {\n\t\t\t\tel = el.parentNode;\n\t\t\t}\n\t\t}\n\t\treturn foundElement;\n\t}\n\n\t// Returns true if the class name passed in is one of the classes assigned\n\t// to the element passed in.\n\tstatic isClassNameIncluded(el, className) {\n\t\treturn el.classList && el.classList.contains(className);\n\t}\n\n\t// Returns the ID of the pipeline referenced by the supernode\n\t// passed in.\n\tstatic getSupernodePipelineId(supernode) {\n\t\tif (supernode.type === SUPER_NODE &&\n\t\t\t\thas(supernode, \"subflow_ref.pipeline_id_ref\")) {\n\t\t\treturn supernode.subflow_ref.pipeline_id_ref;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Convert now deprecated layout fields to the port positions arrays. The layout fields are\n\t// expected to provided in pairs. For example: inputPortTopPosX and inputPortTopPosY. However,\n\t// if they are not and only one of the pair is provided the functions in svg-canvas-utils.nodes.js\n\t// that calculate a x, y coordinate for the port will default to 0 if a value provided is undefined.\n\t// TODO - Remove this in a future major release.\n\tstatic convertPortPosInfo(layout) {\n\t\tconst newLayout = layout;\n\n\t\tif (!layout) {\n\t\t\treturn newLayout;\n\t\t}\n\n\t\t// If custom fields exist for input ports, write the values into the\n\t\t// inputPortPositions array and delete the redundant fields.\n\t\tif (isNumber(newLayout.inputPortTopPosX) || isNumber(newLayout.inputPortTopPosY)) {\n\t\t\tnewLayout.inputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.inputPortTopPosX, y_pos: newLayout.inputPortTopPosY, pos: \"topLeft\" }\n\t\t\t];\n\t\t\tdelete newLayout.inputPortTopPosX;\n\t\t\tdelete newLayout.inputPortTopPosY;\n\n\t\t} else if (isNumber(newLayout.inputPortBottomPosX) || isNumber(newLayout.inputPortBottomPosY)) {\n\t\t\tnewLayout.inputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.inputPortBottomPosX, y_pos: newLayout.inputPortBottomPosY, pos: \"bottomLeft\" }\n\t\t\t];\n\t\t\tdelete newLayout.inputPortBottomPosX;\n\t\t\tdelete newLayout.inputPortBottomPosY;\n\n\t\t} else if (isNumber(newLayout.inputPortLeftPosX) || isNumber(newLayout.inputPortLeftPosY)) {\n\t\t\tnewLayout.inputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.inputPortLeftPosX, y_pos: newLayout.inputPortLeftPosY, pos: \"topLeft\" }\n\t\t\t];\n\t\t\tdelete newLayout.inputPortLeftPosX;\n\t\t\tdelete newLayout.inputPortLeftPosY;\n\t\t}\n\n\t\t// If custom fields exist for output ports, write the values into the\n\t\t// outputPortPositions array and delete the redundant fields.\n\t\tif (isNumber(newLayout.outputPortTopPosX) || isNumber(newLayout.outputPortTopPosY)) {\n\t\t\tnewLayout.outputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.outputPortTopPosX, y_pos: newLayout.outputPortTopPosY, pos: \"topLeft\" }\n\t\t\t];\n\t\t\tdelete newLayout.outputPortTopPosX;\n\t\t\tdelete newLayout.outputPortTopPosY;\n\n\t\t} else if (isNumber(newLayout.outputPortBottomPosX) || isNumber(newLayout.outputPortBottomPosY)) {\n\t\t\tnewLayout.outputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.outputPortBottomPosX, y_pos: newLayout.outputPortBottomPosY, pos: \"bottomLeft\" }\n\t\t\t];\n\t\t\tdelete newLayout.outputPortBottomPosX;\n\t\t\tdelete newLayout.outputPortBottomPosY;\n\n\t\t} else if (isNumber(newLayout.outputPortRightPosX) || isNumber(newLayout.outputPortRightPosY)) {\n\t\t\tconst pos = newLayout.outputPortRightPosition || \"topRight\";\n\t\t\tnewLayout.outputPortPositions = [\n\t\t\t\t{ x_pos: newLayout.outputPortRightPosX, y_pos: newLayout.outputPortRightPosY, pos: pos }\n\t\t\t];\n\t\t\tdelete newLayout.outputPortRightPosX;\n\t\t\tdelete newLayout.outputPortRightPosY;\n\t\t}\n\t\treturn newLayout;\n\t}\n\n\t// Convert now deprecated layout fields to the port objects arrays.\n\t// TODO - Remove this in a future major release.\n\tstatic convertPortDisplayInfo(layout) {\n\t\tconst newLayout = layout;\n\n\t\tif (!layout) {\n\t\t\treturn newLayout;\n\t\t}\n\n\t\t// If custom fields exist for input object info, write the values into the\n\t\t// inputPortDisplayObjects array.\n\t\tif (newLayout.inputPortObject === PORT_DISPLAY_IMAGE) {\n\t\t\tnewLayout.inputPortDisplayObjects = [\n\t\t\t\t{ type: PORT_DISPLAY_IMAGE,\n\t\t\t\t\tsrc: newLayout.inputPortImage,\n\t\t\t\t\theight: newLayout.inputPortHeight || PORT_HEIGHT_DEFAULT,\n\t\t\t\t\twidth: newLayout.inputPortWidth || PORT_WIDTH_DEFAULT\n\t\t\t\t}\n\t\t\t];\n\t\t}\n\n\t\tif (newLayout.inputPortGuideObject === PORT_DISPLAY_IMAGE) {\n\t\t\tnewLayout.inputPortGuideObjects = [\n\t\t\t\t{ type: PORT_DISPLAY_IMAGE,\n\t\t\t\t\tsrc: newLayout.inputPortGuideImage,\n\t\t\t\t\theight: newLayout.inputPortHeight || PORT_HEIGHT_DEFAULT,\n\t\t\t\t\twidth: newLayout.inputPortWidth || PORT_WIDTH_DEFAULT\n\t\t\t\t}\n\t\t\t];\n\t\t}\n\n\t\t// If custom fields exist for output object info, write the values into the\n\t\t// outputPortDisplayObjects array.\n\t\tif (newLayout.outputPortObject === PORT_DISPLAY_IMAGE) {\n\t\t\tnewLayout.outputPortDisplayObjects = [\n\t\t\t\t{ type: PORT_DISPLAY_IMAGE,\n\t\t\t\t\tsrc: newLayout.outputPortImage,\n\t\t\t\t\theight: newLayout.outputPortHeight || PORT_HEIGHT_DEFAULT,\n\t\t\t\t\twidth: newLayout.outputPortWidth || PORT_WIDTH_DEFAULT,\n\t\t\t\t}\n\t\t\t];\n\t\t}\n\n\t\tif (newLayout.outputPortGuideObject === PORT_DISPLAY_IMAGE) {\n\t\t\tnewLayout.outputPortGuideObjects = [\n\t\t\t\t{ type: PORT_DISPLAY_IMAGE,\n\t\t\t\t\tsrc: newLayout.outputPortGuideImage,\n\t\t\t\t\theight: newLayout.outputPortHeight || PORT_HEIGHT_DEFAULT,\n\t\t\t\t\twidth: newLayout.outputPortWidth || PORT_WIDTH_DEFAULT\n\t\t\t\t}\n\t\t\t];\n\t\t}\n\n\t\treturn newLayout;\n\t}\n}\n"],"names":["assignValue","require$$0","castPath","require$$1","isIndex","require$$2","isObject","require$$3","toKey","require$$4","_baseSet","object","path","value","customizer","index","length","lastIndex","nested","key","newValue","objValue","undefined","baseSet","set_1","baseGetTag","isObjectLike","isNumber_1","_createForOfIteratorHelper","r","e","t","Symbol","iterator","Array","isArray","a","_arrayLikeToArray","toString","call","slice","constructor","name","from","test","_unsupportedIterableToArray","_n","F","s","n","done","f","TypeError","o","u","next","CanvasUtils","_classCallCheck","_createClass","objects","objectPositions","forEach","obj","id","x_pos","y_pos","links","positions","l","srcPos","_set","trgPos","supernode","nodeSizingDirection","newWidth","newHeight","updateNodePos","_this","this","newObjectPositions","incWidth","width","incHeight","height","superCenterX","superCenterY","deltas","getMoveDeltas","xDelta","yDelta","updateLinkPos","_this2","newLinkPositions","link","xPos","yPos","indexOf","canvasLayout","expanded_width","Math","max","supernodeDefaultWidth","expanded_height","supernodeDefaultHeight","node","targetNodes","linkType","padding","maxIncrement","getCountOfLinksToTargetNodes","layout","minInitialLineIncrement","minInitialLine","minFinalLine","_this3","count","outputs","output","isNodeOutputLinkedToTargetNodes","_this4","state","srcNodeId","srcNodePortId","isTargetNode","trgNodeId","findIndex","tn","baseDecs","arguments","overlayDecs","decs","map","bd","objDec","find","od","Object","assign","push","navigator","platform","evnt","stopPropagation","preventDefault","gridSize","div","abs","trunc","x","y","w","h","gap","originX","originY","endX","endY","startPointX","startPointY","topEdge","leftEdge","rightEdge","bottomEdge","originTopOffsetY","originLeftOffsetX","originBottomOffsetY","originToEndX","originToEndY","dir","NORTH","SOUTH","ratioRight","EAST","ratioLeft","WEST","x1","y1","x2","y2","dx","dy","angleInDegrees","atan2","PI","halfNodeWidth","halfNodeHeight","xFromCenter","yFromCenter","angleToRight","atan","angleToBottomRight","angleToLeft","angleToTopLeft","rx1","ry1","rx2","ry2","insideLine","lineInside","intersectTop","linesIntersect","intersectLeft","intersectRight","intersectBottom","x3","y3","x4","y4","b","startPos","endPos","isInside","point1","point2","distance","sqrt","pow","p0","p1","p2","p3","config","enableEditingActions","isSuperBindingNode","enableResizableNodes","isExpandedSupernode","trgNodePortId","srcNode","trgNode","type","selfRefLinkAllowed","ASSOCIATION_LINK","isAssocConnectionAllowed","isDataConnectionAllowed","linkAlreadyExists","doesNodeHaveOutputPorts","isSrcCardinalityAtMax","doesNodeHaveInputPorts","isTrgCardinalityAtMax","inputs","isDataConnectionAllowedNoCardinality","getMaxCardinality","isCardinalityAtMax","areAllSrcNodePortsCardinalityAtMax","areAllTrgNodePortsCardinalityAtMax","exists","_this5","_this6","input","isNode","srcPortId","trgPortId","portId","_this7","getDefaultOutputPortId","srcCount","NODE_LINK","isFirstPort","maxCard","_this8","getDefaultInputPortId","trgCount","portArray","getPortIndex","port","p","ports","getPort","cardinality","Number","commentId","commentLinkAlreadyExists","detachedLinks","allNodeDataLinks","_this9","newLinks","oldLinks","nodeOverSrcPos","connected","isSrcConnectionAllowedWithDetachedLinks","getReplacedLinks","newLink","nodeOverTrgPos","isTrgConnectionAllowedWithDetachedLinks","nl","inReg","pipeline","includeLinks","enableAssocLinkType","_step","region","regionSelections","_iterator","nodes","err","_step2","_iterator2","comments","comment","_step3","_iterator3","LINK_TYPE_STRAIGHT","COMMENT_LINK","ASSOC_STRAIGHT","lineIntersectRectangle","isPosInArea","pos","area","pad","isComment","isLink","SUPER_NODE","is_expanded","isSupernode","isExpanded","d","isSupernodeInputBinding","isSupernodeOutputBinding","commentHighlightGap","nodeHighlightGap","allLinks","_this10","canvLeft","Infinity","canvTop","canvRight","canvBottom","nodeGap","min","left","top","right","bottom","defTrgPortId","filter","linkTrgPortId","part","style","style_temp","getStyleValue","_get","concat","inNodes","apiPipeline","trgCenterX","trgCenterY","getNode","srcCenterX","srcCenterY","drawNodeLinkLineFromTo","imagePosX","imageWidth","imagePosY","imageHeight","getOuterCoord","currentLinks","outLinks","some","cl","className","hex","c","substring","rgb","parseInt","commentSel","formats","startsWith","_CanvasUtils$convertF","convertFormat","field","_CanvasUtils$convertF2","domNode","anchorPos","focusPos","sel","window","getSelection","runningLen","childNodes","cn","nodeValue","textLen","anchorNode","anchorOffset","focusNode","focusOffset","start","end","range","document","createRange","selectNodeContents","removeAllRanges","addRange","selection","startTextNode","endTextNode","startTextPos","endTextPos","setStart","setEnd","format","getFontFamily","size","action","element","el","foundElement","isClassNameIncluded","parentNode","classList","contains","_has","subflow_ref","pipeline_id_ref","newLayout","_isNumber","inputPortTopPosX","inputPortTopPosY","inputPortPositions","inputPortBottomPosX","inputPortBottomPosY","inputPortLeftPosX","inputPortLeftPosY","outputPortTopPosX","outputPortTopPosY","outputPortPositions","outputPortBottomPosX","outputPortBottomPosY","outputPortRightPosX","outputPortRightPosY","outputPortRightPosition","inputPortObject","PORT_DISPLAY_IMAGE","inputPortDisplayObjects","src","inputPortImage","inputPortHeight","PORT_HEIGHT_DEFAULT","inputPortWidth","PORT_WIDTH_DEFAULT","inputPortGuideObject","inputPortGuideObjects","inputPortGuideImage","outputPortObject","outputPortDisplayObjects","outputPortImage","outputPortHeight","outputPortWidth","outputPortGuideObject","outputPortGuideObjects","outputPortGuideImage"],"mappings":"qRAAA,IAAIA,EAAcC,EACdC,EAA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