package.dist.chunks.mermaid.esm.chunk-E5O2ULER.mjs.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mermaid Show documentation
Show all versions of mermaid Show documentation
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
The newest version!
{
"version": 3,
"sources": ["../../../src/rendering-util/rendering-elements/shapes/util.ts", "../../../../../node_modules/.pnpm/[email protected]_patch_hash=vxb6t6fqvzyhwhtjiliqr25jyq/node_modules/roughjs/bundled/rough.esm.js", "../../../src/rendering-util/rendering-elements/intersect/intersect-rect.js", "../../../src/rendering-util/rendering-elements/createLabel.js", "../../../src/rendering-util/rendering-elements/shapes/roundedRectPath.ts", "../../../src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts", "../../../src/rendering-util/rendering-elements/clusters.js", "../../../src/rendering-util/rendering-elements/intersect/intersect-node.js", "../../../src/rendering-util/rendering-elements/intersect/intersect-ellipse.js", "../../../src/rendering-util/rendering-elements/intersect/intersect-circle.js", "../../../src/rendering-util/rendering-elements/intersect/intersect-line.js", "../../../src/rendering-util/rendering-elements/intersect/intersect-polygon.js", "../../../src/rendering-util/rendering-elements/intersect/index.js", "../../../src/rendering-util/rendering-elements/shapes/anchor.ts", "../../../src/rendering-util/rendering-elements/shapes/bowTieRect.ts", "../../../src/rendering-util/rendering-elements/shapes/insertPolygonShape.ts", "../../../src/rendering-util/rendering-elements/shapes/card.ts", "../../../src/rendering-util/rendering-elements/shapes/choice.ts", "../../../src/rendering-util/rendering-elements/shapes/circle.ts", "../../../src/rendering-util/rendering-elements/shapes/crossedCircle.ts", "../../../src/rendering-util/rendering-elements/shapes/curlyBraceLeft.ts", "../../../src/rendering-util/rendering-elements/shapes/curlyBraceRight.ts", "../../../src/rendering-util/rendering-elements/shapes/curlyBraces.ts", "../../../src/rendering-util/rendering-elements/shapes/curvedTrapezoid.ts", "../../../src/rendering-util/rendering-elements/shapes/cylinder.ts", "../../../src/rendering-util/rendering-elements/shapes/dividedRect.ts", "../../../src/rendering-util/rendering-elements/shapes/doubleCircle.ts", "../../../src/rendering-util/rendering-elements/shapes/filledCircle.ts", "../../../src/rendering-util/rendering-elements/shapes/flippedTriangle.ts", "../../../src/rendering-util/rendering-elements/shapes/forkJoin.ts", "../../../src/rendering-util/rendering-elements/shapes/halfRoundedRectangle.ts", "../../../src/rendering-util/rendering-elements/shapes/hexagon.ts", "../../../src/rendering-util/rendering-elements/shapes/hourglass.ts", "../../../src/rendering-util/rendering-elements/shapes/icon.ts", "../../../src/rendering-util/rendering-elements/shapes/iconCircle.ts", "../../../src/rendering-util/rendering-elements/shapes/iconRounded.ts", "../../../src/rendering-util/rendering-elements/shapes/iconSquare.ts", "../../../src/rendering-util/rendering-elements/shapes/imageSquare.ts", "../../../src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts", "../../../src/rendering-util/rendering-elements/shapes/drawRect.ts", "../../../src/rendering-util/rendering-elements/shapes/labelRect.ts", "../../../src/rendering-util/rendering-elements/shapes/leanLeft.ts", "../../../src/rendering-util/rendering-elements/shapes/leanRight.ts", "../../../src/rendering-util/rendering-elements/shapes/lightningBolt.ts", "../../../src/rendering-util/rendering-elements/shapes/linedCylinder.ts", "../../../src/rendering-util/rendering-elements/shapes/linedWaveEdgedRect.ts", "../../../src/rendering-util/rendering-elements/shapes/multiRect.ts", "../../../src/rendering-util/rendering-elements/shapes/multiWaveEdgedRectangle.ts", "../../../src/rendering-util/rendering-elements/shapes/note.ts", "../../../src/rendering-util/rendering-elements/shapes/question.ts", "../../../src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts", "../../../src/rendering-util/rendering-elements/shapes/rectWithTitle.ts", "../../../src/rendering-util/rendering-elements/shapes/roundedRect.ts", "../../../src/rendering-util/rendering-elements/shapes/shadedProcess.ts", "../../../src/rendering-util/rendering-elements/shapes/slopedRect.ts", "../../../src/rendering-util/rendering-elements/shapes/squareRect.ts", "../../../src/rendering-util/rendering-elements/shapes/stadium.ts", "../../../src/rendering-util/rendering-elements/shapes/state.ts", "../../../src/rendering-util/rendering-elements/shapes/stateEnd.ts", "../../../src/rendering-util/rendering-elements/shapes/stateStart.ts", "../../../src/rendering-util/rendering-elements/shapes/subroutine.ts", "../../../src/rendering-util/rendering-elements/shapes/taggedRect.ts", "../../../src/rendering-util/rendering-elements/shapes/taggedWaveEdgedRectangle.ts", "../../../src/rendering-util/rendering-elements/shapes/text.ts", "../../../src/rendering-util/rendering-elements/shapes/tiltedCylinder.ts", "../../../src/rendering-util/rendering-elements/shapes/trapezoid.ts", "../../../src/rendering-util/rendering-elements/shapes/trapezoidalPentagon.ts", "../../../src/rendering-util/rendering-elements/shapes/triangle.ts", "../../../src/rendering-util/rendering-elements/shapes/waveEdgedRectangle.ts", "../../../src/rendering-util/rendering-elements/shapes/waveRectangle.ts", "../../../src/rendering-util/rendering-elements/shapes/windowPane.ts", "../../../src/diagrams/class/shapeUtil.ts", "../../../src/rendering-util/rendering-elements/shapes/classBox.ts", "../../../src/rendering-util/rendering-elements/shapes/kanbanItem.ts", "../../../src/rendering-util/rendering-elements/shapes.ts", "../../../src/rendering-util/rendering-elements/nodes.ts"],
"sourcesContent": ["import { createText } from '../../createText.js';\nimport type { Node } from '../../types.js';\nimport { getConfig } from '../../../diagram-api/diagramAPI.js';\nimport { select } from 'd3';\nimport defaultConfig from '../../../defaultConfig.js';\nimport { evaluate, sanitizeText } from '../../../diagrams/common/common.js';\nimport { decodeEntities, handleUndefinedAttr, parseFontSize } from '../../../utils.js';\nimport type { D3Selection, Point } from '../../../types.js';\n\nexport const labelHelper = async (\n parent: D3Selection,\n node: Node,\n _classes?: string\n) => {\n let cssClasses;\n const useHtmlLabels = node.useHtmlLabels || evaluate(getConfig()?.htmlLabels);\n if (!_classes) {\n cssClasses = 'node default';\n } else {\n cssClasses = _classes;\n }\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', cssClasses)\n .attr('id', node.domId || node.id);\n\n // Create the label and insert it after the rect\n const labelEl = shapeSvg\n .insert('g')\n .attr('class', 'label')\n .attr('style', handleUndefinedAttr(node.labelStyle));\n\n // Replace label with default value if undefined\n let label;\n if (node.label === undefined) {\n label = '';\n } else {\n label = typeof node.label === 'string' ? node.label : node.label[0];\n }\n\n const text = await createText(labelEl, sanitizeText(decodeEntities(label), getConfig()), {\n useHtmlLabels,\n width: node.width || getConfig().flowchart?.wrappingWidth,\n // @ts-expect-error -- This is currently not used. Should this be `classes` instead?\n cssClasses: 'markdown-node-label',\n style: node.labelStyle,\n addSvgBackground: !!node.icon || !!node.img,\n });\n // Get the size of the label\n let bbox = text.getBBox();\n const halfPadding = (node?.padding ?? 0) / 2;\n\n if (useHtmlLabels) {\n const div = text.children[0];\n const dv = select(text);\n\n // if there are images, need to wait for them to load before getting the bounding box\n const images = div.getElementsByTagName('img');\n if (images) {\n const noImgText = label.replace(/]*>/g, '').trim() === '';\n\n await Promise.all(\n [...images].map(\n (img) =>\n new Promise((res) => {\n /**\n *\n */\n function setupImage() {\n img.style.display = 'flex';\n img.style.flexDirection = 'column';\n\n if (noImgText) {\n // default size if no text\n const bodyFontSize = getConfig().fontSize\n ? getConfig().fontSize\n : window.getComputedStyle(document.body).fontSize;\n const enlargingFactor = 5;\n const [parsedBodyFontSize = defaultConfig.fontSize] = parseFontSize(bodyFontSize);\n const width = parsedBodyFontSize * enlargingFactor + 'px';\n img.style.minWidth = width;\n img.style.maxWidth = width;\n } else {\n img.style.width = '100%';\n }\n res(img);\n }\n setTimeout(() => {\n if (img.complete) {\n setupImage();\n }\n });\n img.addEventListener('error', setupImage);\n img.addEventListener('load', setupImage);\n })\n )\n );\n }\n\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n // Center the label\n if (useHtmlLabels) {\n labelEl.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')');\n } else {\n labelEl.attr('transform', 'translate(' + 0 + ', ' + -bbox.height / 2 + ')');\n }\n if (node.centerLabel) {\n labelEl.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')');\n }\n labelEl.insert('rect', ':first-child');\n return { shapeSvg, bbox, halfPadding, label: labelEl };\n};\nexport const insertLabel = async (\n parent: D3Selection,\n label: string,\n options: {\n labelStyle?: string | undefined;\n icon?: boolean | undefined;\n img?: string | undefined;\n useHtmlLabels?: boolean | undefined;\n padding: number;\n width?: number | undefined;\n centerLabel?: boolean | undefined;\n addSvgBackground?: boolean | undefined;\n }\n) => {\n const useHtmlLabels = options.useHtmlLabels || evaluate(getConfig()?.flowchart?.htmlLabels);\n\n // Create the label and insert it after the rect\n const labelEl = parent\n .insert('g')\n .attr('class', 'label')\n .attr('style', options.labelStyle || '');\n\n const text = await createText(labelEl, sanitizeText(decodeEntities(label), getConfig()), {\n useHtmlLabels,\n width: options.width || getConfig()?.flowchart?.wrappingWidth,\n style: options.labelStyle,\n addSvgBackground: !!options.icon || !!options.img,\n });\n // Get the size of the label\n let bbox = text.getBBox();\n const halfPadding = options.padding / 2;\n\n if (evaluate(getConfig()?.flowchart?.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n // Center the label\n if (useHtmlLabels) {\n labelEl.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')');\n } else {\n labelEl.attr('transform', 'translate(' + 0 + ', ' + -bbox.height / 2 + ')');\n }\n if (options.centerLabel) {\n labelEl.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')');\n }\n labelEl.insert('rect', ':first-child');\n return { shapeSvg: parent, bbox, halfPadding, label: labelEl };\n};\nexport const updateNodeBounds = (\n node: Node,\n // D3Selection is for the roughjs case, D3Selection is for the non-roughjs case\n element: D3Selection | D3Selection\n) => {\n const bbox = element.node()!.getBBox();\n node.width = bbox.width;\n node.height = bbox.height;\n};\n\n/**\n * @param parent - Parent element to append the polygon to\n * @param w - Width of the polygon\n * @param h - Height of the polygon\n * @param points - Array of points to create the polygon\n */\nexport function insertPolygonShape(\n parent: D3Selection,\n w: number,\n h: number,\n points: Point[]\n) {\n return parent\n .insert('polygon', ':first-child')\n .attr(\n 'points',\n points\n .map(function (d) {\n return d.x + ',' + d.y;\n })\n .join(' ')\n )\n .attr('class', 'label-container')\n .attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')');\n}\n\nexport const getNodeClasses = (node: Node, extra?: string) =>\n (node.look === 'handDrawn' ? 'rough-node' : 'node') + ' ' + node.cssClasses + ' ' + (extra || '');\n\nexport function createPathFromPoints(points: Point[]) {\n const pointStrings = points.map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x},${p.y}`);\n pointStrings.push('Z');\n return pointStrings.join(' ');\n}\n\nexport function generateFullSineWavePoints(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n amplitude: number,\n numCycles: number\n) {\n const points = [];\n const steps = 50; // Number of segments to create a smooth curve\n const deltaX = x2 - x1;\n const deltaY = y2 - y1;\n const cycleLength = deltaX / numCycles;\n\n // Calculate frequency and phase shift\n const frequency = (2 * Math.PI) / cycleLength;\n const midY = y1 + deltaY / 2;\n\n for (let i = 0; i <= steps; i++) {\n const t = i / steps;\n const x = x1 + t * deltaX;\n const y = midY + amplitude * Math.sin(frequency * (x - x1));\n\n points.push({ x, y });\n }\n\n return points;\n}\n\n/**\n * @param centerX - x-coordinate of center of circle\n * @param centerY - y-coordinate of center of circle\n * @param radius - radius of circle\n * @param numPoints - total points required\n * @param startAngle - angle where arc will start\n * @param endAngle - angle where arc will end\n */\nexport function generateCirclePoints(\n centerX: number,\n centerY: number,\n radius: number,\n numPoints: number,\n startAngle: number,\n endAngle: number\n) {\n const points = [];\n\n // Convert angles to radians\n const startAngleRad = (startAngle * Math.PI) / 180;\n const endAngleRad = (endAngle * Math.PI) / 180;\n\n // Calculate the angle range in radians\n const angleRange = endAngleRad - startAngleRad;\n\n // Calculate the angle step\n const angleStep = angleRange / (numPoints - 1);\n\n for (let i = 0; i < numPoints; i++) {\n const angle = startAngleRad + i * angleStep;\n const x = centerX + radius * Math.cos(angle);\n const y = centerY + radius * Math.sin(angle);\n points.push({ x: -x, y: -y });\n }\n\n return points;\n}\n", "function t(t,e,s){if(t&&t.length){const[n,o]=e,a=Math.PI/180*s,h=Math.cos(a),r=Math.sin(a);for(const e of t){const[t,s]=e;e[0]=(t-n)*h-(s-o)*r+n,e[1]=(t-n)*r+(s-o)*h+o}}}function e(t,e){return t[0]===e[0]&&t[1]===e[1]}function s(s,n,o,a=1){const h=o,r=Math.max(n,.1),i=s[0]&&s[0][0]&&\"number\"==typeof s[0][0]?[s]:s,c=[0,0];if(h)for(const e of i)t(e,c,h);const l=function(t,s,n){const o=[];for(const s of t){const t=[...s];e(t[0],t[t.length-1])||t.push([t[0][0],t[0][1]]),t.length>2&&o.push(t)}const a=[];s=Math.max(s,.1);const h=[];for(const t of o)for(let e=0;et.ymine.ymin?1:t.xe.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!h.length)return a;let r=[],i=h[0].ymin,c=0;for(;r.length||h.length;){if(h.length){let t=-1;for(let e=0;ei);e++)t=e;h.splice(0,t+1).forEach((t=>{r.push({s:i,edge:t})}))}if(r=r.filter((t=>!(t.edge.ymax<=i))),r.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),(1!==n||c%s==0)&&r.length>1)for(let t=0;t=r.length)break;const s=r[t].edge,n=r[e].edge;a.push([[Math.round(s.x),i],[Math.round(n.x),i]])}i+=n,r.forEach((t=>{t.edge.x=t.edge.x+n*t.edge.islope})),c++}return a}(i,r,a);if(h){for(const e of i)t(e,c,-h);!function(e,s,n){const o=[];e.forEach((t=>o.push(...t))),t(o,s,n)}(l,c,-h)}return l}function n(t,e){var n;const o=e.hachureAngle+90;let a=e.hachureGap;a<0&&(a=4*e.strokeWidth),a=Math.round(Math.max(a,.1));let h=1;return e.roughness>=1&&((null===(n=e.randomizer)||void 0===n?void 0:n.next())||Math.random())>.7&&(h=a),s(t,a,o,h||1)}class o{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const s=n(t,e);return{type:\"fillSketch\",ops:this.renderLines(s,e)}}renderLines(t,e){const s=[];for(const n of t)s.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return s}}function a(t){const e=t[0],s=t[1];return Math.sqrt(Math.pow(e[0]-s[0],2)+Math.pow(e[1]-s[1],2))}class h extends o{fillPolygons(t,e){let s=e.hachureGap;s<0&&(s=4*e.strokeWidth),s=Math.max(s,.1);const o=n(t,Object.assign({},e,{hachureGap:s})),h=Math.PI/180*e.hachureAngle,r=[],i=.5*s*Math.cos(h),c=.5*s*Math.sin(h);for(const[t,e]of o)a([t,e])&&r.push([[t[0]-i,t[1]+c],[...e]],[[t[0]+i,t[1]-c],[...e]]);return{type:\"fillSketch\",ops:this.renderLines(r,e)}}}class r extends o{fillPolygons(t,e){const s=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),o=this._fillPolygons(t,n);return s.ops=s.ops.concat(o.ops),s}}class i{constructor(t){this.helper=t}fillPolygons(t,e){const s=n(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(s,e)}dotsOnLines(t,e){const s=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let o=e.fillWeight;o<0&&(o=e.strokeWidth/2);const h=n/4;for(const r of t){const t=a(r),i=t/n,c=Math.ceil(i)-1,l=t-c*n,u=(r[0][0]+r[1][0])/2-n/4,p=Math.min(r[0][1],r[1][1]);for(let t=0;t{const h=a(t),r=Math.floor(h/(s+n)),i=(h+n-r*(s+n))/2;let c=t[0],l=t[1];c[0]>l[0]&&(c=t[1],l=t[0]);const u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let t=0;t{const o=a(t),h=Math.round(o/(2*e));let r=t[0],i=t[1];r[0]>i[0]&&(r=t[1],i=t[0]);const c=Math.atan((i[1]-r[1])/(i[0]-r[0]));for(let t=0;tn%2?t+s:t+e));a.push({key:\"C\",data:t}),e=t[4],s=t[5];break}case\"Q\":a.push({key:\"Q\",data:[...r]}),e=r[2],s=r[3];break;case\"q\":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:\"Q\",data:t}),e=t[2],s=t[3];break}case\"A\":a.push({key:\"A\",data:[...r]}),e=r[5],s=r[6];break;case\"a\":e+=r[5],s+=r[6],a.push({key:\"A\",data:[r[0],r[1],r[2],r[3],r[4],e,s]});break;case\"H\":a.push({key:\"H\",data:[...r]}),e=r[0];break;case\"h\":e+=r[0],a.push({key:\"H\",data:[e]});break;case\"V\":a.push({key:\"V\",data:[...r]}),s=r[0];break;case\"v\":s+=r[0],a.push({key:\"V\",data:[s]});break;case\"S\":a.push({key:\"S\",data:[...r]}),e=r[2],s=r[3];break;case\"s\":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:\"S\",data:t}),e=t[2],s=t[3];break}case\"T\":a.push({key:\"T\",data:[...r]}),e=r[0],s=r[1];break;case\"t\":e+=r[0],s+=r[1],a.push({key:\"T\",data:[e,s]});break;case\"Z\":case\"z\":a.push({key:\"Z\",data:[]}),e=n,s=o}return a}function m(t){const e=[];let s=\"\",n=0,o=0,a=0,h=0,r=0,i=0;for(const{key:c,data:l}of t){switch(c){case\"M\":e.push({key:\"M\",data:[...l]}),[n,o]=l,[a,h]=l;break;case\"C\":e.push({key:\"C\",data:[...l]}),n=l[4],o=l[5],r=l[2],i=l[3];break;case\"L\":e.push({key:\"L\",data:[...l]}),[n,o]=l;break;case\"H\":n=l[0],e.push({key:\"L\",data:[n,o]});break;case\"V\":o=l[0],e.push({key:\"L\",data:[n,o]});break;case\"S\":{let t=0,a=0;\"C\"===s||\"S\"===s?(t=n+(n-r),a=o+(o-i)):(t=n,a=o),e.push({key:\"C\",data:[t,a,...l]}),r=l[0],i=l[1],n=l[2],o=l[3];break}case\"T\":{const[t,a]=l;let h=0,c=0;\"Q\"===s||\"T\"===s?(h=n+(n-r),c=o+(o-i)):(h=n,c=o);const u=n+2*(h-n)/3,p=o+2*(c-o)/3,f=t+2*(h-t)/3,d=a+2*(c-a)/3;e.push({key:\"C\",data:[u,p,f,d,t,a]}),r=h,i=c,n=t,o=a;break}case\"Q\":{const[t,s,a,h]=l,c=n+2*(t-n)/3,u=o+2*(s-o)/3,p=a+2*(t-a)/3,f=h+2*(s-h)/3;e.push({key:\"C\",data:[c,u,p,f,a,h]}),r=t,i=s,n=a,o=h;break}case\"A\":{const t=Math.abs(l[0]),s=Math.abs(l[1]),a=l[2],h=l[3],r=l[4],i=l[5],c=l[6];if(0===t||0===s)e.push({key:\"C\",data:[n,o,i,c,i,c]}),n=i,o=c;else if(n!==i||o!==c){x(n,o,i,c,t,s,a,h,r).forEach((function(t){e.push({key:\"C\",data:t})})),n=i,o=c}break}case\"Z\":e.push({key:\"Z\",data:[]}),n=a,o=h}s=c}return e}function w(t,e,s){return[t*Math.cos(s)-e*Math.sin(s),t*Math.sin(s)+e*Math.cos(s)]}function x(t,e,s,n,o,a,h,r,i,c){const l=(u=h,Math.PI*u/180);var u;let p=[],f=0,d=0,g=0,M=0;if(c)[f,d,g,M]=c;else{[t,e]=w(t,e,-l),[s,n]=w(s,n,-l);const h=(t-s)/2,c=(e-n)/2;let u=h*h/(o*o)+c*c/(a*a);u>1&&(u=Math.sqrt(u),o*=u,a*=u);const p=o*o,k=a*a,b=p*k-p*c*c-k*h*h,y=p*c*c+k*h*h,m=(r===i?-1:1)*Math.sqrt(Math.abs(b/y));g=m*o*c/a+(t+s)/2,M=m*-a*h/o+(e+n)/2,f=Math.asin(parseFloat(((e-M)/a).toFixed(9))),d=Math.asin(parseFloat(((n-M)/a).toFixed(9))),td&&(f-=2*Math.PI),!i&&d>f&&(d-=2*Math.PI)}let k=d-f;if(Math.abs(k)>120*Math.PI/180){const t=d,e=s,r=n;d=i&&d>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,p=x(s=g+o*Math.cos(d),n=M+a*Math.sin(d),e,r,o,a,h,0,i,[d,t,g,M])}k=d-f;const b=Math.cos(f),y=Math.sin(f),m=Math.cos(d),P=Math.sin(d),v=Math.tan(k/4),S=4/3*o*v,O=4/3*a*v,L=[t,e],T=[t+S*y,e-O*b],D=[s+S*P,n-O*m],A=[s,n];if(T[0]=2*L[0]-T[0],T[1]=2*L[1]-T[1],c)return[T,D,A].concat(p);{p=[T,D,A].concat(p);const t=[];for(let e=0;e2){const o=[];for(let e=0;e2*Math.PI&&(f=0,d=2*Math.PI);const g=2*Math.PI/i.curveStepCount,M=Math.min(g/2,(d-f)/2),k=V(M,c,l,u,p,f,d,1,i);if(!i.disableMultiStroke){const t=V(M,c,l,u,p,f,d,1.5,i);k.push(...t)}return h&&(r?k.push(...$(c,l,c+u*Math.cos(f),l+p*Math.sin(f),i),...$(c,l,c+u*Math.cos(d),l+p*Math.sin(d),i)):k.push({op:\"lineTo\",data:[c,l]},{op:\"lineTo\",data:[c+u*Math.cos(f),l+p*Math.sin(f)]})),{type:\"path\",ops:k}}function _(t,e){const s=m(y(b(t))),n=[];let o=[0,0],a=[0,0];for(const{key:t,data:h}of s)switch(t){case\"M\":a=[h[0],h[1]],o=[h[0],h[1]];break;case\"L\":n.push(...$(a[0],a[1],h[0],h[1],e)),a=[h[0],h[1]];break;case\"C\":{const[t,s,o,r,i,c]=h;n.push(...Z(t,s,o,r,i,c,a,e)),a=[i,c];break}case\"Z\":n.push(...$(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]]}return{type:\"path\",ops:n}}function I(t,e){const s=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,o=n.length;if(o>2){s.push({op:\"move\",data:[n[0][0]+G(t,e),n[0][1]+G(t,e)]});for(let a=1;a500?.4:-.0016668*i+1.233334;let l=o.maxRandomnessOffset||0;l*l*100>r&&(l=i/10);const u=l/2,p=.2+.2*W(o);let f=o.bowing*o.maxRandomnessOffset*(n-e)/200,d=o.bowing*o.maxRandomnessOffset*(t-s)/200;f=G(f,o,c),d=G(d,o,c);const g=[],M=()=>G(u,o,c),k=()=>G(l,o,c),b=o.preserveVertices;return a&&(h?g.push({op:\"move\",data:[t+(b?0:M()),e+(b?0:M())]}):g.push({op:\"move\",data:[t+(b?0:G(l,o,c)),e+(b?0:G(l,o,c))]})),h?g.push({op:\"bcurveTo\",data:[f+t+(s-t)*p+M(),d+e+(n-e)*p+M(),f+t+2*(s-t)*p+M(),d+e+2*(n-e)*p+M(),s+(b?0:M()),n+(b?0:M())]}):g.push({op:\"bcurveTo\",data:[f+t+(s-t)*p+k(),d+e+(n-e)*p+k(),f+t+2*(s-t)*p+k(),d+e+2*(n-e)*p+k(),s+(b?0:k()),n+(b?0:k())]}),g}function j(t,e,s){if(!t.length)return[];const n=[];n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]),n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]);for(let o=1;o3){const a=[],h=1-s.curveTightness;o.push({op:\"move\",data:[t[1][0],t[1][1]]});for(let e=1;e+21&&o.push(s)}else o.push(s);o.push(t[e+3])}else{const n=.5,a=t[e+0],h=t[e+1],r=t[e+2],i=t[e+3],c=J(a,h,n),l=J(h,r,n),u=J(r,i,n),p=J(c,l,n),f=J(l,u,n),d=J(p,f,n);K([a,c,p,d],0,s,o),K([d,f,u,i],0,s,o)}var a,h;return o}function U(t,e){return X(t,0,t.length,e)}function X(t,e,s,n,o){const a=o||[],h=t[e],r=t[s-1];let i=0,c=1;for(let n=e+1;ni&&(i=e,c=n)}return Math.sqrt(i)>n?(X(t,e,c+1,n,a),X(t,c,s,n,a)):(a.length||a.push(h),a.push(r)),a}function Y(t,e=.15,s){const n=[],o=(t.length-1)/3;for(let s=0;s0?X(n,0,n.length,s):n}const tt=\"none\";class et{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:\"#000\",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:\"hachure\",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,s){return{shape:t,sets:e||[],options:s||this.defaultOptions}}line(t,e,s,n,o){const a=this._o(o);return this._d(\"line\",[v(t,e,s,n,a)],a)}rectangle(t,e,s,n,o){const a=this._o(o),h=[],r=O(t,e,s,n,a);if(a.fill){const o=[[t,e],[t+s,e],[t+s,e+n],[t,e+n]];\"solid\"===a.fillStyle?h.push(I([o],a)):h.push(C([o],a))}return a.stroke!==tt&&h.push(r),this._d(\"rectangle\",h,a)}ellipse(t,e,s,n,o){const a=this._o(o),h=[],r=T(s,n,a),i=D(t,e,a,r);if(a.fill)if(\"solid\"===a.fillStyle){const s=D(t,e,a,r).opset;s.type=\"fillPath\",h.push(s)}else h.push(C([i.estimatedPoints],a));return a.stroke!==tt&&h.push(i.opset),this._d(\"ellipse\",h,a)}circle(t,e,s,n){const o=this.ellipse(t,e,s,s,n);return o.shape=\"circle\",o}linearPath(t,e){const s=this._o(e);return this._d(\"linearPath\",[S(t,!1,s)],s)}arc(t,e,s,n,o,a,h=!1,r){const i=this._o(r),c=[],l=A(t,e,s,n,o,a,h,!0,i);if(h&&i.fill)if(\"solid\"===i.fillStyle){const h=Object.assign({},i);h.disableMultiStroke=!0;const r=A(t,e,s,n,o,a,!0,!1,h);r.type=\"fillPath\",c.push(r)}else c.push(function(t,e,s,n,o,a,h){const r=t,i=e;let c=Math.abs(s/2),l=Math.abs(n/2);c+=G(.01*c,h),l+=G(.01*l,h);let u=o,p=a;for(;u<0;)u+=2*Math.PI,p+=2*Math.PI;p-u>2*Math.PI&&(u=0,p=2*Math.PI);const f=(p-u)/h.curveStepCount,d=[];for(let t=u;t<=p;t+=f)d.push([r+c*Math.cos(t),i+l*Math.sin(t)]);return d.push([r+c*Math.cos(p),i+l*Math.sin(p)]),d.push([r,i]),C([d],h)}(t,e,s,n,o,a,i));return i.stroke!==tt&&c.push(l),this._d(\"arc\",c,i)}curve(t,e){const s=this._o(e),n=[],o=L(t,s);if(s.fill&&s.fill!==tt)if(\"solid\"===s.fillStyle){const e=L(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:\"fillPath\",ops:this._mergedShape(e.ops)})}else{const e=[],o=t;if(o.length){const t=\"number\"==typeof o[0][0]?[o]:o;for(const n of t)n.length<3?e.push(...n):3===n.length?e.push(...Y(H([n[0],n[0],n[1],n[2]]),10,(1+s.roughness)/2)):e.push(...Y(H(n),10,(1+s.roughness)/2))}e.length&&n.push(C([e],s))}return s.stroke!==tt&&n.push(o),this._d(\"curve\",n,s)}polygon(t,e){const s=this._o(e),n=[],o=S(t,!0,s);return s.fill&&(\"solid\"===s.fillStyle?n.push(I([t],s)):n.push(C([t],s))),s.stroke!==tt&&n.push(o),this._d(\"polygon\",n,s)}path(t,e){const s=this._o(e),n=[];if(!t)return this._d(\"path\",n,s);t=(t||\"\").replace(/\\n/g,\" \").replace(/(-\\s)/g,\"-\").replace(\"/(ss)/g\",\" \");const o=s.fill&&\"transparent\"!==s.fill&&s.fill!==tt,a=s.stroke!==tt,h=!!(s.simplification&&s.simplification<1),r=function(t,e,s){const n=m(y(b(t))),o=[];let a=[],h=[0,0],r=[];const i=()=>{r.length>=4&&a.push(...Y(r,e)),r=[]},c=()=>{i(),a.length&&(o.push(a),a=[])};for(const{key:t,data:e}of n)switch(t){case\"M\":c(),h=[e[0],e[1]],a.push(h);break;case\"L\":i(),a.push([e[0],e[1]]);break;case\"C\":if(!r.length){const t=a.length?a[a.length-1]:h;r.push([t[0],t[1]])}r.push([e[0],e[1]]),r.push([e[2],e[3]]),r.push([e[4],e[5]]);break;case\"Z\":i(),a.push([h[0],h[1]])}if(c(),!s)return o;const l=[];for(const t of o){const e=U(t,s);e.length&&l.push(e)}return l}(t,1,h?4-4*(s.simplification||1):(1+s.roughness)/2),i=_(t,s);if(o)if(\"solid\"===s.fillStyle)if(1===r.length){const e=_(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:\"fillPath\",ops:this._mergedShape(e.ops)})}else n.push(I(r,s));else n.push(C(r,s));return a&&(h?r.forEach((t=>{n.push(S(t,!1,s))})):n.push(i)),this._d(\"path\",n,s)}opsToPath(t,e){let s=\"\";for(const n of t.ops){const t=\"number\"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case\"move\":s+=`M${t[0]} ${t[1]} `;break;case\"bcurveTo\":s+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case\"lineTo\":s+=`L${t[0]} ${t[1]} `}}return s.trim()}toPaths(t){const e=t.sets||[],s=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case\"path\":e={d:this.opsToPath(t),stroke:s.stroke,strokeWidth:s.strokeWidth,fill:tt};break;case\"fillPath\":e={d:this.opsToPath(t),stroke:tt,strokeWidth:0,fill:s.fill||tt};break;case\"fillSketch\":e=this.fillSketch(t,s)}e&&n.push(e)}return n}fillSketch(t,e){let s=e.fillWeight;return s<0&&(s=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||tt,strokeWidth:s,fill:tt}}_mergedShape(t){return t.filter(((t,e)=>0===e||\"move\"!==t.op))}}class st{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext(\"2d\"),this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const a of e)switch(a.type){case\"path\":n.save(),n.strokeStyle=\"none\"===s.stroke?\"transparent\":s.stroke,n.lineWidth=s.strokeWidth,s.strokeLineDash&&n.setLineDash(s.strokeLineDash),s.strokeLineDashOffset&&(n.lineDashOffset=s.strokeLineDashOffset),this._drawToContext(n,a,o),n.restore();break;case\"fillPath\":{n.save(),n.fillStyle=s.fill||\"\";const e=\"curve\"===t.shape||\"polygon\"===t.shape||\"path\"===t.shape?\"evenodd\":\"nonzero\";this._drawToContext(n,a,o,e),n.restore();break}case\"fillSketch\":this.fillSketch(n,a,s)}}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2),t.save(),s.fillLineDash&&t.setLineDash(s.fillLineDash),s.fillLineDashOffset&&(t.lineDashOffset=s.fillLineDashOffset),t.strokeStyle=s.fill||\"\",t.lineWidth=n,this._drawToContext(t,e,s.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,s,n=\"nonzero\"){t.beginPath();for(const n of e.ops){const e=\"number\"==typeof s&&s>=0?n.data.map((t=>+t.toFixed(s))):n.data;switch(n.op){case\"move\":t.moveTo(e[0],e[1]);break;case\"bcurveTo\":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case\"lineTo\":t.lineTo(e[0],e[1])}}\"fillPath\"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a),a}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a),a}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a),a}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o),o}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s),s}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s),s}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i),i}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s),s}path(t,e){const s=this.gen.path(t,e);return this.draw(s),s}}const nt=\"http://www.w3.org/2000/svg\";class ot{constructor(t,e){this.svg=t,this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,o=n.createElementNS(nt,\"g\"),a=t.options.fixedDecimalPlaceDigits;for(const h of e){let e=null;switch(h.type){case\"path\":e=n.createElementNS(nt,\"path\"),e.setAttribute(\"d\",this.opsToPath(h,a)),e.setAttribute(\"stroke\",s.stroke),e.setAttribute(\"stroke-width\",s.strokeWidth+\"\"),e.setAttribute(\"fill\",\"none\"),s.strokeLineDash&&e.setAttribute(\"stroke-dasharray\",s.strokeLineDash.join(\" \").trim()),s.strokeLineDashOffset&&e.setAttribute(\"stroke-dashoffset\",`${s.strokeLineDashOffset}`);break;case\"fillPath\":e=n.createElementNS(nt,\"path\"),e.setAttribute(\"d\",this.opsToPath(h,a)),e.setAttribute(\"stroke\",\"none\"),e.setAttribute(\"stroke-width\",\"0\"),e.setAttribute(\"fill\",s.fill||\"\"),\"curve\"!==t.shape&&\"polygon\"!==t.shape||e.setAttribute(\"fill-rule\",\"evenodd\");break;case\"fillSketch\":e=this.fillSketch(n,h,s)}e&&o.appendChild(e)}return o}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2);const o=t.createElementNS(nt,\"path\");return o.setAttribute(\"d\",this.opsToPath(e,s.fixedDecimalPlaceDigits)),o.setAttribute(\"stroke\",s.fill||\"\"),o.setAttribute(\"stroke-width\",n+\"\"),o.setAttribute(\"fill\",\"none\"),s.fillLineDash&&o.setAttribute(\"stroke-dasharray\",s.fillLineDash.join(\" \").trim()),s.fillLineDashOffset&&o.setAttribute(\"stroke-dashoffset\",`${s.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a)}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a)}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a)}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o)}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s)}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s)}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i)}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s)}path(t,e){const s=this.gen.path(t,e);return this.draw(s)}}var at={canvas:(t,e)=>new st(t,e),svg:(t,e)=>new ot(t,e),generator:t=>new et(t),newSeed:()=>et.newSeed()};export{at as default};\n", "const intersectRect = (node, point) => {\n var x = node.x;\n var y = node.y;\n\n // Rectangle intersection algorithm from:\n // https://math.stackexchange.com/questions/108113/find-edge-between-two-boxes\n var dx = point.x - x;\n var dy = point.y - y;\n var w = node.width / 2;\n var h = node.height / 2;\n\n var sx, sy;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n // Intersection is top or bottom of rect.\n if (dy < 0) {\n h = -h;\n }\n sx = dy === 0 ? 0 : (h * dx) / dy;\n sy = h;\n } else {\n // Intersection is left or right of rect.\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = dx === 0 ? 0 : (w * dy) / dx;\n }\n\n return { x: x + sx, y: y + sy };\n};\n\nexport default intersectRect;\n", "import { select } from 'd3';\nimport { log } from '../../logger.js';\nimport { getConfig } from '../../diagram-api/diagramAPI.js';\nimport common, { evaluate, renderKatex, hasKatex } from '../../diagrams/common/common.js';\nimport { decodeEntities } from '../../utils.js';\n\n/**\n * @param dom\n * @param styleFn\n */\nfunction applyStyle(dom, styleFn) {\n if (styleFn) {\n dom.attr('style', styleFn);\n }\n}\n\n/**\n * @param {any} node\n * @returns {Promise} Node\n */\nasync function addHtmlLabel(node) {\n const fo = select(document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject'));\n const div = fo.append('xhtml:div');\n\n let label = node.label;\n if (node.label && hasKatex(node.label)) {\n label = await renderKatex(node.label.replace(common.lineBreakRegex, '\\n'), getConfig());\n }\n const labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel';\n div.html(\n '' +\n label +\n ''\n );\n\n applyStyle(div, node.labelStyle);\n div.style('display', 'inline-block');\n div.style('padding-right', '1px');\n // Fix for firefox\n div.style('white-space', 'nowrap');\n div.attr('xmlns', 'http://www.w3.org/1999/xhtml');\n return fo.node();\n}\n/**\n * @param _vertexText\n * @param style\n * @param isTitle\n * @param isNode\n * @deprecated svg-util/createText instead\n */\nconst createLabel = async (_vertexText, style, isTitle, isNode) => {\n let vertexText = _vertexText || '';\n if (typeof vertexText === 'object') {\n vertexText = vertexText[0];\n }\n\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?\n vertexText = vertexText.replace(/\\\\n|\\n/g, '
');\n log.info('vertexText' + vertexText);\n const node = {\n isNode,\n label: decodeEntities(vertexText).replace(\n /fa[blrs]?:fa-[\\w-]+/g,\n (s) => ``\n ),\n labelStyle: style ? style.replace('fill:', 'color:') : style,\n };\n let vertexNode = await addHtmlLabel(node);\n // vertexNode.parentNode.removeChild(vertexNode);\n return vertexNode;\n } else {\n const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n svgLabel.setAttribute('style', style.replace('color:', 'fill:'));\n let rows = [];\n if (typeof vertexText === 'string') {\n rows = vertexText.split(/\\\\n|\\n|
/gi);\n } else if (Array.isArray(vertexText)) {\n rows = vertexText;\n } else {\n rows = [];\n }\n\n for (const row of rows) {\n const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');\n tspan.setAttribute('dy', '1em');\n tspan.setAttribute('x', '0');\n if (isTitle) {\n tspan.setAttribute('class', 'title-row');\n } else {\n tspan.setAttribute('class', 'row');\n }\n tspan.textContent = row.trim();\n svgLabel.appendChild(tspan);\n }\n return svgLabel;\n }\n};\n\nexport default createLabel;\n", "export const createRoundedRectPathD = (\n x: number,\n y: number,\n totalWidth: number,\n totalHeight: number,\n radius: number\n) =>\n [\n 'M',\n x + radius,\n y, // Move to the first point\n 'H',\n x + totalWidth - radius, // Draw horizontal line to the beginning of the right corner\n 'A',\n radius,\n radius,\n 0,\n 0,\n 1,\n x + totalWidth,\n y + radius, // Draw arc to the right top corner\n 'V',\n y + totalHeight - radius, // Draw vertical line down to the beginning of the right bottom corner\n 'A',\n radius,\n radius,\n 0,\n 0,\n 1,\n x + totalWidth - radius,\n y + totalHeight, // Draw arc to the right bottom corner\n 'H',\n x + radius, // Draw horizontal line to the beginning of the left bottom corner\n 'A',\n radius,\n radius,\n 0,\n 0,\n 1,\n x,\n y + totalHeight - radius, // Draw arc to the left bottom corner\n 'V',\n y + radius, // Draw vertical line up to the beginning of the left top corner\n 'A',\n radius,\n radius,\n 0,\n 0,\n 1,\n x + radius,\n y, // Draw arc to the left top corner\n 'Z', // Close the path\n ].join(' ');\n", "import { getConfig } from '../../../diagram-api/diagramAPI.js';\nimport type { Node } from '../../types.js';\n\n// Striped fill like start or fork nodes in state diagrams\nexport const solidStateFill = (color: string) => {\n const { handDrawnSeed } = getConfig();\n return {\n fill: color,\n hachureAngle: 120, // angle of hachure,\n hachureGap: 4,\n fillWeight: 2,\n roughness: 0.7,\n stroke: color,\n seed: handDrawnSeed,\n };\n};\n\nexport const compileStyles = (node: Node) => {\n // node.cssCompiledStyles is an array of strings in the form of 'key: value' where jey is the css property and value is the value\n // the array is the styles of node node from the classes it is using\n // node.cssStyles is an array of styles directly set on the node\n // concat the arrays and remove duplicates such that the values from node.cssStyles are used if there are duplicates\n const stylesMap = styles2Map([...(node.cssCompiledStyles || []), ...(node.cssStyles || [])]);\n return { stylesMap, stylesArray: [...stylesMap] };\n};\n\nexport const styles2Map = (styles: string[]) => {\n const styleMap = new Map();\n styles.forEach((style) => {\n const [key, value] = style.split(':');\n styleMap.set(key.trim(), value?.trim());\n });\n return styleMap;\n};\n\nexport const styles2String = (node: Node) => {\n const { stylesArray } = compileStyles(node);\n const labelStyles: string[] = [];\n const nodeStyles: string[] = [];\n const borderStyles: string[] = [];\n const backgroundStyles: string[] = [];\n\n stylesArray.forEach((style) => {\n const key = style[0];\n if (\n key === 'color' ||\n key === 'font-size' ||\n key === 'font-family' ||\n key === 'font-weight' ||\n key === 'font-style' ||\n key === 'text-decoration' ||\n key === 'text-align' ||\n key === 'text-transform' ||\n key === 'line-height' ||\n key === 'letter-spacing' ||\n key === 'word-spacing' ||\n key === 'text-shadow' ||\n key === 'text-overflow' ||\n key === 'white-space' ||\n key === 'word-wrap' ||\n key === 'word-break' ||\n key === 'overflow-wrap' ||\n key === 'hyphens'\n ) {\n labelStyles.push(style.join(':') + ' !important');\n } else {\n nodeStyles.push(style.join(':') + ' !important');\n if (key.includes('stroke')) {\n borderStyles.push(style.join(':') + ' !important');\n }\n if (key === 'fill') {\n backgroundStyles.push(style.join(':') + ' !important');\n }\n }\n });\n\n return {\n labelStyles: labelStyles.join(';'),\n nodeStyles: nodeStyles.join(';'),\n stylesArray,\n borderStyles,\n backgroundStyles,\n };\n};\n\n// Striped fill like start or fork nodes in state diagrams\n// TODO remove any\nexport const userNodeOverrides = (node: Node, options: any) => {\n const { themeVariables, handDrawnSeed } = getConfig();\n const { nodeBorder, mainBkg } = themeVariables;\n const { stylesMap } = compileStyles(node);\n\n // index the style array to a map object\n const result = Object.assign(\n {\n roughness: 0.7,\n fill: stylesMap.get('fill') || mainBkg,\n fillStyle: 'hachure', // solid fill\n fillWeight: 4,\n hachureGap: 5.2,\n stroke: stylesMap.get('stroke') || nodeBorder,\n seed: handDrawnSeed,\n strokeWidth: stylesMap.get('stroke-width')?.replace('px', '') || 1.3,\n fillLineDash: [0, 0],\n },\n options\n );\n return result;\n};\n", "import { getConfig } from '../../diagram-api/diagramAPI.js';\nimport { evaluate } from '../../diagrams/common/common.js';\nimport { log } from '../../logger.js';\nimport { getSubGraphTitleMargins } from '../../utils/subGraphTitleMargins.js';\nimport { select } from 'd3';\nimport rough from 'roughjs';\nimport { createText } from '../createText.ts';\nimport intersectRect from '../rendering-elements/intersect/intersect-rect.js';\nimport createLabel from './createLabel.js';\nimport { createRoundedRectPathD } from './shapes/roundedRectPath.ts';\nimport { styles2String, userNodeOverrides } from './shapes/handDrawnShapeStyles.js';\n\nconst rect = async (parent, node) => {\n log.info('Creating subgraph rect for ', node.id, node);\n const siteConfig = getConfig();\n const { themeVariables, handDrawnSeed } = siteConfig;\n const { clusterBkg, clusterBorder } = themeVariables;\n\n const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node);\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'cluster ' + node.cssClasses)\n .attr('id', node.id)\n .attr('data-look', node.look);\n\n const useHtmlLabels = evaluate(siteConfig.flowchart.htmlLabels);\n\n // Create the label and insert it after the rect\n const labelEl = shapeSvg.insert('g').attr('class', 'cluster-label ');\n\n const text = await createText(labelEl, node.label, {\n style: node.labelStyle,\n useHtmlLabels,\n isNode: true,\n });\n\n // Get the size of the label\n let bbox = text.getBBox();\n\n if (evaluate(siteConfig.flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;\n if (node.width <= bbox.width + node.padding) {\n node.diff = (width - node.width) / 2 - node.padding;\n } else {\n node.diff = -node.padding;\n }\n\n const height = node.height;\n const x = node.x - width / 2;\n const y = node.y - height / 2;\n\n log.trace('Data ', node, JSON.stringify(node));\n let rect;\n if (node.look === 'handDrawn') {\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {\n roughness: 0.7,\n fill: clusterBkg,\n // fill: 'red',\n stroke: clusterBorder,\n fillWeight: 3,\n seed: handDrawnSeed,\n });\n const roughNode = rc.path(createRoundedRectPathD(x, y, width, height, 0), options);\n rect = shapeSvg.insert(() => {\n log.debug('Rough node insert CXC', roughNode);\n return roughNode;\n }, ':first-child');\n // Should we affect the options instead of doing this?\n rect.select('path:nth-child(2)').attr('style', borderStyles.join(';'));\n rect.select('path').attr('style', backgroundStyles.join(';').replace('fill', 'stroke'));\n } else {\n // add the rect\n rect = shapeSvg.insert('rect', ':first-child');\n // center the rect around its coordinate\n rect\n .attr('style', nodeStyles)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height);\n }\n const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig);\n labelEl.attr(\n 'transform',\n // This puts the label on top of the box instead of inside it\n `translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`\n );\n\n if (labelStyles) {\n const span = labelEl.select('span');\n if (span) {\n span.attr('style', labelStyles);\n }\n }\n // Center the label\n\n const rectBox = rect.node().getBBox();\n node.offsetX = 0;\n node.width = rectBox.width;\n node.height = rectBox.height;\n // Used by layout engine to position subgraph in parent\n node.offsetY = bbox.height - node.padding / 2;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: bbox };\n};\n\n/**\n * Non visible cluster where the note is group with its\n *\n * @param {any} parent\n * @param {any} node\n * @returns {any} ShapeSvg\n */\nconst noteGroup = (parent, node) => {\n // Add outer g element\n const shapeSvg = parent.insert('g').attr('class', 'note-cluster').attr('id', node.id);\n\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n // center the rect around its coordinate\n rect\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', node.x - node.width / 2 - halfPadding)\n .attr('y', node.y - node.height / 2 - halfPadding)\n .attr('width', node.width + padding)\n .attr('height', node.height + padding)\n .attr('fill', 'none');\n\n const rectBox = rect.node().getBBox();\n node.width = rectBox.width;\n node.height = rectBox.height;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: { width: 0, height: 0 } };\n};\n\nconst roundedWithTitle = async (parent, node) => {\n const siteConfig = getConfig();\n\n const { themeVariables, handDrawnSeed } = siteConfig;\n const { altBackground, compositeBackground, compositeTitleBackground, nodeBorder } =\n themeVariables;\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', node.cssClasses)\n .attr('id', node.id)\n .attr('data-id', node.id)\n .attr('data-look', node.look);\n\n // add the rect\n const outerRectG = shapeSvg.insert('g', ':first-child');\n\n // Create the label and insert it after the rect\n const label = shapeSvg.insert('g').attr('class', 'cluster-label');\n let innerRect = shapeSvg.append('rect');\n\n const text = label\n .node()\n .appendChild(await createLabel(node.label, node.labelStyle, undefined, true));\n\n // Get the size of the label\n let bbox = text.getBBox();\n\n if (evaluate(siteConfig.flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n // Rounded With Title\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n const width =\n (node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width) + padding;\n if (node.width <= bbox.width + node.padding) {\n node.diff = (width - node.width) / 2 - node.padding;\n } else {\n node.diff = -node.padding;\n }\n\n const height = node.height + padding;\n // const height = node.height + padding;\n const innerHeight = node.height + padding - bbox.height - 6;\n const x = node.x - width / 2;\n const y = node.y - height / 2;\n node.width = width;\n const innerY = node.y - node.height / 2 - halfPadding + bbox.height + 2;\n\n // add the rect\n let rect;\n if (node.look === 'handDrawn') {\n const isAlt = node.cssClasses.includes('statediagram-cluster-alt');\n const rc = rough.svg(shapeSvg);\n const roughOuterNode =\n node.rx || node.ry\n ? rc.path(createRoundedRectPathD(x, y, width, height, 10), {\n roughness: 0.7,\n fill: compositeTitleBackground,\n fillStyle: 'solid',\n stroke: nodeBorder,\n seed: handDrawnSeed,\n })\n : rc.rectangle(x, y, width, height, { seed: handDrawnSeed });\n\n rect = shapeSvg.insert(() => roughOuterNode, ':first-child');\n const roughInnerNode = rc.rectangle(x, innerY, width, innerHeight, {\n fill: isAlt ? altBackground : compositeBackground,\n fillStyle: isAlt ? 'hachure' : 'solid',\n stroke: nodeBorder,\n seed: handDrawnSeed,\n });\n\n rect = shapeSvg.insert(() => roughOuterNode, ':first-child');\n innerRect = shapeSvg.insert(() => roughInnerNode);\n } else {\n rect = outerRectG.insert('rect', ':first-child');\n const outerRectClass = 'outer';\n\n // center the rect around its coordinate\n rect\n .attr('class', outerRectClass)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height)\n .attr('data-look', node.look);\n innerRect\n .attr('class', 'inner')\n .attr('x', x)\n .attr('y', innerY)\n .attr('width', width)\n .attr('height', innerHeight);\n }\n\n label.attr(\n 'transform',\n `translate(${node.x - bbox.width / 2}, ${y + 1 - (evaluate(siteConfig.flowchart.htmlLabels) ? 0 : 3)})`\n );\n\n const rectBox = rect.node().getBBox();\n node.height = rectBox.height;\n node.offsetX = 0;\n // Used by layout engine to position subgraph in parent\n node.offsetY = bbox.height - node.padding / 2;\n node.labelBBox = bbox;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: bbox };\n};\nconst kanbanSection = async (parent, node) => {\n log.info('Creating subgraph rect for ', node.id, node);\n const siteConfig = getConfig();\n const { themeVariables, handDrawnSeed } = siteConfig;\n const { clusterBkg, clusterBorder } = themeVariables;\n\n const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node);\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'cluster ' + node.cssClasses)\n .attr('id', node.id)\n .attr('data-look', node.look);\n\n const useHtmlLabels = evaluate(siteConfig.flowchart.htmlLabels);\n\n // Create the label and insert it after the rect\n const labelEl = shapeSvg.insert('g').attr('class', 'cluster-label ');\n\n const text = await createText(labelEl, node.label, {\n style: node.labelStyle,\n useHtmlLabels,\n isNode: true,\n width: node.width,\n });\n\n // Get the size of the label\n let bbox = text.getBBox();\n\n if (evaluate(siteConfig.flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;\n if (node.width <= bbox.width + node.padding) {\n node.diff = (width - node.width) / 2 - node.padding;\n } else {\n node.diff = -node.padding;\n }\n\n const height = node.height;\n const x = node.x - width / 2;\n const y = node.y - height / 2;\n\n log.trace('Data ', node, JSON.stringify(node));\n let rect;\n if (node.look === 'handDrawn') {\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {\n roughness: 0.7,\n fill: clusterBkg,\n // fill: 'red',\n stroke: clusterBorder,\n fillWeight: 4,\n seed: handDrawnSeed,\n });\n const roughNode = rc.path(createRoundedRectPathD(x, y, width, height, node.rx), options);\n rect = shapeSvg.insert(() => {\n log.debug('Rough node insert CXC', roughNode);\n return roughNode;\n }, ':first-child');\n // Should we affect the options instead of doing this?\n rect.select('path:nth-child(2)').attr('style', borderStyles.join(';'));\n rect.select('path').attr('style', backgroundStyles.join(';').replace('fill', 'stroke'));\n } else {\n // add the rect\n rect = shapeSvg.insert('rect', ':first-child');\n // center the rect around its coordinate\n rect\n .attr('style', nodeStyles)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height);\n }\n const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig);\n labelEl.attr(\n 'transform',\n // This puts the label on top of the box instead of inside it\n `translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`\n );\n\n if (labelStyles) {\n const span = labelEl.select('span');\n if (span) {\n span.attr('style', labelStyles);\n }\n }\n // Center the label\n\n const rectBox = rect.node().getBBox();\n node.offsetX = 0;\n node.width = rectBox.width;\n node.height = rectBox.height;\n // Used by layout engine to position subgraph in parent\n node.offsetY = bbox.height - node.padding / 2;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: bbox };\n};\nconst divider = (parent, node) => {\n const siteConfig = getConfig();\n\n const { themeVariables, handDrawnSeed } = siteConfig;\n const { nodeBorder } = themeVariables;\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', node.cssClasses)\n .attr('id', node.id)\n .attr('data-look', node.look);\n\n // add the rect\n const outerRectG = shapeSvg.insert('g', ':first-child');\n\n const padding = 0 * node.padding;\n\n const width = node.width + padding;\n\n node.diff = -node.padding;\n\n const height = node.height + padding;\n // const height = node.height + padding;\n const x = node.x - width / 2;\n const y = node.y - height / 2;\n node.width = width;\n\n // add the rect\n let rect;\n if (node.look === 'handDrawn') {\n const rc = rough.svg(shapeSvg);\n const roughOuterNode = rc.rectangle(x, y, width, height, {\n fill: 'lightgrey',\n roughness: 0.5,\n strokeLineDash: [5],\n stroke: nodeBorder,\n seed: handDrawnSeed,\n });\n\n rect = shapeSvg.insert(() => roughOuterNode, ':first-child');\n } else {\n rect = outerRectG.insert('rect', ':first-child');\n const outerRectClass = 'divider';\n\n // center the rect around its coordinate\n rect\n .attr('class', outerRectClass)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height)\n .attr('data-look', node.look);\n }\n\n const rectBox = rect.node().getBBox();\n node.height = rectBox.height;\n node.offsetX = 0;\n // Used by layout engine to position subgraph in parent\n node.offsetY = 0;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: {} };\n};\n\nconst squareRect = rect;\nconst shapes = {\n rect,\n squareRect,\n roundedWithTitle,\n noteGroup,\n divider,\n kanbanSection,\n};\n\nlet clusterElems = new Map();\n\n/**\n * @typedef {keyof typeof shapes} ClusterShapeID\n */\n\n/**\n * @param {import('../types.js').ClusterNode} node - Shape defaults to 'rect'\n */\nexport const insertCluster = async (elem, node) => {\n const shape = node.shape || 'rect';\n const cluster = await shapes[shape](elem, node);\n clusterElems.set(node.id, cluster);\n return cluster;\n};\n\nexport const getClusterTitleWidth = (elem, node) => {\n const label = createLabel(node.label, node.labelStyle, undefined, true);\n elem.node().appendChild(label);\n const width = label.getBBox().width;\n elem.node().removeChild(label);\n return width;\n};\n\nexport const clear = () => {\n clusterElems = new Map();\n};\n\nexport const positionCluster = (node) => {\n log.info(\n 'Position cluster (' +\n node.id +\n ', ' +\n node.x +\n ', ' +\n node.y +\n ') (' +\n node?.width +\n ', ' +\n node?.height +\n ')',\n clusterElems.get(node.id)\n );\n const el = clusterElems.get(node.id);\n el.cluster.attr('transform', 'translate(' + node.x + ', ' + node.y + ')');\n};\n", "function intersectNode(node, point) {\n return node.intersect(point);\n}\n\nexport default intersectNode;\n", "function intersectEllipse(node, rx, ry, point) {\n // Formulae from: https://mathworld.wolfram.com/Ellipse-LineIntersection.html\n\n var cx = node.x;\n var cy = node.y;\n\n var px = cx - point.x;\n var py = cy - point.y;\n\n var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);\n\n var dx = Math.abs((rx * ry * px) / det);\n if (point.x < cx) {\n dx = -dx;\n }\n var dy = Math.abs((rx * ry * py) / det);\n if (point.y < cy) {\n dy = -dy;\n }\n\n return { x: cx + dx, y: cy + dy };\n}\n\nexport default intersectEllipse;\n", "import intersectEllipse from './intersect-ellipse.js';\n\nfunction intersectCircle(node, rx, point) {\n return intersectEllipse(node, rx, rx, point);\n}\n\nexport default intersectCircle;\n", "/**\n * Returns the point at which two lines, p and q, intersect or returns undefined if they do not intersect.\n */\nfunction intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n\n var a1, a2, b1, b2, c1, c2;\n var r1, r2, r3, r4;\n var denom, offset, num;\n var x, y;\n\n // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = p2.x * p1.y - p1.x * p2.y;\n\n // Compute r3 and r4.\n r3 = a1 * q1.x + b1 * q1.y + c1;\n r4 = a1 * q2.x + b1 * q2.y + c1;\n\n // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {\n return /*DON'T_INTERSECT*/;\n }\n\n // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = q2.x * q1.y - q1.x * q2.y;\n\n // Compute r1 and r2\n r1 = a2 * p1.x + b2 * p1.y + c2;\n r2 = a2 * p2.x + b2 * p2.y + c2;\n\n // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {\n return /*DON'T_INTERSECT*/;\n }\n\n // Line segments intersect: compute intersection point.\n denom = a1 * b2 - a2 * b1;\n if (denom === 0) {\n return /*COLLINEAR*/;\n }\n\n offset = Math.abs(denom / 2);\n\n // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n num = b1 * c2 - b2 * c1;\n x = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n\n num = a2 * c1 - a1 * c2;\n y = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n\n return { x: x, y: y };\n}\n\nfunction sameSign(r1, r2) {\n return r1 * r2 > 0;\n}\n\nexport default intersectLine;\n", "import intersectLine from './intersect-line.js';\n\n/**\n * Returns the point ({x, y}) at which the point argument intersects with the node argument assuming\n * that it has the shape specified by polygon.\n */\nfunction intersectPolygon(node, polyPoints, point) {\n let x1 = node.x;\n let y1 = node.y;\n\n let intersections = [];\n\n let minX = Number.POSITIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n if (typeof polyPoints.forEach === 'function') {\n polyPoints.forEach(function (entry) {\n minX = Math.min(minX, entry.x);\n minY = Math.min(minY, entry.y);\n });\n } else {\n minX = Math.min(minX, polyPoints.x);\n minY = Math.min(minY, polyPoints.y);\n }\n\n let left = x1 - node.width / 2 - minX;\n let top = y1 - node.height / 2 - minY;\n\n for (let i = 0; i < polyPoints.length; i++) {\n let p1 = polyPoints[i];\n let p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0];\n let intersect = intersectLine(\n node,\n point,\n { x: left + p1.x, y: top + p1.y },\n { x: left + p2.x, y: top + p2.y }\n );\n if (intersect) {\n intersections.push(intersect);\n }\n }\n\n if (!intersections.length) {\n return node;\n }\n\n if (intersections.length > 1) {\n // More intersections, find the one nearest to edge end point\n intersections.sort(function (p, q) {\n let pdx = p.x - point.x;\n let pdy = p.y - point.y;\n let distp = Math.sqrt(pdx * pdx + pdy * pdy);\n\n let qdx = q.x - point.x;\n let qdy = q.y - point.y;\n let distq = Math.sqrt(qdx * qdx + qdy * qdy);\n\n return distp < distq ? -1 : distp === distq ? 0 : 1;\n });\n }\n return intersections[0];\n}\n\nexport default intersectPolygon;\n", "/*\n * Borrowed with love from from dagre-d3. Many thanks to cpettitt!\n */\n\nimport node from './intersect-node.js';\nimport circle from './intersect-circle.js';\nimport ellipse from './intersect-ellipse.js';\nimport polygon from './intersect-polygon.js';\nimport rect from './intersect-rect.js';\n\nexport default {\n node,\n circle,\n ellipse,\n polygon,\n rect,\n};\n", "import { log } from '../../../logger.js';\nimport { updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { handleUndefinedAttr } from '../../../utils.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport function anchor(parent: D3Selection, node: Node) {\n const { labelStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const classes = getNodeClasses(node);\n let cssClasses = classes;\n if (!classes) {\n cssClasses = 'anchor';\n }\n const shapeSvg = parent\n .insert('g')\n .attr('class', cssClasses)\n .attr('id', node.domId || node.id);\n\n const radius = 1;\n\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, { fill: 'black', stroke: 'none', fillStyle: 'solid' });\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n }\n const roughNode = rc.circle(0, 0, radius * 2, options);\n const circleElem = shapeSvg.insert(() => roughNode, ':first-child');\n circleElem.attr('class', 'anchor').attr('style', handleUndefinedAttr(cssStyles));\n\n updateNodeBounds(node, circleElem);\n\n node.intersect = function (point) {\n log.info('Circle intersect', node, radius, point);\n return intersect.circle(node, radius, point);\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nfunction generateArcPoints(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n rx: number,\n ry: number,\n clockwise: boolean\n) {\n const numPoints = 20;\n // Calculate midpoint\n const midX = (x1 + x2) / 2;\n const midY = (y1 + y2) / 2;\n\n // Calculate the angle of the line connecting the points\n const angle = Math.atan2(y2 - y1, x2 - x1);\n\n // Calculate transformed coordinates for the ellipse\n const dx = (x2 - x1) / 2;\n const dy = (y2 - y1) / 2;\n\n // Scale to unit circle\n const transformedX = dx / rx;\n const transformedY = dy / ry;\n\n // Calculate the distance between points on the unit circle\n const distance = Math.sqrt(transformedX ** 2 + transformedY ** 2);\n\n // Check if the ellipse can be drawn with the given radii\n if (distance > 1) {\n throw new Error('The given radii are too small to create an arc between the points.');\n }\n\n // Calculate the distance from the midpoint to the center of the ellipse\n const scaledCenterDistance = Math.sqrt(1 - distance ** 2);\n\n // Calculate the center of the ellipse\n const centerX = midX + scaledCenterDistance * ry * Math.sin(angle) * (clockwise ? -1 : 1);\n const centerY = midY - scaledCenterDistance * rx * Math.cos(angle) * (clockwise ? -1 : 1);\n\n // Calculate the start and end angles on the ellipse\n const startAngle = Math.atan2((y1 - centerY) / ry, (x1 - centerX) / rx);\n const endAngle = Math.atan2((y2 - centerY) / ry, (x2 - centerX) / rx);\n\n // Adjust angles for clockwise/counterclockwise\n let angleRange = endAngle - startAngle;\n if (clockwise && angleRange < 0) {\n angleRange += 2 * Math.PI;\n }\n if (!clockwise && angleRange > 0) {\n angleRange -= 2 * Math.PI;\n }\n\n // Generate points\n const points = [];\n for (let i = 0; i < numPoints; i++) {\n const t = i / (numPoints - 1);\n const angle = startAngle + t * angleRange;\n const x = centerX + rx * Math.cos(angle);\n const y = centerY + ry * Math.sin(angle);\n points.push({ x, y });\n }\n\n return points;\n}\n\nexport async function bowTieRect(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n const w = bbox.width + node.padding + 20;\n const h = bbox.height + node.padding;\n\n const ry = h / 2;\n const rx = ry / (2.5 + h / 50);\n\n // let shape: d3.Selection;\n const { cssStyles } = node;\n\n const points = [\n { x: w / 2, y: -h / 2 },\n { x: -w / 2, y: -h / 2 },\n ...generateArcPoints(-w / 2, -h / 2, -w / 2, h / 2, rx, ry, false),\n { x: w / 2, y: h / 2 },\n ...generateArcPoints(w / 2, h / 2, w / 2, -h / 2, rx, ry, true),\n ];\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n const bowTieRectPath = createPathFromPoints(points);\n const bowTieRectShapePath = rc.path(bowTieRectPath, options);\n const bowTieRectShape = shapeSvg.insert(() => bowTieRectShapePath, ':first-child');\n\n bowTieRectShape.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n bowTieRectShape.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n bowTieRectShape.selectAll('path').attr('style', nodeStyles);\n }\n\n bowTieRectShape.attr('transform', `translate(${rx / 2}, 0)`);\n\n updateNodeBounds(node, bowTieRectShape);\n\n node.intersect = function (point) {\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import type { D3Selection } from '../../../types.js';\n\nexport function insertPolygonShape(\n parent: D3Selection,\n w: number,\n h: number,\n points: { x: number; y: number }[]\n) {\n return parent\n .insert('polygon', ':first-child')\n .attr(\n 'points',\n points\n .map(function (d) {\n return d.x + ',' + d.y;\n })\n .join(' ')\n )\n .attr('class', 'label-container')\n .attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')');\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\n\nimport { insertPolygonShape } from './insertPolygonShape.js';\nimport { createPathFromPoints } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\n// const createPathFromPoints = (points: { x: number; y: number }[]): string => {\n// const pointStrings = points.map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x},${p.y}`);\n// pointStrings.push('Z');\n// return pointStrings.join(' ');\n// };\n\nexport async function card(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n\n const h = bbox.height + node.padding;\n const padding = 12;\n const w = bbox.width + node.padding + padding;\n const left = 0;\n const right = w;\n const top = -h;\n const bottom = 0;\n const points = [\n { x: left + padding, y: top },\n { x: right, y: top },\n { x: right, y: bottom },\n { x: left, y: bottom },\n { x: left, y: top + padding },\n { x: left + padding, y: top },\n ];\n\n let polygon: D3Selection | Awaited>;\n const { cssStyles } = node;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n const pathData = createPathFromPoints(points);\n const roughNode = rc.path(pathData, options);\n\n polygon = shapeSvg\n .insert(() => roughNode, ':first-child')\n .attr('transform', `translate(${-w / 2}, ${h / 2})`);\n\n if (cssStyles) {\n polygon.attr('style', cssStyles);\n }\n } else {\n polygon = insertPolygonShape(shapeSvg, w, h, points);\n }\n\n if (nodeStyles) {\n polygon.attr('style', nodeStyles);\n }\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport rough from 'roughjs';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport { createPathFromPoints, getNodeClasses } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport function choice(parent: D3Selection, node: Node) {\n const { nodeStyles } = styles2String(node);\n node.label = '';\n const shapeSvg = parent\n .insert('g')\n .attr('class', getNodeClasses(node))\n .attr('id', node.domId ?? node.id);\n const { cssStyles } = node;\n\n const s = Math.max(28, node.width ?? 0);\n\n const points = [\n { x: 0, y: s / 2 },\n { x: s / 2, y: 0 },\n { x: 0, y: -s / 2 },\n { x: -s / 2, y: 0 },\n ];\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const choicePath = createPathFromPoints(points);\n const roughNode = rc.path(choicePath, options);\n const choiceShape = shapeSvg.insert(() => roughNode, ':first-child');\n\n if (cssStyles && node.look !== 'handDrawn') {\n choiceShape.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n choiceShape.selectAll('path').attr('style', nodeStyles);\n }\n\n node.width = 28;\n node.height = 28;\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import { log } from '../../../logger.js';\nimport { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\nimport { handleUndefinedAttr } from '../../../utils.js';\n\nexport async function circle(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, halfPadding } = await labelHelper(parent, node, getNodeClasses(node));\n\n const radius = bbox.width / 2 + halfPadding;\n let circleElem;\n const { cssStyles } = node;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n const roughNode = rc.circle(0, 0, radius * 2, options);\n\n circleElem = shapeSvg.insert(() => roughNode, ':first-child');\n circleElem.attr('class', 'basic label-container').attr('style', handleUndefinedAttr(cssStyles));\n } else {\n circleElem = shapeSvg\n .insert('circle', ':first-child')\n .attr('class', 'basic label-container')\n .attr('style', nodeStyles)\n .attr('r', radius)\n .attr('cx', 0)\n .attr('cy', 0);\n }\n\n updateNodeBounds(node, circleElem);\n\n node.intersect = function (point) {\n log.info('Circle intersect', node, radius, point);\n return intersect.circle(node, radius, point);\n };\n\n return shapeSvg;\n}\n", "import { log } from '../../../logger.js';\nimport { getNodeClasses, updateNodeBounds } from './util.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport intersect from '../intersect/index.js';\nimport type { D3Selection } from '../../../types.js';\n\nfunction createLine(r: number) {\n const xAxis45 = Math.cos(Math.PI / 4); // cosine of 45 degrees\n const yAxis45 = Math.sin(Math.PI / 4); // sine of 45 degrees\n const lineLength = r * 2;\n\n const pointQ1 = { x: (lineLength / 2) * xAxis45, y: (lineLength / 2) * yAxis45 }; // Quadrant I\n const pointQ2 = { x: -(lineLength / 2) * xAxis45, y: (lineLength / 2) * yAxis45 }; // Quadrant II\n const pointQ3 = { x: -(lineLength / 2) * xAxis45, y: -(lineLength / 2) * yAxis45 }; // Quadrant III\n const pointQ4 = { x: (lineLength / 2) * xAxis45, y: -(lineLength / 2) * yAxis45 }; // Quadrant IV\n\n return `M ${pointQ2.x},${pointQ2.y} L ${pointQ4.x},${pointQ4.y}\n M ${pointQ1.x},${pointQ1.y} L ${pointQ3.x},${pointQ3.y}`;\n}\n\nexport function crossedCircle(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n node.label = '';\n const shapeSvg = parent\n .insert('g')\n .attr('class', getNodeClasses(node))\n .attr('id', node.domId ?? node.id);\n const radius = Math.max(30, node?.width ?? 0);\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const circleNode = rc.circle(0, 0, radius * 2, options);\n const linePath = createLine(radius);\n const lineNode = rc.path(linePath, options);\n\n const crossedCircle = shapeSvg.insert(() => circleNode, ':first-child');\n crossedCircle.insert(() => lineNode);\n\n if (cssStyles && node.look !== 'handDrawn') {\n crossedCircle.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n crossedCircle.selectAll('path').attr('style', nodeStyles);\n }\n\n updateNodeBounds(node, crossedCircle);\n\n node.intersect = function (point) {\n log.info('crossedCircle intersect', node, { radius, point });\n const pos = intersect.circle(node, radius, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nfunction generateCirclePoints(\n centerX: number,\n centerY: number,\n radius: number,\n numPoints = 100,\n startAngle = 0,\n endAngle = 180\n) {\n const points = [];\n\n // Convert angles to radians\n const startAngleRad = (startAngle * Math.PI) / 180;\n const endAngleRad = (endAngle * Math.PI) / 180;\n\n // Calculate the angle range in radians\n const angleRange = endAngleRad - startAngleRad;\n\n // Calculate the angle step\n const angleStep = angleRange / (numPoints - 1);\n\n for (let i = 0; i < numPoints; i++) {\n const angle = startAngleRad + i * angleStep;\n const x = centerX + radius * Math.cos(angle);\n const y = centerY + radius * Math.sin(angle);\n points.push({ x: -x, y: -y });\n }\n\n return points;\n}\n\nexport async function curlyBraceLeft(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = bbox.width + (node.padding ?? 0);\n const h = bbox.height + (node.padding ?? 0);\n const radius = Math.max(5, h * 0.1);\n\n const { cssStyles } = node;\n\n const points = [\n ...generateCirclePoints(w / 2, -h / 2, radius, 30, -90, 0),\n { x: -w / 2 - radius, y: radius },\n ...generateCirclePoints(w / 2 + radius * 2, -radius, radius, 20, -180, -270),\n ...generateCirclePoints(w / 2 + radius * 2, radius, radius, 20, -90, -180),\n { x: -w / 2 - radius, y: -h / 2 },\n ...generateCirclePoints(w / 2, h / 2, radius, 20, 0, 90),\n ];\n\n const rectPoints = [\n { x: w / 2, y: -h / 2 - radius },\n { x: -w / 2, y: -h / 2 - radius },\n ...generateCirclePoints(w / 2, -h / 2, radius, 20, -90, 0),\n { x: -w / 2 - radius, y: -radius },\n ...generateCirclePoints(w / 2 + w * 0.1, -radius, radius, 20, -180, -270),\n ...generateCirclePoints(w / 2 + w * 0.1, radius, radius, 20, -90, -180),\n { x: -w / 2 - radius, y: h / 2 },\n ...generateCirclePoints(w / 2, h / 2, radius, 20, 0, 90),\n { x: -w / 2, y: h / 2 + radius },\n { x: w / 2, y: h / 2 + radius },\n ];\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, { fill: 'none' });\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n const curlyBraceLeftPath = createPathFromPoints(points);\n const newCurlyBracePath = curlyBraceLeftPath.replace('Z', '');\n const curlyBraceLeftNode = rc.path(newCurlyBracePath, options);\n const rectPath = createPathFromPoints(rectPoints);\n const rectShape = rc.path(rectPath, { ...options });\n const curlyBraceLeftShape = shapeSvg.insert('g', ':first-child');\n curlyBraceLeftShape.insert(() => rectShape, ':first-child').attr('stroke-opacity', 0);\n curlyBraceLeftShape.insert(() => curlyBraceLeftNode, ':first-child');\n curlyBraceLeftShape.attr('class', 'text');\n\n if (cssStyles && node.look !== 'handDrawn') {\n curlyBraceLeftShape.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n curlyBraceLeftShape.selectAll('path').attr('style', nodeStyles);\n }\n\n curlyBraceLeftShape.attr('transform', `translate(${radius}, 0)`);\n\n label.attr(\n 'transform',\n `translate(${-w / 2 + radius - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, curlyBraceLeftShape);\n\n node.intersect = function (point) {\n const pos = intersect.polygon(node, rectPoints, point);\n\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nfunction generateCirclePoints(\n centerX: number,\n centerY: number,\n radius: number,\n numPoints = 100,\n startAngle = 0,\n endAngle = 180\n) {\n const points = [];\n\n // Convert angles to radians\n const startAngleRad = (startAngle * Math.PI) / 180;\n const endAngleRad = (endAngle * Math.PI) / 180;\n\n // Calculate the angle range in radians\n const angleRange = endAngleRad - startAngleRad;\n\n // Calculate the angle step\n const angleStep = angleRange / (numPoints - 1);\n\n for (let i = 0; i < numPoints; i++) {\n const angle = startAngleRad + i * angleStep;\n const x = centerX + radius * Math.cos(angle);\n const y = centerY + radius * Math.sin(angle);\n points.push({ x, y });\n }\n\n return points;\n}\n\nexport async function curlyBraceRight(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = bbox.width + (node.padding ?? 0);\n const h = bbox.height + (node.padding ?? 0);\n const radius = Math.max(5, h * 0.1);\n\n const { cssStyles } = node;\n\n const points = [\n ...generateCirclePoints(w / 2, -h / 2, radius, 20, -90, 0),\n { x: w / 2 + radius, y: -radius },\n ...generateCirclePoints(w / 2 + radius * 2, -radius, radius, 20, -180, -270),\n ...generateCirclePoints(w / 2 + radius * 2, radius, radius, 20, -90, -180),\n { x: w / 2 + radius, y: h / 2 },\n ...generateCirclePoints(w / 2, h / 2, radius, 20, 0, 90),\n ];\n\n const rectPoints = [\n { x: -w / 2, y: -h / 2 - radius },\n { x: w / 2, y: -h / 2 - radius },\n ...generateCirclePoints(w / 2, -h / 2, radius, 20, -90, 0),\n { x: w / 2 + radius, y: -radius },\n ...generateCirclePoints(w / 2 + radius * 2, -radius, radius, 20, -180, -270),\n ...generateCirclePoints(w / 2 + radius * 2, radius, radius, 20, -90, -180),\n { x: w / 2 + radius, y: h / 2 },\n ...generateCirclePoints(w / 2, h / 2, radius, 20, 0, 90),\n { x: w / 2, y: h / 2 + radius },\n { x: -w / 2, y: h / 2 + radius },\n ];\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, { fill: 'none' });\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n const curlyBraceRightPath = createPathFromPoints(points);\n const newCurlyBracePath = curlyBraceRightPath.replace('Z', '');\n const curlyBraceRightNode = rc.path(newCurlyBracePath, options);\n const rectPath = createPathFromPoints(rectPoints);\n const rectShape = rc.path(rectPath, { ...options });\n const curlyBraceRightShape = shapeSvg.insert('g', ':first-child');\n curlyBraceRightShape.insert(() => rectShape, ':first-child').attr('stroke-opacity', 0);\n curlyBraceRightShape.insert(() => curlyBraceRightNode, ':first-child');\n curlyBraceRightShape.attr('class', 'text');\n\n if (cssStyles && node.look !== 'handDrawn') {\n curlyBraceRightShape.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n curlyBraceRightShape.selectAll('path').attr('style', nodeStyles);\n }\n\n curlyBraceRightShape.attr('transform', `translate(${-radius}, 0)`);\n\n label.attr(\n 'transform',\n `translate(${-w / 2 + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, curlyBraceRightShape);\n\n node.intersect = function (point) {\n const pos = intersect.polygon(node, rectPoints, point);\n\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nfunction generateCirclePoints(\n centerX: number,\n centerY: number,\n radius: number,\n numPoints = 100,\n startAngle = 0,\n endAngle = 180\n) {\n const points = [];\n\n // Convert angles to radians\n const startAngleRad = (startAngle * Math.PI) / 180;\n const endAngleRad = (endAngle * Math.PI) / 180;\n\n // Calculate the angle range in radians\n const angleRange = endAngleRad - startAngleRad;\n\n // Calculate the angle step\n const angleStep = angleRange / (numPoints - 1);\n\n for (let i = 0; i < numPoints; i++) {\n const angle = startAngleRad + i * angleStep;\n const x = centerX + radius * Math.cos(angle);\n const y = centerY + radius * Math.sin(angle);\n points.push({ x: -x, y: -y });\n }\n\n return points;\n}\n\nexport async function curlyBraces(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = bbox.width + (node.padding ?? 0);\n const h = bbox.height + (node.padding ?? 0);\n const radius = Math.max(5, h * 0.1);\n\n const { cssStyles } = node;\n\n const leftCurlyBracePoints = [\n ...generateCirclePoints(w / 2, -h / 2, radius, 30, -90, 0),\n { x: -w / 2 - radius, y: radius },\n ...generateCirclePoints(w / 2 + radius * 2, -radius, radius, 20, -180, -270),\n ...generateCirclePoints(w / 2 + radius * 2, radius, radius, 20, -90, -180),\n { x: -w / 2 - radius, y: -h / 2 },\n ...generateCirclePoints(w / 2, h / 2, radius, 20, 0, 90),\n ];\n\n const rightCurlyBracePoints = [\n ...generateCirclePoints(-w / 2 + radius + radius / 2, -h / 2, radius, 20, -90, -180),\n { x: w / 2 - radius / 2, y: radius },\n ...generateCirclePoints(-w / 2 - radius / 2, -radius, radius, 20, 0, 90),\n ...generateCirclePoints(-w / 2 - radius / 2, radius, radius, 20, -90, 0),\n { x: w / 2 - radius / 2, y: -radius },\n ...generateCirclePoints(-w / 2 + radius + radius / 2, h / 2, radius, 30, -180, -270),\n ];\n\n const rectPoints = [\n { x: w / 2, y: -h / 2 - radius },\n { x: -w / 2, y: -h / 2 - radius },\n ...generateCirclePoints(w / 2, -h / 2, radius, 20, -90, 0),\n { x: -w / 2 - radius, y: -radius },\n ...generateCirclePoints(w / 2 + radius * 2, -radius, radius, 20, -180, -270),\n ...generateCirclePoints(w / 2 + radius * 2, radius, radius, 20, -90, -180),\n { x: -w / 2 - radius, y: h / 2 },\n ...generateCirclePoints(w / 2, h / 2, radius, 20, 0, 90),\n { x: -w / 2, y: h / 2 + radius },\n { x: w / 2 - radius - radius / 2, y: h / 2 + radius },\n ...generateCirclePoints(-w / 2 + radius + radius / 2, -h / 2, radius, 20, -90, -180),\n { x: w / 2 - radius / 2, y: radius },\n ...generateCirclePoints(-w / 2 - radius / 2, -radius, radius, 20, 0, 90),\n ...generateCirclePoints(-w / 2 - radius / 2, radius, radius, 20, -90, 0),\n { x: w / 2 - radius / 2, y: -radius },\n ...generateCirclePoints(-w / 2 + radius + radius / 2, h / 2, radius, 30, -180, -270),\n ];\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, { fill: 'none' });\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n const leftCurlyBracePath = createPathFromPoints(leftCurlyBracePoints);\n const newLeftCurlyBracePath = leftCurlyBracePath.replace('Z', '');\n const leftCurlyBraceNode = rc.path(newLeftCurlyBracePath, options);\n const rightCurlyBracePath = createPathFromPoints(rightCurlyBracePoints);\n const newRightCurlyBracePath = rightCurlyBracePath.replace('Z', '');\n const rightCurlyBraceNode = rc.path(newRightCurlyBracePath, options);\n const rectPath = createPathFromPoints(rectPoints);\n const rectShape = rc.path(rectPath, { ...options });\n const curlyBracesShape = shapeSvg.insert('g', ':first-child');\n curlyBracesShape.insert(() => rectShape, ':first-child').attr('stroke-opacity', 0);\n curlyBracesShape.insert(() => leftCurlyBraceNode, ':first-child');\n curlyBracesShape.insert(() => rightCurlyBraceNode, ':first-child');\n curlyBracesShape.attr('class', 'text');\n\n if (cssStyles && node.look !== 'handDrawn') {\n curlyBracesShape.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n curlyBracesShape.selectAll('path').attr('style', nodeStyles);\n }\n\n curlyBracesShape.attr('transform', `translate(${radius - radius / 4}, 0)`);\n\n label.attr(\n 'transform',\n `translate(${-w / 2 + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, curlyBracesShape);\n\n node.intersect = function (point) {\n const pos = intersect.polygon(node, rectPoints, point);\n\n return pos;\n };\n\n return shapeSvg;\n}\n", "import {\n labelHelper,\n updateNodeBounds,\n getNodeClasses,\n createPathFromPoints,\n generateCirclePoints,\n} from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function curvedTrapezoid(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n const minWidth = 80,\n minHeight = 20;\n const w = Math.max(minWidth, (bbox.width + (node.padding ?? 0) * 2) * 1.25, node?.width ?? 0);\n const h = Math.max(minHeight, bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const radius = h / 2;\n\n const { cssStyles } = node;\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const totalWidth = w,\n totalHeight = h;\n const rw = totalWidth - radius;\n const tw = totalHeight / 4;\n\n const points = [\n { x: rw, y: 0 },\n { x: tw, y: 0 },\n { x: 0, y: totalHeight / 2 },\n { x: tw, y: totalHeight },\n { x: rw, y: totalHeight },\n ...generateCirclePoints(-rw, -totalHeight / 2, radius, 50, 270, 90),\n ];\n\n const pathData = createPathFromPoints(points);\n const shapeNode = rc.path(pathData, options);\n\n const polygon = shapeSvg.insert(() => shapeNode, ':first-child');\n polygon.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', nodeStyles);\n }\n\n polygon.attr('transform', `translate(${-w / 2}, ${-h / 2})`);\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\nimport { handleUndefinedAttr } from '../../../utils.js';\n\nexport const createCylinderPathD = (\n x: number,\n y: number,\n width: number,\n height: number,\n rx: number,\n ry: number\n): string => {\n return [\n `M${x},${y + ry}`,\n `a${rx},${ry} 0,0,0 ${width},0`,\n `a${rx},${ry} 0,0,0 ${-width},0`,\n `l0,${height}`,\n `a${rx},${ry} 0,0,0 ${width},0`,\n `l0,${-height}`,\n ].join(' ');\n};\nexport const createOuterCylinderPathD = (\n x: number,\n y: number,\n width: number,\n height: number,\n rx: number,\n ry: number\n): string => {\n return [\n `M${x},${y + ry}`,\n `M${x + width},${y + ry}`,\n `a${rx},${ry} 0,0,0 ${-width},0`,\n `l0,${height}`,\n `a${rx},${ry} 0,0,0 ${width},0`,\n `l0,${-height}`,\n ].join(' ');\n};\nexport const createInnerCylinderPathD = (\n x: number,\n y: number,\n width: number,\n height: number,\n rx: number,\n ry: number\n): string => {\n return [`M${x - width / 2},${-height / 2}`, `a${rx},${ry} 0,0,0 ${width},0`].join(' ');\n};\nexport async function cylinder(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + node.padding, node.width ?? 0);\n const rx = w / 2;\n const ry = rx / (2.5 + w / 50);\n const h = Math.max(bbox.height + ry + node.padding, node.height ?? 0);\n\n let cylinder: D3Selection | D3Selection;\n const { cssStyles } = node;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const outerPathData = createOuterCylinderPathD(0, 0, w, h, rx, ry);\n const innerPathData = createInnerCylinderPathD(0, ry, w, h, rx, ry);\n const outerNode = rc.path(outerPathData, userNodeOverrides(node, {}));\n const innerLine = rc.path(innerPathData, userNodeOverrides(node, { fill: 'none' }));\n\n cylinder = shapeSvg.insert(() => innerLine, ':first-child');\n cylinder = shapeSvg.insert(() => outerNode, ':first-child');\n cylinder.attr('class', 'basic label-container');\n if (cssStyles) {\n cylinder.attr('style', cssStyles);\n }\n } else {\n const pathData = createCylinderPathD(0, 0, w, h, rx, ry);\n cylinder = shapeSvg\n .insert('path', ':first-child')\n .attr('d', pathData)\n .attr('class', 'basic label-container')\n .attr('style', handleUndefinedAttr(cssStyles))\n .attr('style', nodeStyles);\n }\n\n cylinder.attr('label-offset-y', ry);\n cylinder.attr('transform', `translate(${-w / 2}, ${-(h / 2 + ry)})`);\n\n updateNodeBounds(node, cylinder);\n\n label.attr(\n 'transform',\n `translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + (node.padding ?? 0) / 1.5 - (bbox.y - (bbox.top ?? 0))})`\n );\n\n node.intersect = function (point) {\n const pos = intersect.rect(node, point);\n const x = pos.x - (node.x ?? 0);\n\n if (\n rx != 0 &&\n (Math.abs(x) < (node.width ?? 0) / 2 ||\n (Math.abs(x) == (node.width ?? 0) / 2 &&\n Math.abs(pos.y - (node.y ?? 0)) > (node.height ?? 0) / 2 - ry))\n ) {\n let y = ry * ry * (1 - (x * x) / (rx * rx));\n if (y > 0) {\n y = Math.sqrt(y);\n }\n y = ry - y;\n if (point.y - (node.y ?? 0) > 0) {\n y = -y;\n }\n\n pos.y += y;\n }\n\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function dividedRectangle(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const rectOffset = h * 0.2;\n\n const x = -w / 2;\n const y = -h / 2 - rectOffset / 2;\n\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const pts = [\n { x, y: y + rectOffset },\n { x: -x, y: y + rectOffset },\n { x: -x, y: -y },\n { x, y: -y },\n { x, y },\n { x: -x, y },\n { x: -x, y: y + rectOffset },\n ];\n\n const poly = rc.polygon(\n pts.map((p) => [p.x, p.y]),\n options\n );\n\n const polygon = shapeSvg.insert(() => poly, ':first-child');\n polygon.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n polygon.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n polygon.selectAll('path').attr('style', nodeStyles);\n }\n\n label.attr(\n 'transform',\n `translate(${x + (node.padding ?? 0) / 2 - (bbox.x - (bbox.left ?? 0))}, ${y + rectOffset + (node.padding ?? 0) / 2 - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n const pos = intersect.rect(node, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { log } from '../../../logger.js';\nimport { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\nimport { handleUndefinedAttr } from '../../../utils.js';\n\nexport async function doublecircle(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, halfPadding } = await labelHelper(parent, node, getNodeClasses(node));\n const gap = 5;\n const outerRadius = bbox.width / 2 + halfPadding + gap;\n const innerRadius = bbox.width / 2 + halfPadding;\n\n let circleGroup;\n const { cssStyles } = node;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const outerOptions = userNodeOverrides(node, { roughness: 0.2, strokeWidth: 2.5 });\n\n const innerOptions = userNodeOverrides(node, { roughness: 0.2, strokeWidth: 1.5 });\n const outerRoughNode = rc.circle(0, 0, outerRadius * 2, outerOptions);\n const innerRoughNode = rc.circle(0, 0, innerRadius * 2, innerOptions);\n\n circleGroup = shapeSvg.insert('g', ':first-child');\n // circleGroup = circleGroup.insert(() => outerRoughNode, ':first-child');\n circleGroup\n .attr('class', handleUndefinedAttr(node.cssClasses))\n .attr('style', handleUndefinedAttr(cssStyles));\n\n circleGroup.node()?.appendChild(outerRoughNode);\n circleGroup.node()?.appendChild(innerRoughNode);\n } else {\n circleGroup = shapeSvg.insert('g', ':first-child');\n\n const outerCircle = circleGroup.insert('circle', ':first-child');\n const innerCircle = circleGroup.insert('circle');\n circleGroup.attr('class', 'basic label-container').attr('style', nodeStyles);\n\n outerCircle\n .attr('class', 'outer-circle')\n .attr('style', nodeStyles)\n .attr('r', outerRadius)\n .attr('cx', 0)\n .attr('cy', 0);\n\n innerCircle\n .attr('class', 'inner-circle')\n .attr('style', nodeStyles)\n .attr('r', innerRadius)\n .attr('cx', 0)\n .attr('cy', 0);\n }\n\n updateNodeBounds(node, circleGroup);\n\n node.intersect = function (point) {\n log.info('DoubleCircle intersect', node, outerRadius, point);\n return intersect.circle(node, outerRadius, point);\n };\n\n return shapeSvg;\n}\n", "import rough from 'roughjs';\nimport { log } from '../../../logger.js';\nimport type { Node, ShapeRenderOptions } from '../../types.js';\nimport intersect from '../intersect/index.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport { getNodeClasses, updateNodeBounds } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport function filledCircle(\n parent: D3Selection,\n node: Node,\n { config: { themeVariables } }: ShapeRenderOptions\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.label = '';\n node.labelStyle = labelStyles;\n const shapeSvg = parent\n .insert('g')\n .attr('class', getNodeClasses(node))\n .attr('id', node.domId ?? node.id);\n const radius = 7;\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const { nodeBorder } = themeVariables;\n const options = userNodeOverrides(node, { fillStyle: 'solid' });\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n }\n\n const circleNode = rc.circle(0, 0, radius * 2, options);\n\n const filledCircle = shapeSvg.insert(() => circleNode, ':first-child');\n\n filledCircle.selectAll('path').attr('style', `fill: ${nodeBorder} !important;`);\n\n if (cssStyles && cssStyles.length > 0 && node.look !== 'handDrawn') {\n filledCircle.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n filledCircle.selectAll('path').attr('style', nodeStyles);\n }\n\n updateNodeBounds(node, filledCircle);\n\n node.intersect = function (point) {\n log.info('filledCircle intersect', node, { radius, point });\n const pos = intersect.circle(node, radius, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { log } from '../../../logger.js';\nimport { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { createPathFromPoints } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function flippedTriangle(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n\n const w = bbox.width + (node.padding ?? 0);\n const h = w + bbox.height;\n\n const tw = w + bbox.height;\n const points = [\n { x: 0, y: -h },\n { x: tw, y: -h },\n { x: tw / 2, y: 0 },\n ];\n\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n const pathData = createPathFromPoints(points);\n const roughNode = rc.path(pathData, options);\n\n const flippedTriangle = shapeSvg\n .insert(() => roughNode, ':first-child')\n .attr('transform', `translate(${-h / 2}, ${h / 2})`);\n\n if (cssStyles && node.look !== 'handDrawn') {\n flippedTriangle.selectChildren('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n flippedTriangle.selectChildren('path').attr('style', nodeStyles);\n }\n\n node.width = w;\n node.height = h;\n\n updateNodeBounds(node, flippedTriangle);\n\n label.attr(\n 'transform',\n `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${-h / 2 + (node.padding ?? 0) / 2 + (bbox.y - (bbox.top ?? 0))})`\n );\n\n node.intersect = function (point) {\n log.info('Triangle intersect', node, points, point);\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import rough from 'roughjs';\nimport type { Node, ShapeRenderOptions } from '../../types.js';\nimport intersect from '../intersect/index.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport { getNodeClasses, updateNodeBounds } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport function forkJoin(\n parent: D3Selection,\n node: Node,\n { dir, config: { state, themeVariables } }: ShapeRenderOptions\n) {\n const { nodeStyles } = styles2String(node);\n node.label = '';\n const shapeSvg = parent\n .insert('g')\n .attr('class', getNodeClasses(node))\n .attr('id', node.domId ?? node.id);\n\n const { cssStyles } = node;\n let width = Math.max(70, node?.width ?? 0);\n let height = Math.max(10, node?.height ?? 0);\n\n if (dir === 'LR') {\n width = Math.max(10, node?.width ?? 0);\n height = Math.max(70, node?.height ?? 0);\n }\n\n const x = (-1 * width) / 2;\n const y = (-1 * height) / 2;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {\n stroke: themeVariables.lineColor,\n fill: themeVariables.lineColor,\n });\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const roughNode = rc.rectangle(x, y, width, height, options);\n\n const shape = shapeSvg.insert(() => roughNode, ':first-child');\n\n if (cssStyles && node.look !== 'handDrawn') {\n shape.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n shape.selectAll('path').attr('style', nodeStyles);\n }\n\n updateNodeBounds(node, shape);\n const padding = state?.padding ?? 0;\n if (node.width && node.height) {\n node.width += padding / 2 || 0;\n node.height += padding / 2 || 0;\n }\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n return shapeSvg;\n}\n", "import { log } from '../../../logger.js';\nimport {\n labelHelper,\n updateNodeBounds,\n getNodeClasses,\n createPathFromPoints,\n generateCirclePoints,\n} from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function halfRoundedRectangle(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const minWidth = 80,\n minHeight = 50;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(minWidth, bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(minHeight, bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const radius = h / 2;\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const points = [\n { x: -w / 2, y: -h / 2 },\n { x: w / 2 - radius, y: -h / 2 },\n ...generateCirclePoints(-w / 2 + radius, 0, radius, 50, 90, 270),\n { x: w / 2 - radius, y: h / 2 },\n { x: -w / 2, y: h / 2 },\n ];\n\n const pathData = createPathFromPoints(points);\n const shapeNode = rc.path(pathData, options);\n const polygon = shapeSvg.insert(() => shapeNode, ':first-child');\n polygon.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', nodeStyles);\n }\n\n // label.attr(\n // 'transform',\n // `translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))}, ${-h / 2 + (node.padding ?? 0) - (bbox.y - (bbox.top ?? 0))})`\n // );\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n log.info('Pill intersect', node, { radius, point });\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { insertPolygonShape } from './insertPolygonShape.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport const createHexagonPathD = (\n x: number,\n y: number,\n width: number,\n height: number,\n m: number\n): string => {\n return [\n `M${x + m},${y}`,\n `L${x + width - m},${y}`,\n `L${x + width},${y - height / 2}`,\n `L${x + width - m},${y - height}`,\n `L${x + m},${y - height}`,\n `L${x},${y - height / 2}`,\n 'Z',\n ].join(' ');\n};\n\nexport async function hexagon(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n\n const f = 4;\n const h = bbox.height + node.padding;\n const m = h / f;\n const w = bbox.width + 2 * m + node.padding;\n const points = [\n { x: m, y: 0 },\n { x: w - m, y: 0 },\n { x: w, y: -h / 2 },\n { x: w - m, y: -h },\n { x: m, y: -h },\n { x: 0, y: -h / 2 },\n ];\n\n let polygon: D3Selection | Awaited>;\n const { cssStyles } = node;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n const pathData = createHexagonPathD(0, 0, w, h, m);\n const roughNode = rc.path(pathData, options);\n\n polygon = shapeSvg\n .insert(() => roughNode, ':first-child')\n .attr('transform', `translate(${-w / 2}, ${h / 2})`);\n\n if (cssStyles) {\n polygon.attr('style', cssStyles);\n }\n } else {\n polygon = insertPolygonShape(shapeSvg, w, h, points);\n }\n\n if (nodeStyles) {\n polygon.attr('style', nodeStyles);\n }\n\n node.width = w;\n node.height = h;\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import { log } from '../../../logger.js';\nimport { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function hourglass(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.label = '';\n node.labelStyle = labelStyles;\n const { shapeSvg } = await labelHelper(parent, node, getNodeClasses(node));\n\n const w = Math.max(30, node?.width ?? 0);\n const h = Math.max(30, node?.height ?? 0);\n\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const points = [\n { x: 0, y: 0 },\n { x: w, y: 0 },\n { x: 0, y: h },\n { x: w, y: h },\n ];\n\n const pathData = createPathFromPoints(points);\n const shapeNode = rc.path(pathData, options);\n const polygon = shapeSvg.insert(() => shapeNode, ':first-child');\n polygon.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', nodeStyles);\n }\n\n polygon.attr('transform', `translate(${-w / 2}, ${-h / 2})`);\n\n updateNodeBounds(node, polygon);\n\n // label.attr('transform', `translate(${-bbox.width / 2}, ${(h/2)})`); // To transform text below hourglass shape\n\n node.intersect = function (point) {\n log.info('Pill intersect', node, { points });\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import rough from 'roughjs';\nimport { log } from '../../../logger.js';\nimport { getIconSVG } from '../../icons.js';\nimport type { Node, ShapeRenderOptions } from '../../types.js';\nimport intersect from '../intersect/index.js';\nimport { compileStyles, styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport { labelHelper, updateNodeBounds } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function icon(\n parent: D3Selection,\n node: Node,\n { config: { themeVariables, flowchart } }: ShapeRenderOptions\n) {\n const { labelStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const assetHeight = node.assetHeight ?? 48;\n const assetWidth = node.assetWidth ?? 48;\n const iconSize = Math.max(assetHeight, assetWidth);\n const defaultWidth = flowchart?.wrappingWidth;\n node.width = Math.max(iconSize, defaultWidth ?? 0);\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, 'icon-shape default');\n\n const topLabel = node.pos === 't';\n\n const height = iconSize;\n const width = iconSize;\n const { nodeBorder } = themeVariables;\n const { stylesMap } = compileStyles(node);\n\n const x = -width / 2;\n const y = -height / 2;\n\n const labelPadding = node.label ? 8 : 0;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, { stroke: 'none', fill: 'none' });\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const iconNode = rc.rectangle(x, y, width, height, options);\n\n const outerWidth = Math.max(width, bbox.width);\n const outerHeight = height + bbox.height + labelPadding;\n\n const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {\n ...options,\n fill: 'transparent',\n stroke: 'none',\n });\n\n const iconShape = shapeSvg.insert(() => iconNode, ':first-child');\n const outerShape = shapeSvg.insert(() => outerNode);\n\n if (node.icon) {\n const iconElem = shapeSvg.append('g');\n iconElem.html(\n `${await getIconSVG(node.icon, {\n height: iconSize,\n width: iconSize,\n fallbackPrefix: '',\n })} `\n );\n const iconBBox = iconElem.node()!.getBBox();\n const iconWidth = iconBBox.width;\n const iconHeight = iconBBox.height;\n const iconX = iconBBox.x;\n const iconY = iconBBox.y;\n iconElem.attr(\n 'transform',\n `translate(${-iconWidth / 2 - iconX},${\n topLabel\n ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY\n : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY\n })`\n );\n iconElem.attr('style', `color: ${stylesMap.get('stroke') ?? nodeBorder};`);\n }\n\n label.attr(\n 'transform',\n `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${\n topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height\n })`\n );\n\n iconShape.attr(\n 'transform',\n `translate(${0},${\n topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2\n })`\n );\n\n updateNodeBounds(node, outerShape);\n\n node.intersect = function (point) {\n log.info('iconSquare intersect', node, point);\n if (!node.label) {\n return intersect.rect(node, point);\n }\n const dx = node.x ?? 0;\n const dy = node.y ?? 0;\n const nodeHeight = node.height ?? 0;\n let points = [];\n if (topLabel) {\n points = [\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx + width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx + width / 2, y: dy + nodeHeight / 2 },\n { x: dx - width / 2, y: dy + nodeHeight / 2 },\n { x: dx - width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n ];\n } else {\n points = [\n { x: dx - width / 2, y: dy - nodeHeight / 2 },\n { x: dx + width / 2, y: dy - nodeHeight / 2 },\n { x: dx + width / 2, y: dy - nodeHeight / 2 + height },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + height },\n { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },\n { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + height },\n { x: dx - width / 2, y: dy - nodeHeight / 2 + height },\n ];\n }\n\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import rough from 'roughjs';\nimport { log } from '../../../logger.js';\nimport { getIconSVG } from '../../icons.js';\nimport type { Node, ShapeRenderOptions } from '../../types.js';\nimport intersect from '../intersect/index.js';\nimport { compileStyles, styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport { labelHelper, updateNodeBounds } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function iconCircle(\n parent: D3Selection,\n node: Node,\n { config: { themeVariables, flowchart } }: ShapeRenderOptions\n) {\n const { labelStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const assetHeight = node.assetHeight ?? 48;\n const assetWidth = node.assetWidth ?? 48;\n const iconSize = Math.max(assetHeight, assetWidth);\n const defaultWidth = flowchart?.wrappingWidth;\n node.width = Math.max(iconSize, defaultWidth ?? 0);\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, 'icon-shape default');\n\n const padding = 20;\n const labelPadding = node.label ? 8 : 0;\n\n const topLabel = node.pos === 't';\n\n const { nodeBorder, mainBkg } = themeVariables;\n const { stylesMap } = compileStyles(node);\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n const fill = stylesMap.get('fill');\n options.stroke = fill ?? mainBkg;\n\n const iconElem = shapeSvg.append('g');\n if (node.icon) {\n iconElem.html(\n `${await getIconSVG(node.icon, {\n height: iconSize,\n width: iconSize,\n fallbackPrefix: '',\n })} `\n );\n }\n const iconBBox = iconElem.node()!.getBBox();\n const iconWidth = iconBBox.width;\n const iconHeight = iconBBox.height;\n const iconX = iconBBox.x;\n const iconY = iconBBox.y;\n\n const diameter = Math.max(iconWidth, iconHeight) * Math.SQRT2 + padding * 2;\n const iconNode = rc.circle(0, 0, diameter, options);\n\n const outerWidth = Math.max(diameter, bbox.width);\n const outerHeight = diameter + bbox.height + labelPadding;\n\n const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {\n ...options,\n fill: 'transparent',\n stroke: 'none',\n });\n\n const iconShape = shapeSvg.insert(() => iconNode, ':first-child');\n const outerShape = shapeSvg.insert(() => outerNode);\n iconElem.attr(\n 'transform',\n `translate(${-iconWidth / 2 - iconX},${\n topLabel\n ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY\n : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY\n })`\n );\n iconElem.attr('style', `color: ${stylesMap.get('stroke') ?? nodeBorder};`);\n label.attr(\n 'transform',\n `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${\n topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height\n })`\n );\n\n iconShape.attr(\n 'transform',\n `translate(${0},${\n topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2\n })`\n );\n\n updateNodeBounds(node, outerShape);\n\n node.intersect = function (point) {\n log.info('iconSquare intersect', node, point);\n const pos = intersect.rect(node, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import rough from 'roughjs';\nimport { log } from '../../../logger.js';\nimport { getIconSVG } from '../../icons.js';\nimport type { Node, ShapeRenderOptions } from '../../types.js';\nimport intersect from '../intersect/index.js';\nimport { compileStyles, styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport { createRoundedRectPathD } from './roundedRectPath.js';\nimport { labelHelper, updateNodeBounds } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function iconRounded(\n parent: D3Selection,\n node: Node,\n { config: { themeVariables, flowchart } }: ShapeRenderOptions\n) {\n const { labelStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const assetHeight = node.assetHeight ?? 48;\n const assetWidth = node.assetWidth ?? 48;\n const iconSize = Math.max(assetHeight, assetWidth);\n const defaultWidth = flowchart?.wrappingWidth;\n node.width = Math.max(iconSize, defaultWidth ?? 0);\n const { shapeSvg, bbox, halfPadding, label } = await labelHelper(\n parent,\n node,\n 'icon-shape default'\n );\n\n const topLabel = node.pos === 't';\n\n const height = iconSize + halfPadding * 2;\n const width = iconSize + halfPadding * 2;\n const { nodeBorder, mainBkg } = themeVariables;\n const { stylesMap } = compileStyles(node);\n\n const x = -width / 2;\n const y = -height / 2;\n\n const labelPadding = node.label ? 8 : 0;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n const fill = stylesMap.get('fill');\n options.stroke = fill ?? mainBkg;\n\n const iconNode = rc.path(createRoundedRectPathD(x, y, width, height, 5), options);\n\n const outerWidth = Math.max(width, bbox.width);\n const outerHeight = height + bbox.height + labelPadding;\n\n const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {\n ...options,\n fill: 'transparent',\n stroke: 'none',\n });\n\n const iconShape = shapeSvg.insert(() => iconNode, ':first-child').attr('class', 'icon-shape2');\n const outerShape = shapeSvg.insert(() => outerNode);\n\n if (node.icon) {\n const iconElem = shapeSvg.append('g');\n iconElem.html(\n `${await getIconSVG(node.icon, {\n height: iconSize,\n width: iconSize,\n fallbackPrefix: '',\n })} `\n );\n const iconBBox = iconElem.node()!.getBBox();\n const iconWidth = iconBBox.width;\n const iconHeight = iconBBox.height;\n const iconX = iconBBox.x;\n const iconY = iconBBox.y;\n iconElem.attr(\n 'transform',\n `translate(${-iconWidth / 2 - iconX},${\n topLabel\n ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY\n : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY\n })`\n );\n iconElem.attr('style', `color: ${stylesMap.get('stroke') ?? nodeBorder};`);\n }\n\n label.attr(\n 'transform',\n `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${\n topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height\n })`\n );\n\n iconShape.attr(\n 'transform',\n `translate(${0},${\n topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2\n })`\n );\n\n updateNodeBounds(node, outerShape);\n\n node.intersect = function (point) {\n log.info('iconSquare intersect', node, point);\n if (!node.label) {\n return intersect.rect(node, point);\n }\n const dx = node.x ?? 0;\n const dy = node.y ?? 0;\n const nodeHeight = node.height ?? 0;\n let points = [];\n if (topLabel) {\n points = [\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx + width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx + width / 2, y: dy + nodeHeight / 2 },\n { x: dx - width / 2, y: dy + nodeHeight / 2 },\n { x: dx - width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n ];\n } else {\n points = [\n { x: dx - width / 2, y: dy - nodeHeight / 2 },\n { x: dx + width / 2, y: dy - nodeHeight / 2 },\n { x: dx + width / 2, y: dy - nodeHeight / 2 + height },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + height },\n { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },\n { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + height },\n { x: dx - width / 2, y: dy - nodeHeight / 2 + height },\n ];\n }\n\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import rough from 'roughjs';\nimport { log } from '../../../logger.js';\nimport { getIconSVG } from '../../icons.js';\nimport type { Node, ShapeRenderOptions } from '../../types.js';\nimport intersect from '../intersect/index.js';\nimport { createRoundedRectPathD } from './roundedRectPath.js';\nimport { compileStyles, styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport { labelHelper, updateNodeBounds } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function iconSquare(\n parent: D3Selection,\n node: Node,\n { config: { themeVariables, flowchart } }: ShapeRenderOptions\n) {\n const { labelStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const assetHeight = node.assetHeight ?? 48;\n const assetWidth = node.assetWidth ?? 48;\n const iconSize = Math.max(assetHeight, assetWidth);\n const defaultWidth = flowchart?.wrappingWidth;\n node.width = Math.max(iconSize, defaultWidth ?? 0);\n const { shapeSvg, bbox, halfPadding, label } = await labelHelper(\n parent,\n node,\n 'icon-shape default'\n );\n\n const topLabel = node.pos === 't';\n\n const height = iconSize + halfPadding * 2;\n const width = iconSize + halfPadding * 2;\n const { nodeBorder, mainBkg } = themeVariables;\n const { stylesMap } = compileStyles(node);\n\n const x = -width / 2;\n const y = -height / 2;\n\n const labelPadding = node.label ? 8 : 0;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n const fill = stylesMap.get('fill');\n options.stroke = fill ?? mainBkg;\n\n const iconNode = rc.path(createRoundedRectPathD(x, y, width, height, 0.1), options);\n\n const outerWidth = Math.max(width, bbox.width);\n const outerHeight = height + bbox.height + labelPadding;\n\n const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {\n ...options,\n fill: 'transparent',\n stroke: 'none',\n });\n\n const iconShape = shapeSvg.insert(() => iconNode, ':first-child');\n const outerShape = shapeSvg.insert(() => outerNode);\n\n if (node.icon) {\n const iconElem = shapeSvg.append('g');\n iconElem.html(\n `${await getIconSVG(node.icon, {\n height: iconSize,\n width: iconSize,\n fallbackPrefix: '',\n })} `\n );\n const iconBBox = iconElem.node()!.getBBox();\n const iconWidth = iconBBox.width;\n const iconHeight = iconBBox.height;\n const iconX = iconBBox.x;\n const iconY = iconBBox.y;\n iconElem.attr(\n 'transform',\n `translate(${-iconWidth / 2 - iconX},${\n topLabel\n ? bbox.height / 2 + labelPadding / 2 - iconHeight / 2 - iconY\n : -bbox.height / 2 - labelPadding / 2 - iconHeight / 2 - iconY\n })`\n );\n iconElem.attr('style', `color: ${stylesMap.get('stroke') ?? nodeBorder};`);\n }\n\n label.attr(\n 'transform',\n `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${\n topLabel ? -outerHeight / 2 : outerHeight / 2 - bbox.height\n })`\n );\n\n iconShape.attr(\n 'transform',\n `translate(${0},${\n topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2\n })`\n );\n\n updateNodeBounds(node, outerShape);\n\n node.intersect = function (point) {\n log.info('iconSquare intersect', node, point);\n if (!node.label) {\n return intersect.rect(node, point);\n }\n const dx = node.x ?? 0;\n const dy = node.y ?? 0;\n const nodeHeight = node.height ?? 0;\n let points = [];\n if (topLabel) {\n points = [\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx + width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx + width / 2, y: dy + nodeHeight / 2 },\n { x: dx - width / 2, y: dy + nodeHeight / 2 },\n { x: dx - width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n ];\n } else {\n points = [\n { x: dx - width / 2, y: dy - nodeHeight / 2 },\n { x: dx + width / 2, y: dy - nodeHeight / 2 },\n { x: dx + width / 2, y: dy - nodeHeight / 2 + height },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + height },\n { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },\n { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + height },\n { x: dx - width / 2, y: dy - nodeHeight / 2 + height },\n ];\n }\n\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import rough from 'roughjs';\nimport { log } from '../../../logger.js';\nimport type { Node, ShapeRenderOptions } from '../../types.js';\nimport intersect from '../intersect/index.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport { labelHelper, updateNodeBounds } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function imageSquare(\n parent: D3Selection,\n node: Node,\n { config: { flowchart } }: ShapeRenderOptions\n) {\n const img = new Image();\n img.src = node?.img ?? '';\n await img.decode();\n\n const imageNaturalWidth = Number(img.naturalWidth.toString().replace('px', ''));\n const imageNaturalHeight = Number(img.naturalHeight.toString().replace('px', ''));\n node.imageAspectRatio = imageNaturalWidth / imageNaturalHeight;\n\n const { labelStyles } = styles2String(node);\n\n node.labelStyle = labelStyles;\n\n const defaultWidth = flowchart?.wrappingWidth;\n node.defaultWidth = flowchart?.wrappingWidth;\n\n const imageRawWidth = Math.max(\n node.label ? (defaultWidth ?? 0) : 0,\n node?.assetWidth ?? imageNaturalWidth\n );\n\n const imageWidth =\n node.constraint === 'on'\n ? node?.assetHeight\n ? node.assetHeight * node.imageAspectRatio\n : imageRawWidth\n : imageRawWidth;\n\n const imageHeight =\n node.constraint === 'on'\n ? imageWidth / node.imageAspectRatio\n : (node?.assetHeight ?? imageNaturalHeight);\n node.width = Math.max(imageWidth, defaultWidth ?? 0);\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, 'image-shape default');\n\n const topLabel = node.pos === 't';\n\n const x = -imageWidth / 2;\n const y = -imageHeight / 2;\n\n const labelPadding = node.label ? 8 : 0;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const imageNode = rc.rectangle(x, y, imageWidth, imageHeight, options);\n\n const outerWidth = Math.max(imageWidth, bbox.width);\n const outerHeight = imageHeight + bbox.height + labelPadding;\n\n const outerNode = rc.rectangle(-outerWidth / 2, -outerHeight / 2, outerWidth, outerHeight, {\n ...options,\n fill: 'none',\n stroke: 'none',\n });\n\n const iconShape = shapeSvg.insert(() => imageNode, ':first-child');\n const outerShape = shapeSvg.insert(() => outerNode);\n\n if (node.img) {\n const image = shapeSvg.append('image');\n\n // Set the image attributes\n image.attr('href', node.img);\n image.attr('width', imageWidth);\n image.attr('height', imageHeight);\n image.attr('preserveAspectRatio', 'none');\n\n image.attr(\n 'transform',\n `translate(${-imageWidth / 2},${topLabel ? outerHeight / 2 - imageHeight : -outerHeight / 2})`\n );\n }\n\n label.attr(\n 'transform',\n `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))},${\n topLabel\n ? -imageHeight / 2 - bbox.height / 2 - labelPadding / 2\n : imageHeight / 2 - bbox.height / 2 + labelPadding / 2\n })`\n );\n\n iconShape.attr(\n 'transform',\n `translate(${0},${\n topLabel ? bbox.height / 2 + labelPadding / 2 : -bbox.height / 2 - labelPadding / 2\n })`\n );\n\n updateNodeBounds(node, outerShape);\n\n node.intersect = function (point) {\n log.info('iconSquare intersect', node, point);\n if (!node.label) {\n return intersect.rect(node, point);\n }\n const dx = node.x ?? 0;\n const dy = node.y ?? 0;\n const nodeHeight = node.height ?? 0;\n let points = [];\n if (topLabel) {\n points = [\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx + imageWidth / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx + imageWidth / 2, y: dy + nodeHeight / 2 },\n { x: dx - imageWidth / 2, y: dy + nodeHeight / 2 },\n { x: dx - imageWidth / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + bbox.height + labelPadding },\n ];\n } else {\n points = [\n { x: dx - imageWidth / 2, y: dy - nodeHeight / 2 },\n { x: dx + imageWidth / 2, y: dy - nodeHeight / 2 },\n { x: dx + imageWidth / 2, y: dy - nodeHeight / 2 + imageHeight },\n { x: dx + bbox.width / 2, y: dy - nodeHeight / 2 + imageHeight },\n { x: dx + bbox.width / 2 / 2, y: dy + nodeHeight / 2 },\n { x: dx - bbox.width / 2, y: dy + nodeHeight / 2 },\n { x: dx - bbox.width / 2, y: dy - nodeHeight / 2 + imageHeight },\n { x: dx - imageWidth / 2, y: dy - nodeHeight / 2 + imageHeight },\n ];\n }\n\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { insertPolygonShape } from './insertPolygonShape.js';\nimport type { D3Selection } from '../../../types.js';\n\n// export const createInvertedTrapezoidPathD = (\n// x: number,\n// y: number,\n// width: number,\n// height: number\n// ): string => {\n// return [\n// `M${x + height / 6},${y}`,\n// `L${x + width - height / 6},${y}`,\n// `L${x + width + (2 * height) / 6},${y - height}`,\n// `L${x - (2 * height) / 6},${y - height}`,\n// 'Z',\n// ].join(' ');\n// };\n\nexport async function inv_trapezoid(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n\n const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n\n const points = [\n { x: 0, y: 0 },\n { x: w, y: 0 },\n { x: w + (3 * h) / 6, y: -h },\n { x: (-3 * h) / 6, y: -h },\n ];\n\n let polygon: typeof shapeSvg | ReturnType;\n const { cssStyles } = node;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n const pathData = createPathFromPoints(points);\n // const pathData = createInvertedTrapezoidPathD(0, 0, w, h);\n const roughNode = rc.path(pathData, options);\n\n polygon = shapeSvg\n .insert(() => roughNode, ':first-child')\n .attr('transform', `translate(${-w / 2}, ${h / 2})`);\n\n if (cssStyles) {\n polygon.attr('style', cssStyles);\n }\n } else {\n polygon = insertPolygonShape(shapeSvg, w, h, points);\n }\n\n if (nodeStyles) {\n polygon.attr('style', nodeStyles);\n }\n\n node.width = w;\n node.height = h;\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node, RectOptions } from '../../types.js';\nimport { createRoundedRectPathD } from './roundedRectPath.js';\nimport { userNodeOverrides, styles2String } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\nimport { handleUndefinedAttr } from '../../../utils.js';\n\nexport async function drawRect(\n parent: D3Selection,\n node: Node,\n options: RectOptions\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n // console.log('IPI labelStyles:', labelStyles);\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n\n const totalWidth = Math.max(bbox.width + options.labelPaddingX * 2, node?.width || 0);\n const totalHeight = Math.max(bbox.height + options.labelPaddingY * 2, node?.height || 0);\n const x = -totalWidth / 2;\n const y = -totalHeight / 2;\n\n // log.info('IPI node = ', node);\n\n let rect;\n let { rx, ry } = node;\n const { cssStyles } = node;\n\n //use options rx, ry overrides if present\n if (options?.rx && options.ry) {\n rx = options.rx;\n ry = options.ry;\n }\n\n if (node.look === 'handDrawn') {\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n const roughNode =\n rx || ry\n ? rc.path(createRoundedRectPathD(x, y, totalWidth, totalHeight, rx || 0), options)\n : rc.rectangle(x, y, totalWidth, totalHeight, options);\n\n rect = shapeSvg.insert(() => roughNode, ':first-child');\n rect.attr('class', 'basic label-container').attr('style', handleUndefinedAttr(cssStyles));\n } else {\n rect = shapeSvg.insert('rect', ':first-child');\n\n rect\n .attr('class', 'basic label-container')\n .attr('style', nodeStyles)\n .attr('rx', handleUndefinedAttr(rx))\n .attr('ry', handleUndefinedAttr(ry))\n .attr('x', x)\n .attr('y', y)\n .attr('width', totalWidth)\n .attr('height', totalHeight);\n }\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n}\n", "import type { Node, RectOptions } from '../../types.js';\nimport { drawRect } from './drawRect.js';\nimport { labelHelper, updateNodeBounds } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function roundedRect(\n parent: D3Selection,\n node: Node\n) {\n const options = {\n rx: 5,\n ry: 5,\n classes: '',\n labelPaddingX: (node?.padding || 0) * 1,\n labelPaddingY: (node?.padding || 0) * 1,\n } as RectOptions;\n\n return drawRect(parent, node, options);\n}\n\nexport async function labelRect(parent: D3Selection, node: Node) {\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, 'label');\n\n // log.trace('Classes = ', node.class);\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n // Hide the rect we are only after the label\n const totalWidth = 0.1;\n const totalHeight = 0.1;\n rect.attr('width', totalWidth).attr('height', totalHeight);\n shapeSvg.attr('class', 'label edgeLabel');\n label.attr(\n 'transform',\n `translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`\n );\n\n // if (node.props) {\n // const propKeys = new Set(Object.keys(node.props));\n // if (node.props.borders) {\n // applyNodePropertyBorders(rect, node.borders, totalWidth, totalHeight);\n // propKeys.delete('borders');\n // }\n // propKeys.forEach((propKey) => {\n // log.warn(`Unknown node property ${propKey}`);\n // });\n // }\n\n updateNodeBounds(node, rect);\n // node.width = 1;\n // node.height = 1;\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { insertPolygonShape } from './insertPolygonShape.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function lean_left(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + (node.padding ?? 0), node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0), node?.height ?? 0);\n const points = [\n { x: 0, y: 0 },\n { x: w + (3 * h) / 6, y: 0 },\n { x: w, y: -h },\n { x: -(3 * h) / 6, y: -h },\n ];\n\n let polygon: typeof shapeSvg | ReturnType;\n const { cssStyles } = node;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n const pathData = createPathFromPoints(points);\n // const pathData = createLeanLeftPathD(0, 0, w, h);\n const roughNode = rc.path(pathData, options);\n\n polygon = shapeSvg\n .insert(() => roughNode, ':first-child')\n .attr('transform', `translate(${-w / 2}, ${h / 2})`);\n\n if (cssStyles) {\n polygon.attr('style', cssStyles);\n }\n } else {\n polygon = insertPolygonShape(shapeSvg, w, h, points);\n }\n\n if (nodeStyles) {\n polygon.attr('style', nodeStyles);\n }\n\n node.width = w;\n node.height = h;\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { insertPolygonShape } from './insertPolygonShape.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function lean_right(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + (node.padding ?? 0), node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0), node?.height ?? 0);\n const points = [\n { x: (-3 * h) / 6, y: 0 },\n { x: w, y: 0 },\n { x: w + (3 * h) / 6, y: -h },\n { x: 0, y: -h },\n ];\n\n let polygon: typeof shapeSvg | ReturnType;\n const { cssStyles } = node;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n const pathData = createPathFromPoints(points);\n const roughNode = rc.path(pathData, options);\n\n polygon = shapeSvg\n .insert(() => roughNode, ':first-child')\n .attr('transform', `translate(${-w / 2}, ${h / 2})`);\n\n if (cssStyles) {\n polygon.attr('style', cssStyles);\n }\n } else {\n polygon = insertPolygonShape(shapeSvg, w, h, points);\n }\n\n if (nodeStyles) {\n polygon.attr('style', nodeStyles);\n }\n\n node.width = w;\n node.height = h;\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import { log } from '../../../logger.js';\nimport { getNodeClasses, updateNodeBounds } from './util.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport intersect from '../intersect/index.js';\nimport { createPathFromPoints } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport function lightningBolt(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.label = '';\n node.labelStyle = labelStyles;\n const shapeSvg = parent\n .insert('g')\n .attr('class', getNodeClasses(node))\n .attr('id', node.domId ?? node.id);\n const { cssStyles } = node;\n const width = Math.max(35, node?.width ?? 0);\n const height = Math.max(35, node?.height ?? 0);\n const gap = 7;\n\n const points = [\n { x: width, y: 0 },\n { x: 0, y: height + gap / 2 },\n { x: width - 2 * gap, y: height + gap / 2 },\n { x: 0, y: 2 * height },\n { x: width, y: height - gap / 2 },\n { x: 2 * gap, y: height - gap / 2 },\n ];\n\n // @ts-expect-error shapeSvg d3 class is incorrect?\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const linePath = createPathFromPoints(points);\n const lineNode = rc.path(linePath, options);\n\n const lightningBolt = shapeSvg.insert(() => lineNode, ':first-child');\n\n if (cssStyles && node.look !== 'handDrawn') {\n lightningBolt.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n lightningBolt.selectAll('path').attr('style', nodeStyles);\n }\n\n lightningBolt.attr('transform', `translate(-${width / 2},${-height})`);\n\n updateNodeBounds(node, lightningBolt);\n\n node.intersect = function (point) {\n log.info('lightningBolt intersect', node, point);\n const pos = intersect.polygon(node, points, point);\n\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\nimport { handleUndefinedAttr } from '../../../utils.js';\n\nexport const createCylinderPathD = (\n x: number,\n y: number,\n width: number,\n height: number,\n rx: number,\n ry: number,\n outerOffset: number\n): string => {\n return [\n `M${x},${y + ry}`,\n `a${rx},${ry} 0,0,0 ${width},0`,\n `a${rx},${ry} 0,0,0 ${-width},0`,\n `l0,${height}`,\n `a${rx},${ry} 0,0,0 ${width},0`,\n `l0,${-height}`,\n `M${x},${y + ry + outerOffset}`,\n `a${rx},${ry} 0,0,0 ${width},0`,\n ].join(' ');\n};\nexport const createOuterCylinderPathD = (\n x: number,\n y: number,\n width: number,\n height: number,\n rx: number,\n ry: number,\n outerOffset: number\n): string => {\n return [\n `M${x},${y + ry}`,\n `M${x + width},${y + ry}`,\n `a${rx},${ry} 0,0,0 ${-width},0`,\n `l0,${height}`,\n `a${rx},${ry} 0,0,0 ${width},0`,\n `l0,${-height}`,\n `M${x},${y + ry + outerOffset}`,\n `a${rx},${ry} 0,0,0 ${width},0`,\n ].join(' ');\n};\nexport const createInnerCylinderPathD = (\n x: number,\n y: number,\n width: number,\n height: number,\n rx: number,\n ry: number\n): string => {\n return [`M${x - width / 2},${-height / 2}`, `a${rx},${ry} 0,0,0 ${width},0`].join(' ');\n};\nexport async function linedCylinder(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + (node.padding ?? 0), node.width ?? 0);\n const rx = w / 2;\n const ry = rx / (2.5 + w / 50);\n const h = Math.max(bbox.height + ry + (node.padding ?? 0), node.height ?? 0);\n const outerOffset = h * 0.1; // 10% of height\n\n let cylinder: typeof shapeSvg | D3Selection;\n const { cssStyles } = node;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const outerPathData = createOuterCylinderPathD(0, 0, w, h, rx, ry, outerOffset);\n const innerPathData = createInnerCylinderPathD(0, ry, w, h, rx, ry);\n const options = userNodeOverrides(node, {});\n\n const outerNode = rc.path(outerPathData, options);\n const innerLine = rc.path(innerPathData, options);\n\n const innerLineEl = shapeSvg.insert(() => innerLine, ':first-child');\n innerLineEl.attr('class', 'line');\n cylinder = shapeSvg.insert(() => outerNode, ':first-child');\n cylinder.attr('class', 'basic label-container');\n if (cssStyles) {\n cylinder.attr('style', cssStyles);\n }\n } else {\n const pathData = createCylinderPathD(0, 0, w, h, rx, ry, outerOffset);\n cylinder = shapeSvg\n .insert('path', ':first-child')\n .attr('d', pathData)\n .attr('class', 'basic label-container')\n .attr('style', handleUndefinedAttr(cssStyles))\n .attr('style', nodeStyles);\n }\n\n // find label and move it down\n cylinder.attr('label-offset-y', ry);\n cylinder.attr('transform', `translate(${-w / 2}, ${-(h / 2 + ry)})`);\n\n updateNodeBounds(node, cylinder);\n\n label.attr(\n 'transform',\n `translate(${-(bbox.width / 2) - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + ry - (bbox.y - (bbox.top ?? 0))})`\n );\n\n node.intersect = function (point) {\n const pos = intersect.rect(node, point);\n const x = pos.x - (node.x ?? 0);\n\n if (\n rx != 0 &&\n (Math.abs(x) < (node.width ?? 0) / 2 ||\n (Math.abs(x) == (node.width ?? 0) / 2 &&\n Math.abs(pos.y - (node.y ?? 0)) > (node.height ?? 0) / 2 - ry))\n ) {\n let y = ry * ry * (1 - (x * x) / (rx * rx));\n if (y > 0) {\n y = Math.sqrt(y);\n }\n y = ry - y;\n if (point.y - (node.y ?? 0) > 0) {\n y = -y;\n }\n\n pos.y += y;\n }\n\n return pos;\n };\n\n return shapeSvg;\n}\n", "import {\n labelHelper,\n updateNodeBounds,\n getNodeClasses,\n generateFullSineWavePoints,\n} from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport rough from 'roughjs';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function linedWaveEdgedRect(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const waveAmplitude = h / 4;\n const finalH = h + waveAmplitude;\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const points = [\n { x: -w / 2 - (w / 2) * 0.1, y: -finalH / 2 },\n { x: -w / 2 - (w / 2) * 0.1, y: finalH / 2 },\n ...generateFullSineWavePoints(\n -w / 2 - (w / 2) * 0.1,\n finalH / 2,\n w / 2 + (w / 2) * 0.1,\n finalH / 2,\n waveAmplitude,\n 0.8\n ),\n { x: w / 2 + (w / 2) * 0.1, y: -finalH / 2 },\n { x: -w / 2 - (w / 2) * 0.1, y: -finalH / 2 },\n { x: -w / 2, y: -finalH / 2 },\n { x: -w / 2, y: (finalH / 2) * 1.1 },\n { x: -w / 2, y: -finalH / 2 },\n ];\n\n const poly = rc.polygon(\n points.map((p) => [p.x, p.y]),\n options\n );\n\n const waveEdgeRect = shapeSvg.insert(() => poly, ':first-child');\n\n waveEdgeRect.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n waveEdgeRect.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n waveEdgeRect.selectAll('path').attr('style', nodeStyles);\n }\n\n waveEdgeRect.attr('transform', `translate(0,${-waveAmplitude / 2})`);\n label.attr(\n 'transform',\n `translate(${-w / 2 + (node.padding ?? 0) + ((w / 2) * 0.1) / 2 - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, waveEdgeRect);\n node.intersect = function (point) {\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, getNodeClasses, updateNodeBounds, createPathFromPoints } from './util.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport intersect from '../intersect/index.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function multiRect(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const rectOffset = 5;\n const x = -w / 2;\n const y = -h / 2;\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n const outerPathPoints = [\n { x: x - rectOffset, y: y + rectOffset },\n { x: x - rectOffset, y: y + h + rectOffset },\n { x: x + w - rectOffset, y: y + h + rectOffset },\n { x: x + w - rectOffset, y: y + h },\n { x: x + w, y: y + h },\n { x: x + w, y: y + h - rectOffset },\n { x: x + w + rectOffset, y: y + h - rectOffset },\n { x: x + w + rectOffset, y: y - rectOffset },\n { x: x + rectOffset, y: y - rectOffset },\n { x: x + rectOffset, y: y },\n { x, y },\n { x, y: y + rectOffset },\n ];\n\n const innerPathPoints = [\n { x, y: y + rectOffset },\n { x: x + w - rectOffset, y: y + rectOffset },\n { x: x + w - rectOffset, y: y + h },\n { x: x + w, y: y + h },\n { x: x + w, y },\n { x, y },\n ];\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const outerPath = createPathFromPoints(outerPathPoints);\n const outerNode = rc.path(outerPath, options);\n const innerPath = createPathFromPoints(innerPathPoints);\n const innerNode = rc.path(innerPath, { ...options, fill: 'none' });\n\n const multiRect = shapeSvg.insert(() => innerNode, ':first-child');\n multiRect.insert(() => outerNode, ':first-child');\n\n multiRect.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n multiRect.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n multiRect.selectAll('path').attr('style', nodeStyles);\n }\n\n label.attr(\n 'transform',\n `translate(${-(bbox.width / 2) - rectOffset - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, multiRect);\n\n node.intersect = function (point) {\n const pos = intersect.polygon(node, outerPathPoints, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import {\n labelHelper,\n updateNodeBounds,\n getNodeClasses,\n createPathFromPoints,\n generateFullSineWavePoints,\n} from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport rough from 'roughjs';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function multiWaveEdgedRectangle(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const waveAmplitude = h / 4;\n const finalH = h + waveAmplitude;\n const x = -w / 2;\n const y = -finalH / 2;\n const rectOffset = 5;\n\n const { cssStyles } = node;\n\n const wavePoints = generateFullSineWavePoints(\n x - rectOffset,\n y + finalH + rectOffset,\n x + w - rectOffset,\n y + finalH + rectOffset,\n waveAmplitude,\n 0.8\n );\n\n const lastWavePoint = wavePoints?.[wavePoints.length - 1];\n\n const outerPathPoints = [\n { x: x - rectOffset, y: y + rectOffset },\n { x: x - rectOffset, y: y + finalH + rectOffset },\n ...wavePoints,\n { x: x + w - rectOffset, y: lastWavePoint.y - rectOffset },\n { x: x + w, y: lastWavePoint.y - rectOffset },\n { x: x + w, y: lastWavePoint.y - 2 * rectOffset },\n { x: x + w + rectOffset, y: lastWavePoint.y - 2 * rectOffset },\n { x: x + w + rectOffset, y: y - rectOffset },\n { x: x + rectOffset, y: y - rectOffset },\n { x: x + rectOffset, y: y },\n { x, y },\n { x, y: y + rectOffset },\n ];\n\n const innerPathPoints = [\n { x, y: y + rectOffset },\n { x: x + w - rectOffset, y: y + rectOffset },\n { x: x + w - rectOffset, y: lastWavePoint.y - rectOffset },\n { x: x + w, y: lastWavePoint.y - rectOffset },\n { x: x + w, y },\n { x, y },\n ];\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const outerPath = createPathFromPoints(outerPathPoints);\n const outerNode = rc.path(outerPath, options);\n const innerPath = createPathFromPoints(innerPathPoints);\n const innerNode = rc.path(innerPath, options);\n\n const shape = shapeSvg.insert(() => outerNode, ':first-child');\n shape.insert(() => innerNode);\n\n shape.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n shape.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n shape.selectAll('path').attr('style', nodeStyles);\n }\n\n shape.attr('transform', `translate(0,${-waveAmplitude / 2})`);\n\n label.attr(\n 'transform',\n `translate(${-(bbox.width / 2) - rectOffset - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, shape);\n\n node.intersect = function (point) {\n const pos = intersect.polygon(node, outerPathPoints, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import rough from 'roughjs';\nimport type { Node, ShapeRenderOptions } from '../../types.js';\nimport intersect from '../intersect/index.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport { getNodeClasses, labelHelper, updateNodeBounds } from './util.js';\nimport type { D3Selection } from '../../../types.js';\nimport { getConfig } from '../../../config.js';\n\nexport async function note(\n parent: D3Selection,\n node: Node,\n { config: { themeVariables } }: ShapeRenderOptions\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const useHtmlLabels = node.useHtmlLabels || getConfig().flowchart?.htmlLabels !== false;\n if (!useHtmlLabels) {\n node.centerLabel = true;\n }\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n const totalWidth = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const totalHeight = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const x = -totalWidth / 2;\n const y = -totalHeight / 2;\n const { cssStyles } = node;\n\n // add the rect\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {\n fill: themeVariables.noteBkgColor,\n stroke: themeVariables.noteBorderColor,\n });\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const noteShapeNode = rc.rectangle(x, y, totalWidth, totalHeight, options);\n\n const rect = shapeSvg.insert(() => noteShapeNode, ':first-child');\n rect.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n rect.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n rect.selectAll('path').attr('style', nodeStyles);\n }\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n}\n", "import { log } from '../../../logger.js';\nimport { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { insertPolygonShape } from './insertPolygonShape.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport const createDecisionBoxPathD = (x: number, y: number, size: number): string => {\n return [\n `M${x + size / 2},${y}`,\n `L${x + size},${y - size / 2}`,\n `L${x + size / 2},${y - size}`,\n `L${x},${y - size / 2}`,\n 'Z',\n ].join(' ');\n};\n\nexport async function question(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const s = w + h;\n\n const points = [\n { x: s / 2, y: 0 },\n { x: s, y: -s / 2 },\n { x: s / 2, y: -s },\n { x: 0, y: -s / 2 },\n ];\n\n let polygon: typeof shapeSvg | ReturnType;\n const { cssStyles } = node;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n const pathData = createDecisionBoxPathD(0, 0, s);\n const roughNode = rc.path(pathData, options);\n\n polygon = shapeSvg\n .insert(() => roughNode, ':first-child')\n .attr('transform', `translate(${-s / 2}, ${s / 2})`);\n\n if (cssStyles) {\n polygon.attr('style', cssStyles);\n }\n } else {\n polygon = insertPolygonShape(shapeSvg, s, s, points);\n }\n\n if (nodeStyles) {\n polygon.attr('style', nodeStyles);\n }\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n log.debug(\n 'APA12 Intersect called SPLIT\\npoint:',\n point,\n '\\nnode:\\n',\n node,\n '\\nres:',\n intersect.polygon(node, points, point)\n );\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function rect_left_inv_arrow(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n\n const w = Math.max(bbox.width + (node.padding ?? 0), node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0), node?.height ?? 0);\n\n const x = -w / 2;\n const y = -h / 2;\n const notch = y / 2;\n\n const points = [\n { x: x + notch, y },\n { x: x, y: 0 },\n { x: x + notch, y: -y },\n { x: -x, y: -y },\n { x: -x, y },\n ];\n\n const { cssStyles } = node;\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const pathData = createPathFromPoints(points);\n const roughNode = rc.path(pathData, options);\n\n const polygon = shapeSvg.insert(() => roughNode, ':first-child');\n\n polygon.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n polygon.selectAll('path').attr('style', cssStyles);\n }\n if (nodeStyles && node.look !== 'handDrawn') {\n polygon.selectAll('path').attr('style', nodeStyles);\n }\n\n polygon.attr('transform', `translate(${-notch / 2},0)`);\n\n label.attr(\n 'transform',\n `translate(${-notch / 2 - bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`\n );\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import type { Node } from '../../types.js';\nimport { select } from 'd3';\nimport { evaluate } from '../../../diagrams/common/common.js';\nimport { updateNodeBounds } from './util.js';\nimport createLabel from '../createLabel.js';\nimport intersect from '../intersect/index.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { getConfig } from '../../../diagram-api/diagramAPI.js';\nimport { createRoundedRectPathD } from './roundedRectPath.js';\nimport { log } from '../../../logger.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function rectWithTitle(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n let classes;\n if (!node.cssClasses) {\n classes = 'node default';\n } else {\n classes = 'node ' + node.cssClasses;\n }\n\n // Add outer g element\n const shapeSvg = parent\n // @ts-ignore - d3 typings are not correct\n .insert('g')\n .attr('class', classes)\n .attr('id', node.domId || node.id);\n\n // Create the title label and insert it after the rect\n const g = shapeSvg.insert('g');\n\n const label = shapeSvg.insert('g').attr('class', 'label').attr('style', nodeStyles);\n\n const description = node.description;\n\n const title = node.label;\n\n const text = label.node()!.appendChild(await createLabel(title, node.labelStyle, true, true));\n let bbox = { width: 0, height: 0 };\n if (evaluate(getConfig()?.flowchart?.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n log.info('Text 2', description);\n const textRows = description || [];\n const titleBox = text.getBBox();\n const descr = label\n .node()!\n .appendChild(\n await createLabel(\n textRows.join ? textRows.join('
') : textRows,\n node.labelStyle,\n true,\n true\n )\n );\n\n //if (evaluate(getConfig()?.flowchart?.htmlLabels)) {\n const div = descr.children[0];\n const dv = select(descr);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n // }\n\n const halfPadding = (node.padding || 0) / 2;\n select(descr).attr(\n 'transform',\n 'translate( ' +\n (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) +\n ', ' +\n (titleBox.height + halfPadding + 5) +\n ')'\n );\n select(text).attr(\n 'transform',\n 'translate( ' +\n (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) +\n ', ' +\n 0 +\n ')'\n );\n // Get the size of the label\n\n // Bounding box for title and text\n bbox = label.node()!.getBBox();\n\n // Center the label\n label.attr(\n 'transform',\n 'translate(' + -bbox.width / 2 + ', ' + (-bbox.height / 2 - halfPadding + 3) + ')'\n );\n\n const totalWidth = bbox.width + (node.padding || 0);\n const totalHeight = bbox.height + (node.padding || 0);\n const x = -bbox.width / 2 - halfPadding;\n const y = -bbox.height / 2 - halfPadding;\n let rect;\n let innerLine;\n if (node.look === 'handDrawn') {\n // @ts-ignore No typings for rough\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n const roughNode = rc.path(\n createRoundedRectPathD(x, y, totalWidth, totalHeight, node.rx || 0),\n options\n );\n\n const roughLine = rc.line(\n -bbox.width / 2 - halfPadding,\n -bbox.height / 2 - halfPadding + titleBox.height + halfPadding,\n bbox.width / 2 + halfPadding,\n -bbox.height / 2 - halfPadding + titleBox.height + halfPadding,\n options\n );\n\n innerLine = shapeSvg.insert(() => {\n log.debug('Rough node insert CXC', roughNode);\n return roughLine;\n }, ':first-child');\n rect = shapeSvg.insert(() => {\n log.debug('Rough node insert CXC', roughNode);\n return roughNode;\n }, ':first-child');\n } else {\n rect = g.insert('rect', ':first-child');\n innerLine = g.insert('line');\n rect\n .attr('class', 'outer title-state')\n .attr('style', nodeStyles)\n .attr('x', -bbox.width / 2 - halfPadding)\n .attr('y', -bbox.height / 2 - halfPadding)\n .attr('width', bbox.width + (node.padding || 0))\n .attr('height', bbox.height + (node.padding || 0));\n\n innerLine\n .attr('class', 'divider')\n .attr('x1', -bbox.width / 2 - halfPadding)\n .attr('x2', bbox.width / 2 + halfPadding)\n .attr('y1', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding)\n .attr('y2', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);\n }\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n}\n", "import type { Node, RectOptions } from '../../types.js';\nimport type { D3Selection } from '../../../types.js';\nimport { drawRect } from './drawRect.js';\n\nexport async function roundedRect(\n parent: D3Selection,\n node: Node\n) {\n const options = {\n rx: 5,\n ry: 5,\n classes: '',\n labelPaddingX: (node?.padding || 0) * 1,\n labelPaddingY: (node?.padding || 0) * 1,\n } as RectOptions;\n\n return drawRect(parent, node, options);\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\nimport { handleUndefinedAttr } from '../../../utils.js';\n\nexport async function shadedProcess(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const halfPadding = node?.padding ?? 0;\n const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const x = -bbox.width / 2 - halfPadding;\n const y = -bbox.height / 2 - halfPadding;\n\n const { cssStyles } = node;\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const points = [\n { x, y },\n { x: x + w + 8, y },\n { x: x + w + 8, y: y + h },\n { x: x - 8, y: y + h },\n { x: x - 8, y: y },\n { x, y },\n { x, y: y + h },\n ];\n\n const roughNode = rc.polygon(\n points.map((p) => [p.x, p.y]),\n options\n );\n\n const rect = shapeSvg.insert(() => roughNode, ':first-child');\n\n rect.attr('class', 'basic label-container').attr('style', handleUndefinedAttr(cssStyles));\n\n if (nodeStyles && node.look !== 'handDrawn') {\n rect.selectAll('path').attr('style', nodeStyles);\n }\n\n if (cssStyles && node.look !== 'handDrawn') {\n rect.selectAll('path').attr('style', nodeStyles);\n }\n\n label.attr(\n 'transform',\n `translate(${-w / 2 + 4 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function slopedRect(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const x = -w / 2;\n const y = -h / 2;\n\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const points = [\n { x, y },\n { x, y: y + h },\n { x: x + w, y: y + h },\n { x: x + w, y: y - h / 2 },\n ];\n\n const pathData = createPathFromPoints(points);\n const shapeNode = rc.path(pathData, options);\n\n const polygon = shapeSvg.insert(() => shapeNode, ':first-child');\n polygon.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', nodeStyles);\n }\n\n polygon.attr('transform', `translate(0, ${h / 4})`);\n label.attr(\n 'transform',\n `translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))}, ${-h / 4 + (node.padding ?? 0) - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import type { Node, RectOptions } from '../../types.js';\nimport type { D3Selection } from '../../../types.js';\nimport { drawRect } from './drawRect.js';\n\nexport async function squareRect(parent: D3Selection, node: Node) {\n const options = {\n rx: 0,\n ry: 0,\n classes: '',\n labelPaddingX: (node?.padding || 0) * 2,\n labelPaddingY: (node?.padding || 0) * 1,\n } as RectOptions;\n return drawRect(parent, node, options);\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { createRoundedRectPathD } from './roundedRectPath.js';\nimport type { D3Selection } from '../../../types.js';\nimport { handleUndefinedAttr } from '../../../utils.js';\n\nexport const createStadiumPathD = (\n x: number,\n y: number,\n totalWidth: number,\n totalHeight: number\n) => {\n const radius = totalHeight / 2;\n return [\n 'M',\n x + radius,\n y, // Move to the start of the top-left arc\n 'H',\n x + totalWidth - radius, // Draw horizontal line to the start of the top-right arc\n 'A',\n radius,\n radius,\n 0,\n 0,\n 1,\n x + totalWidth,\n y + radius, // Draw top-right arc\n 'H',\n x, // Draw horizontal line to the start of the bottom-right arc\n 'A',\n radius,\n radius,\n 0,\n 0,\n 1,\n x + totalWidth - radius,\n y + totalHeight, // Draw bottom-right arc\n 'H',\n x + radius, // Draw horizontal line to the start of the bottom-left arc\n 'A',\n radius,\n radius,\n 0,\n 0,\n 1,\n x,\n y + radius, // Draw bottom-left arc\n 'Z', // Close the path\n ].join(' ');\n};\n\nexport async function stadium(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n\n const h = bbox.height + node.padding;\n const w = bbox.width + h / 4 + node.padding;\n\n let rect;\n const { cssStyles } = node;\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n const pathData = createRoundedRectPathD(-w / 2, -h / 2, w, h, h / 2);\n const roughNode = rc.path(pathData, options);\n\n rect = shapeSvg.insert(() => roughNode, ':first-child');\n rect.attr('class', 'basic label-container').attr('style', handleUndefinedAttr(cssStyles));\n } else {\n rect = shapeSvg.insert('rect', ':first-child');\n\n rect\n .attr('class', 'basic label-container')\n .attr('style', nodeStyles)\n .attr('rx', h / 2)\n .attr('ry', h / 2)\n .attr('x', -w / 2)\n .attr('y', -h / 2)\n .attr('width', w)\n .attr('height', h);\n }\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n}\n", "import type { Node, RectOptions } from '../../types.js';\nimport type { D3Selection } from '../../../types.js';\nimport { drawRect } from './drawRect.js';\n\nexport async function state(parent: D3Selection, node: Node) {\n const options = {\n rx: 5,\n ry: 5,\n classes: 'flowchart-node',\n } as RectOptions;\n return drawRect(parent, node, options);\n}\n", "import rough from 'roughjs';\nimport type { Node, ShapeRenderOptions } from '../../types.js';\nimport intersect from '../intersect/index.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport { updateNodeBounds } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport function stateEnd(\n parent: D3Selection,\n node: Node,\n { config: { themeVariables } }: ShapeRenderOptions\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { cssStyles } = node;\n const { lineColor, stateBorder, nodeBorder } = themeVariables;\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'node default')\n .attr('id', node.domId || node.id);\n\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const roughNode = rc.circle(0, 0, 14, {\n ...options,\n stroke: lineColor,\n strokeWidth: 2,\n });\n const innerFill = stateBorder ?? nodeBorder;\n const roughInnerNode = rc.circle(0, 0, 5, {\n ...options,\n fill: innerFill,\n stroke: innerFill,\n strokeWidth: 2,\n fillStyle: 'solid',\n });\n const circle = shapeSvg.insert(() => roughNode, ':first-child');\n circle.insert(() => roughInnerNode);\n\n if (cssStyles) {\n circle.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles) {\n circle.selectAll('path').attr('style', nodeStyles);\n }\n\n updateNodeBounds(node, circle);\n\n node.intersect = function (point) {\n return intersect.circle(node, 7, point);\n };\n\n return shapeSvg;\n}\n", "import rough from 'roughjs';\nimport type { Node, ShapeRenderOptions } from '../../types.js';\nimport intersect from '../intersect/index.js';\nimport { solidStateFill } from './handDrawnShapeStyles.js';\nimport { updateNodeBounds } from './util.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport function stateStart(\n parent: D3Selection,\n node: Node,\n { config: { themeVariables } }: ShapeRenderOptions\n) {\n const { lineColor } = themeVariables;\n\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'node default')\n .attr('id', node.domId || node.id);\n\n let circle: D3Selection | D3Selection;\n if (node.look === 'handDrawn') {\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const roughNode = rc.circle(0, 0, 14, solidStateFill(lineColor));\n circle = shapeSvg.insert(() => roughNode);\n // center the circle around its coordinate\n circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14);\n } else {\n circle = shapeSvg.insert('circle', ':first-child');\n // center the circle around its coordinate\n circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14);\n }\n\n updateNodeBounds(node, circle);\n\n node.intersect = function (point) {\n return intersect.circle(node, 7, point);\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { insertPolygonShape } from './insertPolygonShape.js';\nimport type { D3Selection } from '../../../types.js';\nimport { handleUndefinedAttr } from '../../../utils.js';\n\nexport const createSubroutinePathD = (\n x: number,\n y: number,\n width: number,\n height: number\n): string => {\n const offset = 8;\n return [\n `M${x - offset},${y}`,\n `H${x + width + offset}`,\n `V${y + height}`,\n `H${x - offset}`,\n `V${y}`,\n 'M',\n x,\n y,\n 'H',\n x + width,\n 'V',\n y + height,\n 'H',\n x,\n 'Z',\n ].join(' ');\n};\n\nexport async function subroutine(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n const halfPadding = (node?.padding || 0) / 2;\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const x = -bbox.width / 2 - halfPadding;\n const y = -bbox.height / 2 - halfPadding;\n\n const points = [\n { x: 0, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: 0, y: -h },\n { x: 0, y: 0 },\n { x: -8, y: 0 },\n { x: w + 8, y: 0 },\n { x: w + 8, y: -h },\n { x: -8, y: -h },\n { x: -8, y: 0 },\n ];\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n const roughNode = rc.rectangle(x - 8, y, w + 16, h, options);\n const l1 = rc.line(x, y, x, y + h, options);\n const l2 = rc.line(x + w, y, x + w, y + h, options);\n\n shapeSvg.insert(() => l1, ':first-child');\n shapeSvg.insert(() => l2, ':first-child');\n const rect = shapeSvg.insert(() => roughNode, ':first-child');\n const { cssStyles } = node;\n rect.attr('class', 'basic label-container').attr('style', handleUndefinedAttr(cssStyles));\n updateNodeBounds(node, rect);\n } else {\n const el = insertPolygonShape(shapeSvg, w, h, points);\n if (nodeStyles) {\n el.attr('style', nodeStyles);\n }\n updateNodeBounds(node, el);\n }\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, getNodeClasses, updateNodeBounds, createPathFromPoints } from './util.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport intersect from '../intersect/index.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function taggedRect(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const x = -w / 2;\n const y = -h / 2;\n const tagWidth = 0.2 * h;\n const tagHeight = 0.2 * h;\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n const rectPoints = [\n { x: x - tagWidth / 2, y },\n { x: x + w + tagWidth / 2, y },\n { x: x + w + tagWidth / 2, y: y + h },\n { x: x - tagWidth / 2, y: y + h },\n ];\n\n const tagPoints = [\n { x: x + w - tagWidth / 2, y: y + h },\n { x: x + w + tagWidth / 2, y: y + h },\n { x: x + w + tagWidth / 2, y: y + h - tagHeight },\n ];\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const rectPath = createPathFromPoints(rectPoints);\n const rectNode = rc.path(rectPath, options);\n\n const tagPath = createPathFromPoints(tagPoints);\n const tagNode = rc.path(tagPath, { ...options, fillStyle: 'solid' });\n\n const taggedRect = shapeSvg.insert(() => tagNode, ':first-child');\n taggedRect.insert(() => rectNode, ':first-child');\n\n taggedRect.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n taggedRect.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n taggedRect.selectAll('path').attr('style', nodeStyles);\n }\n\n updateNodeBounds(node, taggedRect);\n\n node.intersect = function (point) {\n const pos = intersect.polygon(node, rectPoints, point);\n\n return pos;\n };\n\n return shapeSvg;\n}\n", "import {\n labelHelper,\n updateNodeBounds,\n getNodeClasses,\n generateFullSineWavePoints,\n createPathFromPoints,\n} from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport rough from 'roughjs';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function taggedWaveEdgedRectangle(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const waveAmplitude = h / 4;\n const tagWidth = 0.2 * w;\n const tagHeight = 0.2 * h;\n const finalH = h + waveAmplitude;\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const points = [\n { x: -w / 2 - (w / 2) * 0.1, y: finalH / 2 },\n ...generateFullSineWavePoints(\n -w / 2 - (w / 2) * 0.1,\n finalH / 2,\n w / 2 + (w / 2) * 0.1,\n finalH / 2,\n waveAmplitude,\n 0.8\n ),\n\n { x: w / 2 + (w / 2) * 0.1, y: -finalH / 2 },\n { x: -w / 2 - (w / 2) * 0.1, y: -finalH / 2 },\n ];\n\n const x = -w / 2 + (w / 2) * 0.1;\n const y = -finalH / 2 - tagHeight * 0.4;\n\n const tagPoints = [\n { x: x + w - tagWidth, y: (y + h) * 1.4 },\n { x: x + w, y: y + h - tagHeight },\n { x: x + w, y: (y + h) * 0.9 },\n ...generateFullSineWavePoints(\n x + w,\n (y + h) * 1.3,\n x + w - tagWidth,\n (y + h) * 1.5,\n -h * 0.03,\n 0.5\n ),\n ];\n\n const waveEdgeRectPath = createPathFromPoints(points);\n const waveEdgeRectNode = rc.path(waveEdgeRectPath, options);\n\n const taggedWaveEdgeRectPath = createPathFromPoints(tagPoints);\n const taggedWaveEdgeRectNode = rc.path(taggedWaveEdgeRectPath, {\n ...options,\n fillStyle: 'solid',\n });\n\n const waveEdgeRect = shapeSvg.insert(() => taggedWaveEdgeRectNode, ':first-child');\n waveEdgeRect.insert(() => waveEdgeRectNode, ':first-child');\n\n waveEdgeRect.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n waveEdgeRect.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n waveEdgeRect.selectAll('path').attr('style', nodeStyles);\n }\n\n waveEdgeRect.attr('transform', `translate(0,${-waveAmplitude / 2})`);\n label.attr(\n 'transform',\n `translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - waveAmplitude / 2 - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, waveEdgeRect);\n node.intersect = function (point) {\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String } from './handDrawnShapeStyles.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function text(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n\n const totalWidth = Math.max(bbox.width + node.padding, node?.width || 0);\n const totalHeight = Math.max(bbox.height + node.padding, node?.height || 0);\n const x = -totalWidth / 2;\n const y = -totalHeight / 2;\n\n const rect = shapeSvg.insert('rect', ':first-child');\n\n rect\n .attr('class', 'text')\n .attr('style', nodeStyles)\n .attr('rx', 0)\n .attr('ry', 0)\n .attr('x', x)\n .attr('y', y)\n .attr('width', totalWidth)\n .attr('height', totalHeight);\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, getNodeClasses, updateNodeBounds } from './util.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport intersect from '../intersect/index.js';\nimport type { D3Selection } from '../../../types.js';\nimport { handleUndefinedAttr } from '../../../utils.js';\n\nexport const createCylinderPathD = (\n x: number,\n y: number,\n width: number,\n height: number,\n rx: number,\n ry: number\n): string => {\n return `M${x},${y}\n a${rx},${ry} 0,0,1 ${0},${-height}\n l${width},${0}\n a${rx},${ry} 0,0,1 ${0},${height}\n M${width},${-height}\n a${rx},${ry} 0,0,0 ${0},${height}\n l${-width},${0}`;\n};\n\nexport const createOuterCylinderPathD = (\n x: number,\n y: number,\n width: number,\n height: number,\n rx: number,\n ry: number\n): string => {\n return [\n `M${x},${y}`,\n `M${x + width},${y}`,\n `a${rx},${ry} 0,0,0 ${0},${-height}`,\n `l${-width},0`,\n `a${rx},${ry} 0,0,0 ${0},${height}`,\n `l${width},0`,\n ].join(' ');\n};\nexport const createInnerCylinderPathD = (\n x: number,\n y: number,\n width: number,\n height: number,\n rx: number,\n ry: number\n): string => {\n return [`M${x + width / 2},${-height / 2}`, `a${rx},${ry} 0,0,0 0,${height}`].join(' ');\n};\n\nexport async function tiltedCylinder(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label, halfPadding } = await labelHelper(\n parent,\n node,\n getNodeClasses(node)\n );\n const labelPadding = node.look === 'neo' ? halfPadding * 2 : halfPadding;\n const h = bbox.height + labelPadding;\n const ry = h / 2;\n const rx = ry / (2.5 + h / 50);\n const w = bbox.width + rx + labelPadding;\n const { cssStyles } = node;\n\n let cylinder: D3Selection | D3Selection;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const outerPathData = createOuterCylinderPathD(0, 0, w, h, rx, ry);\n const innerPathData = createInnerCylinderPathD(0, 0, w, h, rx, ry);\n const outerNode = rc.path(outerPathData, userNodeOverrides(node, {}));\n const innerLine = rc.path(innerPathData, userNodeOverrides(node, { fill: 'none' }));\n cylinder = shapeSvg.insert(() => innerLine, ':first-child');\n cylinder = shapeSvg.insert(() => outerNode, ':first-child');\n cylinder.attr('class', 'basic label-container');\n if (cssStyles) {\n cylinder.attr('style', cssStyles);\n }\n } else {\n const pathData = createCylinderPathD(0, 0, w, h, rx, ry);\n cylinder = shapeSvg\n .insert('path', ':first-child')\n .attr('d', pathData)\n .attr('class', 'basic label-container')\n .attr('style', handleUndefinedAttr(cssStyles))\n .attr('style', nodeStyles);\n cylinder.attr('class', 'basic label-container');\n\n if (cssStyles) {\n cylinder.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles) {\n cylinder.selectAll('path').attr('style', nodeStyles);\n }\n }\n\n cylinder.attr('label-offset-x', rx);\n cylinder.attr('transform', `translate(${-w / 2}, ${h / 2} )`);\n\n label.attr(\n 'transform',\n `translate(${-(bbox.width / 2) - rx - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, cylinder);\n\n node.intersect = function (point) {\n const pos = intersect.rect(node, point);\n const y = pos.y - (node.y ?? 0);\n\n if (\n ry != 0 &&\n (Math.abs(y) < (node.height ?? 0) / 2 ||\n (Math.abs(y) == (node.height ?? 0) / 2 &&\n Math.abs(pos.x - (node.x ?? 0)) > (node.width ?? 0) / 2 - rx))\n ) {\n let x = rx * rx * (1 - (y * y) / (ry * ry));\n if (x != 0) {\n x = Math.sqrt(x);\n }\n x = rx - x;\n if (point.x - (node.x ?? 0) > 0) {\n x = -x;\n }\n\n pos.x += x;\n }\n\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { insertPolygonShape } from './insertPolygonShape.js';\nimport type { D3Selection } from '../../../types.js';\n\n// export const createTrapezoidPathD = (\n// x: number,\n// y: number,\n// width: number,\n// height: number\n// ): string => {\n// return [\n// `M${x - (2 * height) / 6},${y}`,\n// `L${x + width + (2 * height) / 6},${y}`,\n// `L${x + width - height / 6},${y - height}`,\n// `L${x + height / 6},${y - height}`,\n// 'Z',\n// ].join(' ');\n// };\n\nexport async function trapezoid(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: (-3 * h) / 6, y: 0 },\n { x: w + (3 * h) / 6, y: 0 },\n { x: w, y: -h },\n { x: 0, y: -h },\n ];\n\n let polygon: typeof shapeSvg | ReturnType;\n const { cssStyles } = node;\n\n if (node.look === 'handDrawn') {\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n const pathData = createPathFromPoints(points);\n const roughNode = rc.path(pathData, options);\n\n polygon = shapeSvg\n .insert(() => roughNode, ':first-child')\n .attr('transform', `translate(${-w / 2}, ${h / 2})`);\n\n if (cssStyles) {\n polygon.attr('style', cssStyles);\n }\n } else {\n polygon = insertPolygonShape(shapeSvg, w, h, points);\n }\n\n if (nodeStyles) {\n polygon.attr('style', nodeStyles);\n }\n\n node.width = w;\n node.height = h;\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, updateNodeBounds, getNodeClasses, createPathFromPoints } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function trapezoidalPentagon(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n const minWidth = 60,\n minHeight = 20;\n const w = Math.max(minWidth, bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(minHeight, bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n\n const { cssStyles } = node;\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const points = [\n { x: (-w / 2) * 0.8, y: -h / 2 },\n { x: (w / 2) * 0.8, y: -h / 2 },\n { x: w / 2, y: (-h / 2) * 0.6 },\n { x: w / 2, y: h / 2 },\n { x: -w / 2, y: h / 2 },\n { x: -w / 2, y: (-h / 2) * 0.6 },\n ];\n\n const pathData = createPathFromPoints(points);\n const shapeNode = rc.path(pathData, options);\n\n const polygon = shapeSvg.insert(() => shapeNode, ':first-child');\n polygon.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', nodeStyles);\n }\n\n updateNodeBounds(node, polygon);\n\n node.intersect = function (point) {\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { log } from '../../../logger.js';\nimport { labelHelper, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport { createPathFromPoints } from './util.js';\nimport { evaluate } from '../../../diagrams/common/common.js';\nimport { getConfig } from '../../../diagram-api/diagramAPI.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function triangle(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const useHtmlLabels = evaluate(getConfig().flowchart?.htmlLabels);\n\n const w = bbox.width + (node.padding ?? 0);\n const h = w + bbox.height;\n\n const tw = w + bbox.height;\n const points = [\n { x: 0, y: 0 },\n { x: tw, y: 0 },\n { x: tw / 2, y: -h },\n ];\n\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n const pathData = createPathFromPoints(points);\n const roughNode = rc.path(pathData, options);\n\n const polygon = shapeSvg\n .insert(() => roughNode, ':first-child')\n .attr('transform', `translate(${-h / 2}, ${h / 2})`);\n\n if (cssStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n polygon.selectChildren('path').attr('style', nodeStyles);\n }\n\n node.width = w;\n node.height = h;\n\n updateNodeBounds(node, polygon);\n\n label.attr(\n 'transform',\n `translate(${-bbox.width / 2 - (bbox.x - (bbox.left ?? 0))}, ${h / 2 - (bbox.height + (node.padding ?? 0) / (useHtmlLabels ? 2 : 1) - (bbox.y - (bbox.top ?? 0)))})`\n );\n\n node.intersect = function (point) {\n log.info('Triangle intersect', node, points, point);\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n}\n", "import {\n labelHelper,\n updateNodeBounds,\n getNodeClasses,\n generateFullSineWavePoints,\n createPathFromPoints,\n} from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport rough from 'roughjs';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function waveEdgedRectangle(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const waveAmplitude = h / 8;\n const finalH = h + waveAmplitude;\n const { cssStyles } = node;\n\n // To maintain minimum width\n const minWidth = 70;\n const widthDif = minWidth - w;\n const extraW = widthDif > 0 ? widthDif / 2 : 0;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const points = [\n { x: -w / 2 - extraW, y: finalH / 2 },\n ...generateFullSineWavePoints(\n -w / 2 - extraW,\n finalH / 2,\n w / 2 + extraW,\n finalH / 2,\n waveAmplitude,\n 0.8\n ),\n { x: w / 2 + extraW, y: -finalH / 2 },\n { x: -w / 2 - extraW, y: -finalH / 2 },\n ];\n\n const waveEdgeRectPath = createPathFromPoints(points);\n const waveEdgeRectNode = rc.path(waveEdgeRectPath, options);\n\n const waveEdgeRect = shapeSvg.insert(() => waveEdgeRectNode, ':first-child');\n\n waveEdgeRect.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n waveEdgeRect.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n waveEdgeRect.selectAll('path').attr('style', nodeStyles);\n }\n\n waveEdgeRect.attr('transform', `translate(0,${-waveAmplitude / 2})`);\n label.attr(\n 'transform',\n `translate(${-w / 2 + (node.padding ?? 0) - (bbox.x - (bbox.left ?? 0))},${-h / 2 + (node.padding ?? 0) - waveAmplitude - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, waveEdgeRect);\n node.intersect = function (point) {\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import {\n labelHelper,\n updateNodeBounds,\n getNodeClasses,\n createPathFromPoints,\n generateFullSineWavePoints,\n} from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function waveRectangle(\n parent: D3Selection,\n node: Node\n) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));\n\n const minWidth = 100; // Minimum width\n const minHeight = 50; // Minimum height\n\n const baseWidth = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const baseHeight = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n\n const aspectRatio = baseWidth / baseHeight;\n\n let w = baseWidth;\n let h = baseHeight;\n\n if (w > h * aspectRatio) {\n h = w / aspectRatio;\n } else {\n w = h * aspectRatio;\n }\n\n w = Math.max(w, minWidth);\n h = Math.max(h, minHeight);\n\n const waveAmplitude = Math.min(h * 0.2, h / 4);\n const finalH = h + waveAmplitude * 2;\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const points = [\n { x: -w / 2, y: finalH / 2 },\n ...generateFullSineWavePoints(-w / 2, finalH / 2, w / 2, finalH / 2, waveAmplitude, 1),\n { x: w / 2, y: -finalH / 2 },\n ...generateFullSineWavePoints(w / 2, -finalH / 2, -w / 2, -finalH / 2, waveAmplitude, -1),\n ];\n\n const waveRectPath = createPathFromPoints(points);\n const waveRectNode = rc.path(waveRectPath, options);\n\n const waveRect = shapeSvg.insert(() => waveRectNode, ':first-child');\n\n waveRect.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n waveRect.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n waveRect.selectAll('path').attr('style', nodeStyles);\n }\n\n updateNodeBounds(node, waveRect);\n node.intersect = function (point) {\n const pos = intersect.polygon(node, points, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, getNodeClasses, updateNodeBounds } from './util.js';\nimport type { Node } from '../../types.js';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport intersect from '../intersect/index.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function windowPane(parent: D3Selection, node: Node) {\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n const { shapeSvg, bbox, label } = await labelHelper(parent, node, getNodeClasses(node));\n const w = Math.max(bbox.width + (node.padding ?? 0) * 2, node?.width ?? 0);\n const h = Math.max(bbox.height + (node.padding ?? 0) * 2, node?.height ?? 0);\n const rectOffset = 5;\n const x = -w / 2;\n const y = -h / 2;\n const { cssStyles } = node;\n\n // @ts-expect-error -- Passing a D3.Selection seems to work for some reason\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n const outerPathPoints = [\n { x: x - rectOffset, y: y - rectOffset },\n { x: x - rectOffset, y: y + h },\n { x: x + w, y: y + h },\n { x: x + w, y: y - rectOffset },\n ];\n\n const path = `M${x - rectOffset},${y - rectOffset} L${x + w},${y - rectOffset} L${x + w},${y + h} L${x - rectOffset},${y + h} L${x - rectOffset},${y - rectOffset}\n M${x - rectOffset},${y} L${x + w},${y}\n M${x},${y - rectOffset} L${x},${y + h}`;\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const no = rc.path(path, options);\n\n const windowPane = shapeSvg.insert(() => no, ':first-child');\n windowPane.attr('transform', `translate(${rectOffset / 2}, ${rectOffset / 2})`);\n\n windowPane.attr('class', 'basic label-container');\n\n if (cssStyles && node.look !== 'handDrawn') {\n windowPane.selectAll('path').attr('style', cssStyles);\n }\n\n if (nodeStyles && node.look !== 'handDrawn') {\n windowPane.selectAll('path').attr('style', nodeStyles);\n }\n\n label.attr(\n 'transform',\n `translate(${-(bbox.width / 2) + rectOffset / 2 - (bbox.x - (bbox.left ?? 0))}, ${-(bbox.height / 2) + rectOffset / 2 - (bbox.y - (bbox.top ?? 0))})`\n );\n\n updateNodeBounds(node, windowPane);\n\n node.intersect = function (point) {\n const pos = intersect.polygon(node, outerPathPoints, point);\n return pos;\n };\n\n return shapeSvg;\n}\n", "import { select } from 'd3';\nimport { getConfig } from '../../config.js';\nimport { getNodeClasses } from '../../rendering-util/rendering-elements/shapes/util.js';\nimport { calculateTextWidth, decodeEntities } from '../../utils.js';\nimport type { ClassMember, ClassNode } from './classTypes.js';\nimport { sanitizeText } from '../../diagram-api/diagramAPI.js';\nimport { createText } from '../../rendering-util/createText.js';\nimport { evaluate, hasKatex } from '../common/common.js';\nimport type { Node } from '../../rendering-util/types.js';\nimport type { MermaidConfig } from '../../config.type.js';\nimport type { D3Selection } from '../../types.js';\n\n// Creates the shapeSvg and inserts text\nexport async function textHelper(\n parent: D3Selection,\n node: any,\n config: MermaidConfig,\n useHtmlLabels: boolean,\n GAP = config.class!.padding ?? 12\n) {\n const TEXT_PADDING = !useHtmlLabels ? 3 : 0;\n const shapeSvg = parent\n // @ts-ignore: Ignore error for using .insert on SVGAElement\n .insert('g')\n .attr('class', getNodeClasses(node))\n .attr('id', node.domId || node.id);\n\n let annotationGroup = null;\n let labelGroup = null;\n let membersGroup = null;\n let methodsGroup = null;\n\n let annotationGroupHeight = 0;\n let labelGroupHeight = 0;\n let membersGroupHeight = 0;\n\n annotationGroup = shapeSvg.insert('g').attr('class', 'annotation-group text');\n if (node.annotations.length > 0) {\n const annotation = node.annotations[0];\n await addText(annotationGroup, { text: `\u00AB${annotation}\u00BB` } as unknown as ClassMember, 0);\n\n const annotationGroupBBox = annotationGroup.node()!.getBBox();\n annotationGroupHeight = annotationGroupBBox.height;\n }\n\n labelGroup = shapeSvg.insert('g').attr('class', 'label-group text');\n await addText(labelGroup, node, 0, ['font-weight: bolder']);\n const labelGroupBBox = labelGroup.node()!.getBBox();\n labelGroupHeight = labelGroupBBox.height;\n\n membersGroup = shapeSvg.insert('g').attr('class', 'members-group text');\n let yOffset = 0;\n for (const member of node.members) {\n const height = await addText(membersGroup, member, yOffset, [member.parseClassifier()]);\n yOffset += height + TEXT_PADDING;\n }\n membersGroupHeight = membersGroup.node()!.getBBox().height;\n if (membersGroupHeight <= 0) {\n membersGroupHeight = GAP / 2;\n }\n\n methodsGroup = shapeSvg.insert('g').attr('class', 'methods-group text');\n let methodsYOffset = 0;\n for (const method of node.methods) {\n const height = await addText(methodsGroup, method, methodsYOffset, [method.parseClassifier()]);\n methodsYOffset += height + TEXT_PADDING;\n }\n\n let bbox = shapeSvg.node()!.getBBox();\n\n // Center annotation\n if (annotationGroup !== null) {\n const annotationGroupBBox = annotationGroup.node()!.getBBox();\n annotationGroup.attr('transform', `translate(${-annotationGroupBBox.width / 2})`);\n }\n\n // Adjust label\n labelGroup.attr('transform', `translate(${-labelGroupBBox.width / 2}, ${annotationGroupHeight})`);\n\n bbox = shapeSvg.node()!.getBBox();\n\n membersGroup.attr(\n 'transform',\n `translate(${0}, ${annotationGroupHeight + labelGroupHeight + GAP * 2})`\n );\n bbox = shapeSvg.node()!.getBBox();\n methodsGroup.attr(\n 'transform',\n `translate(${0}, ${annotationGroupHeight + labelGroupHeight + (membersGroupHeight ? membersGroupHeight + GAP * 4 : GAP * 2)})`\n );\n\n bbox = shapeSvg.node()!.getBBox();\n\n return { shapeSvg, bbox };\n}\n\n// Modified version of labelHelper() to help create and place text for classes\nasync function addText(\n parentGroup: D3Selection,\n node: Node | ClassNode | ClassMember,\n yOffset: number,\n styles: string[] = []\n) {\n const textEl = parentGroup.insert('g').attr('class', 'label').attr('style', styles.join('; '));\n const config = getConfig();\n let useHtmlLabels =\n 'useHtmlLabels' in node ? node.useHtmlLabels : (evaluate(config.htmlLabels) ?? true);\n\n let textContent = '';\n // Support regular node type (.label) and classNodes (.text)\n if ('text' in node) {\n textContent = node.text;\n } else {\n textContent = node.label!;\n }\n\n // createText() will cause unwanted behavior because of classDiagram syntax so workarounds are needed\n\n if (!useHtmlLabels && textContent.startsWith('\\\\')) {\n textContent = textContent.substring(1);\n }\n\n if (hasKatex(textContent)) {\n useHtmlLabels = true;\n }\n\n const text = await createText(\n textEl,\n sanitizeText(decodeEntities(textContent)),\n {\n width: calculateTextWidth(textContent, config) + 50, // Add room for error when splitting text into multiple lines\n classes: 'markdown-node-label',\n useHtmlLabels,\n },\n config\n );\n let bbox;\n let numberOfLines = 1;\n\n if (!useHtmlLabels) {\n // Undo font-weight normal\n if (styles.includes('font-weight: bolder')) {\n select(text).selectAll('tspan').attr('font-weight', '');\n }\n\n numberOfLines = text.children.length;\n\n const textChild = text.children[0];\n if (text.textContent === '' || text.textContent.includes('>')) {\n textChild.textContent =\n textContent[0] +\n textContent.substring(1).replaceAll('>', '>').replaceAll('<', '<').trim();\n\n // Text was improperly removed due to spaces (preserve one space if present)\n const preserveSpace = textContent[1] === ' ';\n if (preserveSpace) {\n textChild.textContent = textChild.textContent[0] + ' ' + textChild.textContent.substring(1);\n }\n }\n\n // To support empty boxes\n if (textChild.textContent === 'undefined') {\n textChild.textContent = '';\n }\n\n // Get the bounding box after the text update\n bbox = text.getBBox();\n } else {\n const div = text.children[0];\n const dv = select(text);\n\n numberOfLines = div.innerHTML.split('
').length;\n // Katex math support\n if (div.innerHTML.includes('')) {\n numberOfLines += div.innerHTML.split('').length - 1;\n }\n\n // Support images\n const images = div.getElementsByTagName('img');\n if (images) {\n const noImgText = textContent.replace(/]*>/g, '').trim() === '';\n await Promise.all(\n [...images].map(\n (img) =>\n new Promise((res) => {\n function setupImage() {\n img.style.display = 'flex';\n img.style.flexDirection = 'column';\n\n if (noImgText) {\n // default size if no text\n const bodyFontSize =\n config.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize;\n const enlargingFactor = 5;\n const width = parseInt(bodyFontSize, 10) * enlargingFactor + 'px';\n img.style.minWidth = width;\n img.style.maxWidth = width;\n } else {\n img.style.width = '100%';\n }\n res(img);\n }\n setTimeout(() => {\n if (img.complete) {\n setupImage();\n }\n });\n img.addEventListener('error', setupImage);\n img.addEventListener('load', setupImage);\n })\n )\n );\n }\n\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n // Center text and offset by yOffset\n textEl.attr('transform', 'translate(0,' + (-bbox.height / (2 * numberOfLines) + yOffset) + ')');\n return bbox.height;\n}\n", "import { updateNodeBounds } from './util.js';\nimport { getConfig } from '../../../diagram-api/diagramAPI.js';\nimport { select } from 'd3';\nimport type { Node } from '../../types.js';\nimport type { ClassNode } from '../../../diagrams/class/classTypes.js';\nimport rough from 'roughjs';\nimport { styles2String, userNodeOverrides } from './handDrawnShapeStyles.js';\nimport intersect from '../intersect/index.js';\nimport { textHelper } from '../../../diagrams/class/shapeUtil.js';\nimport { evaluate } from '../../../diagrams/common/common.js';\nimport type { D3Selection } from '../../../types.js';\n\nexport async function classBox(parent: D3Selection, node: Node) {\n const config = getConfig();\n const PADDING = config.class!.padding ?? 12;\n const GAP = PADDING;\n const useHtmlLabels = node.useHtmlLabels ?? evaluate(config.htmlLabels) ?? true;\n // Treat node as classNode\n const classNode = node as unknown as ClassNode;\n classNode.annotations = classNode.annotations ?? [];\n classNode.members = classNode.members ?? [];\n classNode.methods = classNode.methods ?? [];\n\n const { shapeSvg, bbox } = await textHelper(parent, node, config, useHtmlLabels, GAP);\n\n const { labelStyles, nodeStyles } = styles2String(node);\n node.labelStyle = labelStyles;\n\n node.cssStyles = classNode.styles || '';\n\n const styles = classNode.styles?.join(';') || nodeStyles || '';\n\n if (!node.cssStyles) {\n node.cssStyles = styles.replaceAll('!important', '').split(';');\n }\n\n const renderExtraBox =\n classNode.members.length === 0 &&\n classNode.methods.length === 0 &&\n !config.class?.hideEmptyMembersBox;\n\n // Setup roughjs\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {});\n\n if (node.look !== 'handDrawn') {\n options.roughness = 0;\n options.fillStyle = 'solid';\n }\n\n const w = bbox.width;\n let h = bbox.height;\n if (classNode.members.length === 0 && classNode.methods.length === 0) {\n h += GAP;\n } else if (classNode.members.length > 0 && classNode.methods.length === 0) {\n h += GAP * 2;\n }\n const x = -w / 2;\n const y = -h / 2;\n\n // Create and center rectangle\n const roughRect = rc.rectangle(\n x - PADDING,\n y -\n PADDING -\n (renderExtraBox\n ? PADDING\n : classNode.members.length === 0 && classNode.methods.length === 0\n ? -PADDING / 2\n : 0),\n w + 2 * PADDING,\n h +\n 2 * PADDING +\n (renderExtraBox\n ? PADDING * 2\n : classNode.members.length === 0 && classNode.methods.length === 0\n ? -PADDING\n : 0),\n options\n );\n\n const rect = shapeSvg.insert(() => roughRect, ':first-child');\n rect.attr('class', 'basic label-container');\n const rectBBox = rect.node()!.getBBox();\n\n // Rect is centered so now adjust labels.\n // TODO: Fix types\n shapeSvg.selectAll('.text').each((_: any, i: number, nodes: any) => {\n const text = select(nodes[i]);\n // Get the current transform attribute\n const transform = text.attr('transform');\n // Initialize variables for the translation values\n let translateY = 0;\n // Check if the transform attribute exists\n if (transform) {\n const regex = RegExp(/translate\\(([^,]+),([^)]+)\\)/);\n const translate = regex.exec(transform);\n if (translate) {\n translateY = parseFloat(translate[2]);\n }\n }\n // Add to the y value\n let newTranslateY =\n translateY +\n y +\n PADDING -\n (renderExtraBox\n ? PADDING\n : classNode.members.length === 0 && classNode.methods.length === 0\n ? -PADDING / 2\n : 0);\n if (!useHtmlLabels) {\n // Fix so non html labels are better centered.\n // BBox of text seems to be slightly different when calculated so we offset\n newTranslateY -= 4;\n }\n let newTranslateX = x;\n if (\n text.attr('class').includes('label-group') ||\n text.attr('class').includes('annotation-group')\n ) {\n newTranslateX = -text.node()?.getBBox().width / 2 || 0;\n shapeSvg.selectAll('text').each(function (_: any, i: number, nodes: any) {\n if (window.getComputedStyle(nodes[i]).textAnchor === 'middle') {\n newTranslateX = 0;\n }\n });\n }\n // Set the updated transform attribute\n text.attr('transform', `translate(${newTranslateX}, ${newTranslateY})`);\n });\n\n // Render divider lines.\n const annotationGroupHeight =\n (shapeSvg.select('.annotation-group').node() as SVGGraphicsElement).getBBox().height -\n (renderExtraBox ? PADDING / 2 : 0) || 0;\n const labelGroupHeight =\n (shapeSvg.select('.label-group').node() as SVGGraphicsElement).getBBox().height -\n (renderExtraBox ? PADDING / 2 : 0) || 0;\n const membersGroupHeight =\n (shapeSvg.select('.members-group').node() as SVGGraphicsElement).getBBox().height -\n (renderExtraBox ? PADDING / 2 : 0) || 0;\n // First line (under label)\n if (classNode.members.length > 0 || classNode.methods.length > 0 || renderExtraBox) {\n const roughLine = rc.line(\n rectBBox.x,\n annotationGroupHeight + labelGroupHeight + y + PADDING,\n rectBBox.x + rectBBox.width,\n annotationGroupHeight + labelGroupHeight + y + PADDING,\n options\n );\n const line = shapeSvg.insert(() => roughLine);\n line.attr('class', 'divider').attr('style', styles);\n }\n\n // Second line (under members)\n if (renderExtraBox || classNode.members.length > 0 || classNode.methods.length > 0) {\n const roughLine = rc.line(\n rectBBox.x,\n annotationGroupHeight + labelGroupHeight + membersGroupHeight + y + GAP * 2 + PADDING,\n rectBBox.x + rectBBox.width,\n annotationGroupHeight + labelGroupHeight + membersGroupHeight + y + PADDING + GAP * 2,\n options\n );\n const line = shapeSvg.insert(() => roughLine);\n line.attr('class', 'divider').attr('style', styles);\n }\n\n /// Apply styles ///\n if (classNode.look !== 'handDrawn') {\n shapeSvg.selectAll('path').attr('style', styles);\n }\n // Apply other styles like stroke-width and stroke-dasharray to border (not background of shape)\n rect.select(':nth-child(2)').attr('style', styles);\n // Divider lines\n shapeSvg.selectAll('.divider').select('path').attr('style', styles);\n // Text elements\n if (node.labelStyle) {\n shapeSvg.selectAll('span').attr('style', node.labelStyle);\n } else {\n shapeSvg.selectAll('span').attr('style', styles);\n }\n // SVG text uses fill not color\n if (!useHtmlLabels) {\n // We just want to apply color to the text\n const colorRegex = RegExp(/color\\s*:\\s*([^;]*)/);\n const match = colorRegex.exec(styles);\n if (match) {\n const colorStyle = match[0].replace('color', 'fill');\n shapeSvg.selectAll('tspan').attr('style', colorStyle);\n } else if (labelStyles) {\n const match = colorRegex.exec(labelStyles);\n if (match) {\n const colorStyle = match[0].replace('color', 'fill');\n shapeSvg.selectAll('tspan').attr('style', colorStyle);\n }\n }\n }\n\n updateNodeBounds(node, rect);\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n}\n", "import { labelHelper, insertLabel, updateNodeBounds, getNodeClasses } from './util.js';\nimport intersect from '../intersect/index.js';\nimport type { Node, KanbanNode, ShapeRenderOptions } from '../../types.js';\nimport { createRoundedRectPathD } from './roundedRectPath.js';\nimport { userNodeOverrides, styles2String } from './handDrawnShapeStyles.js';\nimport rough from 'roughjs';\nimport type { D3Selection } from '../../../types.js';\n\nconst colorFromPriority = (priority: NonNullable) => {\n switch (priority) {\n case 'Very High':\n return 'red';\n case 'High':\n return 'orange';\n case 'Medium':\n return null; // no stroke\n case 'Low':\n return 'blue';\n case 'Very Low':\n return 'lightblue';\n }\n};\nexport async function kanbanItem(\n parent: D3Selection,\n // Omit the 'shape' prop since otherwise, it causes a TypeScript circular dependency error\n kanbanNode: Omit | Omit,\n { config }: ShapeRenderOptions\n) {\n const { labelStyles, nodeStyles } = styles2String(kanbanNode);\n kanbanNode.labelStyle = labelStyles || '';\n\n const labelPaddingX = 10;\n const orgWidth = kanbanNode.width;\n kanbanNode.width = (kanbanNode.width ?? 200) - 10;\n\n const {\n shapeSvg,\n bbox,\n label: labelElTitle,\n } = await labelHelper(parent, kanbanNode, getNodeClasses(kanbanNode));\n const padding = kanbanNode.padding || 10;\n\n let ticketUrl = '';\n let link;\n\n if ('ticket' in kanbanNode && kanbanNode.ticket && config?.kanban?.ticketBaseUrl) {\n ticketUrl = config?.kanban?.ticketBaseUrl.replace('#TICKET#', kanbanNode.ticket);\n link = shapeSvg\n .insert('svg:a', ':first-child')\n .attr('class', 'kanban-ticket-link')\n .attr('xlink:href', ticketUrl)\n .attr('target', '_blank');\n }\n\n const options = {\n useHtmlLabels: kanbanNode.useHtmlLabels,\n labelStyle: kanbanNode.labelStyle || '',\n width: kanbanNode.width,\n img: kanbanNode.img,\n padding: kanbanNode.padding || 8,\n centerLabel: false,\n };\n let labelEl, bbox2;\n if (link) {\n ({ label: labelEl, bbox: bbox2 } = await insertLabel(\n link,\n ('ticket' in kanbanNode && kanbanNode.ticket) || '',\n options\n ));\n } else {\n ({ label: labelEl, bbox: bbox2 } = await insertLabel(\n shapeSvg,\n ('ticket' in kanbanNode && kanbanNode.ticket) || '',\n options\n ));\n }\n const { label: labelElAssigned, bbox: bboxAssigned } = await insertLabel(\n shapeSvg,\n ('assigned' in kanbanNode && kanbanNode.assigned) || '',\n options\n );\n kanbanNode.width = orgWidth;\n const labelPaddingY = 10;\n const totalWidth = kanbanNode?.width || 0;\n const heightAdj = Math.max(bbox2.height, bboxAssigned.height) / 2;\n const totalHeight =\n Math.max(bbox.height + labelPaddingY * 2, kanbanNode?.height || 0) + heightAdj;\n const x = -totalWidth / 2;\n const y = -totalHeight / 2;\n labelElTitle.attr(\n 'transform',\n 'translate(' + (padding - totalWidth / 2) + ', ' + (-heightAdj - bbox.height / 2) + ')'\n );\n labelEl.attr(\n 'transform',\n 'translate(' + (padding - totalWidth / 2) + ', ' + (-heightAdj + bbox.height / 2) + ')'\n );\n labelElAssigned.attr(\n 'transform',\n 'translate(' +\n (padding + totalWidth / 2 - bboxAssigned.width - 2 * labelPaddingX) +\n ', ' +\n (-heightAdj + bbox.height / 2) +\n ')'\n );\n\n let rect;\n\n const { rx, ry } = kanbanNode;\n const { cssStyles } = kanbanNode;\n\n if (kanbanNode.look === 'handDrawn') {\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(kanbanNode, {});\n\n const roughNode =\n rx || ry\n ? rc.path(createRoundedRectPathD(x, y, totalWidth, totalHeight, rx || 0), options)\n : rc.rectangle(x, y, totalWidth, totalHeight, options);\n\n rect = shapeSvg.insert(() => roughNode, ':first-child');\n rect.attr('class', 'basic label-container').attr('style', cssStyles ? cssStyles : null);\n } else {\n rect = shapeSvg.insert('rect', ':first-child');\n\n rect\n .attr('class', 'basic label-container __APA__')\n .attr('style', nodeStyles)\n .attr('rx', rx ?? 5)\n .attr('ry', ry ?? 5)\n .attr('x', x)\n .attr('y', y)\n .attr('width', totalWidth)\n .attr('height', totalHeight);\n\n const priority = 'priority' in kanbanNode && kanbanNode.priority;\n if (priority) {\n const line = shapeSvg.append('line');\n const lineX = x + 2;\n\n const y1 = y + Math.floor((rx ?? 0) / 2);\n const y2 = y + totalHeight - Math.floor((rx ?? 0) / 2);\n line\n .attr('x1', lineX)\n .attr('y1', y1)\n .attr('x2', lineX)\n .attr('y2', y2)\n\n .attr('stroke-width', '4')\n .attr('stroke', colorFromPriority(priority));\n }\n }\n\n updateNodeBounds(kanbanNode, rect);\n kanbanNode.height = totalHeight;\n\n kanbanNode.intersect = function (point) {\n return intersect.rect(kanbanNode, point);\n };\n\n return shapeSvg;\n}\n", "import type { Entries } from 'type-fest';\nimport type { D3Selection, MaybePromise } from '../../types.js';\nimport type { Node, ShapeRenderOptions } from '../types.js';\nimport { anchor } from './shapes/anchor.js';\nimport { bowTieRect } from './shapes/bowTieRect.js';\nimport { card } from './shapes/card.js';\nimport { choice } from './shapes/choice.js';\nimport { circle } from './shapes/circle.js';\nimport { crossedCircle } from './shapes/crossedCircle.js';\nimport { curlyBraceLeft } from './shapes/curlyBraceLeft.js';\nimport { curlyBraceRight } from './shapes/curlyBraceRight.js';\nimport { curlyBraces } from './shapes/curlyBraces.js';\nimport { curvedTrapezoid } from './shapes/curvedTrapezoid.js';\nimport { cylinder } from './shapes/cylinder.js';\nimport { dividedRectangle } from './shapes/dividedRect.js';\nimport { doublecircle } from './shapes/doubleCircle.js';\nimport { filledCircle } from './shapes/filledCircle.js';\nimport { flippedTriangle } from './shapes/flippedTriangle.js';\nimport { forkJoin } from './shapes/forkJoin.js';\nimport { halfRoundedRectangle } from './shapes/halfRoundedRectangle.js';\nimport { hexagon } from './shapes/hexagon.js';\nimport { hourglass } from './shapes/hourglass.js';\nimport { icon } from './shapes/icon.js';\nimport { iconCircle } from './shapes/iconCircle.js';\nimport { iconRounded } from './shapes/iconRounded.js';\nimport { iconSquare } from './shapes/iconSquare.js';\nimport { imageSquare } from './shapes/imageSquare.js';\nimport { inv_trapezoid } from './shapes/invertedTrapezoid.js';\nimport { labelRect } from './shapes/labelRect.js';\nimport { lean_left } from './shapes/leanLeft.js';\nimport { lean_right } from './shapes/leanRight.js';\nimport { lightningBolt } from './shapes/lightningBolt.js';\nimport { linedCylinder } from './shapes/linedCylinder.js';\nimport { linedWaveEdgedRect } from './shapes/linedWaveEdgedRect.js';\nimport { multiRect } from './shapes/multiRect.js';\nimport { multiWaveEdgedRectangle } from './shapes/multiWaveEdgedRectangle.js';\nimport { note } from './shapes/note.js';\nimport { question } from './shapes/question.js';\nimport { rect_left_inv_arrow } from './shapes/rectLeftInvArrow.js';\nimport { rectWithTitle } from './shapes/rectWithTitle.js';\nimport { roundedRect } from './shapes/roundedRect.js';\nimport { shadedProcess } from './shapes/shadedProcess.js';\nimport { slopedRect } from './shapes/slopedRect.js';\nimport { squareRect } from './shapes/squareRect.js';\nimport { stadium } from './shapes/stadium.js';\nimport { state } from './shapes/state.js';\nimport { stateEnd } from './shapes/stateEnd.js';\nimport { stateStart } from './shapes/stateStart.js';\nimport { subroutine } from './shapes/subroutine.js';\nimport { taggedRect } from './shapes/taggedRect.js';\nimport { taggedWaveEdgedRectangle } from './shapes/taggedWaveEdgedRectangle.js';\nimport { text } from './shapes/text.js';\nimport { tiltedCylinder } from './shapes/tiltedCylinder.js';\nimport { trapezoid } from './shapes/trapezoid.js';\nimport { trapezoidalPentagon } from './shapes/trapezoidalPentagon.js';\nimport { triangle } from './shapes/triangle.js';\nimport { waveEdgedRectangle } from './shapes/waveEdgedRectangle.js';\nimport { waveRectangle } from './shapes/waveRectangle.js';\nimport { windowPane } from './shapes/windowPane.js';\nimport { classBox } from './shapes/classBox.js';\nimport { kanbanItem } from './shapes/kanbanItem.js';\n\ntype ShapeHandler = (\n parent: D3Selection,\n node: Node,\n options: ShapeRenderOptions\n) => MaybePromise>;\n\nexport interface ShapeDefinition {\n semanticName: string;\n name: string;\n shortName: string;\n description: string;\n /**\n * Aliases can include descriptive names, other short names, etc.\n */\n aliases?: string[];\n /**\n * These are names used by mermaid before the introduction of new shapes. These will not be in standard formats, and shouldn't be used by the users\n */\n internalAliases?: string[];\n handler: ShapeHandler;\n}\n\nexport const shapesDefs = [\n {\n semanticName: 'Process',\n name: 'Rectangle',\n shortName: 'rect',\n description: 'Standard process shape',\n aliases: ['proc', 'process', 'rectangle'],\n internalAliases: ['squareRect'],\n handler: squareRect,\n },\n {\n semanticName: 'Event',\n name: 'Rounded Rectangle',\n shortName: 'rounded',\n description: 'Represents an event',\n aliases: ['event'],\n internalAliases: ['roundedRect'],\n handler: roundedRect,\n },\n {\n semanticName: 'Terminal Point',\n name: 'Stadium',\n shortName: 'stadium',\n description: 'Terminal point',\n aliases: ['terminal', 'pill'],\n handler: stadium,\n },\n {\n semanticName: 'Subprocess',\n name: 'Framed Rectangle',\n shortName: 'fr-rect',\n description: 'Subprocess',\n aliases: ['subprocess', 'subproc', 'framed-rectangle', 'subroutine'],\n handler: subroutine,\n },\n {\n semanticName: 'Database',\n name: 'Cylinder',\n shortName: 'cyl',\n description: 'Database storage',\n aliases: ['db', 'database', 'cylinder'],\n handler: cylinder,\n },\n {\n semanticName: 'Start',\n name: 'Circle',\n shortName: 'circle',\n description: 'Starting point',\n aliases: ['circ'],\n handler: circle,\n },\n {\n semanticName: 'Decision',\n name: 'Diamond',\n shortName: 'diam',\n description: 'Decision-making step',\n aliases: ['decision', 'diamond', 'question'],\n handler: question,\n },\n {\n semanticName: 'Prepare Conditional',\n name: 'Hexagon',\n shortName: 'hex',\n description: 'Preparation or condition step',\n aliases: ['hexagon', 'prepare'],\n handler: hexagon,\n },\n {\n semanticName: 'Data Input/Output',\n name: 'Lean Right',\n shortName: 'lean-r',\n description: 'Represents input or output',\n aliases: ['lean-right', 'in-out'],\n internalAliases: ['lean_right'],\n handler: lean_right,\n },\n {\n semanticName: 'Data Input/Output',\n name: 'Lean Left',\n shortName: 'lean-l',\n description: 'Represents output or input',\n aliases: ['lean-left', 'out-in'],\n internalAliases: ['lean_left'],\n handler: lean_left,\n },\n {\n semanticName: 'Priority Action',\n name: 'Trapezoid Base Bottom',\n shortName: 'trap-b',\n description: 'Priority action',\n aliases: ['priority', 'trapezoid-bottom', 'trapezoid'],\n handler: trapezoid,\n },\n {\n semanticName: 'Manual Operation',\n name: 'Trapezoid Base Top',\n shortName: 'trap-t',\n description: 'Represents a manual task',\n aliases: ['manual', 'trapezoid-top', 'inv-trapezoid'],\n internalAliases: ['inv_trapezoid'],\n handler: inv_trapezoid,\n },\n {\n semanticName: 'Stop',\n name: 'Double Circle',\n shortName: 'dbl-circ',\n description: 'Represents a stop point',\n aliases: ['double-circle'],\n internalAliases: ['doublecircle'],\n handler: doublecircle,\n },\n {\n semanticName: 'Text Block',\n name: 'Text Block',\n shortName: 'text',\n description: 'Text block',\n handler: text,\n },\n {\n semanticName: 'Card',\n name: 'Notched Rectangle',\n shortName: 'notch-rect',\n description: 'Represents a card',\n aliases: ['card', 'notched-rectangle'],\n handler: card,\n },\n {\n semanticName: 'Lined/Shaded Process',\n name: 'Lined Rectangle',\n shortName: 'lin-rect',\n description: 'Lined process shape',\n aliases: ['lined-rectangle', 'lined-process', 'lin-proc', 'shaded-process'],\n handler: shadedProcess,\n },\n {\n semanticName: 'Start',\n name: 'Small Circle',\n shortName: 'sm-circ',\n description: 'Small starting point',\n aliases: ['start', 'small-circle'],\n internalAliases: ['stateStart'],\n handler: stateStart,\n },\n {\n semanticName: 'Stop',\n name: 'Framed Circle',\n shortName: 'fr-circ',\n description: 'Stop point',\n aliases: ['stop', 'framed-circle'],\n internalAliases: ['stateEnd'],\n handler: stateEnd,\n },\n {\n semanticName: 'Fork/Join',\n name: 'Filled Rectangle',\n shortName: 'fork',\n description: 'Fork or join in process flow',\n aliases: ['join'],\n internalAliases: ['forkJoin'],\n handler: forkJoin,\n },\n {\n semanticName: 'Collate',\n name: 'Hourglass',\n shortName: 'hourglass',\n description: 'Represents a collate operation',\n aliases: ['hourglass', 'collate'],\n handler: hourglass,\n },\n {\n semanticName: 'Comment',\n name: 'Curly Brace',\n shortName: 'brace',\n description: 'Adds a comment',\n aliases: ['comment', 'brace-l'],\n handler: curlyBraceLeft,\n },\n {\n semanticName: 'Comment Right',\n name: 'Curly Brace',\n shortName: 'brace-r',\n description: 'Adds a comment',\n handler: curlyBraceRight,\n },\n {\n semanticName: 'Comment with braces on both sides',\n name: 'Curly Braces',\n shortName: 'braces',\n description: 'Adds a comment',\n handler: curlyBraces,\n },\n {\n semanticName: 'Com Link',\n name: 'Lightning Bolt',\n shortName: 'bolt',\n description: 'Communication link',\n aliases: ['com-link', 'lightning-bolt'],\n handler: lightningBolt,\n },\n {\n semanticName: 'Document',\n name: 'Document',\n shortName: 'doc',\n description: 'Represents a document',\n aliases: ['doc', 'document'],\n handler: waveEdgedRectangle,\n },\n {\n semanticName: 'Delay',\n name: 'Half-Rounded Rectangle',\n shortName: 'delay',\n description: 'Represents a delay',\n aliases: ['half-rounded-rectangle'],\n handler: halfRoundedRectangle,\n },\n {\n semanticName: 'Direct Access Storage',\n name: 'Horizontal Cylinder',\n shortName: 'h-cyl',\n description: 'Direct access storage',\n aliases: ['das', 'horizontal-cylinder'],\n handler: tiltedCylinder,\n },\n {\n semanticName: 'Disk Storage',\n name: 'Lined Cylinder',\n shortName: 'lin-cyl',\n description: 'Disk storage',\n aliases: ['disk', 'lined-cylinder'],\n handler: linedCylinder,\n },\n {\n semanticName: 'Display',\n name: 'Curved Trapezoid',\n shortName: 'curv-trap',\n description: 'Represents a display',\n aliases: ['curved-trapezoid', 'display'],\n handler: curvedTrapezoid,\n },\n {\n semanticName: 'Divided Process',\n name: 'Divided Rectangle',\n shortName: 'div-rect',\n description: 'Divided process shape',\n aliases: ['div-proc', 'divided-rectangle', 'divided-process'],\n handler: dividedRectangle,\n },\n {\n semanticName: 'Extract',\n name: 'Triangle',\n shortName: 'tri',\n description: 'Extraction process',\n aliases: ['extract', 'triangle'],\n handler: triangle,\n },\n {\n semanticName: 'Internal Storage',\n name: 'Window Pane',\n shortName: 'win-pane',\n description: 'Internal storage',\n aliases: ['internal-storage', 'window-pane'],\n handler: windowPane,\n },\n {\n semanticName: 'Junction',\n name: 'Filled Circle',\n shortName: 'f-circ',\n description: 'Junction point',\n aliases: ['junction', 'filled-circle'],\n handler: filledCircle,\n },\n {\n semanticName: 'Loop Limit',\n name: 'Trapezoidal Pentagon',\n shortName: 'notch-pent',\n description: 'Loop limit step',\n aliases: ['loop-limit', 'notched-pentagon'],\n handler: trapezoidalPentagon,\n },\n {\n semanticName: 'Manual File',\n name: 'Flipped Triangle',\n shortName: 'flip-tri',\n description: 'Manual file operation',\n aliases: ['manual-file', 'flipped-triangle'],\n handler: flippedTriangle,\n },\n {\n semanticName: 'Manual Input',\n name: 'Sloped Rectangle',\n shortName: 'sl-rect',\n description: 'Manual input step',\n aliases: ['manual-input', 'sloped-rectangle'],\n handler: slopedRect,\n },\n {\n semanticName: 'Multi-Document',\n name: 'Stacked Document',\n shortName: 'docs',\n description: 'Multiple documents',\n aliases: ['documents', 'st-doc', 'stacked-document'],\n handler: multiWaveEdgedRectangle,\n },\n {\n semanticName: 'Multi-Process',\n name: 'Stacked Rectangle',\n shortName: 'st-rect',\n description: 'Multiple processes',\n aliases: ['procs', 'processes', 'stacked-rectangle'],\n handler: multiRect,\n },\n {\n semanticName: 'Stored Data',\n name: 'Bow Tie Rectangle',\n shortName: 'bow-rect',\n description: 'Stored data',\n aliases: ['stored-data', 'bow-tie-rectangle'],\n handler: bowTieRect,\n },\n {\n semanticName: 'Summary',\n name: 'Crossed Circle',\n shortName: 'cross-circ',\n description: 'Summary',\n aliases: ['summary', 'crossed-circle'],\n handler: crossedCircle,\n },\n {\n semanticName: 'Tagged Document',\n name: 'Tagged Document',\n shortName: 'tag-doc',\n description: 'Tagged document',\n aliases: ['tag-doc', 'tagged-document'],\n handler: taggedWaveEdgedRectangle,\n },\n {\n semanticName: 'Tagged Process',\n name: 'Tagged Rectangle',\n shortName: 'tag-rect',\n description: 'Tagged process',\n aliases: ['tagged-rectangle', 'tag-proc', 'tagged-process'],\n handler: taggedRect,\n },\n {\n semanticName: 'Paper Tape',\n name: 'Flag',\n shortName: 'flag',\n description: 'Paper tape',\n aliases: ['paper-tape'],\n handler: waveRectangle,\n },\n {\n semanticName: 'Odd',\n name: 'Odd',\n shortName: 'odd',\n description: 'Odd shape',\n internalAliases: ['rect_left_inv_arrow'],\n handler: rect_left_inv_arrow,\n },\n {\n semanticName: 'Lined Document',\n name: 'Lined Document',\n shortName: 'lin-doc',\n description: 'Lined document',\n aliases: ['lined-document'],\n handler: linedWaveEdgedRect,\n },\n] as const satisfies ShapeDefinition[];\n\nconst generateShapeMap = () => {\n // These are the shapes that didn't have documentation present\n const undocumentedShapes = {\n // States\n state,\n choice,\n note,\n\n // Rectangles\n rectWithTitle,\n labelRect,\n\n // Icons\n iconSquare,\n iconCircle,\n icon,\n iconRounded,\n imageSquare,\n anchor,\n\n // Kanban diagram\n kanbanItem,\n\n // class diagram\n classBox,\n } as const;\n\n const entries = [\n ...(Object.entries(undocumentedShapes) as Entries),\n ...shapesDefs.flatMap((shape) => {\n const aliases = [\n shape.shortName,\n ...('aliases' in shape ? shape.aliases : []),\n ...('internalAliases' in shape ? shape.internalAliases : []),\n ];\n return aliases.map((alias) => [alias, shape.handler] as const);\n }),\n ];\n return Object.fromEntries(entries) as Record<\n (typeof entries)[number][0],\n (typeof entries)[number][1]\n > satisfies Record;\n};\n\nexport const shapes = generateShapeMap();\n\nexport function isValidShape(shape: string): shape is ShapeID {\n return shape in shapes;\n}\n\nexport type ShapeID = keyof typeof shapes;\n", "import { log } from '../../logger.js';\nimport { shapes } from './shapes.js';\nimport type { Node, NonClusterNode, ShapeRenderOptions } from '../types.js';\nimport type { SVGGroup } from '../../mermaid.js';\nimport type { D3Selection } from '../../types.js';\nimport type { graphlib } from 'dagre-d3-es';\n\ntype ShapeHandler = (typeof shapes)[keyof typeof shapes];\ntype NodeElement = D3Selection | Awaited>;\n\nconst nodeElems = new Map();\n\nexport async function insertNode(\n elem: SVGGroup,\n node: NonClusterNode,\n renderOptions: ShapeRenderOptions\n) {\n let newEl: NodeElement | undefined;\n let el;\n\n //special check for rect shape (with or without rounded corners)\n if (node.shape === 'rect') {\n if (node.rx && node.ry) {\n node.shape = 'roundedRect';\n } else {\n node.shape = 'squareRect';\n }\n }\n\n const shapeHandler = node.shape ? shapes[node.shape] : undefined;\n\n if (!shapeHandler) {\n throw new Error(`No such shape: ${node.shape}. Please check your syntax.`);\n }\n\n if (node.link) {\n // Add link when appropriate\n let target;\n if (renderOptions.config.securityLevel === 'sandbox') {\n target = '_top';\n } else if (node.linkTarget) {\n target = node.linkTarget || '_blank';\n }\n newEl = elem\n .insert('svg:a')\n .attr('xlink:href', node.link)\n .attr('target', target ?? null);\n el = await shapeHandler(newEl, node, renderOptions);\n } else {\n el = await shapeHandler(elem, node, renderOptions);\n newEl = el;\n }\n if (node.tooltip) {\n el.attr('title', node.tooltip);\n }\n\n nodeElems.set(node.id, newEl);\n\n if (node.haveCallback) {\n newEl.attr('class', newEl.attr('class') + ' clickable');\n }\n return newEl;\n}\n\nexport const setNodeElem = (elem: NodeElement, node: Pick) => {\n nodeElems.set(node.id, elem);\n};\n\nexport const clear = () => {\n nodeElems.clear();\n};\n\nexport const positionNode = (node: ReturnType) => {\n const el = nodeElems.get(node.id)!;\n log.trace(\n 'Transforming node',\n node.diff,\n node,\n 'translate(' + (node.x - node.width / 2 - 5) + ', ' + node.width / 2 + ')'\n );\n const padding = 8;\n const diff = node.diff || 0;\n if (node.clusterNode) {\n el.attr(\n 'transform',\n 'translate(' +\n (node.x + diff - node.width / 2) +\n ', ' +\n (node.y - node.height / 2 - padding) +\n ')'\n );\n } else {\n el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')');\n }\n return diff;\n};\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,IAAM,cAAc,8BACzB,QACA,MACA,aACG;AACH,MAAI;AACJ,QAAM,gBAAgB,KAAK,iBAAiB,SAASA,WAAU,GAAG,UAAU;AAC5E,MAAI,CAAC,UAAU;AACb,iBAAa;AAAA,EACf,OAA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IAAM,cAAc,wBAAC,MAAmB,SAA2B;AACxE,YAAU,IAAI,KAAK,IAAI,IAAI;AAC7B,GAF2B;AAIpB,IAAMC,SAAQ,6BAAM;AACzB,YAAU,MAAM;AAClB,GAFqB;AAId,IAAM,eAAe,wBAAC,SAA6C;AACxE,QAAM,KAAK,UAAU,IAAI,KAAK,EAAE;AAChC,MAAI;AAAA,IACF;AAAA,IACA,KAAK;AAAA,IACL;AAAA,IACA,gBAAgB,KAAK,IAAI,KAAK,QAAQ,IAAI,KAAK,OAAO,KAAK,QAAQ,IAAI;AAAA,EACzE;AACA,QAAM,UAAU;AAChB,QAAM,OAAO,KAAK,QAAQ;AAC1B,MAAI,KAAK,aAAa;AACpB,OAAG;AAAA,MACD;AAAA,MACA,gBACG,KAAK,IAAI,OAAO,KAAK,QAAQ,KAC9B,QACC,KAAK,IAAI,KAAK,SAAS,IAAI,WAC5B;AAAA,IACJ;AAAA,EACF,OAAO;AACL,OAAG,KAAK,aAAa,eAAe,KAAK,IAAI,OAAO,KAAK,IAAI,GAAG;AAAA,EAClE;AACA,SAAO;AACT,GAvB4B;",
"names": ["getConfig", "text", "p", "i", "t", "x", "y", "t", "e", "s", "n", "o", "a", "h", "r", "i", "c", "l", "u", "p", "f", "d", "g", "M", "k", "b", "y", "m", "P", "v", "S", "O", "L", "T", "D", "A", "x", "y", "w", "h", "getConfig", "s", "x", "y", "getConfig", "getConfig", "text", "x", "y", "rect", "x", "y", "i", "p", "q", "i", "t", "angle", "x", "y", "w", "h", "w", "h", "d", "h", "w", "s", "r", "crossedCircle", "generateCirclePoints", "i", "x", "y", "w", "h", "generateCirclePoints", "i", "x", "y", "w", "h", "generateCirclePoints", "i", "x", "y", "w", "h", "w", "h", "x", "y", "w", "h", "cylinder", "w", "h", "x", "y", "p", "filledCircle", "w", "h", "flippedTriangle", "state", "x", "y", "w", "h", "x", "y", "m", "f", "h", "w", "w", "h", "x", "y", "x", "y", "x", "y", "x", "y", "w", "h", "x", "y", "rect", "options", "rect", "w", "h", "w", "h", "lightningBolt", "createCylinderPathD", "x", "y", "createOuterCylinderPathD", "createInnerCylinderPathD", "w", "h", "cylinder", "w", "h", "p", "w", "h", "x", "y", "multiRect", "w", "h", "x", "y", "x", "y", "rect", "x", "y", "w", "h", "s", "w", "h", "x", "y", "g", "text", "getConfig", "div", "dv", "x", "y", "rect", "w", "h", "x", "y", "p", "rect", "w", "h", "x", "y", "squareRect", "h", "w", "rect", "circle", "circle", "w", "h", "x", "y", "rect", "w", "h", "x", "y", "taggedRect", "w", "h", "x", "y", "x", "y", "rect", "createCylinderPathD", "x", "y", "createOuterCylinderPathD", "createInnerCylinderPathD", "h", "w", "cylinder", "w", "h", "w", "h", "getConfig", "w", "h", "w", "h", "w", "h", "w", "h", "x", "y", "windowPane", "text", "sanitizeText", "getConfig", "w", "h", "x", "y", "rect", "_", "i", "text", "nodes", "match", "x", "y", "rect", "options", "y2", "squareRect", "shapes", "shapes", "clear"]
}