@next-bricks/diagram 0.56.1 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +4 -4
- package/dist/chunks/8436.38f6bb4d.js +2 -0
- package/dist/chunks/8436.38f6bb4d.js.map +1 -0
- package/dist/chunks/9024.9fb24b35.js +2 -0
- package/dist/chunks/9024.9fb24b35.js.map +1 -0
- package/dist/chunks/{9711.a67e7f03.js → 9711.6468901d.js} +2 -2
- package/dist/chunks/{9711.a67e7f03.js.map → 9711.6468901d.js.map} +1 -1
- package/dist/chunks/{eo-display-canvas.28d0385d.js → eo-display-canvas.d3d4fa57.js} +2 -2
- package/dist/chunks/{eo-display-canvas.28d0385d.js.map → eo-display-canvas.d3d4fa57.js.map} +1 -1
- package/dist/chunks/{eo-draw-canvas.4b11d12e.js → eo-draw-canvas.c41d08df.js} +2 -2
- package/dist/chunks/{eo-draw-canvas.4b11d12e.js.map → eo-draw-canvas.c41d08df.js.map} +1 -1
- package/dist/chunks/{main.caa1be21.js → main.cab55157.js} +2 -2
- package/dist/chunks/{main.caa1be21.js.map → main.cab55157.js.map} +1 -1
- package/dist/examples.json +6 -6
- package/dist/{index.e4a680fa.js → index.e995f9bc.js} +2 -2
- package/dist/{index.e4a680fa.js.map → index.e995f9bc.js.map} +1 -1
- package/dist/manifest.json +178 -178
- package/dist/types.json +100 -74
- package/dist-types/diagram/lines/curveLine.d.ts +2 -1
- package/dist-types/diagram/lines/intersect.d.ts +2 -0
- package/dist-types/diagram/lines/intersect.spec.d.ts +1 -0
- package/dist-types/draw-canvas/interfaces.d.ts +17 -4
- package/dist-types/shared/canvas/collectLineJumpsFactory.d.ts +3 -0
- package/dist-types/shared/canvas/collectLineJumpsFactory.spec.d.ts +1 -0
- package/docs/eo-draw-canvas.md +2 -0
- package/package.json +2 -2
- package/dist/chunks/5903.c898abec.js +0 -2
- package/dist/chunks/5903.c898abec.js.map +0 -1
- package/dist/chunks/8436.107dc714.js +0 -2
- package/dist/chunks/8436.107dc714.js.map +0 -1
package/dist/bricks.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "bricks/diagram",
|
|
3
3
|
"bricks": [
|
|
4
|
-
"diagram.
|
|
5
|
-
"diagram.
|
|
4
|
+
"diagram.editable-label",
|
|
5
|
+
"diagram.experimental-node"
|
|
6
6
|
],
|
|
7
7
|
"elements": [
|
|
8
|
-
"eo-diagram",
|
|
9
8
|
"eo-display-canvas",
|
|
9
|
+
"eo-diagram",
|
|
10
10
|
"eo-draw-canvas"
|
|
11
11
|
],
|
|
12
12
|
"processors": [],
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"basic.lock-body-scroll"
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
|
-
"filePath": "bricks/diagram/dist/index.
|
|
19
|
+
"filePath": "bricks/diagram/dist/index.e995f9bc.js"
|
|
20
20
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[8436],{3739:(t,e,r)=>{r.d(e,{c:()=>o});var i=r(8769),n=r.n(i);function o(t){let e,{id:r,type:i,strokeColor:o}=t;switch(i){case"0..1":e=y;break;case"0..N":e=x;break;case"circle":e=h;break;default:e=s}return n().createElement(e,{id:r,strokeColor:o})}function h(t){let{id:e,strokeColor:r}=t;return n().createElement("marker",{viewBox:"0 0 9 9",refX:3,refY:3,id:e,overflow:"visible",markerWidth:9,markerHeight:9},n().createElement("circle",{stroke:"none",fill:r,cx:3,cy:3,r:3}))}function s(t){let{id:e,strokeColor:r}=t;return n().createElement("marker",{id:e,viewBox:"0 0 6 6",refX:5,refY:3,markerWidth:6,markerHeight:6,orient:"auto-start-reverse",strokeLinejoin:"round"},n().createElement("path",{d:"M 0.5 0.5 L 5.5 3 L 0.5 5.5 z",stroke:r,strokeWidth:1,fill:r}))}function y(t){let{id:e,strokeColor:r}=t;return n().createElement("marker",{id:e,viewBox:"0 0 21 11",refX:.5,refY:5.5,markerWidth:21,markerHeight:11,orient:"auto-start-reverse"},n().createElement("path",{d:"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 15.5 0.5 V 10.5 M 10.5 5.5 H 20.5",stroke:r,strokeWidth:1,fill:"none"}))}function x(t){let{id:e,strokeColor:r}=t;return n().createElement("marker",{id:e,viewBox:"0 0 21 11",refX:.5,refY:5.5,markerWidth:21,markerHeight:11,orient:"auto-start-reverse"},n().createElement("path",{d:"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 20.5 0.5 L 10.5 5.5 L 20.5 10.5 M 10.5 5.5 H 20.5",stroke:r,strokeWidth:1,fill:"none"}))}},8653:(t,e,r)=>{r.d(e,{S:()=>x});var i=r(482),n=r(4643),o=r(3488),h=r(6066),s=r(4993),y=r(3269);function x(t,e,r,x,c){if(!Array.isArray(t))return"";let l;switch(e){case"curveLinear":l=i.A;break;case"curveBumpX":l=n.dJ;break;case"curveBumpY":l=n.kl;break;case"curveMonotoneX":l=o.G;break;case"curveMonotoneY":l=o.N;break;case"curveNatural":l=h.A;break;default:l=s.Ay}const u=a(t[1],t[0],r),f=a(t[t.length-2],t[t.length-1],x),d=(0,y.A)().x(((e,r)=>e.x-(0===r?u.x:r===t.length-1?f.x:0))).y(((e,r)=>e.y-(0===r?u.y:r===t.length-1?f.y:0))).curve(l);if(c&&"curveLinear"==e){const e=[];for(let r=0;r<t.length-1;r++){const i=t[r],n=t[r+1];0===r&&e.push(`M${i.x},${i.y}`);const o=c.get(r);if(o){const t=n.x-i.x,r=n.y-i.y,h=Math.atan2(r,t),s=Math.abs(h)<=Math.PI/2?-1:1,y=h+Math.PI/2*s,x=1.3*o.radius*Math.cos(y),a=1.3*o.radius*Math.sin(y),c=o.radius*Math.cos(h),l=o.radius*Math.sin(h);for(const t of o.jumpPoints){const r=t.x-c,i=t.y-l,n=t.x+c,o=t.y+l;e.push(`L${r},${i}`),e.push(`C${r+x},${i+a} ${n+x},${o+a} ${n},${o}`)}}e.push(`L${n.x},${n.y}`)}return e.join("")}return d(t)}function a(t,e,r){if(!r)return{x:0,y:0};const{x:i,y:n}=t,{x:o,y:h}=e,s=r/Math.sqrt(Math.pow(o-i,2)+Math.pow(h-n,2));return{x:(o-i)*s,y:(h-n)*s}}},3188:(t,e,r)=>{r.d(e,{h:()=>o});var i=r(733),n=r(4525);function o(t,e,r,n){const o=!(null==n||!n.exitPosition),s=!(null==n||!n.entryPosition);if(t===e||(0,i.w)(t,e,0,0)&&!o&&!s)return null;let y,x,a=0,c=0;if(r){const i=e.x-t.x,n=e.y-t.y,o=Math.atan2(n,i);a=r/2*Math.cos(o+Math.PI/2),c=r/2*Math.sin(o+Math.PI/2)}const l=[o?[t.x+(n.exitPosition.x-.5)*t.width,t.y+(n.exitPosition.y-.5)*t.height]:[t.x+a,t.y+c],s?[e.x+(n.entryPosition.x-.5)*e.width,e.y+(n.entryPosition.y-.5)*e.height]:[e.x+a,e.y+c]];if(o)y=l[0];else{const e=h(t,l);y=e.length>0?e[0]:[t.x,t.y]}if(s)x=l[1];else{const t=h(e,l);x=t.length>0?t[0]:[e.x,e.y]}return[{x:y[0],y:y[1]},{x:x[0],y:x[1]}]}function h(t,e){const r=[[t.x-t.width/2,t.y-t.height/2],[t.x+t.width/2,t.y-t.height/2],[t.x+t.width/2,t.y+t.height/2],[t.x-t.width/2,t.y+t.height/2]],i=[];for(let t=0;t<4;t++)i.push([r[t],r[(t+1)%4]]);const o=[];for(const t of i){const r=(0,n.y)(e[0],e[1],t[0],t[1]);r&&o.push(r)}return o}},4059:(t,e,r)=>{r.d(e,{o:()=>n});const i=20;function n(t,e,r,n,h,s){const y=o(t,r,h),x=o(e,n,s);let a=[],c=!1;const l="top"===r||"bottom"===r;if(l!==("top"===n||"bottom"===n)){let o,h,s,u,f,d;l?(o=e,h=t,s="right"===n?1:-1,u="bottom"===r?1:-1,f=x,d=y):(o=t,h=e,s="right"===r?1:-1,u="bottom"===n?1:-1,f=y,d=x,c=!0);const g=f.x+i*s,k=d.y+i*u;if((o.x-h.x)*s>=0)if((h.y-o.y)*u>=0)a=[{x:d.x,y:k},{x:g,y:k},{x:g,y:f.y}];else{const t=h.y+(h.height/2+i)*u,e=o.y-(o.height/2+i)*u;if((e-t)*u>=0){const r=(t+e)/2;a=[{x:d.x,y:r},{x:g,y:r},{x:g,y:f.y}]}else{const r=(h.x+h.width/2*s+o.x-o.width/2*s)/2;a=[{x:d.x,y:t},{x:r,y:t},{x:r,y:e},{x:g,y:e},{x:g,y:f.y}]}}else if((f.y-k)*u>=0)if((d.x-g)*s>=0)a=[{x:d.x,y:f.y}];else{const t=(h.y+(h.height/2+i)*u+(o.y-(o.height/2+i)*u))/2;a=[{x:d.x,y:t},{x:g,y:t},{x:g,y:f.y}]}else{const t=h.x-(h.width/2+i)*s;if((t-g)*s>=0){const e=(t+g)/2;a=[{x:d.x,y:k},{x:e,y:k},{x:e,y:f.y}]}else{const e=(h.y-h.height/2*u+o.y+o.height/2*u)/2;a=[{x:d.x,y:k},{x:t,y:k},{x:t,y:e},{x:g,y:e},{x:g,y:f.y}]}}}else if(r===n){const n="bottom"===r||"right"===r?1:-1;let o,h,s,u;const f=l?"y":"x",d=l?"x":"y";let g,k,m,w;e[f]<t[f]?(o=e,h=t,s=x,u=y,c=1===n):(o=t,h=e,s=y,u=x,c=1!==n),1===n?(g=h,k=o,m=u,w=s):(g=o,k=h,m=s,w=u);const M=g===(e[d]<t[d]?t:e)?1:-1;if(l){const t=g.x-(g.width/2+i)*M,e=m.y+i*n;if((t-w.x)*M>=0)a=[{x:w.x,y:e},{x:m.x,y:e}];else{const r=(k.y+k.height/2*n+g.y-g.height/2*n)/2;a=[{x:w.x,y:r},{x:t,y:r},{x:t,y:e},{x:m.x,y:e}]}}else{const t=m.x+i*n,e=g.y-(g.height/2+i)*M;if((e-w.y)*M>=0)a=[{x:t,y:w.y},{x:t,y:m.y}];else{const r=(k.x+k.width/2*n+g.x-g.width/2*n)/2;a=[{x:r,y:w.y},{x:r,y:e},{x:t,y:e},{x:t,y:m.y}]}}}else{const r="bottom"===n||"right"===n?1:-1;let o,h,s,c;l?(o="y",h="x",s="height",c="width"):(o="x",h="y",s="width",c="height");const u=e[o]+e[s]/2*r,f=t[o]-t[s]/2*r,d=u+i*r,g=f-i*r,k=y[h]===x[h];if((g-d)*r>=0){const t=(g+d)/2;a=k?[]:[{[h]:y[h],[o]:t},{[h]:x[h],[o]:t}]}else if(k&&(f-u)*r>=0)a=[];else{const n=e[h]<t[h]?-1:1,l=t[h]+(t[c]/2+i)*n,u=e[h]-(e[c]/2+i)*n;if((u-l)*n>=0||Math.abs((g-d)*r)<i){const t=(l+u)/2;a=[{[h]:y[h],[o]:g},{[h]:t,[o]:g},{[h]:t,[o]:d},{[h]:x[h],[o]:d}]}else{const i=(t[o]+t[s]/2*r+e[o]-e[s]/2*r)/2;a=[{[h]:y[h],[o]:g},{[h]:l,[o]:g},{[h]:l,[o]:i},{[h]:u,[o]:i},{[h]:u,[o]:d},{[h]:x[h],[o]:d}]}}}return c&&a.reverse(),[y,...a,x]}function o(t,e,r){const{x:i,y:n,width:o,height:h}=t;switch(e){case"top":return{x:i-o/2+o*r,y:n-h/2};case"bottom":return{x:i-o/2+o*r,y:n+h/2};case"left":return{x:i-o/2,y:n-h/2+h*r};case"right":return{x:i+o/2,y:n-h/2+h*r}}}},4525:(t,e,r)=>{function i(t,e,r,i){let[n,o]=t,[h,s]=e,[y,x]=r,[a,c]=i;if(n===h&&o===s||y===a&&x===c)return null;const l=(c-x)*(h-n)-(a-y)*(s-o);if(0===l)return null;const u=((a-y)*(o-x)-(c-x)*(n-y))/l,f=((h-n)*(o-x)-(s-o)*(n-y))/l;return u<0||u>1||f<0||f>1?null:[n+u*(h-n),o+u*(s-o)]}r.d(e,{y:()=>i})},733:(t,e,r)=>{function i(t,e,r,i){const o=r?n(t,r):t,h=i?n(e,i):e,s=Math.min(o.x-o.width/2,h.x-h.width/2),y=Math.max(o.x+o.width/2,h.x+h.width/2),x=Math.min(o.y-o.height/2,h.y-h.height/2),a=Math.max(o.y+o.height/2,h.y+h.height/2);return y-s<o.width+h.width&&a-x<o.height+h.height}function n(t,e){return{x:t.x-t.width/2-e,y:t.y-t.height/2-e,width:t.width+2*e,height:t.height+2*e}}r.d(e,{w:()=>i})},8802:(t,e,r)=>{function i(t){if(Array.isArray(t)){const e=t[0],r=t.length>1?t[1]:e;return[e,r,t.length>2?t[2]:e,t.length>3?t[3]:r]}return new Array(4).fill(t)}r.d(e,{D:()=>i})}}]);
|
|
2
|
+
//# sourceMappingURL=8436.38f6bb4d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunks/8436.38f6bb4d.js","mappings":"gLAYO,SAASA,EAAeC,GAIO,IAChCC,GAL0B,GAC9BC,EAAE,KACFC,EAAI,YACJC,GACqBJ,EAGrB,OAAQG,GACN,IAAK,OACHF,EAAYI,EACZ,MACF,IAAK,OACHJ,EAAYK,EACZ,MACF,IAAK,SACHL,EAAYM,EACZ,MACF,QACEN,EAAYO,EAEhB,OAAOC,IAAAA,cAACR,EAAS,CAACC,GAAIA,EAAIE,YAAaA,GACzC,CAEA,SAASG,EAAYG,GAGqB,IAHpB,GACpBR,EAAE,YACFE,GACyBM,EAGzB,OACED,IAAAA,cAAA,UACEE,QAAS,UACTC,KALM,EAMNC,KANM,EAONX,GAAIA,EACJY,SAAS,UACTC,YARMC,EASNC,aATMD,GAWNP,IAAAA,cAAA,UAAQS,OAAO,OAAOC,KAAMf,EAAagB,GAZnC,EAY0CC,GAZ1C,EAYiDL,EAZjD,IAeZ,CAEA,SAASR,EAAWc,GAGsB,IAHrB,GACnBpB,EAAE,YACFE,GACyBkB,EACzB,OACEb,IAAAA,cAAA,UACEP,GAAIA,EACJS,QAAQ,UACRC,KAAM,EACNC,KAAM,EACNE,YAAa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AAVkF,EAE1B,C,iCCtBO,SAASC,EACdC,GAEA,GAAItJ,MAAMC,QAAQqJ,GAAQ,CACxB,MAAMC,EAAKD,EAAM,GACXE,EAAKF,EAAMzI,OAAS,EAAIyI,EAAM,GAAMC,EAG1C,MAAO,CAACA,EAAIC,EAFDF,EAAMzI,OAAS,EAAIyI,EAAM,GAAMC,EAC/BD,EAAMzI,OAAS,EAAIyI,EAAM,GAAME,EAE5C,CACA,OAAO,IAAIxJ,MAAM,GAAGhB,KAAKsK,EAC3B,C","sources":["webpack:///./src/diagram/MarkerComponent.tsx","webpack:///./src/diagram/lines/curveLine.ts","webpack:///./src/diagram/lines/getDirectLinePoints.ts","webpack:///./src/diagram/lines/getPolyLinePoints.ts","webpack:///./src/diagram/lines/intersect.ts","webpack:///./src/diagram/processors/doTwoNodesOverlap.ts","webpack:///./src/diagram/processors/extractPartialRectTuple.ts"],"sourcesContent":["import React from \"react\";\nimport type { LineMarkerType } from \"./interfaces\";\n\nexport interface MarkerComponentProps extends BaseMarkerComponentProps {\n type: LineMarkerType;\n}\n\nexport interface BaseMarkerComponentProps {\n id: string;\n strokeColor?: string;\n}\n\nexport function MarkerComponent({\n id,\n type,\n strokeColor,\n}: MarkerComponentProps): JSX.Element {\n let Component: (props: BaseMarkerComponentProps) => JSX.Element;\n\n switch (type) {\n case \"0..1\":\n Component = EntityRelationZeroOrOneMarker;\n break;\n case \"0..N\":\n Component = EntityRelationZeroOrManyMarker;\n break;\n case \"circle\":\n Component = CircleMarker;\n break;\n default:\n Component = ArrowMarker;\n }\n return <Component id={id} strokeColor={strokeColor} />;\n}\n\nfunction CircleMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n const r = 3;\n const d = r * 3;\n return (\n <marker\n viewBox={`0 0 ${d} ${d}`}\n refX={r}\n refY={r}\n id={id}\n overflow=\"visible\"\n markerWidth={d}\n markerHeight={d}\n >\n <circle stroke=\"none\" fill={strokeColor} cx={r} cy={r} r={r} />\n </marker>\n );\n}\n\nfunction ArrowMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 6 6\"\n refX={5}\n refY={3}\n markerWidth={6}\n markerHeight={6}\n orient=\"auto-start-reverse\"\n strokeLinejoin=\"round\"\n >\n <path\n d=\"M 0.5 0.5 L 5.5 3 L 0.5 5.5 z\"\n stroke={strokeColor}\n strokeWidth={1}\n fill={strokeColor}\n />\n </marker>\n );\n}\n\nfunction EntityRelationZeroOrOneMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 21 11\"\n refX={0.5}\n refY={5.5}\n markerWidth={21}\n markerHeight={11}\n orient=\"auto-start-reverse\"\n >\n <path\n d=\"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 15.5 0.5 V 10.5 M 10.5 5.5 H 20.5\"\n stroke={strokeColor}\n strokeWidth={1}\n fill=\"none\"\n />\n </marker>\n );\n}\n\nfunction EntityRelationZeroOrManyMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 21 11\"\n refX={0.5}\n refY={5.5}\n markerWidth={21}\n markerHeight={11}\n orient=\"auto-start-reverse\"\n >\n <path\n d=\"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 20.5 0.5 L 10.5 5.5 L 20.5 10.5 M 10.5 5.5 H 20.5\"\n stroke={strokeColor}\n strokeWidth={1}\n fill=\"none\"\n />\n </marker>\n );\n}\n","import {\n curveLinear,\n line,\n curveBasis,\n curveBumpX,\n curveBumpY,\n type CurveFactory,\n curveMonotoneX,\n curveNatural,\n curveMonotoneY,\n} from \"d3-shape\";\nimport type { CurveType, NodePosition } from \"../interfaces\";\nimport type { LineSegmentJumps } from \"../../draw-canvas/interfaces\";\n\n/**\n * Generate Line from points\n */\nexport function curveLine(\n points: Array<NodePosition> | null | undefined,\n curveType: CurveType | undefined,\n startOffset: number,\n endOffset: number,\n jumpsMap?: Map<number, LineSegmentJumps> | null\n): string {\n if (!Array.isArray(points)) {\n return \"\";\n }\n let curveFactory: CurveFactory;\n switch (curveType) {\n case \"curveLinear\":\n curveFactory = curveLinear;\n break;\n case \"curveBumpX\":\n curveFactory = curveBumpX;\n break;\n case \"curveBumpY\":\n curveFactory = curveBumpY;\n break;\n case \"curveMonotoneX\":\n curveFactory = curveMonotoneX;\n break;\n case \"curveMonotoneY\":\n curveFactory = curveMonotoneY;\n break;\n case \"curveNatural\":\n curveFactory = curveNatural;\n break;\n default:\n curveFactory = curveBasis;\n }\n const startOffsets = getOffsets(points[1], points[0], startOffset);\n const endOffsets = getOffsets(\n points[points.length - 2],\n points[points.length - 1],\n endOffset\n );\n const lineFunction = line<NodePosition>()\n .x(\n (d, index) =>\n d.x -\n (index === 0\n ? startOffsets.x\n : index === points.length - 1\n ? endOffsets.x\n : 0)\n )\n .y(\n (d, index) =>\n d.y -\n (index === 0\n ? startOffsets.y\n : index === points.length - 1\n ? endOffsets.y\n : 0)\n )\n .curve(curveFactory);\n\n if (jumpsMap && curveType == \"curveLinear\") {\n const d: string[] = [];\n for (let i = 0; i < points.length - 1; i++) {\n const start = points[i];\n const end = points[i + 1];\n if (i === 0) {\n d.push(`M${start.x},${start.y}`);\n }\n // 处理交叉跨线点\n const jump = jumpsMap.get(i);\n if (jump) {\n // 跨线点近似为一段半圆,参考 draw.io 使用三次贝赛尔曲线实现。\n // 一条 jump 记录中所有的 jumpPoints 都在同一线段上,因此角度一致、尺寸一致。\n const dx = end.x - start.x;\n const dy = end.y - start.y;\n const angle = Math.atan2(dy, dx);\n const direction = Math.abs(angle) <= Math.PI / 2 ? -1 : 1;\n const verticalAngle = angle + (Math.PI / 2) * direction;\n const offsetX = jump.radius * 1.3 * Math.cos(verticalAngle);\n const offsetY = jump.radius * 1.3 * Math.sin(verticalAngle);\n const xDiff = jump.radius * Math.cos(angle);\n const yDiff = jump.radius * Math.sin(angle);\n for (const p of jump.jumpPoints) {\n const x0 = p.x - xDiff;\n const y0 = p.y - yDiff;\n const x1 = p.x + xDiff;\n const y1 = p.y + yDiff;\n d.push(`L${x0},${y0}`);\n d.push(\n `C${x0 + offsetX},${y0 + offsetY} ${x1 + offsetX},${y1 + offsetY} ${x1},${y1}`\n );\n }\n }\n d.push(`L${end.x},${end.y}`);\n }\n return d.join(\"\");\n }\n\n return lineFunction(points)!;\n}\n\nfunction getOffsets(\n start: NodePosition,\n end: NodePosition,\n offset: number\n): NodePosition {\n if (!offset) {\n return { x: 0, y: 0 };\n }\n const { x: x0, y: y0 } = start;\n const { x: x1, y: y1 } = end;\n const distance = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2));\n const ratio = offset / distance;\n return {\n x: (x1 - x0) * ratio,\n y: (y1 - y0) * ratio,\n };\n}\n","import type { EdgeView } from \"../../draw-canvas/interfaces\";\nimport type { NodePosition, NodeRect, PositionTuple } from \"../interfaces\";\nimport { doTwoNodesOverlap } from \"../processors/doTwoNodesOverlap\";\nimport { intersect } from \"./intersect\";\n\ntype LineTuple = [start: PositionTuple, end: PositionTuple];\n\nexport function getDirectLinePoints(\n source: NodeRect,\n target: NodeRect,\n parallelGap?: number,\n edgeView?: EdgeView\n): NodePosition[] | null {\n const hasExitPosition = !!edgeView?.exitPosition;\n const hasEntryPosition = !!edgeView?.entryPosition;\n\n // Ignore if two nodes are the same.\n // Ignore if two nodes overlap and no entry nor exit position.\n if (\n source === target ||\n (doTwoNodesOverlap(source, target, 0, 0) &&\n !(hasExitPosition || hasEntryPosition))\n ) {\n return null;\n }\n\n let p0: PositionTuple;\n let p1: PositionTuple;\n\n let xDiff = 0;\n let yDiff = 0;\n\n if (parallelGap) {\n const dx = target.x - source.x;\n const dy = target.y - source.y;\n const angle = Math.atan2(dy, dx);\n xDiff = (parallelGap / 2) * Math.cos(angle + Math.PI / 2);\n yDiff = (parallelGap / 2) * Math.sin(angle + Math.PI / 2);\n }\n\n const line: LineTuple = [\n hasExitPosition\n ? [\n source.x + (edgeView!.exitPosition!.x - 0.5) * source.width,\n source.y + (edgeView!.exitPosition!.y - 0.5) * source.height,\n ]\n : [source.x + xDiff, source.y + yDiff],\n hasEntryPosition\n ? [\n target.x + (edgeView!.entryPosition!.x - 0.5) * target.width,\n target.y + (edgeView!.entryPosition!.y - 0.5) * target.height,\n ]\n : [target.x + xDiff, target.y + yDiff],\n ];\n\n if (hasExitPosition) {\n p0 = line[0];\n } else {\n const sourceIntersections = getIntersections(source, line);\n // Todo: handle when more than one intersection\n if (sourceIntersections.length > 0) {\n p0 = sourceIntersections[0];\n } else {\n p0 = [source.x, source.y];\n }\n }\n\n if (hasEntryPosition) {\n p1 = line[1];\n } else {\n const targetIntersections = getIntersections(target, line);\n // Todo: handle when more than one intersection\n if (targetIntersections.length > 0) {\n p1 = targetIntersections[0];\n } else {\n p1 = [target.x, target.y];\n }\n }\n\n return [\n { x: p0[0], y: p0[1] },\n { x: p1[0], y: p1[1] },\n ];\n}\n\nfunction getIntersections(rect: NodeRect, line: LineTuple) {\n const vertices: PositionTuple[] = [\n [rect.x - rect.width / 2, rect.y - rect.height / 2],\n [rect.x + rect.width / 2, rect.y - rect.height / 2],\n [rect.x + rect.width / 2, rect.y + rect.height / 2],\n [rect.x - rect.width / 2, rect.y + rect.height / 2],\n ];\n const possibleLines: [start: PositionTuple, end: PositionTuple][] = [];\n for (let i = 0; i < 4; i++) {\n possibleLines.push([vertices[i], vertices[(i + 1) % 4]]);\n }\n const intersections: PositionTuple[] = [];\n for (const item of possibleLines) {\n const intersection = intersect(line[0], line[1], item[0], item[1]);\n if (intersection) {\n intersections.push(intersection);\n }\n }\n return intersections;\n}\n","import type { Direction, NodePosition, NodeRect } from \"../interfaces\";\n\nconst MINIMAL_OFFSET = 20;\n\nexport function getPolyLinePoints(\n source: NodeRect,\n target: NodeRect,\n sourceDirection: Direction,\n targetDirection: Direction,\n sourcePosition: number,\n targetPosition: number\n): NodePosition[] {\n const p0 = getCoordinates(source, sourceDirection, sourcePosition);\n const p1 = getCoordinates(target, targetDirection, targetPosition);\n\n let controls: NodePosition[] = [];\n let reverseControls = false;\n\n const sourceIsVertical =\n sourceDirection === \"top\" || sourceDirection === \"bottom\";\n const targetIsVertical =\n targetDirection === \"top\" || targetDirection === \"bottom\";\n\n if (sourceIsVertical !== targetIsVertical) {\n // One is vertical and the other is horizontal\n let horizontal: NodeRect;\n let vertical: NodeRect;\n let horizontalSign: number;\n let verticalSign: number;\n let horizontalPosition: NodePosition;\n let verticalPosition: NodePosition;\n if (sourceIsVertical) {\n horizontal = target;\n vertical = source;\n horizontalSign = targetDirection === \"right\" ? 1 : -1;\n verticalSign = sourceDirection === \"bottom\" ? 1 : -1;\n horizontalPosition = p1;\n verticalPosition = p0;\n } else {\n horizontal = source;\n vertical = target;\n horizontalSign = sourceDirection === \"right\" ? 1 : -1;\n verticalSign = targetDirection === \"bottom\" ? 1 : -1;\n horizontalPosition = p0;\n verticalPosition = p1;\n reverseControls = true;\n }\n\n const defaultControlX =\n horizontalPosition.x + MINIMAL_OFFSET * horizontalSign;\n const defaultControlY = verticalPosition.y + MINIMAL_OFFSET * verticalSign;\n\n if ((horizontal.x - vertical.x) * horizontalSign >= 0) {\n if ((vertical.y - horizontal.y) * verticalSign >= 0) {\n // ┌──────────────┐\n // ┌──┴──┐ ┌─────┐ │\n // │ S │ │ T ├─┘\n // └─────┘ └─────┘\n controls = [\n { x: verticalPosition.x, y: defaultControlY },\n { x: defaultControlX, y: defaultControlY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n } else {\n const controlY0 =\n vertical.y + (vertical.height / 2 + MINIMAL_OFFSET) * verticalSign;\n const controlY1 =\n horizontal.y -\n (horizontal.height / 2 + MINIMAL_OFFSET) * verticalSign;\n if ((controlY1 - controlY0) * verticalSign >= 0) {\n // ┌─────┐\n // │ T ├─┐\n // └─────┘ │\n // ┌────────┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n const middleY = (controlY0 + controlY1) / 2;\n controls = [\n { x: verticalPosition.x, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n } else {\n // ┌─────┐\n // ┌────┐ │ T ├─┐\n // ┌──┴──┐ │ └─────┘ │\n // │ S │ └─────────┘\n // └─────┘\n const middleX =\n (vertical.x +\n (vertical.width / 2) * horizontalSign +\n horizontal.x -\n (horizontal.width / 2) * horizontalSign) /\n 2;\n controls = [\n { x: verticalPosition.x, y: controlY0 },\n { x: middleX, y: controlY0 },\n { x: middleX, y: controlY1 },\n { x: defaultControlX, y: controlY1 },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n }\n }\n } else if ((horizontalPosition.y - defaultControlY) * verticalSign >= 0) {\n if ((verticalPosition.x - defaultControlX) * horizontalSign >= 0) {\n // ┌─────┐\n // ┌──┤ T │\n // │ └─────┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [{ x: verticalPosition.x, y: horizontalPosition.y }];\n } else {\n // ┌─────┐\n // │ T ├─┐\n // └─────┘ │\n // ┌─┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n const controlY0 =\n vertical.y + (vertical.height / 2 + MINIMAL_OFFSET) * verticalSign;\n const controlY1 =\n horizontal.y -\n (horizontal.height / 2 + MINIMAL_OFFSET) * verticalSign;\n const middleY = (controlY0 + controlY1) / 2;\n controls = [\n { x: verticalPosition.x, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n }\n } else {\n const sourceExtendX =\n vertical.x - (vertical.width / 2 + MINIMAL_OFFSET) * horizontalSign;\n if ((sourceExtendX - defaultControlX) * horizontalSign >= 0) {\n // ┌────┐\n // │ ┌──┴──┐\n // │ │ S │\n // ┌─────┐ │ └─────┘\n // │ T ├─┘\n // └─────┘\n const middleX = (sourceExtendX + defaultControlX) / 2;\n controls = [\n { x: verticalPosition.x, y: defaultControlY },\n { x: middleX, y: defaultControlY },\n { x: middleX, y: horizontalPosition.y },\n ];\n } else {\n // ┌────┐\n // │ ┌──┴──┐\n // │ │ S │\n // │ └─────┘\n // └───┐\n // ┌─────┐ │\n // │ T ├─┘\n // └─────┘\n const middleY =\n (vertical.y -\n (vertical.height / 2) * verticalSign +\n horizontal.y +\n (horizontal.height / 2) * verticalSign) /\n 2;\n controls = [\n { x: verticalPosition.x, y: defaultControlY },\n { x: sourceExtendX, y: defaultControlY },\n { x: sourceExtendX, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: horizontalPosition.y },\n ];\n }\n }\n } else if (sourceDirection === targetDirection) {\n // Same direction\n const sign =\n sourceDirection === \"bottom\" || sourceDirection === \"right\" ? 1 : -1;\n let start: NodeRect;\n let end: NodeRect;\n let startPosition: NodePosition;\n let endPosition: NodePosition;\n const axis = sourceIsVertical ? \"y\" : \"x\";\n const oppositeAxis = sourceIsVertical ? \"x\" : \"y\";\n if (target[axis] < source[axis]) {\n start = target;\n end = source;\n startPosition = p1;\n endPosition = p0;\n reverseControls = sign === 1;\n } else {\n start = source;\n end = target;\n startPosition = p0;\n endPosition = p1;\n reverseControls = sign !== 1;\n }\n const perpendicular =\n target[oppositeAxis] < source[oppositeAxis] ? source : target;\n let around: NodeRect;\n let nonAround: NodeRect;\n let aroundPosition: NodePosition;\n let nonAroundPosition: NodePosition;\n if (sign === 1) {\n around = end;\n nonAround = start;\n aroundPosition = endPosition;\n nonAroundPosition = startPosition;\n } else {\n around = start;\n nonAround = end;\n aroundPosition = startPosition;\n nonAroundPosition = endPosition;\n }\n const aroundSign = around === perpendicular ? 1 : -1;\n if (sourceIsVertical) {\n const defaultControlX =\n around.x - (around.width / 2 + MINIMAL_OFFSET) * aroundSign;\n const defaultControlY = aroundPosition.y + MINIMAL_OFFSET * sign;\n if ((defaultControlX - nonAroundPosition.x) * aroundSign >= 0) {\n // ┌─────────┐\n // │ ┌──┴──┐\n // │ │ T │\n // ┌──┴──┐ └─────┘\n // │ S │\n // └─────┘\n controls = [\n { x: nonAroundPosition.x, y: defaultControlY },\n { x: aroundPosition.x, y: defaultControlY },\n ];\n } else {\n // ┌────┐\n // │ ┌──┴──┐\n // │ │ T │\n // │ └─────┘\n // └─┐\n // ┌──┴──┐\n // │ S │\n // └─────┘\n const middleY =\n (nonAround.y +\n (nonAround.height / 2) * sign +\n around.y -\n (around.height / 2) * sign) /\n 2;\n controls = [\n { x: nonAroundPosition.x, y: middleY },\n { x: defaultControlX, y: middleY },\n { x: defaultControlX, y: defaultControlY },\n { x: aroundPosition.x, y: defaultControlY },\n ];\n }\n } else {\n const defaultControlX = aroundPosition.x + MINIMAL_OFFSET * sign;\n const defaultControlY =\n around.y - (around.height / 2 + MINIMAL_OFFSET) * aroundSign;\n if ((defaultControlY - nonAroundPosition.y) * aroundSign >= 0) {\n // ┌─────┐\n // ┌─────────┤ T │\n // │ ┌─────┐ └─────┘\n // └─┤ S │\n // └─────┘\n controls = [\n { x: defaultControlX, y: nonAroundPosition.y },\n { x: defaultControlX, y: aroundPosition.y },\n ];\n } else {\n // ┌─────────┐\n // │ ┌─────┐ │ ┌─────┐\n // └─┤ S │ └─┤ T │\n // └─────┘ └─────┘\n const middleX =\n (nonAround.x +\n (nonAround.width / 2) * sign +\n around.x -\n (around.width / 2) * sign) /\n 2;\n controls = [\n { x: middleX, y: nonAroundPosition.y },\n { x: middleX, y: defaultControlY },\n { x: defaultControlX, y: defaultControlY },\n { x: defaultControlX, y: aroundPosition.y },\n ];\n }\n }\n } else {\n // Opposite direction\n const targetSign =\n targetDirection === \"bottom\" || targetDirection === \"right\" ? 1 : -1;\n let axis: \"x\" | \"y\";\n let oppositeAxis: \"x\" | \"y\";\n let size: \"width\" | \"height\";\n let oppositeSize: \"width\" | \"height\";\n if (sourceIsVertical) {\n axis = \"y\";\n oppositeAxis = \"x\";\n size = \"height\";\n oppositeSize = \"width\";\n } else {\n axis = \"x\";\n oppositeAxis = \"y\";\n size = \"width\";\n oppositeSize = \"height\";\n }\n const targetEdge = target[axis] + (target[size] / 2) * targetSign;\n const sourceEdge = source[axis] - (source[size] / 2) * targetSign;\n const targetControl = targetEdge + MINIMAL_OFFSET * targetSign;\n const sourceControl = sourceEdge - MINIMAL_OFFSET * targetSign;\n const oppositeIsStraight = p0[oppositeAxis] === p1[oppositeAxis];\n if ((sourceControl - targetControl) * targetSign >= 0) {\n const middle = (sourceControl + targetControl) / 2;\n if (oppositeIsStraight) {\n // Straight line\n // ┌─────┐\n // │ T │\n // └──┬──┘\n // │\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [];\n } else {\n // ┌─────┐\n // │ T │\n // └──┬──┘\n // ┌───┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [\n { [oppositeAxis]: p0[oppositeAxis], [axis]: middle },\n { [oppositeAxis]: p1[oppositeAxis], [axis]: middle },\n ] as unknown[] as NodePosition[];\n }\n } else if (\n oppositeIsStraight &&\n (sourceEdge - targetEdge) * targetSign >= 0\n ) {\n // Straight line (very close)\n // ┌─────┐\n // │ T │\n // └──┬──┘\n // ┌──┴──┐\n // │ S │\n // └─────┘\n controls = [];\n } else {\n const targetOppositeSign =\n target[oppositeAxis] < source[oppositeAxis] ? -1 : 1;\n const sourceOppositeControl =\n source[oppositeAxis] +\n (source[oppositeSize] / 2 + MINIMAL_OFFSET) * targetOppositeSign;\n const targetOppositeControl =\n target[oppositeAxis] -\n (target[oppositeSize] / 2 + MINIMAL_OFFSET) * targetOppositeSign;\n if (\n (targetOppositeControl - sourceOppositeControl) * targetOppositeSign >=\n 0 ||\n Math.abs((sourceControl - targetControl) * targetSign) < MINIMAL_OFFSET\n ) {\n // ┌─────┐\n // ┌────┐ │ T │\n // ┌──┴──┐ │ └──┬──┘\n // │ S │ └────┘\n // └─────┘\n const oppositeMiddle =\n (sourceOppositeControl + targetOppositeControl) / 2;\n controls = [\n { [oppositeAxis]: p0[oppositeAxis], [axis]: sourceControl },\n { [oppositeAxis]: oppositeMiddle, [axis]: sourceControl },\n { [oppositeAxis]: oppositeMiddle, [axis]: targetControl },\n { [oppositeAxis]: p1[oppositeAxis], [axis]: targetControl },\n ] as unknown[] as NodePosition[];\n } else {\n // ┌────┐\n // ┌──┴──┐ │\n // │ S │ │\n // └─────┘ │\n // ┌─────────┘\n // │ ┌─────┐\n // │ │ T │\n // │ └──┬──┘\n // └────┘\n const middle =\n (source[axis] +\n (source[size] / 2) * targetSign +\n target[axis] -\n (target[size] / 2) * targetSign) /\n 2;\n controls = [\n { [oppositeAxis]: p0[oppositeAxis], [axis]: sourceControl },\n { [oppositeAxis]: sourceOppositeControl, [axis]: sourceControl },\n { [oppositeAxis]: sourceOppositeControl, [axis]: middle },\n { [oppositeAxis]: targetOppositeControl, [axis]: middle },\n { [oppositeAxis]: targetOppositeControl, [axis]: targetControl },\n { [oppositeAxis]: p1[oppositeAxis], [axis]: targetControl },\n ] as unknown[] as NodePosition[];\n }\n }\n }\n\n if (reverseControls) {\n controls.reverse();\n }\n\n return [p0, ...controls, p1] as NodePosition[];\n}\n\nfunction getCoordinates(\n node: NodeRect,\n direction: Direction,\n position: number\n): NodePosition {\n const { x, y, width, height } = node;\n switch (direction) {\n case \"top\":\n return {\n x: x - width / 2 + width * position,\n y: y - height / 2,\n };\n case \"bottom\":\n return {\n x: x - width / 2 + width * position,\n y: y + height / 2,\n };\n case \"left\":\n return {\n x: x - width / 2,\n y: y - height / 2 + height * position,\n };\n case \"right\":\n return {\n x: x + width / 2,\n y: y - height / 2 + height * position,\n };\n }\n}\n","import type { PositionTuple } from \"../interfaces\";\n\n// https://paulbourke.net/geometry/pointlineplane/javascript.txt\nexport function intersect(\n [x1, y1]: PositionTuple,\n [x2, y2]: PositionTuple,\n [x3, y3]: PositionTuple,\n [x4, y4]: PositionTuple\n): null | PositionTuple {\n // Check if none of the lines are of length 0\n if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n return null;\n }\n\n const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n\n // Lines are parallel\n if (denominator === 0) {\n return null;\n }\n\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n const ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator;\n\n // is the intersection along the segments\n if (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n return null;\n }\n\n // Return a object with the x and y coordinates of the intersection\n const x = x1 + ua * (x2 - x1);\n const y = y1 + ua * (y2 - y1);\n\n return [x, y];\n}\n","import type { NodeRect } from \"../interfaces\";\n\nexport function doTwoNodesOverlap(\n a: NodeRect,\n b: NodeRect,\n paddingA: number,\n paddingB: number\n): boolean {\n const A = paddingA ? getNodesWithPadding(a, paddingA) : a;\n const B = paddingB ? getNodesWithPadding(b, paddingB) : b;\n const left = Math.min(A.x - A.width / 2, B.x - B.width / 2);\n const right = Math.max(A.x + A.width / 2, B.x + B.width / 2);\n const top = Math.min(A.y - A.height / 2, B.y - B.height / 2);\n const bottom = Math.max(A.y + A.height / 2, B.y + B.height / 2);\n return right - left < A.width + B.width && bottom - top < A.height + B.height;\n}\n\nfunction getNodesWithPadding(node: NodeRect, padding: number) {\n return {\n x: node.x - node.width / 2 - padding,\n y: node.y - node.height / 2 - padding,\n width: node.width + padding * 2,\n height: node.height + padding * 2,\n };\n}\n","import type { FullRectTuple, PartialRectTuple } from \"../interfaces\";\n\nexport function extractPartialRectTuple(\n value: PartialRectTuple\n): FullRectTuple {\n if (Array.isArray(value)) {\n const v0 = value[0];\n const v1 = value.length > 1 ? value[1]! : v0;\n const v2 = value.length > 2 ? value[2]! : v0;\n const v3 = value.length > 3 ? value[3]! : v1;\n return [v0, v1, v2, v3];\n }\n return new Array(4).fill(value) as FullRectTuple;\n}\n"],"names":["MarkerComponent","_ref","Component","id","type","strokeColor","EntityRelationZeroOrOneMarker","EntityRelationZeroOrManyMarker","CircleMarker","ArrowMarker","React","_ref2","viewBox","refX","refY","overflow","markerWidth","r","markerHeight","stroke","fill","cx","cy","_ref3","orient","strokeLinejoin","d","strokeWidth","_ref4","_ref5","curveLine","points","curveType","startOffset","endOffset","jumpsMap","Array","isArray","curveFactory","curveLinear","curveBumpX","curveBumpY","curveMonotoneX","curveMonotoneY","curveNatural","curveBasis","startOffsets","getOffsets","endOffsets","length","lineFunction","line","x","index","y","curve","i","start","end","push","jump","get","dx","dy","angle","Math","atan2","direction","abs","PI","verticalAngle","offsetX","radius","cos","offsetY","sin","xDiff","yDiff","p","jumpPoints","x0","y0","x1","y1","join","offset","ratio","sqrt","pow","getDirectLinePoints","source","target","parallelGap","edgeView","hasExitPosition","exitPosition","hasEntryPosition","entryPosition","doTwoNodesOverlap","p0","p1","width","height","sourceIntersections","getIntersections","targetIntersections","rect","vertices","possibleLines","intersections","item","intersection","intersect","MINIMAL_OFFSET","getPolyLinePoints","sourceDirection","targetDirection","sourcePosition","targetPosition","getCoordinates","controls","reverseControls","sourceIsVertical","horizontal","vertical","horizontalSign","verticalSign","horizontalPosition","verticalPosition","defaultControlX","defaultControlY","controlY0","controlY1","middleY","middleX","sourceExtendX","sign","startPosition","endPosition","axis","oppositeAxis","around","nonAround","aroundPosition","nonAroundPosition","aroundSign","targetSign","size","oppositeSize","targetEdge","sourceEdge","targetControl","sourceControl","oppositeIsStraight","middle","targetOppositeSign","sourceOppositeControl","targetOppositeControl","oppositeMiddle","reverse","node","position","x2","y2","x3","y3","x4","y4","denominator","ua","ub","a","b","paddingA","paddingB","A","getNodesWithPadding","B","left","min","right","max","top","bottom","padding","extractPartialRectTuple","value","v0","v1"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[9024],{6616:(e,t,n)=>{n.d(t,{m:()=>T});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i),a=n(531),c=n(1030),s=n(9126),d=n(3033),u=n(8653),v=n(7531),f=n(2716),h=n(3848);function m(e){let{edge:t,position:n,offset:o,label:i,text:a,onRendered:c,onClick:s}=e;if(!i&&!a)return null;const d=!(!n||!o);return r().createElement("foreignObject",{className:l()("line-label-container",{ready:d}),x:d?n[0]+o[0]:0,y:d?n[1]+o[1]:0,onClick:s},i?r().createElement("div",{className:"line-label label"},r().createElement(p,{edge:t,label:i,onRendered:c})):r().createElement(g,{text:a,onRendered:c}))}function g(e){let{text:t,onRendered:n}=e;const i=(0,o.useCallback)((e=>{null==n||n(e)}),[n]);return r().createElement("div",{className:"line-label text",ref:i,style:t.style},t.content)}function p(e){let{edge:t,label:n,onRendered:i}=e;const l=(0,o.useMemo)((()=>(0,f.checkIfOfComputed)(n)?n.useBrick:null),[n]),a=(0,o.useMemo)((()=>({edge:t})),[t]);(0,o.useEffect)((()=>{l||setTimeout((()=>{null==i||i(null)}))}),[i,l]),(0,o.useEffect)((()=>()=>{null==i||i(null)}),[]);const c=(0,o.useCallback)((e=>{e&&setTimeout((()=>{null==i||i(e.parentElement)}))}),[i]),s=(0,o.useCallback)((()=>{setTimeout((()=>{null==i||i(null)}))}),[i]);return l?r().createElement(h.ReactUseBrick,{refCallback:c,ignoredCallback:s,useBrick:l,data:a}):null}var y=n(9386);function x(e){var t,n,i,a,f,h,g;let{edge:p,lineConfMap:x,editableLineMap:w,readOnly:E,active:k,activeRelated:b,onSwitchActiveTarget:C}=e;const M=(0,o.useRef)(null),I=x.get(p),{points:L,jumpsMap:S}=null!==(t=w.get(p))&&void 0!==t?t:{},z=(0,o.useMemo)((()=>(0,u.S)(L,"curve"===I.type?I.curveType:"curveLinear",0,1,S)),[I,L,S]),P=(0,o.useMemo)((()=>(0,c.uniqueId)("line-mask-")),[]),[N,R]=(0,o.useState)(null),[A,T]=(0,o.useState)(null),[H,W]=(0,o.useState)(null),D=(0,o.useCallback)((()=>{const e=M.current,{label:t,text:n}=I;if(e&&L&&(t||n)){var o,r;const i=null!==(o=t?t.placement:n.placement)&&void 0!==o?o:"center",l=e.getTotalLength(),a=l/2,c=e.getPointAtLength("start"===i?Math.min(0,a):"end"===i?Math.max(l-0,a):a);let s="center",d=0;if("start"===i||"end"===i){let e,t;"start"===i?(e=L[0],t=L[1]):(e=L[L.length-1],t=L[L.length-2]),d=Math.atan2(t.y-e.y,t.x-e.x),s=Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?e.x>t.x?"left":"right":e.y>t.y?"top":"bottom"}const u=null!==(r=t?t.offset:n.offset)&&void 0!==r?r:0;R([c.x,c.y,s,d,u]);const v=e.getBBox();W({x:v.x-1e3,y:v.y-1e3,width:v.width+2e3,height:v.height+2e3})}}),[I,L]),[Z,j]=(0,o.useState)(null),B=(0,o.useCallback)((e=>{if(M.current=e,e){var t,n,o;j(null!==(t=null===(n=e.getTotalLength)||void 0===n?void 0:n.call(e))&&void 0!==t?t:100);const r=null===(o=e.getBBox)||void 0===o?void 0:o.call(e);p.view={...p.view,x:null==r?void 0:r.x,y:null==r?void 0:r.y,width:null==r?void 0:r.width,height:null==r?void 0:r.height}}D()}),[D,p]),[$,U]=(0,o.useState)(null);(0,o.useEffect)((()=>{if(!$)return void T(null);const e=new s.A((()=>{const{offsetWidth:e,offsetHeight:t}=$;T(0!==e&&0!==t?[e,t]:null)}));return e.observe($),()=>{e.disconnect()}}),[$]);const O=(0,o.useCallback)((e=>{U(e)}),[]);(0,o.useEffect)((()=>{D()}),[D,L]);const V=(0,o.useCallback)((()=>{null==C||C((0,y.P)(p))}),[p,C]),G=(0,o.useCallback)((e=>{var t,n;!E&&I.callLabelOnDoubleClick&&(e.preventDefault(),e.stopPropagation(),null==$||null===(t=$.firstElementChild)||void 0===t||null===(n=t[I.callLabelOnDoubleClick])||void 0===n||n.call(t))}),[$,I,E]),[X,Y]=(0,o.useMemo)((()=>function(e,t){if(!e||!t)return[null,null];const[n,o,r,i,l]=e,[a,c]=t,s=n-a/2-3,d=o-c/2-3;let u=0,v=0;const f=a/2+3,h=c/2+3;switch(r){case"top":u=l*Math.cos(i)-h/Math.tan(i),v=l*Math.sin(i)-h;break;case"bottom":u=l*Math.cos(i)+h/Math.tan(i),v=l*Math.sin(i)+h;break;case"left":u=l*Math.cos(i)-f,v=l*Math.sin(i)-f*Math.tan(i);break;case"right":u=l*Math.cos(i)+f,v=l*Math.sin(i)+f*Math.tan(i)}return[{left:s+u,top:d+v,width:a+6,height:c+6},[u,v]]}(N,A)),[N,A]),F=(0,o.useMemo)((()=>{if(!X||!H)return null;const e=H.x+H.width,t=H.y+H.height,n=X.left+X.width,o=X.top+X.height;return[[X.left,o],[n,o],[n,X.top],[X.left,X.top],[X.left,H.y],[e,H.y],[e,t],[H.x,t],[H.x,H.y],[X.left,H.y]].map((e=>e.join(","))).join(" ")}),[H,X]);if(!z)return null;let Q,_,J,K,q;const ee=(0,v.I)(I);if(k){var te,ne,oe;const e=null===(te=I.overrides)||void 0===te?void 0:te.active;J=null!==(ne=null==e?void 0:e.strokeColor)&&void 0!==ne?ne:I.strokeColor,K=null!==(oe=null==e?void 0:e.strokeWidth)&&void 0!==oe?oe:I.strokeWidth,q=null==e?void 0:e.motion;for(const e of ee){var re,ie;"start"===e.placement?Q=null!==(re=I.$activeMarkerStartUrl)&&void 0!==re?re:I.$markerStartUrl:_=null!==(ie=I.$activeMarkerEndUrl)&&void 0!==ie?ie:I.$markerEndUrl}}else if(b){var le,ae,ce;const e=null===(le=I.overrides)||void 0===le?void 0:le.activeRelated;J=null!==(ae=null==e?void 0:e.strokeColor)&&void 0!==ae?ae:I.strokeColor,K=null!==(ce=null==e?void 0:e.strokeWidth)&&void 0!==ce?ce:I.strokeWidth,q=null==e?void 0:e.motion;for(const e of ee){var se,de;"start"===e.placement?Q=null!==(se=I.$activeRelatedMarkerStartUrl)&&void 0!==se?se:I.$markerStartUrl:_=null!==(de=I.$activeRelatedMarkerEndUrl)&&void 0!==de?de:I.$markerEndUrl}}else{J=I.strokeColor,K=I.strokeWidth;for(const e of ee)"start"===e.placement?Q=I.$markerStartUrl:_=I.$markerEndUrl}let ue,ve;if("dot"===(null===(n=q)||void 0===n?void 0:n.shape)){const e=null==q.size?2*K:q.size/2;ue=`M 0,${-e} A ${e},${e} 0,1,1 0,${e} A ${e},${e} 0,1,1 0,${-e} z`}else if("triangle"===(null===(i=q)||void 0===i?void 0:i.shape)){const e=null==q.size?2*K:q.size/2,t=e/Math.sqrt(3);ue=`M ${-t},${e} v ${2*-e} L ${2*t},0 z`}var fe,he;Z&&(ve=Z/(null!==(fe=null===(he=q)||void 0===he?void 0:he.speed)&&void 0!==fe?fe:d.Jo)+"s");const me=[null===(a=I.overrides)||void 0===a||null===(a=a.active)||void 0===a||null===(a=a.motion)||void 0===a?void 0:a.shape,null===(f=I.overrides)||void 0===f||null===(f=f.activeRelated)||void 0===f||null===(f=f.motion)||void 0===f?void 0:f.shape].some((e=>"dot"===e||"triangle"===e)),ge=F?`url(#${P})`:void 0;return r().createElement(r().Fragment,null,F&&r().createElement("defs",null,r().createElement("clipPath",{id:P},r().createElement("polygon",{points:F}))),r().createElement("g",{className:"line-group",onDoubleClick:G},r().createElement("path",{d:z,fill:"none",stroke:"transparent",strokeWidth:I.interactStrokeWidth,clipPath:ge}),r().createElement("path",{ref:B,className:l()("line",{dashed:I.dashed,dotted:I.dotted,[(I.dashed?"dashed":I.dotted?"dotted":"solid")+"-animation"]:I.animate.useAnimate}),clipPath:ge,style:{"--time":`${null!==(h=I.animate.duration)&&void 0!==h?h:d.Be}s`,"--solid-length":Z},d:z,fill:"none",stroke:J,strokeWidth:K,markerStart:Q,markerEnd:_}),!(null!==(g=I.overrides)&&void 0!==g&&g.active)&&r().createElement("path",{className:"line-active-bg",d:z,fill:"none",clipPath:ge}),me&&ve&&r().createElement("path",{className:l()("motion",{visible:!!ue}),d:ue,fill:J},r().createElement("animateMotion",{dur:ve,repeatCount:"indefinite",rotate:"auto",path:z}))),r().createElement(m,{edge:p,position:N,offset:Y,label:I.label,text:I.text,onClick:V,onRendered:O}))}function w(e){let{node:t,degraded:n,degradedNodeLabel:i,defaultNodeBricks:l,onResize:a}=e;const d=function(e){const[t,n]=(0,o.useState)(e);return(0,o.useEffect)((()=>{n((t=>(0,c.isEqual)(t,e)?t:e))}),[e]),t}({node:{id:t.id,data:t.data}}),u=t.useBrick,v=(0,o.useRef)(null),m=(0,o.useMemo)((()=>{var e;return n?null:null!=u?u:null==l||null===(e=l.find((e=>(0,f.checkIfByTransform)(e,d))))||void 0===e?void 0:e.useBrick}),[n,u,l,d]),g=(0,o.useMemo)((()=>n?String(f.__secret_internals.legacyDoTransform(d,null!=i?i:"<% DATA.node.id %>")):""),[n,i,d]),p=(0,o.useCallback)((e=>{const n=v.current;n&&(n.disconnect(),v.current=null),e?setTimeout((()=>{const n=new s.A((()=>{a(t.id,[e.offsetWidth,e.offsetHeight])}));n.observe(e),v.current=n})):a(t.id,null)}),[t.id,a]),y=(0,o.useCallback)((e=>{if(e){const n=e.getBBox();a(t.id,[n.width,n.height])}else a(t.id,null)}),[t.id,a]);return m?r().createElement("foreignObject",{width:9999,height:9999,className:"node"},m&&r().createElement(h.ReactUseBrick,{useBrick:m,data:d,refCallback:p})):n?r().createElement("g",{className:"degraded",ref:y},r().createElement("circle",{cx:8,cy:8,r:8}),r().createElement("text",{x:8,y:32},g)):null}const E=["center","top","bottom","left","right"];function k(e,t){const n={};for(const i of null!==(o=null==t||null===(r=t.split(/\s+/g))||void 0===r?void 0:r.flatMap((e=>"all"===e?E:e)))&&void 0!==o?o:[]){var o,r;let t;const l=e.x+e.width/2,a=e.y+e.height/2;switch(i){case"center":t=[l,a];break;case"top":t=[l,e.y];break;case"right":t=[e.x+e.width,a];break;case"bottom":t=[l,e.y+e.height];break;case"left":t=[e.x,a];break;default:throw new Error(`Unknown snap position: "${i}"`)}n[i]=t}return n}var b=n(8185),C=n(4197);const M=["left","center","right"],I=["top","center","bottom"];function L(e,t){var n;let{action:o,cell:r,scale:i,layout:l,layoutOptions:c,activeTarget:s,cells:u,onCellsMoving:v,onCellsMoved:f,onCellResizing:h,onCellResized:m,onSwitchActiveTarget:g,updateCurActiveEditableLine:p}=t;e.stopPropagation();const x=(0,C.Q)(r,s);if(e.shiftKey){const e=s?"multi"===(null==s?void 0:s.type)?s.targets:[s]:[];let t=[];x?t=e.filter((e=>!(0,b.c)(e,r))):(t=[...e,r],((0,a.WW)(r)||(0,a._m)(r))&&(null==p||p(r))),null==g||g(t.length>0?{type:"multi",targets:t}:null)}else"resize"!==o&&x||(null==g||g((0,y.P)(r)),((0,a.WW)(r)||(0,a._m)(r))&&(null==p||p(r)));if((0,a.WW)(r))return;const w=[],E="multi"===(null==s?void 0:s.type)&&"move"===o?u.filter((e=>(0,C.Q)(e,s))):[r];E.forEach((e=>{w.push(e),"move"===o&&(0,a.t2)(e)&&w.push(...u.filter((t=>(0,a.N)(t)&&t.containerId===e.id&&!E.includes(t))))}));const L="force"===l||"dagre"===l,S=w.filter((e=>(0,a.N)(e)&&!L||(0,a.mH)(e)));if(0===S.length)return;const z=function(e){var t,n,o;const r=e?!0===e?{grid:!0,object:!0}:e:null,i=null!=r&&r.grid?!0===r.grid?{}:r.grid:null,l=null!=r&&r.object?!0===r.object?{}:r.object:null;return{grid:i?{size:null!==(t=i.size)&&void 0!==t?t:d.gx}:null,object:l?{distance:null!==(n=l.distance)&&void 0!==n?n:d.ld,positions:null!==(o=l.positions)&&void 0!==o?o:d.o5}:null}}(null==c?void 0:c.snap),P=null===(n=z.object)||void 0===n?void 0:n.positions,N=[e.clientX,e.clientY],R=S.map((e=>({cell:e,position:"move"===o?[e.view.x,e.view.y]:[e.view.width,e.view.height],snapPositions:"move"!==o||(0,a.WW)(e)?null:k(e.view,P)}))),A=R[0].position;let T=[];if("move"===o&&z.object){const e=u.filter((e=>!(0,a.WW)(e)&&!(0,a._m)(e)&&!w.includes(e)));T=e.map((e=>({cell:e,snapPositions:k(e.view,P)})))}let H=!1;const W=(e,t)=>{const n=function(e){return[(e.clientX-N[0])/i,(e.clientY-N[1])/i]}(e),l=[...n];let c,s,d,u,g;if(H||(H=n[0]**2+n[1]**2>=9),!z.grid&&!z.object||e.altKey)c=R.map((e=>{let{position:t}=e;return[t[0]+n[0],t[1]+n[1]]}));else{let e=1/0,t=1/0;if(z.object){const o=z.object.distance;let r,i,a,c,v=0,f=0;for(const{cell:s,snapPositions:d}of T)for(const{cell:h,snapPositions:m}of R)for(const[p,y]of Object.entries(m)){const m=M.includes(p),x=I.includes(p),[w,E]=d[p],[k,b]=y;if(m){const t=Math.abs(k+n[0]-w);t<o&&t<e&&(e=t,l[0]=w-k,u=h,a=s,r=[w,E],v=b)}if(x){const e=Math.abs(b+n[1]-E);e<o&&e<t&&(t=e,l[1]=E-b,g=h,c=s,i=[w,E],f=k)}}if(a&&a===c){const e=a.view.height/2,t=a.view.width/2;s=[[r[0],r[1]-e],[r[0],r[1]+e]],d=[[i[0]-t,i[1]],[i[0]+t,i[1]]]}else r&&(s=[r,[r[0],v+l[1]]]),i&&(d=[i,[f+l[0],i[1]]])}if(z.grid){const o=z.grid.size,r=[Math.round((A[0]+n[0])/o)*o,Math.round((A[1]+n[1])/o)*o],i=[r[0]-A[0],r[1]-A[1]],a=Math.abs(i[0]-n[0]),c=Math.abs(i[1]-n[1]);a<e&&(e=a,l[0]=i[0],s=void 0,u=void 0),c<t&&(t=c,l[1]=i[1],d=void 0,g=void 0)}c=R.map((e=>{let{position:t}=e;return[t[0]+l[0],t[1]+l[1]]}))}if(H)if("move"===o){var p;const e=R.map(((e,n)=>{var o;let{cell:r}=e;return{type:r.type,id:r.id,x:c[n][0],y:c[n][1],width:r.view.width,height:r.view.height,decorator:(0,a.mH)(r)?r.decorator:void 0,guideLines:t?void 0:[...u===r?[s]:[],...g===r?[d]:[]],...(0,a._m)(r)?{source:{x:r.view.source.x+l[0],y:r.view.source.y+l[1]},target:{x:r.view.target.x+l[0],y:r.view.target.y+l[1]},vertices:null===(o=r.view.vertices)||void 0===o?void 0:o.map((e=>({x:e.x+l[0],y:e.y+l[1]})))}:null}}));null===(p=t?f:v)||void 0===p||p(e)}else{var y;null===(y=t?m:h)||void 0===y||y({type:r.type,id:r.id,width:c[0][0],height:c[0][1]})}},D=e=>{W(e)},Z=e=>{W(e,!0),H=!1,document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",Z)};document.addEventListener("mousemove",D),document.addEventListener("mouseup",Z)}function S(e){const t=document.createRange();t.selectNodeContents(e);const n=window.getSelection();n.removeAllRanges(),n.addRange(t)}var z=n(9068);const P=new Map([["container",function(e){let{cell:t,transform:n,readOnly:i,layout:s,view:d,activeTarget:u,cells:v,onCellResizing:f,onCellResized:h,onSwitchActiveTarget:m,onDecoratorTextEditing:g,onDecoratorTextChange:p}=e;const y=(0,c.get)(t.view,"text",""),x=(0,c.get)(t.view,"direction","top"),w=(0,o.useRef)(null),E=r().useRef(null),[k,b]=(0,o.useState)(!1),[C,M]=(0,o.useState)(y),[I,P]=(0,o.useState)(!1),[N,R]=(0,o.useState)(),[A,T]=(0,o.useState)({x:0,y:0,width:t.view.width,height:t.view.height}),H=(0,o.useCallback)((e=>{i||(e.preventDefault(),e.stopPropagation(),b(!0))}),[i]),W=(0,o.useCallback)((e=>{i||M(e.target.textContent)}),[i]),D=(0,o.useCallback)((()=>{i||(b(!1),P(!0),R((0,z.uuidV4)()))}),[i]);return(0,o.useEffect)((()=>{M(y)}),[y]),(0,o.useEffect)((()=>{const e=w.current;e&&e.textContent!==C&&(e.textContent=C)}),[C]),(0,o.useEffect)((()=>{var e;const t=null===(e=w.current)||void 0===e?void 0:e.parentElement;if(t){const{clientWidth:e,clientHeight:n}=t;if(["left","right"].includes(x)){const t={width:e,height:d.height,x:"left"===x?-e:d.width,y:0};T(t)}else{const e={width:d.width,height:n,x:0,y:"top"===x?-n:d.height};T(e)}}}),[d,C,x,N]),(0,o.useEffect)((()=>{k&&w.current&&(w.current.focus(),S(w.current)),null==g||g({id:t.id,editing:k})}),[t.id,k,g]),(0,o.useEffect)((()=>{I&&(null==p||p({id:t.id,view:{...d,text:C}}),P(!1))}),[t,d,C,p,I]),(0,o.useEffect)((()=>{const e=E.current;if(!e||i)return;const o=e=>{L(e,{action:"resize",cell:t,scale:n.k,activeTarget:u,cells:v,onCellResizing:f,onCellResized:h,onSwitchActiveTarget:m})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[u,t,v,h,f,m,i,n.k]),r().createElement("g",{className:"decorator-container"},r().createElement("foreignObject",A,r().createElement("div",{className:l()("text-container",{editing:k,[["left","right"].includes(x)?"vertical":"horizontal"]:!0}),onDoubleClick:H},r().createElement("div",{className:"text",contentEditable:k,ref:w,onInput:W,onBlur:D}))),r().createElement("rect",{width:d.width,height:d.height,className:"container"}),!i&&!(0,a.OD)(s)&&r().createElement("g",{ref:E,className:"resize-handle",transform:`translate(${d.width-20} ${d.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})))}],["area",function(e){let{cell:t,transform:n,readOnly:i,layoutOptions:l,activeTarget:a,cells:c,onCellResizing:s,onCellResized:d,onSwitchActiveTarget:u}=e;const v=r().useRef(null);return(0,o.useEffect)((()=>{const e=v.current;if(!e||i)return;const o=e=>{L(e,{action:"resize",cell:t,scale:n.k,layoutOptions:l,activeTarget:a,cells:c,onCellResizing:s,onCellResized:d,onSwitchActiveTarget:u})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[a,t,c,l,d,s,u,i,n.k]),r().createElement("g",{className:"decorator-area"},r().createElement("rect",{width:t.view.width,height:t.view.height,className:"area"}),!i&&r().createElement("g",{ref:v,className:"resize-handle",transform:`translate(${t.view.width-20} ${t.view.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})))}],["text",function(e){var t;let{cell:n,readOnly:i,onDecoratorTextEditing:a,onDecoratorTextChange:c}=e;const s=null!==(t=n.view.text)&&void 0!==t?t:"",[d,u]=(0,o.useState)(s),[v,f]=(0,o.useState)(!1),h=(0,o.useRef)(!1),[m,g]=(0,o.useState)(!1),p=(0,o.useRef)(null),y=(0,o.useCallback)((e=>{i||(e.preventDefault(),e.stopPropagation(),f(!0))}),[i]);(0,o.useEffect)((()=>{const e=p.current;e&&e.textContent!==d&&(e.textContent=d)}),[d]),(0,o.useEffect)((()=>{var e;const t=null===(e=p.current)||void 0===e?void 0:e.parentElement;t&&(n.view.width=t.clientWidth,n.view.height=t.clientHeight)}),[d,n.id]),(0,o.useEffect)((()=>{v&&p.current&&(p.current.focus(),S(p.current)),null==a||a({id:n.id,editing:v})}),[n.id,v,a]),(0,o.useEffect)((()=>{h.current?null==a||a({id:n.id,editing:v}):h.current=!0}),[n.id,v,a]);const x=(0,o.useCallback)((e=>{i||u(e.target.textContent)}),[i]),w=(0,o.useCallback)((()=>{i||(f(!1),g(!0))}),[i]);return(0,o.useEffect)((()=>{m&&(null==c||c({id:n.id,view:{...n.view,text:d}}),g(!1))}),[n,d,c,m]),r().createElement("foreignObject",{className:"decorator-text"},r().createElement("div",{className:l()("text-container",{editing:v}),onDoubleClick:y},r().createElement("div",{className:"text",contentEditable:v,ref:p,onInput:x,onBlur:w})))}],["rect",function(e){let{cell:t,transform:n,readOnly:i,layout:l,view:c,activeTarget:s,cells:d,onCellResizing:u,onCellResized:v,onSwitchActiveTarget:f}=e;const h=r().useRef(null);return(0,o.useEffect)((()=>{const e=h.current;if(!e||i)return;const o=e=>{L(e,{action:"resize",cell:t,scale:n.k,layout:l,activeTarget:s,cells:d,onCellResizing:u,onCellResized:v,onSwitchActiveTarget:f})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[s,t,d,v,u,f,i,n.k,l]),r().createElement("g",{className:"decorator-rect-container"},r().createElement("rect",{width:c.width,height:c.height,className:"rect-container"}),!i&&!(0,a.OD)(l)&&r().createElement("g",{ref:h,className:"resize-handle",transform:`translate(${c.width-20} ${c.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})))}],["line",function(e){var t;let{cell:n,active:i,lineConfMap:a,editableLineMap:c}=e;const s=a.get(n),{points:d,jumpsMap:f}=null!==(t=c.get(n))&&void 0!==t?t:{},h=(0,o.useMemo)((()=>(0,u.S)(d,"curve"===s.type?s.curveType:"curveLinear",0,1,f)),[s,d,f]),m=(0,o.useRef)(null),g=(0,o.useCallback)((e=>{if(m.current=e,e){const t=e.getBBox();n.view={...n.view,x:t.x,y:t.y,width:t.width,height:t.height}}}),[n]);if(!h)return null;let p,y,x,w;const E=(0,v.I)(s);if(i){var k,b,C;const e=null===(k=s.overrides)||void 0===k?void 0:k.active;x=null!==(b=null==e?void 0:e.strokeColor)&&void 0!==b?b:s.strokeColor,w=null!==(C=null==e?void 0:e.strokeWidth)&&void 0!==C?C:s.strokeWidth;for(const e of E){var M,I;"start"===e.placement?p=null!==(M=s.$activeMarkerStartUrl)&&void 0!==M?M:s.$markerStartUrl:y=null!==(I=s.$activeMarkerEndUrl)&&void 0!==I?I:s.$markerEndUrl}}else{x=s.strokeColor,w=s.strokeWidth;for(const e of E)"start"===e.placement?p=s.$markerStartUrl:y=s.$markerEndUrl}return r().createElement("g",{className:"decorator-line"},r().createElement("path",{d:h,fill:"none",stroke:"transparent",strokeWidth:s.interactStrokeWidth}),r().createElement("path",{className:l()("line",{dashed:s.dashed,dotted:s.dotted}),ref:g,d:h,fill:"none",stroke:x,strokeWidth:w,markerStart:p,markerEnd:y}))}]]);function N(e){let{cell:t,view:n,transform:o,readOnly:i,layout:l,layoutOptions:a,active:c,activeTarget:s,cells:d,lineConfMap:u,editableLineMap:v,onCellResizing:f,onCellResized:h,onSwitchActiveTarget:m,onDecoratorTextEditing:g,onDecoratorTextChange:p}=e;const y=P.get(t.decorator);return y?r().createElement(y,{cell:t,view:n,transform:o,readOnly:i,layout:l,layoutOptions:a,active:c,activeTarget:s,cells:d,lineConfMap:u,editableLineMap:v,onCellResizing:f,onCellResized:h,onSwitchActiveTarget:m,onDecoratorTextEditing:g,onDecoratorTextChange:p}):(console.error(`Unknown decorator: ${t.decorator}`),null)}function R(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;return e.forEach((e=>{const{x:i,y:l,width:a,height:c}=e.view;i<t&&(t=i),l<n&&(n=l),i+a>o&&(o=i+a),l+c>r&&(r=l+c)})),[t,o,n,r].some((e=>isFinite(e)))?{x:t-20,y:n-20,width:o-t+40,height:r-n+40}:{}}var A=n(9978);function T(e){let{layout:t,layoutOptions:n,cell:i,cells:s,degraded:d,degradedNodeLabel:u,defaultNodeBricks:v,lineConfMap:f,editableLineMap:h,activeTarget:m,dragNodeToContainerActive:g,readOnly:p,transform:E,hoverCell:k,unrelatedCells:M,allowEdgeToArea:I,curActiveEditableLine:S,updateCurActiveEditableLine:z,onCellsMoving:P,onCellsMoved:T,onCellResizing:H,onCellResized:W,onSwitchActiveTarget:D,onCellContextMenu:Z,onCellClick:j,onDecoratorTextEditing:B,onDecoratorTextChange:$,onNodeBrickResize:U,onCellMouseEnter:O,onCellMouseLeave:V}=e;const{lineEditorState:G,smartConnectLineState:X,setSmartConnectLineState:Y,onConnect:F,setLineEditorState:Q,onChangeEdgeView:_}=(0,A.s)(),J=(0,o.useRef)(null),K=(0,o.useMemo)((()=>M.some((e=>(0,b.c)(e,i)))),[i,M]),q=(0,o.useMemo)((()=>{if((0,a.t2)(i)&&(0,a.OD)(t)){const e=s.filter((e=>(0,a.N)(e)&&e.containerId===i.id)),t={...i.view,...R(e)};return i.view=t,t}return(0,a.WW)(i)||(0,a._m)(i)?void 0:(0,c.get)(i,"view",{x:0,y:0,width:0,height:0})}),[t,i,s]);(0,o.useEffect)((()=>{const e=J.current;if(!e)return;const o=e=>{p||(0,a.t2)(i)&&(0,a.OD)(t)?e.stopPropagation():L(e,{layout:t,layoutOptions:n,action:"move",cell:i,scale:E.k,activeTarget:m,cells:s,onCellsMoving:P,onCellsMoved:T,onSwitchActiveTarget:D,updateCurActiveEditableLine:z})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[t,n,i,m,s,T,P,D,z,p,E.k]),(0,o.useEffect)((()=>{const e=J.current;if(!e||!(0,a.bo)(i,I)||!(X||G&&"control"!==G.type))return;const t=e=>{if(!S||!G||"decorator"!==S.type)if(e.preventDefault(),e.stopPropagation(),X)X.source!==i&&(null==F||F(X.source,i,X.exitPosition,void 0)),Y(null);else if(S&&G){const{type:e}=G,{source:t,target:n}=h.get(S),{view:o}=S,r="entry"===e;(r?n:t)===i&&(r?null==_||_(t,n,{...o,entryPosition:null}):null==_||_(t,n,{...o,exitPosition:null})),Q(null)}};return e.addEventListener("mouseup",t),()=>{e.removeEventListener("mouseup",t)}}),[S,h,I,i,G,_,F,Q,Y,X,z]);const ee=(0,o.useCallback)((e=>{p&&"decorator"===i.type||(e.preventDefault(),D((0,y.P)(i)),Z({cell:i,clientX:e.clientX,clientY:e.clientY}))}),[i,Z,D,p]),te=(0,o.useCallback)((e=>{j&&"decorator"!==i.type&&j({cell:i,clientX:e.clientX,clientY:e.clientY})}),[i,j]),ne=(0,o.useCallback)((()=>{null==O||O(i)}),[i,O]),oe=(0,o.useCallback)((()=>{null==V||V(i)}),[i,V]),re=(0,C.Q)(i,m);return r().createElement("g",{className:l()("cell",{active:re,faded:K,"read-only":p,"container-active":g}),ref:J,transform:(0,a.WW)(i)||(0,a._m)(i)||null==i.view.x?void 0:`translate(${q.x} ${q.y})`,onContextMenu:ee,onClick:te,onMouseEnter:ne,onMouseLeave:oe},(0,a.N)(i)?r().createElement(w,{node:i,degraded:d,degradedNodeLabel:u,defaultNodeBricks:v,onResize:U}):(0,a.WW)(i)?r().createElement(x,{edge:i,active:p?k===i:re,activeRelated:!!(p?k:m)&&!K,lineConfMap:f,editableLineMap:h,readOnly:p,onSwitchActiveTarget:D}):(0,a.mH)(i)?r().createElement(N,{cell:i,view:q,transform:E,readOnly:p,layout:t,layoutOptions:n,active:re,activeTarget:m,cells:s,lineConfMap:f,editableLineMap:h,onCellResizing:H,onCellResized:W,onSwitchActiveTarget:D,onDecoratorTextEditing:B,onDecoratorTextChange:$}):null)}},3639:(e,t,n)=>{n.d(t,{w:()=>a});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i);function a(e){let{connectLineState:t,transform:n,markerEnd:i,onConnect:a}=e;const[c,s]=(0,o.useState)(null);return(0,o.useEffect)((()=>{t&&s(t.from)}),[t]),(0,o.useEffect)((()=>{if(t){const e=e=>[(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k],o=t=>{s(e(t))},r=e=>{e.stopPropagation()},i=n=>{n.stopPropagation(),l(),a(t,e(n))},l=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mousedown",r,{capture:!0}),document.removeEventListener("click",i,{capture:!0}),s(null)};return document.addEventListener("mousemove",o),document.addEventListener("mousedown",r,{capture:!0}),document.addEventListener("click",i,{capture:!0}),l}}),[t,a,n]),r().createElement("path",{className:l()("connect-line",{connecting:!!t&&c&&(c[0]-t.from[0])**2+(c[1]-t.from[1])**2>25}),d:t&&c?`M${t.from.join(" ")}L${c.join(" ")}`:"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:`url(#${i})`})}},1825:(e,t,n)=>{n.d(t,{W:()=>m});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i),a=n(8653),c=n(9978),s=n(1030),d=n(967),u=n(531);function v(e,t,n,o){const{control:r}=t,{points:i}=n.get(e),l=[],[a,c]=o,s=i[0],u=i[i.length-1];0===r.index&&l.push("ns"===r.direction?{x:s.x,y:c}:{x:a,y:s.y});for(let e=1;e<i.length-1;e++){const t=i[e];l.push(e===r.index||e===r.index+1?"ns"===r.direction?{x:t.x,y:c}:{x:a,y:t.y}:t)}return r.index===i.length-2&&l.push("ns"===r.direction?{x:u.x,y:c}:{x:a,y:u.y}),(0,d.P)(s,l,u)}var f=n(7531);const h=["control","corner","break"];function m(e){let{cells:t,editableLineMap:n,transform:i,options:m,activeEditableLine:g}=e;const[p,y]=(0,o.useState)(null),{hoverState:x,lineEditorState:w,setLineEditorState:E,onChangeEdgeView:k,onChangeDecoratorView:b}=(0,c.s)(),C=(0,o.useRef)(!1);(0,o.useEffect)((()=>{w||setTimeout((()=>{C.current=!1}),0)}),[w]),(0,o.useEffect)((()=>{if(!g||!w)return;C.current=!1;const{type:e,offset:o,from:r}=w,l=l=>{const a={x:(l.clientX-i.x-o[0])/i.k,y:(l.clientY-i.y-o[1])/i.k},c=n.get(g).points,s={x:1/0,y:1/0};let d,v;const f=()=>{if(!C.current){const e=(l.clientX-r[0])/i.k,t=(l.clientY-r[1])/i.k;C.current=e**2+t**2>=9}return[a.x,a.y]};if(h.includes(e)&&!l.altKey){const t=w.control;v="control"===e?["ns"===t.direction?"y":"x"]:["x","y"],d=c.filter(((n,o)=>0===o||o===c.length-1||("control"===e?o!==t.index&&o!==t.index+1:"corner"!==e||o!==t.index+1)))}else{if(!(0,u._m)(g)||"exit"!==e&&"entry"!==e||l.altKey)return f();{const t="exit"===e?c[0]:c[c.length-1];d=c.filter((e=>e!==t)),v=["x","y"]}}for(const e of t){if(!(0,u.WW)(e)&&!(0,u._m)(e)||e===g)continue;const t=n.get(e);t&&d.push(...t.points.slice(1,-1))}for(const e of d)for(const t of v){const n=Math.abs(e[t]-a[t]);n<=5&&n<s[t]&&(a[t]=e[t],s[t]=n)}return f()},a=e=>{const t=l(e);C.current&&y(t)};function c(e){if(e.preventDefault(),s(),!C.current)return;const t=l(e),o=(0,u.WW)(g);if("control"!==(null==w?void 0:w.type)){if(!o)switch(null==w?void 0:w.type){case"entry":case"exit":null==b||b(g,{...g.view,["entry"===w.type?"target":"source"]:{x:t[0],y:t[1]}});break;case"corner":null==b||b(g,{...g.view,vertices:g.view.vertices.map(((e,n)=>n===w.control.index?{x:t[0],y:t[1]}:e))});break;case"break":{var r;const e=[...null!==(r=g.view.vertices)&&void 0!==r?r:[]];e.splice(w.control.index,0,{x:t[0],y:t[1]}),null==b||b(g,{...g.view,vertices:e});break}}}else if(o){const e=n.get(g),{source:o,target:r}=e;null==k||k(o,r,{...g.view,vertices:v(g,w,n,t)})}else null==b||b(g,{...g.view,vertices:v(g,w,n,t)})}function s(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",c),y(null),E(null)}return document.addEventListener("mousemove",a),document.addEventListener("mouseup",c),s}),[g,n,w,i,E,k,t,b]),(0,o.useEffect)((()=>{if(!g)return;const e=e=>{C.current&&(e.stopPropagation(),e.preventDefault())};return document.body.addEventListener("click",e),()=>{document.body.removeEventListener("click",e)}}),[g]);const M=(0,o.useMemo)((()=>{const e=function(e,t,n,o,r){if(!e||!t||!(o||"control"!==t.type&&void 0!==(null==r?void 0:r.activePointIndex)))return null;const{type:i}=t,l=n.get(e);let a,c;const f=e.type;if((0,u.om)(l))a=l.source.view,c=l.target.view;else{const e=l.decorator.view;a={...e.source,width:0,height:0},c={...e.target,width:0,height:0}}const h=e.view,{exitPosition:m,entryPosition:g,vertices:p}=null!=h?h:{},y=(0,s.pick)(h,["type","curveType"]);if("control"===i){const r=v(e,t,n,o);return(0,d.V)(a,c,{...y,exitPosition:m,entryPosition:g,vertices:r},0,f)}if("corner"===i){const e=[...p];return e.splice(t.control.index,1,{x:o[0],y:o[1]}),(0,d.V)(a,c,{...y,exitPosition:m,entryPosition:g,vertices:e},0,f)}if("break"===i){const e=[...null!=p?p:[]];return e.splice(t.control.index,0,{x:o[0],y:o[1]}),(0,d.V)(a,c,{...y,exitPosition:m,entryPosition:g,vertices:e},0,f)}if("edge"===f&&void 0!==(null==r?void 0:r.activePointIndex)){const e=r.relativePoints[r.activePointIndex];return(0,d.V)(a,c,{...y,..."entry"===i?{exitPosition:m,entryPosition:e}:{exitPosition:e,entryPosition:g},vertices:p},0,f)}const[x,w]=o;return"entry"===i?(0,d.V)(a,{x,y:w,width:0,height:0},{...y,exitPosition:m,vertices:p},0,f):(0,d.V)({x,y:w,width:0,height:0},c,{...y,entryPosition:g,vertices:p},0,f)}(g,w,n,p,x),t=null==g?void 0:g.view;return(0,a.S)(e,"curve"===(null==t?void 0:t.type)?t.curveType:"curveLinear",0,1)}),[p,x,g,w,n]);let I,L;const S=(0,f.I)(m);for(const e of S)"start"===e.placement?I=m.$editingStartMarkerUrl:L=m.$editingEndMarkerUrl;return r().createElement("path",{className:l()("editing-line",{editing:!(!w||!p)}),d:M,fill:"none",stroke:m.editingStrokeColor,markerStart:I,markerEnd:L})}},9978:(e,t,n)=>{n.d(t,{H:()=>i,s:()=>l});var o=n(8769),r=n.n(o);const i=r().createContext({rootRef:{current:null},smartConnectLineState:null,unsetHoverStateTimeoutRef:{current:null},hoverState:null,activeEditableLines:[],lineEditorState:null,setLineEditorState:()=>{},setHoverState:()=>{},setSmartConnectLineState:()=>{}});function l(){return r().useContext(i)}},2722:(e,t,n)=>{n.d(t,{T:()=>f});var o=n(8769),r=n.n(o),i=n(9978),l=n(4197),a=n(3033),c=n(531);const s="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSI1cHgiIGhlaWdodD0iNXB4IiB2ZXJzaW9uPSIxLjEiPjxwYXRoIGQ9Im0gMCAwIEwgNSA1IE0gMCA1IEwgNSAwIiBzdHJva2Utd2lkdGg9IjIiIHN0eWxlPSJzdHJva2Utb3BhY2l0eTowLjQiIHN0cm9rZT0iI2ZmZmZmZiIvPjxwYXRoIGQ9Im0gMCAwIEwgNSA1IE0gMCA1IEwgNSAwIiBzdHJva2U9IiMyOWI2ZjIiLz48L3N2Zz4=",d=5,u=8,v=d/2;function f(e){let{activeTarget:t,editableLineMap:n,scale:s,activeEditableLine:d,disabled:v}=e;const{unsetHoverStateTimeoutRef:f,hoverState:m,setHoverState:g,smartConnectLineState:p,lineEditorState:y}=(0,i.s)(),x=(0,o.useCallback)((()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)}),[f]),w=(0,o.useCallback)((()=>{x(),g((e=>void 0===(null==e?void 0:e.activePointIndex)?e:{...m,activePointIndex:void 0}))}),[m,g,x]),E=(0,o.useCallback)((()=>{f.current=setTimeout((()=>{g(null)}))}),[g,f]);let k,b,C;const M=!v&&m&&(!!p||(d&&y?(C=n.get(d))&&!!(0,c.om)(C)&&(({source:k,target:b}=C),"entry"===y.type?m.cell===b:"exit"===y.type&&m.cell===k):!(0,l.Q)(m.cell,t)&&!function(e){return e&&("edge"===e.type||"multi"===e.type&&e.targets.some((e=>"edge"===e.type)))}(t))),I=a.XK,L=I/2;return r().createElement("g",{onMouseEnter:w,onMouseLeave:E},M&&r().createElement(r().Fragment,null,r().createElement("rect",{x:m.cell.view.x-L,y:m.cell.view.y-L,width:m.cell.view.width+I,height:m.cell.view.height+I,fill:"none",stroke:"transparent",strokeWidth:2*u/s,pointerEvents:"stroke"}),void 0!==m.activePointIndex&&r().createElement("circle",{cx:m.points[m.activePointIndex].x,cy:m.points[m.activePointIndex].y,r:u/s,fill:"lightgreen",fillOpacity:.5,pointerEvents:"none"}),m.points.map(((e,t)=>r().createElement(h,{key:t,editableLineMap:n,index:t,point:e,scale:s,activeEditableLine:d,unsetActivePointIndex:w,unsetTimeout:x})))))}function h(e){let{editableLineMap:t,index:n,point:l,scale:a,activeEditableLine:c,unsetTimeout:f,unsetActivePointIndex:h}=e;const{rootRef:m,smartConnectLineState:g,hoverState:p,setHoverState:y,setSmartConnectLineState:x,onConnect:w,lineEditorState:E,setLineEditorState:k,onChangeEdgeView:b}=(0,i.s)(),C=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const e=C.current,t=o=>{"mousemove"===o.type&&(null==e||e.removeEventListener(o.type,t)),f(),y((e=>e&&e.activePointIndex!==n?{...p,activePointIndex:n}:e))};return null==e||e.addEventListener("mouseenter",t),null==e||e.addEventListener("mousemove",t),()=>{null==e||e.removeEventListener("mouseenter",t),null==e||e.removeEventListener("mousemove",t)}}),[p,n,y,f]),(0,o.useEffect)((()=>{if(E)return;const e=e=>{e.preventDefault(),e.stopPropagation();const t=m.current.getBoundingClientRect(),o=p.points[n];x({source:p.cell,from:[o.x,o.y],offset:[t.left,t.top],exitPosition:p.relativePoints[n]})},t=C.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[p,n,E,m,x]),(0,o.useEffect)((()=>{const e=e=>{if(!c||!E||"decorator"!==c.type)if(e.preventDefault(),e.stopPropagation(),g)g.source!==(null==p?void 0:p.cell)&&(null==w||w(g.source,p.cell,g.exitPosition,p.relativePoints[p.activePointIndex])),x(null);else if(c&&E){const e=p.relativePoints[p.activePointIndex],{type:n}=E,{source:o,target:r}=t.get(c),{view:i}=c;"entry"===n?null==b||b(o,r,{...i,entryPosition:e}):null==b||b(o,r,{...i,exitPosition:e}),k(null)}},n=C.current;return null==n||n.addEventListener("mouseup",e),()=>{null==n||n.removeEventListener("mouseup",e)}}),[g,p,w,x,c,E,t,b,k]),r().createElement("g",{ref:C,onMouseLeave:h},r().createElement("circle",{cx:l.x,cy:l.y,r:u,fill:"transparent"}),r().createElement("image",{x:l.x-v/a,y:l.y-v/a,width:d/a,height:d/a,xlinkHref:s,preserveAspectRatio:"none"}))}},2202:(e,t,n)=>{n.d(t,{F:()=>f});var o=n(9575),r=n(8769),i=n.n(r),l=n(9978),a=n(531);const c="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbm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IiBmaWxsPSIjMDFiZDIyIi8+PHBhdGggZD0ibSA4IDggTCAxNCAxNE0gOCAxNCBMIDE0IDgiIHN0cm9rZT0iI2ZmZiIvPjwvc3ZnPg==",u="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiIHZlcnNpb249IjEuMSI+PGNpcmNsZSBjeD0iOSIgY3k9IjkiIHI9IjUiIHN0cm9rZT0iI2ZmZiIgZmlsbD0iIzI5YjZmMiIvPjwvc3ZnPg==",v=22;function f(e){let{scale:t,editableLineMap:n,activeEditableLine:f,updateCurActiveEditableLine:h}=e;const{rootRef:m,movingCells:g,lineEditorState:p,setLineEditorState:y}=(0,l.s)(),x=(0,r.useRef)(null),w=(0,r.useRef)(null),E=(0,r.useRef)([]),k=(0,a._m)(f);(0,r.useEffect)((()=>{const e=x.current,t=w.current;if(!e||!t||!f)return;const n=e=>t=>{t.stopPropagation(),t.preventDefault();const n=m.current.getBoundingClientRect();y({offset:[n.left,n.top],from:[t.clientX,t.clientY],type:e}),null==h||h(f)},o=n("exit"),r=n("entry");return e.addEventListener("mousedown",o),t.addEventListener("mousedown",r),()=>{e.removeEventListener("mousedown",o),t.removeEventListener("mousedown",r)}}),[f,m,y,h]);const b=(0,r.useMemo)((()=>{var e;if(!f)return[];const t=n.get(f).points;return(0,a.jw)(null===(e=f.view)||void 0===e?void 0:e.type)?k?function(e){const t=[];let n=e[0],o=1;for(;o<e.length;){const r=e[o];t.push({type:"break",index:o-1,x:(n.x+r.x)/2,y:(n.y+r.y)/2}),o<e.length-1&&t.push({...r,type:"corner",index:o-1}),n=r,o++}return t}(t):[]:function(e){const t=[];let n=e[0],o=1;for(;o<e.length;){const r=e[o],i=n.y===r.y,l=n.x===r.x;if(!i||!l){const e=i?"ns":"ew";t.push({type:"control",direction:e,index:o-1,x:(n.x+r.x)/2,y:(n.y+r.y)/2})}n=r,o++}return t}(t)}),[f,n,k]);(0,r.useEffect)((()=>{if(!f)return;const e=E.current,t=b.map((e=>(e=>t=>{t.stopPropagation(),t.preventDefault(),null==h||h(f);const n=m.current.getBoundingClientRect();y({offset:[n.left,n.top],from:[t.clientX,t.clientY],type:e.type,control:e})})(e)));return e.forEach(((e,n)=>{null==e||e.addEventListener("mousedown",t[n])})),()=>{e.forEach(((e,n)=>{null==e||e.removeEventListener("mousedown",t[n])}))}}),[f,b,m,y,h]);const C=(0,r.useRef)(null);if((0,r.useEffect)((()=>{const e=C.current,t=e=>{e.stopPropagation(),e.preventDefault()};return null==e||e.addEventListener("click",t),()=>{null==e||e.removeEventListener("click",t)}}),[]),g)return null;const M=f.view,I=n.get(f).points,{exitPosition:L,entryPosition:S}=null!=M?M:{},z={width:v/t,height:v/t,preserveAspectRatio:"none",cursor:"pointer",pointerEvents:"fill"},P=I[0],N=I[I.length-1],R=v/t/2;return i().createElement("g",{ref:C},i().createElement("image",(0,o.A)({ref:x},z,{x:P.x-R,y:P.y-R,xlinkHref:k?u:L?d:c})),b.map(((e,t)=>i().createElement("image",(0,o.A)({key:t,ref:e=>{E.current[t]=e}},z,{x:e.x-R,y:e.y-R,opacity:"break"!==e.type||"break"===(null==p?void 0:p.type)&&p.control===e?1:.4,xlinkHref:u,cursor:k?"crosshair":"ns"===e.direction?"row-resize":"col-resize"})))),i().createElement("image",(0,o.A)({ref:w},z,{x:N.x-R,y:N.y-R,xlinkHref:k?s:S?d:c})))}},1103:(e,t,n)=>{n.d(t,{X:()=>u});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i),a=n(8653),c=n(9978),s=n(967),d=n(7531);function u(e){let{transform:t,lineSettings:n,options:i}=e;const[u,v]=(0,o.useState)(null),{hoverState:f,smartConnectLineState:h,setSmartConnectLineState:m}=(0,c.s)();(0,o.useEffect)((()=>{if(h)return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),o;function e(e){v([(e.clientX-t.x-h.offset[0])/t.k,(e.clientY-t.y-h.offset[1])/t.k])}function n(e){e.preventDefault(),o()}function o(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n),v(null),m(null)}}),[m,h,t]);const g=(0,o.useMemo)((()=>{const e=function(e,t,n,o){if(!e||!t&&void 0===(null==n?void 0:n.activePointIndex))return null;const r=e.source.view;if(void 0!==(null==n?void 0:n.activePointIndex))return(0,s.V)(r,n.cell.view,{...o,exitPosition:e.exitPosition,entryPosition:n.relativePoints[n.activePointIndex]});const[i,l]=t;return(0,s.V)(r,{x:i,y:l,width:0,height:0},{...o,exitPosition:e.exitPosition})}(h,u,f,n);return(0,a.S)(e,"curve"===(null==n?void 0:n.type)?n.curveType:"curveLinear",0,1)}),[u,f,h,n]);let p,y;const x=(0,d.I)(i);for(const e of x)"start"===e.placement?p=i.$markerStartUrl:y=i.$markerEndUrl;return r().createElement("path",{className:l()("connect-line",{connecting:!(!h||!u)}),d:g,fill:"none",stroke:i.strokeColor,strokeWidth:i.strokeWidth,markerStart:p,markerEnd:y})}},3033:(e,t,n)=>{n.d(t,{Be:()=>y,CE:()=>h,CV:()=>o,D9:()=>a,Dm:()=>l,HP:()=>i,Ie:()=>m,Jo:()=>M,N8:()=>c,Ub:()=>p,VO:()=>f,XK:()=>C,XV:()=>g,Yt:()=>u,gx:()=>w,ld:()=>E,mF:()=>v,o5:()=>k,p6:()=>b,pC:()=>x,sS:()=>d,w1:()=>s,xc:()=>r});const o=Symbol.for("size-initialized"),r=Symbol.for("layout-initialized"),i=20,l=36,a=50,c=180,s=120,d=.5,u=2,v="gray",f=1,h="rgba(73, 126, 255, 0.7)",m=15,g=!1,p=!0,y=1,x=500,w=10,E=5,k="all",b=5,C=0,M=50},531:(e,t,n)=>{function o(e){return"node"===e.type}function r(e){return"decorator"===e.type}function i(e){return"node"===e.type}function l(e){return"edge"===e.type}function a(e){return"node"===e.type||"edge"===e.type}function c(e){return"node"===e.type||"decorator"===e.type&&"area"===e.decorator}function s(e,t){return"node"===e.type||!!t&&"decorator"===e.type&&"area"===e.decorator}function d(e){return"decorator"===e.type&&"container"===e.decorator}function u(e){return"decorator"===e.type&&"line"===e.decorator}function v(e){return!["manual",void 0].includes(e)}function f(e){return!("polyline"===e||"curve"===e)}function h(e){return!!e.edge}n.d(t,{N:()=>o,OD:()=>v,WW:()=>l,_m:()=>u,bo:()=>s,jw:()=>f,mH:()=>r,nv:()=>a,o6:()=>c,om:()=>h,t2:()=>d,vC:()=>i})},9386:(e,t,n)=>{n.d(t,{P:()=>r});var o=n(1030);function r(e){return"edge"===e.type?(0,o.pick)(e,["type","source","target","data"]):(0,o.pick)(e,["type","id","data"])}},227:(e,t,n)=>{n.d(t,{Y:()=>r});var o=n(4197);function r(e,t,n,r){const i=[];if(t){const n=new Set;for(const o of e)"edge"===o.type&&o.source===t.source.id&&n.add(o.target);for(const t of e)switch(t.type){case"node":n.has(t.id)&&i.push(t);break;case"decorator":r&&"text"!=t.decorator&&!n.has(t.id)||i.push(t);break;default:i.push(t)}}else switch(null==n?void 0:n.type){case"multi":{const t=new Map,r=new Set,l=new Set;for(const e of n.targets)"node"===e.type&&(r.add(e.id),l.add(e.id));for(const a of e)"node"===a.type?t.set(a.id,a):"edge"===a.type?r.has(a.source)?l.add(a.target):r.has(a.target)?l.add(a.source):(0,o.Q)(a,n)||i.push(a):(0,o.Q)(a,n)||i.push(a);for(const[e,n]of t)l.has(e)||i.push(n);break}case"node":{const t=new Map,o=new Set([n.id]);for(const r of e)"node"===r.type?t.set(r.id,r):"edge"===r.type?r.source===n.id?o.add(r.target):r.target===n.id?o.add(r.source):i.push(r):i.push(r);for(const[e,n]of t)o.has(e)||i.push(n);break}case"edge":for(const t of e)("edge"===t.type?(0,o.Q)(t,n):"node"===t.type&&(t.id===n.source||t.id===n.target))||i.push(t)}return i}},2733:(e,t,n)=>{n.d(t,{a:()=>r});var o=n(4197);function r(e,t){let{cells:n,activeTarget:r}=t;const i=n.filter((e=>(0,o.Q)(e,r)));if(0!==i.length)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cells",cells:i}}}},2219:(e,t,n)=>{function o(e,t){let{transform:n,offset:o,onLassoing:r,onLassoed:i}=t;if(e.ctrlKey||e.button)return;e.stopPropagation();const l=[e.clientX,e.clientY],a=(e.clientX-o[0]-n.x)/n.k,c=(e.clientY-o[1]-n.y)/n.k;let s=!1;const d=(e,t)=>{const o=function(e){return[(e.clientX-l[0])/n.k,(e.clientY-l[1])/n.k]}(e);if(s||(s=o[0]**2+o[1]**2>=9),s){let[e,n]=o,l=a,s=c;e<0&&(l=a+e,e=-e),n<0&&(s=c+n,n=-n),(t?i:r)({x:l,y:s,width:e,height:n})}},u=e=>{d(e)},v=e=>{d(e,!0),s=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",v)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",v)}n.d(t,{F:()=>o})},1991:(e,t,n)=>{n.d(t,{_:()=>r});var o=n(531);function r(e,t,n){const r=t.filter((e=>(0,o.N)(e))),i=e.filter((e=>(0,o.t2)(e))).map((e=>e.id)),l=e.filter((e=>{const t=r.find((t=>t.id===e.id)),n=(null==t?void 0:t.containerId)&&i.includes(t.containerId);return(0,o.N)(e)&&!n}));l.forEach((e=>{const n=e.x,r=e.x+e.width,i=e.y,l=e.y+e.height,a=t.filter((e=>(0,o.t2)(e)));for(const t of a){const o=t.view.x,a=t.view.x+t.view.width,c=t.view.y,s=t.view.y+t.view.height;if(n>=o&&r<=a&&i>=c&&l<=s){e.containerCell=t;break}}}));let a=[];return a=l.filter((e=>{var t;const n=r.find((t=>t.id===e.id));return(null==n?void 0:n.containerId)!==(null===(t=e.containerCell)||void 0===t?void 0:t.id)})),a.length>0&&(null==n||n(a)),a}},3783:(e,t,n)=>{n.d(t,{C:()=>r});var o=n(531);function r(e,t){let{defaultNodeSize:n}=t;return(null!=e?e:[]).map((e=>{var t,r;return!(0,o.vC)(e)||void 0!==(null===(t=e.view)||void 0===t?void 0:t.width)&&void 0!==(null===(r=e.view)||void 0===r?void 0:r.height)?e:{...e,view:{width:n[0],height:n[1],...e.view}}}))}},8185:(e,t,n)=>{function o(e,t){return e?!!t&&e.type===t.type&&("multi"===e.type?e.targets.length===t.targets.length&&e.targets.every((e=>t.targets.some((t=>o(e,t))))):"node"===e.type||"decorator"===e.type?e.id===t.id:e.source===t.source&&e.target===t.target):!t}n.d(t,{c:()=>o})},4197:(e,t,n)=>{n.d(t,{Q:()=>r});var o=n(8185);function r(e,t){return!!t&&("multi"===t.type?t.targets:[t]).some((t=>(0,o.c)(t,e)))}},908:(e,t,n)=>{n.d(t,{r:()=>r});var o=n(531);function r(e,t){let{canvasWidth:n,canvasHeight:r,scaleRange:i}=t,l=1/0,a=1/0,c=-1/0,s=-1/0,d=!0;for(const t of e)if(!(0,o.WW)(t)){d=!1;const{view:e}=t,n=e.x+e.width,o=e.y+e.height;e.x<l&&(l=e.x),n>c&&(c=n),e.y<a&&(a=e.y),o>s&&(s=o)}const u=c-l,v=s-a,f=i&&!d&&(u>n||v>r)?Math.max(Math.min(n/u,r/v,i[1]),i[0]):1;return{x:d?0:(n-u*f)/2-l*f,y:d?0:(r-v*f)/2-a*f,k:f}}},2098:(e,t,n)=>{n.d(t,{L:()=>u});var o=n(1030),r=n(3033),i=n(531),l=n(3783),a=n(908),c=n(6170),s=n(9127),d=n(8185);function u(e){let{cells:t,layout:n,previousCells:u,defaultNodeSize:v,canvasWidth:f,canvasHeight:h,scaleRange:m,transform:g,reason:p,parent:y,allowEdgeToArea:x}=e;const w="force"!==n&&"dagre"!==n,E=(0,l.C)(t,{defaultNodeSize:v}),k=[];let b=!1;const C=new Map;let M=!1;for(const e of u)(0,i.mH)(e)?M=!0:(0,i.N)(e)&&(M=!0,e[r.CV]&&C.set(e.id,e));const I=new Map;for(const e of E)if((0,i.N)(e)){I.set(e.id,e);const t=C.get(e.id);t&&(e.view.width=t.view.width,e.view.height=t.view.height,e[r.CV]=!0)}let L=!1;if("add-related-nodes"===p&&y){const e=new Set;for(const t of E)(0,i.WW)(t)&&t.source===y&&t.target!==y&&e.add(t.target);const t=I.get(y);if(void 0!==(null==t?void 0:t.view.x)&&void 0!==t.view.y){if(L=!0,w)for(const t of E)((0,i.N)(t)&&void 0===t.view.x||(0,i.N)(t)&&void 0===t.view.y)&&e.add(t.id);const n=[...e].map((e=>I.get(e))).filter(Boolean);let o;for(const e of n)void 0!==e.view.x&&void 0!==e.view.y?(!o||e.view.x>o.view.x)&&e.view.y>t.view.y&&(o=e):k.push(e);if(k.length>0&&w){let e,n;if(o)e=o.view.x+o.view.width+r.Dm,n=o.view.y;else{const o=k.reduce(((e,t)=>e+t.view.width+r.Dm),-r.Dm);e=t.view.x-o/2+t.view.width/2,n=t.view.y+t.view.height+r.D9}for(const t of k)t.view.x=e,t.view.y=n,e+=t.view.width+r.Dm}}}if(!L){const e=[];let t=!1;for(const n of E)(0,i.N)(n)?void 0===n.view.x||void 0===n.view.y?k.push(n):e.push(n):(0,i.mH)(n)&&(t=!0);if(w){let n;M||(g=(0,a.r)((0,o.without)(E,...k),{canvasWidth:f,canvasHeight:h,scaleRange:m})),0===e.length||1===e.length&&!t&&k.length>0?(k.push(...e),({getNodeView:n}=(0,s.C)({cells:E,allowEdgeToArea:x})),b=0===u.length||u.length===E.length&&u.every(((e,t)=>(0,d.c)(e,E[t])))):({getNodeView:n}=(0,c.k)({cells:E,fixedPosition:!0,allowEdgeToArea:x,center:[(f/2-g.x)/g.k,(h/2-g.y)/g.k]}));for(const e of E)if((0,i.N)(e)){const t=n(e.id);e.view.x=t.x,e.view.y=t.y}}}return{cells:E,updated:k,shouldReCenter:b}}},5748:(e,t,n)=>{n.d(t,{d:()=>d});var o=n(1030),r=n(531),i=n(3033);const l=[{type:"decorator",decorators:["line","area","container","rect"]},{type:"edge"},{type:"node"},{type:"decorator",decorators:["text"]}];function a(e,t){return c(e,[t])}function c(e,t){if(0===t.length)return e;const n=l.findIndex((e=>s(t[0],e)));-1===n&&console.warn("Default order index unhandled for the cell: %o.\n%s",t[0],"This is a bug of diagram-NB, please report it.");const o=e.findLastIndex((e=>l.findIndex((t=>s(e,t)))<=n))+1;return[...e.slice(0,o),...t,...e.slice(o)]}function s(e,t){return e.type===t.type&&("decorator"!==t.type||t.decorators.includes(e.decorator))}const d=(u={cells:(e,t)=>{switch(t.type){case"drop-node":case"drop-decorator":return a(e,t.payload);case"add-nodes":return c(e,t.payload);case"add-edge":{const n=e.findIndex((e=>"edge"===e.type&&e.source===t.payload.source&&e.target===t.payload.target));return-1===n?a(e,t.payload):[...e.slice(0,n),t.payload,...e.slice(n+1)]}case"change-edge-view":{const n=e.findIndex((e=>"edge"===e.type&&e.source===t.payload.source&&e.target===t.payload.target));return-1===n?e:[...e.slice(0,n),{...e[n],view:t.payload.view},...e.slice(n+1)]}case"change-decorator-view":{const n=e.findIndex((e=>"decorator"===e.type&&e.id===t.payload.id));return-1===n?e:[...e.slice(0,n),{...e[n],view:t.payload.view},...e.slice(n+1)]}case"move-cells":{let n=!1;const r=e.map((e=>{const r=t.payload.find((t=>e.type===t.type&&e.id===t.id));return r?(n=!0,{...e,view:{...e.view,x:r.x,y:r.y,...(0,o.pick)(r,"source","target","vertices")}}):e}));return n?r:e}case"resize-cell":{const{type:n,id:o,width:r,height:i}=t.payload,l=e.findIndex((e=>e.type===n&&e.id===o));if(-1!==l){const t=e[l];return[...e.slice(0,l),{...t,view:{...t.view,width:r,height:i}},...e.slice(l+1)]}return e}case"update-cells":return t.payload;case"update-node-size":return e.map((e=>(0,r.N)(e)&&e.id===t.payload.id?{...e,[i.CV]:!0,view:t.payload.size?{...e.view,width:t.payload.size[0],height:t.payload.size[1]}:e.view}:e))}return e},layoutKey:(e,t)=>"update-node-size"===t.type?t.layoutKey:e},(e,t)=>Object.fromEntries(Object.entries(u).map((n=>{let[o,r]=n;return[o,r(e[o],t)]}))));var u},7099:(e,t,n)=>{n.d(t,{Y:()=>h});var o=n(8769),r=n.n(o),i=n(1895),l=n(6768),a=n(6313),c=n(5694),s=n(3848),d=n(9575);const u=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),o.createElement("path",{d:"M12 0a.5.5 0 0 1 .5.5v2.013a9.5 9.5 0 0 1 8.987 8.988L23.5 11.5a.5.5 0 0 1 0 1h-2.013a9.5 9.5 0 0 1-8.987 8.987V23.5a.5.5 0 0 1-1 0v-2.013A9.5 9.5 0 0 1 2.514 12.5H.5a.5.5 0 0 1 0-1h2.013A9.5 9.5 0 0 1 11.5 2.514V.5A.5.5 0 0 1 12 0M3.514 11.5H7.5a.5.5 0 0 1 0 1H3.514a8.5 8.5 0 0 0 7.987 7.986L11.5 16.5a.5.5 0 0 1 1 0v3.986a8.5 8.5 0 0 0 7.986-7.986H16.5a.5.5 0 0 1 0-1h3.986A8.5 8.5 0 0 0 12.5 3.515V7.5a.5.5 0 0 1-1 0V3.514a8.5 8.5 0 0 0-7.986 7.987zm8.486-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3"})),v=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),o.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),o.createElement("path",{d:"M744.448 486.4h-204.8V281.6a25.6 25.6 0 1 0-51.2 0v204.8h-204.8a25.6 25.6 0 0 0 0 51.2h204.8v204.8a25.6 25.6 0 0 0 51.2 0V537.6h204.8a25.6 25.6 0 0 0 0-51.2"})),f=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),o.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),o.createElement("path",{d:"M744.448 486.4H280.064a25.6 25.6 0 1 0 0 51.2h464.384a25.6 25.6 0 0 0 0-51.2"}));function h(e){let{shadowRoot:t,scale:n,scaleRange:d,onZoomChange:h,onReCenter:m}=e;const g=(0,s.useCurrentTheme)(),p=(0,o.useMemo)((()=>(0,c.VC)()),[]),y=(0,o.useRef)(null),x=100*d[0],w=100*d[1],E=100*n,k=(0,o.useMemo)((()=>({formatter:e=>`${e}%`,placement:"left",getPopupContainer:()=>y.current})),[]),b=(0,o.useCallback)((()=>{h(Math.min(E+5,w))}),[w,h,E]),C=(0,o.useCallback)((()=>{h(Math.max(E-5,x))}),[x,h,E]);return r().createElement(i.Ay,{theme:{algorithm:"dark-v2"===g?l.A.darkAlgorithm:l.A.defaultAlgorithm}},r().createElement(c.N7,{container:t,autoClear:!0,cache:p,hashPriority:"high"},r().createElement("div",{className:"zoom-bar",ref:y},r().createElement("div",{className:"center-button",onClick:m,role:"button"},r().createElement(u,null)),r().createElement("div",{className:"zoom-slider"},r().createElement("div",{className:"zoom-button",role:"button",onClick:b},r().createElement(v,null)),r().createElement(a.A,{min:x,max:w,value:E,step:5,vertical:!0,included:!1,tooltip:k,onChange:h}),r().createElement("div",{className:"zoom-button",role:"button",onClick:C},r().createElement(f,null))))))}},9127:(e,t,n)=>{n.d(t,{C:()=>c});var o=n(1030),r=n(7586),i=n.n(r),l=n(8802),a=n(531);function c(e){let{cells:t,layoutOptions:n,allowEdgeToArea:r}=e;const{nodePadding:c,...s}={nodePadding:0,rankdir:"TB",ranksep:50,edgesep:10,nodesep:50,...(0,o.pick)(n,["nodePadding","rankdir","ranksep","edgesep","nodesep","align"])},d=(0,l.D)(c);if(!t.some(a.N))return{getNodeView:()=>null,nodePaddings:d};const u=new(i().graphlib.Graph);u.setGraph(s),u.setDefaultEdgeLabel((function(){return{}}));for(const e of t)r&&(0,a.o6)(e)||(0,a.N)(e)?u.setNode(e.id,{id:e.id,width:e.view.width+d[1]+d[3],height:e.view.height+d[0]+d[2]}):(0,a.WW)(e)&&u.setEdge(e.source,e.target);return i().layout(u),{getNodeView:e=>u.node(e),nodePaddings:d}}},6170:(e,t,n)=>{n.d(t,{k:()=>v});var o=n(1030),r=n(6149),i=n(4842),l=n(1945),a=n(9418),c=n(3854),s=n(7931),d=n(531),u=n(8802);function v(e){let{cells:t,layoutOptions:n,center:v,fixedPosition:f,allowEdgeToArea:h}=e;const{nodePadding:m,collide:g}={nodePadding:0,...(0,o.pick)(n,["nodePadding"]),collide:!1!==(null==n?void 0:n.collide)&&{radiusDiff:18,strength:1,iterations:1,...!0===(null==n?void 0:n.collide)?null:null==n?void 0:n.collide}},p=(0,u.D)(m),y=[],x=[],w=new Map;for(const e of t)if(h&&(0,d.o6)(e)||(0,d.N)(e)){const t={id:e.id,width:e.view.width+p[1]+p[3],height:e.view.height+p[0]+p[2],...f?{fx:e.view.x,fy:e.view.y}:null};y.push(t),w.set(t.id,t)}else(0,d.WW)(e)&&x.push({source:e.source,target:e.target});const E=(0,r.A)(x).id((e=>e.id)),k=(0,i.A)(y).force("link",E).force("x",(0,l.A)(null==v?void 0:v[0])).force("y",(0,a.A)(null==v?void 0:v[1])).force("charge",(0,c.A)());return g&&k.force("collide",(0,s.A)().radius((e=>Math.sqrt(e.width**2+e.height**2)/2+g.radiusDiff)).strength(g.strength).iterations(g.iterations)),k.stop(),function(e){e.tick(Math.ceil(Math.log(e.alphaMin())/Math.log(1-e.alphaDecay())))}(k),{getNodeView:e=>w.get(e),nodePaddings:p}}},967:(e,t,n)=>{n.d(t,{V:()=>u,P:()=>v});var o=n(1030),r=n(8875),i=n(4059);function l(e,t){return{x:e.x+e.width/2,y:e.y+e.height/2,width:e.width+t,height:e.height+t}}var a=n(3033),c=n(3188),s=n(531);const d=["right","top","left","bottom"];function u(e,t,n,u,p){var y,x,w,E,k,b;const{type:C,vertices:M,exitPosition:I,entryPosition:L}=null!=n?n:{};if((0,s.jw)(C))return"decorator"===p?[{x:e.x,y:e.y},...null!=M?M:[],{x:t.x,y:t.y}]:(0,c.h)(l(e,I?a.XK:a.p6),l(t,L?a.XK:a.p6),u,n);if(null!=M&&M.length){const n=M[0],o=M[M.length-1];let r,i,l,a;if(I)r=h(e,I);else{let i;if(M.length>1?i=M[1]:L&&(i=h(t,L)),i)r=m(n,e,n.y===i.y);else{const n=o.y<t.y||o.y>t.y+t.height?"ns":"ew";({point:r,direction:l}=g(e,t,M,n))}}if(L)i=h(t,L);else{let r;if(M.length>1?r=M[M.length-2]:I&&(r=h(e,I)),r)i=m(o,t,o.y===r.y);else{const o=n.x<e.x||n.x>e.x+e.width?"ew":"ns";({point:i,direction:a}=g(t,e,M.slice().reverse(),o))}}const{x:c,y:s}=r,{x:d,y:u}=i,f=[r,...M,i],p=[...M];return n&&n.x!==c&&n.y!==s&&p.unshift("ns"===l?{x:c,y:n.y}:"ew"===l?{x:n.x,y:s}:n.x===f[2].x?{x:c,y:n.y}:{x:n.x,y:s}),o&&o.x!==d&&o.y!==u&&p.push("ns"===a?{x:d,y:o.y}:"ew"===a?{x:o.x,y:u}:o.x===f[f.length-3].x?{x:d,y:o.y}:{x:o.x,y:u}),[r,...v(r,p,i),i]}const S=null!=I?I:f(t,e),z=null!=L?L:f(e,t),{x:P,y:N}=h(e,S),{x:R,y:A}=h(t,z),T=(0,r.X)(),H=null!==(y=null===(x=T.find((e=>e.x===S.x&&e.y===S.y)))||void 0===x?void 0:x.d)&&void 0!==y?y:d,W=null!==(w=null===(E=T.find((e=>e.x===z.x&&e.y===z.y)))||void 0===E?void 0:E.d)&&void 0!==w?w:d,D=[...H],Z=[...W];P<R?((0,o.pull)(D,"left"),(0,o.pull)(Z,"right")):((0,o.pull)(D,"right"),(0,o.pull)(Z,"left")),N<A?((0,o.pull)(D,"top"),(0,o.pull)(Z,"bottom")):((0,o.pull)(D,"bottom"),(0,o.pull)(Z,"top"));const j=null!==(k=D[0])&&void 0!==k?k:H[0],B=null!==(b=Z[0])&&void 0!==b?b:W[0],$="left"===j||"right"===j?S.y:S.x,U="left"===B||"right"===B?z.y:z.x;return(0,i.o)(l(e,a.XK),l(t,a.XK),j,B,$,U)}function v(e,t,n){const o=[];let r,i=e,l=0;for(;l<t.length;){const e=t[l],a=e.x!==i.x,c=e.y!==i.y;if(a||c){const c=a?"ew":"ns";if(c!==r){const a=l===t.length-1?n:t[l+1],s=a.x!==e.x,d=a.y!==e.y;(s||d)&&c!==(s?"ew":"ns")&&(r=c,o.push(e),i=e)}}l++}return o}function f(e,t){return t.y+t.height<e.y?{x:.5,y:1}:t.y>e.y+e.height?{x:.5,y:0}:t.x<e.x?{x:1,y:.5}:{x:0,y:.5}}function h(e,t){const n=a.XK/2;return{x:e.x-n+t.x*(e.width+a.XK),y:e.y-n+t.y*(e.height+a.XK)}}function m(e,t,n){let o,r,i,l,c;if(n?(o="y",r="x",i="height",l="width"):(o="x",r="y",i="width",l="height"),t[r]+t[l]<e[r]&&(c={[o]:.5,[r]:1}),t[r]>e[r]&&(c={[o]:.5,[r]:0}),c)return h(t,c);const s=t[o]<e[o]?1:0;return{[o]:t[o]-a.XK/2+s*(t[i]+a.XK),[r]:e[r]}}function g(e,t,n,o){let r,i,l,a,c,s,d,u;"ns"===o?(l="x",a="y",c="width",s="height",d="ns",u="ew"):(l="y",a="x",c="height",s="width",d="ew",u="ns");const v=n[0];if(v[l]>=e[l]&&v[l]<=e[l]+e[c])if(v[a]>e[a]+e[s])r={[l]:v[l],[a]:e[a]+e[s]},i=d;else if(v[a]<e[a])r={[l]:v[l],[a]:e[a]},i=d;else{var f;const o=null!==(f=n[1])&&void 0!==f?f:t;r={[l]:v[l],[a]:o[a]<v[a]?v[a]:e[a]+e[s]},i=d}else v[a]<e[a]?(r={[l]:e[l]+e[c]/2,[a]:e[a]},i=d):v[a]>e[a]+e[s]?(r={[l]:e[l]+e[c]/2,[a]:e[a]+e[s]},i=d):v[l]<e[l]?(r={[l]:e[l],[a]:v[a]},i=u):(r={[l]:e[l]+e[c],[a]:v[a]},i=u);return{point:r,direction:i}}},8875:(e,t,n)=>{n.d(t,{G:()=>l,X:()=>i});const o=[{x:0,y:0,d:["top","left"]},{x:.5,y:0,d:["top"]},{x:1,y:0,d:["top","right"]},{x:0,y:.5,d:["left"]},{x:1,y:.5,d:["right"]},{x:0,y:1,d:["bottom","left"]},{x:.5,y:1,d:["bottom"]},{x:1,y:1,d:["bottom","right"]}],r=o.map((e=>({x:e.x,y:e.y})));function i(){return o}function l(){return r}},1819:(e,t,n)=>{n.d(t,{J:()=>i});var o=n(8769),r=n(8185);function i(e){let{rootRef:t,activeTarget:n,doNotResetActiveTargetForSelector:i,doNotResetActiveTargetOutsideCanvas:l,onActiveTargetChange:a}=e;const c=null!=n?n:null,[s,d]=(0,o.useState)(c);(0,o.useEffect)((()=>{d((e=>(0,r.c)(e,c)?e:c))}),[c]);const u=(0,o.useRef)(!1);return(0,o.useEffect)((()=>{u.current?a(s):u.current=!0}),[s,a]),(0,o.useEffect)((()=>{if(!s)return;const e=e=>{const n=e.composedPath(),o=n.indexOf(t.current);(l?0!==o:!(o<=0)||i&&n.some((e=>e instanceof Element&&e.matches(i))))||d(null)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[s,l,i,t]),s}},4117:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(8769),r=n(531);function i(e,t){return e.find((e=>(0,r.o6)(e)&&e.id===t))}var l=n(967),a=n(1030),c=n(4525);const s=6;function d(e,t,n,o,r){const i=(0,c.y)([e.x,e.y],[t.x,t.y],[n.x,n.y],[o.x,o.y]);if(i){const l=r*r;for(const r of[e,t,n,o]){const e=i[0]-r.x,t=i[1]-r.y;if(e*e+t*t<l)return null}return{x:i[0],y:i[1]}}return null}function u(e){let{cells:t,lineConfMap:n}=e;return(0,o.useMemo)((()=>{const e=new WeakMap,o=function(){const e=[],t=[];return function(n,o){const r=[],i=[];if("curve"!==o.type||"curveLinear"===o.curveType){for(let l=0;l<n.length-1;l++){const c=n[l],u=n[l+1],v=[],f=s/2+o.strokeWidth-1;if(o.jumps)e:for(const n of t){const t=d(c,u,n.start,n.end,f);if(t){for(const n of e)for(const e of n.jumpPoints)if(Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))<f+n.radius)continue e;v.push(t)}}if(v.length>0){const t={jumpPoints:(0,a.sortBy)(v,(e=>(e.x-n[0].x)**2+(e.y-n[0].y)**2)),index:l,radius:f};e.push(t),r.push(t)}i.push({start:c,end:u})}t.push(...i)}return r.length>0?new Map(r.map((e=>[e.index,e]))):null}}();for(const a of t)if((0,r.WW)(a)){var c;const s=n.get(a),d=i(t,a.source),u=i(t,a.target),v=(0,r.jw)(null===(c=a.view)||void 0===c?void 0:c.type)&&t.some((e=>{var t;return(0,r.WW)(e)&&e.source===e.target&&e.target===e.source&&(0,r.jw)(null===(t=e.view)||void 0===t?void 0:t.type)}))?s.parallelGap:0,f=d&&u&&null!=d.view.x&&null!=u.view.x?(0,l.V)(d.view,u.view,a.view,v,a.type):null;if(f){const t=o(f,s);e.set(a,{edge:a,points:f,source:d,target:u,parallelGap:v,jumpsMap:t})}}else if((0,r._m)(a)){const{source:t,target:r}=a.view,i=t&&r?(0,l.V)({...t,width:0,height:0},{...r,width:0,height:0},a.view,0,a.type):null;if(i){const t=o(i,n.get(a));e.set(a,{decorator:a,points:i,parallelGap:0,jumpsMap:t})}}return e}),[t,n])}},1484:(e,t,n)=>{n.d(t,{g:()=>f});var o=n(8769),r=n(7566),i=n(9047),l=n(3033),a=n(531),c=n(908),s=n(6170),d=n(9127);const u=new Map([["center",.5],["left",0],["right",1],["top",0],["bottom",1]]);function v(e,t){if("string"==typeof e){const n=u.get(e);if(void 0!==n)return n;const o=e.match(/^(-?\d+(?:\.\d+)?)%$/);if(o)return Number(o[1])/100;console.error("Unexpected align origin %s:",t,e)}else{if("number"==typeof e)return e;console.error("Unexpected align origin %s, expected %s, received %s:",t,"string | number",typeof e,e)}return.5}function f(e){let{layout:t,layoutOptions:n,rootRef:u,cells:f,zoomable:h,zoomer:m,scaleRange:g,layoutKey:p,allowEdgeToArea:y,autoCenterWhenCellsChange:x,dispatch:w}=e;const[E,k]=(0,o.useState)("force"!==t&&"dagre"!==t),b=(0,o.useRef)(p),C=(0,o.useCallback)((()=>++b.current),[]),[M,I]=function(e){let{rootRef:t,cells:n,layoutInitialized:s,zoomable:d,zoomer:u,scaleRange:v,autoCenterWhenCellsChange:f}=e;const[h,m]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{n.some((e=>(0,a.N)(e)||(0,a.mH)(e)))&&!f||m(!1)}),[n,f]),(0,o.useEffect)((()=>{const e=t.current;if(!e||!s||h||!n.some((e=>(0,a.N)(e)||(0,a.mH)(e)))||n.some((e=>(0,a.N)(e)&&!e[l.CV])))return;const{k:o,x:f,y:g}=(0,c.r)(n,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:d?v:void 0});u.transform((0,r.A)(e),new i.uV(o,f,g)),m(!0)}),[n,h,s,t,v,d,u]),[h,m]}({rootRef:u,layoutInitialized:E,cells:f,zoomable:h,zoomer:m,scaleRange:g,autoCenterWhenCellsChange:x}),L=(0,o.useRef)(null);return(0,o.useEffect)((()=>{if(f.some((e=>(0,a.N)(e)&&!e[l.CV]))||0===f.length)return;if("force"!==t&&"dagre"!==t)return void k(!0);if(b.current!==p||(e=L.current,o=f.filter(a.nv),(null==e?void 0:e.length)===o.length&&e.every(((e,t)=>e===o[t]))))return;var e,o;let r,i;({getNodeView:r,nodePaddings:i}="force"===t?(0,s.k)({cells:f,layoutOptions:n,allowEdgeToArea:y}):(0,d.C)({cells:f,layoutOptions:n,allowEdgeToArea:y}));const c=function(e){const t=null!=e?e:[.5,.5];return[v(t[0],"x"),v(t[1],"y")]}(null==n?void 0:n.alignOrigin),u=f.map((e=>{if(y&&(0,a.o6)(e)||(0,a.N)(e)){const t=r(e.id);return{...e,view:{...e.view,x:t.x-t.width*c[0]+i[3],y:t.y-t.height*c[1]+i[0]},[l.xc]:!0}}return e}));L.current=u.filter(a.nv),w({type:"update-cells",payload:u}),k(!0)}),[f,w,t,p,n]),{centered:M,setCentered:I,getNextLayoutKey:C}}},7531:(e,t,n)=>{n.d(t,{I:()=>d,d:()=>c});var o=n(8769),r=n(2716),i=n(1030),l=n(531),a=n(3033);function c(e){let{cells:t,defaultEdgeLines:n,markerPrefix:c,lineConnector:f}=e;return(0,o.useMemo)((()=>{const e=[{strokeColor:a.mF,markerType:"arrow"}];let o=null;if(f){o={...v(),editingStrokeColor:"var(--palette-blue-5)",...(0,i.omitBy)(!0===f?{}:f,i.isUndefined)};const t=d(o);for(const n of t){const{placement:t,type:r}=n,i=null!=r?r:"arrow",l=u({strokeColor:o.strokeColor,markerType:i},e),a=u({strokeColor:o.editingStrokeColor,markerType:i},e);"start"===t?(o.$markerStartUrl=`url(#${c}${l})`,o.$editingStartMarkerUrl=`url(#${c}${a})`):(o.$markerEndUrl=`url(#${c}${l})`,o.$editingEndMarkerUrl=`url(#${c}${a})`)}}const h=new WeakMap;for(const o of t){const t=(0,l.WW)(o),f=(0,l._m)(o);let x;if(t){var m,g;const e=null!==(m=Array.isArray(n)?s(n.find((e=>(0,r.checkIfByTransform)(e,{edge:o}))),o):null===(g=r.__secret_internals.legacyDoTransform({edge:o},n))||void 0===g?void 0:g.find((e=>(0,r.checkIfOfComputed)(e))))&&void 0!==m?m:{};x={...v(),...(0,i.omitBy)(e,i.isUndefined),...(0,i.omitBy)(o.view,i.isUndefined)},void 0===x.parallelGap&&(x.parallelGap=x.interactStrokeWidth)}else x={...v(),showEndArrow:!1,strokeColor:a.CE,...(0,i.omitBy)(o.view,i.isUndefined)};if(t||f){const n=d(x);for(const o of n){var p;const{placement:n,type:r}=o,i=null!=r?r:"arrow",l=u({strokeColor:x.strokeColor,markerType:i},e);"start"===n?x.$markerStartUrl=`url(#${c}${l})`:x.$markerEndUrl=`url(#${c}${l})`;const a=null===(p=x.overrides)||void 0===p||null===(p=p.active)||void 0===p?void 0:p.strokeColor;if(a&&a!==x.strokeColor){const t=u({strokeColor:a,markerType:i},e);"start"===n?x.$activeMarkerStartUrl=`url(#${c}${t})`:x.$activeMarkerEndUrl=`url(#${c}${t})`}if(t){var y;const t=null===(y=x.overrides)||void 0===y||null===(y=y.activeRelated)||void 0===y?void 0:y.strokeColor;if(t&&t!==x.strokeColor){const o=u({strokeColor:t,markerType:i},e);"start"===n?x.$activeRelatedMarkerStartUrl=`url(#${c}${o})`:x.$activeRelatedMarkerEndUrl=`url(#${c}${o})`}}}h.set(o,x)}}return{lineConfMap:h,lineConnectorConf:o,markers:e}}),[t,n,f,c])}function s(e,t){var n;if(null!=e&&null!==(n=e.label)&&void 0!==n&&n.useBrick){const{label:{useBrick:n,...o},...i}=e,l=r.__secret_internals.legacyDoTransform({edge:t},{...i,label:o});return{...l,label:{...l.label,useBrick:n}}}return r.__secret_internals.legacyDoTransform({edge:t},e)}function d(e){let t=[];return e.markers?t=e.markers:(e.showStartArrow&&t.push({type:"arrow",placement:"start"}),e.showEndArrow&&t.push({type:"arrow",placement:"end"})),t}function u(e,t){let n=(0,i.findIndex)(t,e);return-1===n&&(n=t.push(e)-1),n}function v(){return{type:"straight",dashed:!1,strokeColor:a.mF,strokeWidth:a.VO,interactStrokeWidth:a.Ie,showStartArrow:a.XV,showEndArrow:a.Ub,animate:{useAnimate:!1,duration:a.Be},jumps:!1}}},8197:(e,t,n)=>{n.d(t,{H:()=>l});var o=n(8769),r=n(531),i=n(3033);function l(e){let{cells:t,layout:n,centered:l}=e;return(0,o.useMemo)((()=>l&&t.every((e=>!(0,r.N)(e)||e[i.CV]&&("force"!==n&&"dagre"!==n||e[i.xc])))),[t,l,n])}},8091:(e,t,n)=>{n.d(t,{f:()=>v});var o,r,i,l=n(8769),a=n(7566),c=n(9047),s=n(3033);const d=/mac/i.test(null!==(o=null!==(r=null===(i=navigator.userAgentData)||void 0===i?void 0:i.platform)&&void 0!==r?r:navigator.platform)&&void 0!==o?o:navigator.userAgent);function u(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey&&d?10:1)}function v(e){let{rootRef:t,zoomable:n,scrollable:o,pannable:r,draggable:i,ctrlDraggable:d,scaleRange:v,onSwitchActiveTarget:f}=e;const[h,m]=(0,l.useState)(!1),[g,p]=(0,l.useState)({k:1,x:0,y:0}),y=(0,l.useMemo)((()=>null!=v?v:[s.sS,s.Yt]),[v]),x=(0,l.useMemo)((()=>(0,c.s_)().wheelDelta(u)),[]);return(0,l.useEffect)((()=>{let e=!1;x.scaleExtent(n?y:[1,1]).on("start",(()=>{e=!1,m(!0)})).on("zoom",(t=>{e=!0,p(t.transform)})).on("end",(()=>{m(!1),e||null==f||f(null)})).filter((e=>("wheel"===e.type||(d?i||e.ctrlKey:!e.ctrlKey))&&!e.button))}),[f,y,n,x,d,i]),(0,l.useEffect)((()=>{if(d){const e=e=>{e.ctrlKey&&e.preventDefault()};return document.addEventListener("contextmenu",e,!0),()=>{document.removeEventListener("contextmenu",e,!0)}}}),[d]),(0,l.useEffect)((()=>{const e=t.current;if(!e)return;const l=(0,a.A)(e),c=()=>{l.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(n||o||r)return(n||o)&&l.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),o&&(e.preventDefault(),x.translateBy(l,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),l.call(x).on("wheel",(e=>{e.preventDefault()})).on("dblclick.zoom",null),(i||d)&&r||l.on("mousedown.zoom",null),r||l.on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),c;c()}),[d,i,r,t,o,n,x]),{grabbing:h,transform:g,zoomer:x,scaleRange:y}}},6237:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),r=n.n(o),i=n(935),l=n.n(i)()(r());l.push([e.id,'.zoom-bar{position:absolute;bottom:20px;right:20px;width:40px;scale:0.8}.zoom-slider,\n.center-button{width:100%;display:flex;align-items:center;border:1px solid var(--antd-background-color-base);border-radius:var(--larger-border-radius);box-shadow:var(--connected-overlay-shadow);background-color:var(--color-fill-bg-container-4)}.zoom-slider{height:140px;padding:8px 0;flex-direction:column}[role="button"]{cursor:pointer}.center-button{justify-content:center;margin-bottom:8px;height:40px}.center-button:hover{border-color:var(--antd-btn-default-hover-border-color)}.center-button path{fill:var(--antd-link-hover-color)}.center-button:hover path{fill:var(--palette-blue-7)}.zoom-button{font-size:16px;line-height:0}.zoom-button svg{width:1em;height:1em;fill:var(--antd-link-hover-color)}.zoom-slider .ant-slider-vertical{padding-left:5px;padding-right:5px}.zoom-slider .ant-slider-vertical .ant-slider-rail{width:2px}.zoom-slider .ant-slider-vertical .ant-slider-handle{width:6px;height:6px;left:3px}.zoom-slider .ant-slider .ant-slider-handle:hover::before,\n.zoom-slider .ant-slider .ant-slider-handle:focus::before,\n.zoom-slider .ant-slider .ant-slider-handle::before{width:10px;height:10px;left:-2px}.zoom-slider .ant-slider .ant-slider-handle:hover::after,\n.zoom-slider .ant-slider .ant-slider-handle:focus::after,\n.zoom-slider .ant-slider .ant-slider-handle::after{width:6px;height:6px;top:0;left:0}',""]);const a=l.toString()},3012:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),r=n.n(o),i=n(935),l=n.n(i)()(r());l.push([e.id,"*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden;--animation-dasharray:48;--stroke-dashedoffset:96;--stroke-dottedoffset:24;--dasharray:4;--dotted:1}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}@keyframes solidAnimation{to{stroke-dashoffset:0}}@keyframes dashedAnimation{0%{stroke-dashoffset:var(--stroke-dashedoffset)}to{stroke-dashoffset:0}}@keyframes dottedAnimation{0%{stroke-dashoffset:var(--stroke-dottedoffset)}to{stroke-dashoffset:0}}.solid-animation{stroke-dasharray:var(--solid-length);stroke-dashoffset:var(--solid-length);animation:solidAnimation var(--time) linear infinite}.dashed-animation{animation:dashedAnimation var(--time) linear infinite}.dotted-animation{animation:dottedAnimation var(--time) linear infinite}.decorator-area .area,\n.decorator-container .container{fill:rgba(73,126,255,0.1);stroke:none;stroke-width:0}.decorator-rect-container .rect-container{fill:rgba(73,126,255,0);stroke:rgba(73,126,255,0.7)}.cell.active .decorator-rect-container .rect-container{fill:rgba(73,126,255,0);stroke:rgba(73,126,255,1);stroke-width:2}.node,\n.decorator-text{overflow:visible}.cell.active .decorator-area .area,\n.cell.active .decorator-container .container,\n.cell:not(.read-only) .decorator-container .container:hover,\n.allowEdgeToArea .decorator-area .area:hover,\n.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:var(--dasharray);stroke-width:1}.container-active .decorator-container .container{stroke:var(--palette-blue-5);stroke-width:1}.cell:not(.read-only){-webkit-user-select:none;user-select:none}.resize-handle{cursor:nwse-resize;opacity:0}.resize-handle rect{fill:transparent;stroke:none}.resize-handle path{fill:none;stroke:var(--palette-gray-5);stroke-width:1.5}.cell.active .decorator-area .resize-handle,\n.decorator-area:hover .resize-handle,\n.decorator-container:hover .resize-handle{opacity:1}.connect-line{pointer-events:none}.connect-line:not(.connecting){display:none}.editing-line{pointer-events:none;stroke-dasharray:var(--dasharray);stroke-width:1}.editing-line:not(.editing){display:none}.line.dashed{stroke-dasharray:var(--dasharray)}.line.dotted{stroke-dasharray:var(--dotted)}.cell.active .decorator-text .text-container{outline:1px dashed var(--palette-blue-5)}.decorator-text .text-container{width:max-content;padding:0.5em}.decorator-text .text:focus{outline:none}.cell.faded{opacity:0.3}.cell.container-active{opacity:1}.cell .node{pointer-events:none}.cell .node > *{position:fixed;pointer-events:auto}.degraded{pointer-events:bounding-box}.degraded circle{fill:rgb(119,141,195)}.degraded text{text-anchor:middle;fill:var(--antd-text-color)}.cell.active .degraded circle,\n.cell.active .degraded text,\n.degraded:hover circle,\n.degraded:hover text{fill:var(--color-brand)}.decorator-container{--defaultSize:24px}.decorator-container .text-container{display:flex;align-items:center;justify-content:center;padding:0.5em;text-align:center;font-size:16px;background-color:rgba(73,126,255,0.6);overflow:hidden}.decorator-container .horizontal{height:max-content;width:100%}.decorator-container .horizontal .text{min-height:var(--defaultSize)}.decorator-container .vertical{width:max-content;height:100%;writing-mode:vertical-lr;-webkit-text-orientation:upright;text-orientation:upright;letter-spacing:4px}.decorator-container .vertical .text{min-width:var(--defaultSize)}.line-label-container{overflow:visible;opacity:0}.line-label-container.ready{opacity:1}.line-label{position:absolute;display:block;transform:translate(-50%,-50%);white-space:pre-line;width:max-content;text-align:center}.line-label.text{font-size:11px;color:var(--color-secondary-text);font-weight:400;line-height:1.63636364}.motion:not(.visible){opacity:0}",""]);const a=l.toString()}}]);
|
|
2
|
+
//# sourceMappingURL=9024.9fb24b35.js.map
|