@next-bricks/diagram 0.42.1 → 0.42.3
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 +1 -1
- package/dist/chunks/1371.69ab52e0.js +2 -0
- package/dist/chunks/1371.69ab52e0.js.map +1 -0
- package/dist/chunks/4017.5d5f544d.js +3 -0
- package/dist/chunks/4017.5d5f544d.js.map +1 -0
- package/dist/chunks/editable-label.54bc7004.js +3 -0
- package/dist/chunks/{editable-label.f35640ea.js.map → editable-label.54bc7004.js.map} +1 -1
- package/dist/chunks/eo-display-canvas.da51ba14.js +2 -0
- package/dist/chunks/eo-display-canvas.da51ba14.js.map +1 -0
- package/dist/chunks/eo-draw-canvas.ffc4b526.js +2 -0
- package/dist/chunks/eo-draw-canvas.ffc4b526.js.map +1 -0
- package/dist/chunks/{main.21a6eddf.js → main.5262e1e2.js} +2 -2
- package/dist/chunks/{main.21a6eddf.js.map → main.5262e1e2.js.map} +1 -1
- package/dist/index.b51e0a33.js +2 -0
- package/dist/index.b51e0a33.js.map +1 -0
- package/dist/manifest.json +41 -41
- package/dist-types/draw-canvas/index.d.ts +1 -0
- package/package.json +2 -2
- package/dist/chunks/1868.9f87bf11.js +0 -2
- package/dist/chunks/1868.9f87bf11.js.map +0 -1
- package/dist/chunks/6215.a8907b75.js +0 -3
- package/dist/chunks/6215.a8907b75.js.map +0 -1
- package/dist/chunks/editable-label.f35640ea.js +0 -3
- package/dist/chunks/eo-display-canvas.36c4170c.js +0 -2
- package/dist/chunks/eo-display-canvas.36c4170c.js.map +0 -1
- package/dist/chunks/eo-draw-canvas.cf04882c.js +0 -2
- package/dist/chunks/eo-draw-canvas.cf04882c.js.map +0 -1
- package/dist/index.12b6fc5b.js +0 -2
- package/dist/index.12b6fc5b.js.map +0 -1
- /package/dist/chunks/{6215.a8907b75.js.LICENSE.txt → 4017.5d5f544d.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{editable-label.f35640ea.js.LICENSE.txt → editable-label.54bc7004.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/1868.9f87bf11.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,QACEL,EAAYM,EAGhB,OAAOC,IAAAA,cAACP,EAAS,CAACC,GAAIA,EAAIE,YAAaA,GACzC,CAEA,SAASG,EAAWE,GAGsB,IAHrB,GACnBP,EAAE,YACFE,GACyBK,EACzB,OACED,IAAAA,cAAA,UACEN,GAAIA,EACJQ,QAAQ,UACRC,KAAM,EACNC,KAAM,EACNC,YAAa,EACbC,aAAc,EACdC,OAAO,qBACPC,eAAe,SAEfR,IAAAA,cAAA,QACES,EAAE,gCACFC,OAAQd,EACRe,YAAa,EACbC,KAAMhB,IAId,CAEA,SAASC,EAA6BgB,GAGI,IAHH,GACrCnB,EAAE,YACFE,GACyBiB,EACzB,OACEb,IAAAA,cAAA,UACEN,GAAIA,EACJQ,QAAQ,YACRC,KAAM,GACNC,KAAM,IACNC,YAAa,GACbC,aAAc,GACdC,OAAO,sBAEPP,IAAAA,cAAA,QACES,EAAE,yFACFC,OAAQd,EACRe,YAAa,EACbC,KAAK,SAIb,CAEA,SAASd,EAA8BgB,GAGG,IAHF,GACtCpB,EAAE,YACFE,GACyBkB,EACzB,OACEd,IAAAA,cAAA,UACEN,GAAIA,EACJQ,QAAQ,YACRC,KAAM,GACNC,KAAM,IACNC,YAAa,GACbC,aAAc,GACdC,OAAO,sBAEPP,IAAAA,cAAA,QACES,EAAE,yGACFC,OAAQd,EACRe,YAAa,EACbC,KAAK,SAIb,C,+CCnGO,SAASG,EACdC,EACAC,EACAC,GAIA,GAAIF,IAAWC,IAAUE,EAAAA,EAAAA,GAAkBH,EAAQC,EAAQ,EAAG,G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J3Y,EAAAA,EAAAA,YAAU,KACR,MAAMgX,EAAOV,EAAQvX,QACrB,IAAKiY,EACH,OAGF,MAAMqC,GAAgBpC,EAAAA,EAAAA,GAAOD,GAEvBsC,EAAYA,KAChBD,EACGH,GAAG,QAAS,MACZA,GAAG,eAAgB,MACnBA,GAAG,QAAS,KAAK,EAGtB,GAAM3C,GAAYiC,GAAcC,EA+ChC,OA1CIlC,GAAYiC,IAGda,EAAcH,GACZ,qBACCjV,IAEMA,EAAEkV,UAELlV,EAAEsV,2BACEf,IACFvU,EAAE+B,iBACFwQ,EAAOgD,YACLH,EACApV,EAAEwV,YAAc,EAChBxV,EAAEyV,YAAc,IAGtB,IAMNL,EACGpa,KAAKuX,GACL0C,GAAG,SAAUjV,IACZA,EAAE+B,gBAAgB,IAEnBkT,GAAG,gBAAiB,OAEjBR,GAAcC,IAAmBF,GACrCY,EAAcH,GAAG,iBAAkB,MAGhCT,GACHY,EACGH,GAAG,kBAAmB,MACtBA,GAAG,iBAAkB,MACrBA,GAAG,gBAAiB,MAGlBI,EA9CLA,GA8Cc,GACf,CACDX,EACAD,EACAD,EACAnC,EACAkC,EACAjC,EACAC,IAGK,CAAEqC,WAAU/T,YAAW0R,SAAQxJ,aACxC,C,kEC9KI2M,E,MAA0B,GAA4B,KAE1DA,EAAwBhf,KAAK,CAACif,EAAOpiB,GAAI,86CAK2E,KAEpH,QAAemiB,EAAwBE,U,kECTnCF,E,MAA0B,GAA4B,KAE1DA,EAAwBhf,KAAK,CAACif,EAAOpiB,GAAI,6jFAY8V,KAEvY,QAAemiB,EAAwBE,U","sources":["webpack:///./src/diagram/MarkerComponent.tsx","webpack:///./src/diagram/lines/getDirectLinePoints.ts","webpack:///./src/diagram/processors/doTwoNodesOverlap.ts","webpack:///./src/diagram/processors/extractPartialRectTuple.ts","webpack:///./src/draw-canvas/processors/findNodeOrAreaDecorator.ts","webpack:///./src/draw-canvas/EdgeComponent.tsx","webpack:///./src/draw-canvas/NodeComponent.tsx","webpack:///./src/draw-canvas/processors/handleMouseDown.ts","webpack:///./src/draw-canvas/decorators/DecoratorArea.tsx","webpack:///./src/draw-canvas/decorators/DecoratorText.tsx","webpack:///./src/draw-canvas/decorators/DecoratorContainer.tsx","webpack:///./src/draw-canvas/decorators/index.tsx","webpack:///./src/draw-canvas/processors/computeContainerRect.ts","webpack:///./src/draw-canvas/CellComponent.tsx","webpack:///./src/draw-canvas/constants.ts","webpack:///./src/draw-canvas/processors/asserts.ts","webpack:///./src/draw-canvas/processors/cellToTarget.ts","webpack:///./src/draw-canvas/processors/getUnrelatedCells.ts","webpack:///./src/draw-canvas/processors/initializeCells.ts","webpack:///./src/draw-canvas/processors/sameTarget.ts","webpack:///./src/draw-canvas/processors/targetIsActive.ts","webpack:///./src/draw-canvas/processors/transformToCenter.ts","webpack:///./src/draw-canvas/processors/updateCells.ts","webpack:///./src/draw-canvas/reducers/cells.ts","webpack:///./src/draw-canvas/reducers/index.ts","webpack:///./src/draw-canvas/reducers/layoutKey.ts","webpack:///./src/shared/canvas/icons/center.svg","webpack:///./src/shared/canvas/icons/zoom-in.svg","webpack:///./src/shared/canvas/icons/zoom-out.svg","webpack:///./src/shared/canvas/ZoomBarComponent.tsx","webpack:///./src/shared/canvas/dagreLayout.ts","webpack:///./src/shared/canvas/forceLayout.ts","webpack:///./src/shared/canvas/useActiveTarget.ts","webpack:///./src/draw-canvas/processors/normalizeAlignOrigin.ts","webpack:///./src/shared/canvas/useLayout.ts","webpack:///./src/shared/canvas/useAutoCenter.ts","webpack:///./src/shared/canvas/useLineMarkers.ts","webpack:///./src/shared/canvas/useReady.ts","webpack:///./src/shared/canvas/useZoom.ts","webpack:///./src/shared/canvas/ZoomBarComponent.shadow.css","webpack:///./src/shared/canvas/styles.shadow.css"],"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 default:\n Component = ArrowMarker;\n }\n\n return <Component id={id} strokeColor={strokeColor} />;\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 type { NodePosition, NodeRect, PositionTuple } from \"../interfaces\";\nimport { doTwoNodesOverlap } from \"../processors/doTwoNodesOverlap\";\n\ntype LineTuple = [start: PositionTuple, end: PositionTuple];\n\nexport function getDirectLinePoints(\n source: NodeRect,\n target: NodeRect,\n parallelGap?: number\n): NodePosition[] | null {\n // Ignore if two nodes are the same.\n // Ignore if two nodes overlap.\n if (source === target || doTwoNodesOverlap(source, target, 0, 0)) {\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 [source.x + xDiff, source.y + yDiff],\n [target.x + xDiff, target.y + yDiff],\n ];\n const sourceIntersections = getIntersections(source, line);\n const targetIntersections = getIntersections(target, line);\n\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 if (targetIntersections.length > 0) {\n p1 = targetIntersections[0];\n } else {\n p1 = [target.x, target.y];\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\n// https://paulbourke.net/geometry/pointlineplane/javascript.txt\nfunction 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","import type { Cell, NodeCell, DecoratorCell, NodeId } from \"../interfaces\";\nimport { isNodeOrAreaDecoratorCell } from \"./asserts\";\n\nexport function findNodeOrAreaDecorator(\n cells: Cell[],\n id: NodeId\n): NodeCell | DecoratorCell | undefined {\n return cells.find(\n (cell) => isNodeOrAreaDecoratorCell(cell) && cell.id === id\n ) as NodeCell | DecoratorCell | undefined;\n}\n","import React, { useMemo, useRef } from \"react\";\nimport classNames from \"classnames\";\nimport type {\n Cell,\n ComputedEdgeLineConf,\n EdgeCell,\n NodeView,\n} from \"./interfaces\";\nimport { getDirectLinePoints } from \"../diagram/lines/getDirectLinePoints\";\nimport type { NodeRect } from \"../diagram/interfaces\";\nimport { isEdgeCell } from \"./processors/asserts\";\nimport { DEFAULT_LINE_INTERACT_ANIMATE_DURATION } from \"./constants\";\nimport { findNodeOrAreaDecorator } from \"./processors/findNodeOrAreaDecorator\";\n\nexport interface EdgeComponentProps {\n edge: EdgeCell;\n cells: Cell[];\n lineConfMap: WeakMap<EdgeCell, ComputedEdgeLineConf>;\n}\n\nexport function EdgeComponent({\n edge,\n cells,\n lineConfMap,\n}: EdgeComponentProps): JSX.Element | null {\n const pathRef = useRef<SVGPathElement>(null);\n const sourceNode = useMemo(\n () => findNodeOrAreaDecorator(cells, edge.source),\n [cells, edge.source]\n );\n const targetNode = useMemo(\n () => findNodeOrAreaDecorator(cells, edge.target),\n [cells, edge.target]\n );\n const lineConf = useMemo(() => lineConfMap.get(edge)!, [edge, lineConfMap]);\n\n const parallelGap = useMemo(() => {\n const hasOppositeEdge = cells.some(\n (cell) =>\n isEdgeCell(cell) &&\n cell.source === edge.target &&\n cell.target === edge.source\n );\n return hasOppositeEdge ? lineConf.parallelGap : 0;\n }, [cells, edge, lineConf.parallelGap]);\n\n const padding = 5;\n const line = useMemo(\n () =>\n sourceNode &&\n targetNode &&\n sourceNode.view.x != null &&\n targetNode.view.x != null\n ? getDirectLinePoints(\n nodeViewToNodeRect(sourceNode.view, padding),\n nodeViewToNodeRect(targetNode.view, padding),\n parallelGap\n )\n : null,\n [parallelGap, sourceNode, targetNode]\n );\n\n if (!line) {\n // This happens when source or target is not found,\n // or when source or target has not been positioned yet.\n return null;\n }\n const d = `M${line[0].x} ${line[0].y}L${line[1].x} ${line[1].y}`;\n return (\n <>\n <path\n // This `path` is made for expanding interaction area of graph lines.\n d={d}\n fill=\"none\"\n stroke=\"transparent\"\n strokeWidth={lineConf.interactStrokeWidth}\n />\n <path\n ref={pathRef}\n className={classNames(\"line\", {\n dashed: lineConf.dashed,\n [`${lineConf.dashed ? \"dashed\" : \"solid\"}-animation`]:\n lineConf.animate.useAnimate,\n })}\n style={\n {\n \"--time\": `${lineConf.animate.duration ?? DEFAULT_LINE_INTERACT_ANIMATE_DURATION}s`,\n \"--solid-length\": pathRef.current?.getTotalLength?.(),\n } as React.CSSProperties\n }\n d={d}\n fill=\"none\"\n stroke={lineConf.strokeColor}\n strokeWidth={lineConf.strokeWidth}\n markerStart={lineConf.showStartArrow ? lineConf.markerArrow : \"\"}\n markerEnd={lineConf.showEndArrow ? lineConf.markerArrow : \"\"}\n />\n <path className=\"line-active-bg\" d={d} fill=\"none\" />\n </>\n );\n}\n\nfunction nodeViewToNodeRect(view: NodeView, padding: number): NodeRect {\n return {\n x: view.x + view.width / 2,\n y: view.y + view.height / 2,\n width: view.width + padding,\n height: view.height + padding,\n };\n}\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { ReactUseBrick } from \"@next-core/react-runtime\";\nimport { __secret_internals, checkIfByTransform } from \"@next-core/runtime\";\nimport { isEqual } from \"lodash\";\nimport ResizeObserver from \"resize-observer-polyfill\";\nimport type { NodeBrickCell, NodeBrickConf, NodeCell } from \"./interfaces\";\nimport type { SizeTuple } from \"../diagram/interfaces\";\n\nexport interface NodeComponentProps {\n node: NodeCell;\n degraded: boolean;\n degradedNodeLabel?: string;\n defaultNodeBricks?: NodeBrickConf[];\n onResize(id: string, size: SizeTuple | null): void;\n}\n\nexport function NodeComponent({\n node,\n degraded,\n degradedNodeLabel,\n defaultNodeBricks,\n onResize,\n}: NodeComponentProps): JSX.Element | null {\n const memoizedData = useDeepMemo({ node: { id: node.id, data: node.data } });\n const specifiedUseBrick = (node as NodeBrickCell).useBrick;\n const observerRef = useRef<ResizeObserver | null>(null);\n\n const useBrick = useMemo(() => {\n return degraded\n ? null\n : specifiedUseBrick ??\n defaultNodeBricks?.find((item) =>\n checkIfByTransform(item, memoizedData)\n )?.useBrick;\n }, [degraded, specifiedUseBrick, defaultNodeBricks, memoizedData]);\n\n const label = useMemo<string>(\n () =>\n degraded\n ? String(\n __secret_internals.legacyDoTransform(\n memoizedData,\n degradedNodeLabel ?? \"<% DATA.node.id %>\"\n )\n )\n : \"\",\n [degraded, degradedNodeLabel, memoizedData]\n );\n\n const refCallback = useCallback(\n (element: HTMLElement | null) => {\n const prevObserver = observerRef.current;\n if (prevObserver) {\n prevObserver.disconnect();\n observerRef.current = null;\n }\n if (element) {\n // Todo: correctly wait for `useBrick` in v3 to be rendered (after layout)\n // Wait a macro task to let `useBrick` to be rendered.\n setTimeout(() => {\n const observer = new ResizeObserver(() => {\n onResize(node.id, [element.offsetWidth, element.offsetHeight]);\n });\n observer.observe(element);\n observerRef.current = observer;\n });\n } else {\n onResize(node.id, null);\n }\n },\n [node.id, onResize]\n );\n\n const degradedRefCallBack = useCallback(\n (g: SVGGElement | null) => {\n if (g) {\n // istanbul ignore next\n const size =\n process.env.NODE_ENV === \"test\"\n ? { width: 60, height: 60 }\n : g.getBBox();\n onResize(node.id, [size.width, size.height]);\n } else {\n onResize(node.id, null);\n }\n },\n [node.id, onResize]\n );\n\n return useBrick ? (\n <foreignObject\n // Make a large size to avoid the brick inside to be clipped by the foreignObject.\n width={9999}\n height={9999}\n className=\"node\"\n >\n {useBrick && (\n <ReactUseBrick\n useBrick={useBrick}\n data={memoizedData}\n refCallback={refCallback}\n />\n )}\n </foreignObject>\n ) : degraded ? (\n <g className=\"degraded\" ref={degradedRefCallBack}>\n <circle cx={8} cy={8} r={8} />\n <text x={8} y={32}>\n {label}\n </text>\n </g>\n ) : null;\n}\n\nfunction useDeepMemo<T>(value: T): T {\n const [memoizedValue, setMemoizedValue] = useState(value);\n\n useEffect(() => {\n setMemoizedValue((prev) => (isEqual(prev, value) ? prev : value));\n }, [value]);\n\n return memoizedValue;\n}\n","import type { PositionTuple } from \"../../diagram/interfaces\";\nimport type {\n ActiveTarget,\n Cell,\n DecoratorCell,\n LayoutType,\n NodeCell,\n} from \"../interfaces\";\nimport type {\n MoveCellPayload,\n ResizeCellPayload,\n} from \"../reducers/interfaces\";\nimport {\n isContainerDecoratorCell,\n isDecoratorCell,\n isEdgeCell,\n isNodeCell,\n} from \"./asserts\";\nimport { cellToTarget } from \"./cellToTarget\";\nimport { targetIsActive } from \"./targetIsActive\";\n\nexport function handleMouseDown(\n event: MouseEvent,\n {\n action,\n cell,\n scale,\n layout,\n activeTarget,\n cells,\n onCellsMoving,\n onCellsMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n }: {\n action: \"move\" | \"resize\";\n cell: Cell;\n scale: number;\n layout?: LayoutType;\n activeTarget: ActiveTarget | null | undefined;\n cells: Cell[];\n onCellsMoving?(info: MoveCellPayload[]): void;\n onCellsMoved?(info: MoveCellPayload[]): void;\n onCellResizing?(info: ResizeCellPayload): void;\n onCellResized?(info: ResizeCellPayload): void;\n onSwitchActiveTarget?(activeTarget: ActiveTarget | null): void;\n }\n) {\n event.stopPropagation();\n // Drag node\n if (action === \"resize\" || !targetIsActive(cell, activeTarget)) {\n onSwitchActiveTarget?.(cellToTarget(cell));\n }\n\n const isAutoLayout = layout === \"force\" || layout === \"dagre\";\n if (isEdgeCell(cell)) {\n return;\n }\n const activeCells: Cell[] = [];\n const actives =\n activeTarget?.type === \"multi\" && action === \"move\"\n ? cells.filter((c) => targetIsActive(c, activeTarget))\n : [cell];\n actives.forEach((a) => {\n activeCells.push(a);\n if (isContainerDecoratorCell(a) && action === \"move\") {\n activeCells.push(\n ...cells.filter((c) => isNodeCell(c) && c.containerId === a.id)\n );\n }\n });\n const movableActiveCells = activeCells.filter(\n (c) => (isNodeCell(c) && !isAutoLayout) || isDecoratorCell(c)\n ) as (NodeCell | DecoratorCell)[];\n\n if (movableActiveCells.length === 0) {\n return;\n }\n\n const from: PositionTuple = [event.clientX, event.clientY];\n const originals = movableActiveCells.map((c) => ({\n cell: c,\n position:\n action === \"move\" ? [c.view.x, c.view.y] : [c.view.width, c.view.height],\n }));\n\n function getMovement(e: MouseEvent): PositionTuple {\n return [(e.clientX - from[0]) / scale, (e.clientY - from[1]) / scale];\n }\n let moved = false;\n\n const handleMove = (e: MouseEvent, finished?: boolean) => {\n // Respect the scale\n const movement = getMovement(e);\n if (!moved) {\n moved = movement[0] ** 2 + movement[1] ** 2 >= 9;\n }\n if (moved) {\n if (action === \"move\") {\n const payloads = originals.map(({ cell, position }) => ({\n type: cell.type,\n id: cell.id,\n x: position[0] + movement[0],\n y: position[1] + movement[1],\n width: cell.view.width,\n height: cell.view.height,\n decorator: isDecoratorCell(cell) ? cell.decorator : undefined,\n }));\n (finished ? onCellsMoved : onCellsMoving)?.(payloads);\n } else {\n (finished ? onCellResized : onCellResizing)?.({\n type: cell.type,\n id: cell.id,\n width: originals[0].position[0] + movement[0],\n height: originals[0].position[1] + movement[1],\n });\n }\n }\n };\n\n const onMouseMove = (e: MouseEvent) => {\n handleMove(e);\n };\n const onMouseUp = (e: MouseEvent) => {\n handleMove(e, true);\n moved = false;\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n };\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n}\n","import React, { useEffect } from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport { handleMouseDown } from \"../processors/handleMouseDown\";\n\nexport function DecoratorArea({\n cell,\n transform,\n readOnly,\n activeTarget,\n cells,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n}: BasicDecoratorProps): JSX.Element {\n const resizeHandleRef = React.useRef<SVGGElement>(null);\n\n useEffect(() => {\n const resizeHandle = resizeHandleRef.current;\n if (!resizeHandle || readOnly) {\n return;\n }\n const onMouseDown = (event: MouseEvent) => {\n handleMouseDown(event, {\n action: \"resize\",\n cell,\n scale: transform.k,\n activeTarget,\n cells,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n });\n };\n resizeHandle.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n resizeHandle.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [\n activeTarget,\n cell,\n cells,\n onCellResized,\n onCellResizing,\n onSwitchActiveTarget,\n readOnly,\n transform.k,\n ]);\n\n return (\n <g className=\"decorator-area\">\n <rect\n width={cell.view.width}\n height={cell.view.height}\n className=\"area\"\n />\n {!readOnly && (\n <g\n ref={resizeHandleRef}\n className=\"resize-handle\"\n transform={`translate(${cell.view.width - 20} ${cell.view.height - 20})`}\n >\n <rect width={20} height={20} />\n <path d=\"M10 18L18 10 M15 18L18 15\" />\n </g>\n )}\n </g>\n );\n}\n","import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport classNames from \"classnames\";\n\nexport type DecoratorTextProps = Pick<\n BasicDecoratorProps,\n \"cell\" | \"readOnly\" | \"onDecoratorTextEditing\" | \"onDecoratorTextChange\"\n>;\n\nexport function DecoratorText({\n cell,\n readOnly,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: DecoratorTextProps): JSX.Element {\n const label = cell.view.text ?? \"\";\n const [currentLabel, setCurrentLabel] = useState<string>(label);\n const [editingLabel, setEditingLabel] = useState(false);\n const editingLabelInitialized = useRef(false);\n const [shouldEmitLabelChange, setShouldEmitLabelChange] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n const handleEnableEdit = useCallback(\n (e: React.MouseEvent) => {\n if (readOnly) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n setEditingLabel(true);\n },\n [readOnly]\n );\n\n useEffect(() => {\n const element = ref.current;\n if (element && element.textContent !== currentLabel) {\n element.textContent = currentLabel;\n }\n }, [currentLabel]);\n useEffect(() => {\n const parentElement = ref.current?.parentElement;\n if (parentElement) {\n cell.view.width = parentElement.clientWidth;\n cell.view.height = parentElement.clientHeight;\n }\n }, [currentLabel, cell.id]);\n\n useEffect(() => {\n if (editingLabel && ref.current) {\n ref.current.focus();\n selectAllText(ref.current);\n }\n onDecoratorTextEditing?.({ id: cell.id, editing: editingLabel });\n }, [cell.id, editingLabel, onDecoratorTextEditing]);\n\n useEffect(() => {\n if (editingLabelInitialized.current) {\n onDecoratorTextEditing?.({ id: cell.id, editing: editingLabel });\n } else {\n editingLabelInitialized.current = true;\n }\n }, [cell.id, editingLabel, onDecoratorTextEditing]);\n\n const handleInput = useCallback(\n (event: React.FormEvent<HTMLDivElement>) => {\n if (readOnly) {\n return;\n }\n setCurrentLabel((event.target as HTMLDivElement).textContent!);\n },\n [readOnly]\n );\n\n const handleBlur = useCallback(() => {\n if (readOnly) {\n return;\n }\n setEditingLabel(false);\n setShouldEmitLabelChange(true);\n }, [readOnly]);\n\n useEffect(() => {\n if (shouldEmitLabelChange) {\n onDecoratorTextChange?.({\n id: cell.id,\n view: { ...cell.view, text: currentLabel },\n });\n setShouldEmitLabelChange(false);\n }\n }, [cell, currentLabel, onDecoratorTextChange, shouldEmitLabelChange]);\n\n return (\n <foreignObject className=\"decorator-text\">\n <div\n className={classNames(\"text-container\", { editing: editingLabel })}\n onDoubleClick={handleEnableEdit}\n >\n <div\n className=\"text\"\n contentEditable={editingLabel}\n ref={ref}\n onInput={handleInput}\n onBlur={handleBlur}\n />\n </div>\n </foreignObject>\n );\n}\n\nexport function selectAllText(element: HTMLElement) {\n const range = document.createRange();\n range.selectNodeContents(element);\n const selection = window.getSelection()!;\n selection.removeAllRanges();\n selection.addRange(range);\n}\n","import React, {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport { handleMouseDown } from \"../processors/handleMouseDown\";\nimport classNames from \"classnames\";\nimport { get } from \"lodash\";\nimport { selectAllText } from \"./DecoratorText\";\nimport { isNoManualLayout } from \"../processors/asserts\";\n\nexport function DecoratorContainer({\n cell,\n transform,\n readOnly,\n layout,\n view,\n activeTarget,\n cells,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: BasicDecoratorProps): JSX.Element {\n const label = get(cell.view, \"text\", \"\");\n const direction = get(cell.view, \"direction\", \"top\");\n const textRef = useRef<HTMLDivElement>(null);\n const resizeHandleRef = React.useRef<SVGGElement>(null);\n const [editingLabel, setEditingLabel] = useState(false);\n const [currentLabel, setCurrentLabel] = useState<string>(label);\n const [shouldEmitLabelChange, setShouldEmitLabelChange] = useState(false);\n const [titleForeignRect, setTitleForeignRect] = useState({\n x: 0,\n y: 0,\n width: cell.view.width,\n height: cell.view.height,\n });\n const handleEnableEdit = useCallback(\n (e: React.MouseEvent) => {\n if (readOnly) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n setEditingLabel(true);\n },\n [readOnly]\n );\n const handleInput = useCallback(\n (event: React.FormEvent<HTMLDivElement>) => {\n if (readOnly) {\n return;\n }\n setCurrentLabel((event.target as HTMLDivElement).textContent!);\n },\n [readOnly]\n );\n\n const handleBlur = useCallback(() => {\n if (readOnly) {\n return;\n }\n setEditingLabel(false);\n setShouldEmitLabelChange(true);\n }, [readOnly]);\n\n useLayoutEffect(() => {\n const element = textRef.current;\n if (element && element.textContent !== currentLabel) {\n element.textContent = currentLabel;\n }\n }, [currentLabel]);\n\n useEffect(() => {\n const textParentEle = textRef.current?.parentElement;\n if (textParentEle) {\n const { clientWidth, clientHeight } = textParentEle;\n if ([\"left\", \"right\"].includes(direction)) {\n const rect = {\n width: clientWidth,\n height: view.height,\n x: direction === \"left\" ? -clientWidth : view.width,\n y: 0,\n };\n setTitleForeignRect(rect);\n } else {\n const rect = {\n width: view.width,\n height: clientHeight,\n x: 0,\n y: direction === \"top\" ? -clientHeight : view.height,\n };\n setTitleForeignRect(rect);\n }\n }\n }, [view, currentLabel, direction]);\n\n useEffect(() => {\n if (editingLabel && textRef.current) {\n textRef.current.focus();\n selectAllText(textRef.current);\n }\n onDecoratorTextEditing?.({ id: cell.id, editing: editingLabel });\n }, [cell.id, editingLabel, onDecoratorTextEditing]);\n\n useEffect(() => {\n if (shouldEmitLabelChange) {\n onDecoratorTextChange?.({\n id: cell.id,\n view: { ...view, text: currentLabel },\n });\n setShouldEmitLabelChange(false);\n }\n }, [cell, view, currentLabel, onDecoratorTextChange, shouldEmitLabelChange]);\n\n useEffect(() => {\n const resizeHandle = resizeHandleRef.current;\n if (!resizeHandle || readOnly) {\n return;\n }\n const onMouseDown = (event: MouseEvent) => {\n handleMouseDown(event, {\n action: \"resize\",\n cell,\n scale: transform.k,\n activeTarget,\n cells,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n });\n };\n resizeHandle.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n resizeHandle.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [\n activeTarget,\n cell,\n cells,\n onCellResized,\n onCellResizing,\n onSwitchActiveTarget,\n readOnly,\n transform.k,\n ]);\n\n return (\n <g className=\"decorator-container\">\n <foreignObject {...titleForeignRect}>\n <div\n className={classNames(\"text-container\", {\n editing: editingLabel,\n [[\"left\", \"right\"].includes(direction) ? \"vertical\" : \"horizontal\"]:\n true,\n })}\n onDoubleClick={handleEnableEdit}\n >\n <div\n className=\"text\"\n contentEditable={editingLabel}\n ref={textRef}\n onInput={handleInput}\n onBlur={handleBlur}\n />\n </div>\n </foreignObject>\n <rect width={view.width} height={view.height} className=\"container\" />\n {!readOnly && !isNoManualLayout(layout) && (\n <g\n ref={resizeHandleRef}\n className=\"resize-handle\"\n transform={`translate(${view.width - 20} ${view.height - 20})`}\n >\n <rect width={20} height={20} />\n <path d=\"M10 18L18 10 M15 18L18 15\" />\n </g>\n )}\n </g>\n );\n}\n","import React from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport { DecoratorArea } from \"./DecoratorArea\";\nimport { DecoratorText } from \"./DecoratorText\";\nimport { DecoratorContainer } from \"./DecoratorContainer\";\n\nexport function DecoratorComponent({\n cell,\n view,\n transform,\n readOnly,\n layout,\n activeTarget,\n cells,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: BasicDecoratorProps): JSX.Element | null {\n let SpecifiedComponent: (props: BasicDecoratorProps) => JSX.Element | null;\n\n switch (cell.decorator) {\n case \"container\":\n SpecifiedComponent = DecoratorContainer;\n break;\n case \"area\":\n SpecifiedComponent = DecoratorArea;\n break;\n case \"text\":\n SpecifiedComponent = DecoratorText;\n break;\n // istanbul ignore next\n default:\n // eslint-disable-next-line no-console\n console.error(`Unknown decorator: ${cell.decorator}`);\n return null;\n }\n\n return (\n <SpecifiedComponent\n cell={cell}\n view={view}\n transform={transform}\n readOnly={readOnly}\n layout={layout}\n activeTarget={activeTarget}\n cells={cells}\n onCellResizing={onCellResizing}\n onCellResized={onCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onDecoratorTextEditing={onDecoratorTextEditing}\n onDecoratorTextChange={onDecoratorTextChange}\n />\n );\n}\n","import { BaseNodeCell } from \"../interfaces\";\n\nexport function computeContainerRect(cells: BaseNodeCell[]) {\n let minX = Infinity,\n minY = Infinity;\n let maxX = -Infinity,\n maxY = -Infinity;\n cells.forEach((cell) => {\n const { x, y, width, height } = cell.view;\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x + width > maxX) maxX = x + width;\n if (y + height > maxY) maxY = y + height;\n });\n if (![minX, maxX, minY, maxY].some((n) => isFinite(n))) return {};\n const padding = 20;\n const width = maxX - minX + padding * 2;\n const height = maxY - minY + padding * 2;\n return {\n x: minX - padding,\n y: minY - padding,\n width: width,\n height: height,\n };\n}\n","import React, { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport classNames from \"classnames\";\nimport type {\n ActiveTarget,\n Cell,\n CellContextMenuDetail,\n ComputedEdgeLineConf,\n DecoratorTextChangeDetail,\n DecoratorView,\n EdgeCell,\n LayoutType,\n NodeBrickConf,\n NodeCell,\n} from \"./interfaces\";\nimport {\n isContainerDecoratorCell,\n isDecoratorCell,\n isEdgeCell,\n isNoManualLayout,\n isNodeCell,\n} from \"./processors/asserts\";\nimport { EdgeComponent } from \"./EdgeComponent\";\nimport { NodeComponent } from \"./NodeComponent\";\nimport { handleMouseDown } from \"./processors/handleMouseDown\";\nimport type { MoveCellPayload, ResizeCellPayload } from \"./reducers/interfaces\";\nimport { DecoratorComponent } from \"./decorators\";\nimport { cellToTarget } from \"./processors/cellToTarget\";\nimport type { SizeTuple, TransformLiteral } from \"../diagram/interfaces\";\nimport { sameTarget } from \"./processors/sameTarget\";\nimport { targetIsActive } from \"./processors/targetIsActive\";\nimport { computeContainerRect } from \"./processors/computeContainerRect\";\nimport { get } from \"lodash\";\nexport interface CellComponentProps {\n layout: LayoutType;\n cell: Cell;\n cells: Cell[];\n degraded: boolean;\n degradedNodeLabel?: string;\n defaultNodeBricks?: NodeBrickConf[];\n transform: TransformLiteral;\n lineConfMap: WeakMap<EdgeCell, ComputedEdgeLineConf>;\n activeTarget: ActiveTarget | null | undefined;\n readOnly?: boolean;\n unrelatedCells: Cell[];\n dragNodeToContainerActive?: boolean;\n onCellsMoving?(info: MoveCellPayload[]): void;\n onCellsMoved?(info: MoveCellPayload[]): void;\n onCellResizing?(info: ResizeCellPayload): void;\n onCellResized?(info: ResizeCellPayload): void;\n onSwitchActiveTarget(target: ActiveTarget | null): void;\n onCellContextMenu(detail: CellContextMenuDetail): void;\n onCellClick?(detail: CellContextMenuDetail): void;\n onDecoratorTextEditing?(detail: { id: string; editing: boolean }): void;\n onDecoratorTextChange?(detail: DecoratorTextChangeDetail): void;\n onNodeBrickResize(id: string, size: SizeTuple | null): void;\n onCellMouseEnter?(cell: Cell): void;\n onCellMouseLeave?(cell: Cell): void;\n}\n\nexport function CellComponent({\n layout,\n cell,\n cells,\n degraded,\n degradedNodeLabel,\n defaultNodeBricks,\n lineConfMap,\n activeTarget,\n dragNodeToContainerActive,\n readOnly,\n transform,\n unrelatedCells,\n onCellsMoving,\n onCellsMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onCellContextMenu,\n onCellClick,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n onNodeBrickResize,\n onCellMouseEnter,\n onCellMouseLeave,\n}: CellComponentProps): JSX.Element | null {\n const gRef = useRef<SVGGElement>(null);\n const unrelated = useMemo(\n () => unrelatedCells.some((item) => sameTarget(item, cell)),\n [cell, unrelatedCells]\n );\n const containerRect = useMemo((): DecoratorView => {\n if (isContainerDecoratorCell(cell) && isNoManualLayout(layout)) {\n const containCells = cells.filter(\n (c): c is NodeCell => isNodeCell(c) && c.containerId === cell.id\n );\n const view = {\n ...cell.view,\n ...computeContainerRect(containCells),\n };\n cell.view = view; //Update the rect container to make sure Lasso gets the correct size\n return view;\n }\n return get(cell, \"view\", { x: 0, y: 0, width: 0, height: 0 });\n }, [layout, cell, cells]);\n\n useEffect(() => {\n const g = gRef.current;\n if (!g) {\n return;\n }\n const onMouseDown = (event: MouseEvent) => {\n if (\n readOnly ||\n (isContainerDecoratorCell(cell) && isNoManualLayout(layout))\n ) {\n event.stopPropagation();\n } else {\n handleMouseDown(event, {\n layout,\n action: \"move\",\n cell,\n scale: transform.k,\n activeTarget,\n cells,\n onCellsMoving,\n onCellsMoved,\n onSwitchActiveTarget,\n });\n }\n };\n g.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n g.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [\n layout,\n cell,\n activeTarget,\n cells,\n onCellsMoved,\n onCellsMoving,\n onSwitchActiveTarget,\n readOnly,\n transform.k,\n ]);\n\n const handleContextMenu = useCallback(\n (event: React.MouseEvent<SVGGElement>) => {\n if (readOnly && cell.type === \"decorator\") {\n return;\n }\n event.preventDefault();\n onSwitchActiveTarget(cellToTarget(cell));\n onCellContextMenu({\n cell,\n clientX: event.clientX,\n clientY: event.clientY,\n });\n },\n [cell, onCellContextMenu, onSwitchActiveTarget, readOnly]\n );\n\n const handleCellClick = useCallback(\n (event: React.MouseEvent<SVGGElement>) => {\n if (!onCellClick || cell.type === \"decorator\") {\n return;\n }\n onCellClick({\n cell,\n clientX: event.clientX,\n clientY: event.clientY,\n });\n },\n [cell, onCellClick]\n );\n\n const handleMouseEnter = useCallback(() => {\n onCellMouseEnter?.(cell);\n }, [cell, onCellMouseEnter]);\n\n const handleMouseLeave = useCallback(() => {\n onCellMouseLeave?.(cell);\n }, [cell, onCellMouseLeave]);\n return (\n <g\n className={classNames(\"cell\", {\n active: targetIsActive(cell, activeTarget),\n faded: unrelated,\n \"read-only\": readOnly,\n \"container-active\": dragNodeToContainerActive,\n })}\n ref={gRef}\n transform={\n cell.type === \"edge\" || cell.view.x == null\n ? undefined\n : `translate(${containerRect.x} ${containerRect.y})`\n }\n onContextMenu={handleContextMenu}\n onClick={handleCellClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {isNodeCell(cell) ? (\n <NodeComponent\n node={cell}\n degraded={degraded}\n degradedNodeLabel={degradedNodeLabel}\n defaultNodeBricks={defaultNodeBricks}\n onResize={onNodeBrickResize}\n />\n ) : isEdgeCell(cell) ? (\n <EdgeComponent edge={cell} cells={cells} lineConfMap={lineConfMap} />\n ) : isDecoratorCell(cell) ? (\n <DecoratorComponent\n cell={cell}\n view={containerRect}\n transform={transform}\n readOnly={readOnly}\n layout={layout}\n activeTarget={activeTarget}\n cells={cells}\n onCellResizing={onCellResizing}\n onCellResized={onCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onDecoratorTextEditing={onDecoratorTextEditing}\n onDecoratorTextChange={onDecoratorTextChange}\n />\n ) : null}\n </g>\n );\n}\n","export const SYMBOL_FOR_SIZE_INITIALIZED = Symbol.for(\"size-initialized\");\nexport const SYMBOL_FOR_LAYOUT_INITIALIZED = Symbol.for(\"layout-initialized\");\nexport const DEFAULT_NODE_SIZE = 20;\nexport const DEFAULT_NODE_GAP = 36;\nexport const DEFAULT_AREA_WIDTH = 180;\nexport const DEFAULT_AREA_HEIGHT = 120;\nexport const DEFAULT_SCALE_RANGE_MIN = 0.5;\nexport const DEFAULT_SCALE_RANGE_MAX = 2;\nexport const DEFAULT_LINE_STROKE_COLOR = \"gray\";\nexport const DEFAULT_LINE_STROKE_WIDTH = 1;\nexport const DEFAULT_LINE_INTERACT_STROKE_WIDTH = 15;\nexport const DEFAULT_LINE_INTERACT_SHOW_START_ARROW = false;\nexport const DEFAULT_LINE_INTERACT_SHOW_END_ARROW = true;\nexport const DEFAULT_LINE_INTERACT_ANIMATE_DURATION = 1;\nexport const DEFAULT_DEGRADED_THRESHOLD = 500;\n","import type {\n Cell,\n DecoratorCell,\n EdgeCell,\n InitialCell,\n InitialNodeCell,\n LayoutType,\n NodeCell,\n} from \"../interfaces\";\nimport { MoveCellPayload } from \"../reducers/interfaces\";\n\nexport function isNodeCell(cell: Cell | MoveCellPayload): cell is NodeCell {\n return cell.type === \"node\";\n}\n\nexport function isDecoratorCell(cell: Cell): cell is DecoratorCell {\n return cell.type === \"decorator\";\n}\n\nexport function isInitialNodeCell(cell: InitialCell): cell is InitialNodeCell {\n return cell.type === \"node\";\n}\n\nexport function isEdgeCell(cell: Cell): cell is EdgeCell {\n return cell.type === \"edge\";\n}\n\nexport function isNodeOrEdgeCell(cell: Cell): cell is NodeCell | EdgeCell {\n return cell.type === \"node\" || cell.type === \"edge\";\n}\n\nexport function isNodeOrAreaDecoratorCell(\n cell: Cell\n): cell is NodeCell | DecoratorCell {\n return (\n cell.type === \"node\" ||\n (cell.type === \"decorator\" && cell.decorator === \"area\")\n );\n}\nexport function isNodeOrTextDecoratorCell(\n cell: Cell | MoveCellPayload\n): cell is NodeCell | DecoratorCell {\n return (\n cell.type === \"node\" ||\n (cell.type === \"decorator\" && cell.decorator === \"text\")\n );\n}\n\nexport function isTextDecoratorCell(cell: Cell): cell is DecoratorCell {\n return cell.type === \"decorator\" && cell.decorator === \"text\";\n}\nexport function isContainerDecoratorCell(\n cell: Cell | MoveCellPayload\n): cell is DecoratorCell {\n return cell.type === \"decorator\" && cell.decorator === \"container\";\n}\n\nexport function isNoManualLayout(layout: LayoutType) {\n return ![\"manual\", undefined].includes(layout!);\n}\n","import { pick } from \"lodash\";\nimport type { ActiveTargetOfSingular, Cell } from \"../interfaces\";\n\nexport function cellToTarget(cell: Cell): ActiveTargetOfSingular {\n return cell.type === \"edge\"\n ? pick(cell, [\"type\", \"source\", \"target\", \"data\"])\n : pick(cell, [\"type\", \"id\", \"data\"]);\n}\n","import type { ActiveTarget, Cell, ConnectLineState } from \"../interfaces\";\nimport { targetIsActive } from \"./targetIsActive\";\n\nexport function getUnrelatedCells(\n cells: Cell[],\n connectLineState: ConnectLineState | null,\n activeTarget: ActiveTarget | null,\n allowEdgeToArea?: boolean\n): Cell[] {\n const unrelated: Cell[] = [];\n if (connectLineState) {\n const existedTargets = new Set<string>();\n for (const cell of cells) {\n if (cell.type === \"edge\" && cell.source === connectLineState.source.id) {\n existedTargets.add(cell.target);\n }\n }\n for (const cell of cells) {\n switch (cell.type) {\n case \"node\":\n if (existedTargets.has(cell.id)) {\n unrelated.push(cell);\n }\n break;\n case \"decorator\":\n if (\n !allowEdgeToArea ||\n cell.decorator == \"text\" ||\n existedTargets.has(cell.id)\n ) {\n unrelated.push(cell);\n }\n break;\n default:\n unrelated.push(cell);\n }\n }\n } else {\n switch (activeTarget?.type) {\n case \"multi\": {\n const nodesMap = new Map<string, Cell>();\n const activeNodeIds = new Set<string>();\n const relatedNodeIds = new Set<string>();\n for (const active of activeTarget.targets) {\n if (active.type === \"node\") {\n activeNodeIds.add(active.id);\n relatedNodeIds.add(active.id);\n }\n }\n for (const cell of cells) {\n if (cell.type === \"node\") {\n nodesMap.set(cell.id, cell);\n } else if (cell.type === \"edge\") {\n if (activeNodeIds.has(cell.source)) {\n relatedNodeIds.add(cell.target);\n } else if (activeNodeIds.has(cell.target)) {\n relatedNodeIds.add(cell.source);\n } else if (!targetIsActive(cell, activeTarget)) {\n unrelated.push(cell);\n }\n } else if (!targetIsActive(cell, activeTarget)) {\n unrelated.push(cell);\n }\n }\n for (const [id, cell] of nodesMap) {\n if (!relatedNodeIds.has(id)) {\n unrelated.push(cell);\n }\n }\n break;\n }\n\n case \"node\": {\n const nodesMap = new Map<string, Cell>();\n const relatedNodeIds = new Set<string>([activeTarget.id]);\n for (const cell of cells) {\n if (cell.type === \"node\") {\n nodesMap.set(cell.id, cell);\n } else if (cell.type === \"edge\") {\n if (cell.source === activeTarget.id) {\n relatedNodeIds.add(cell.target);\n } else if (cell.target === activeTarget.id) {\n relatedNodeIds.add(cell.source);\n } else {\n unrelated.push(cell);\n }\n } else {\n unrelated.push(cell);\n }\n }\n for (const [id, cell] of nodesMap) {\n if (!relatedNodeIds.has(id)) {\n unrelated.push(cell);\n }\n }\n break;\n }\n\n case \"edge\":\n for (const cell of cells) {\n if (\n !(cell.type === \"edge\"\n ? targetIsActive(cell, activeTarget)\n : cell.type === \"node\" &&\n (cell.id === activeTarget.source ||\n cell.id === activeTarget.target))\n ) {\n unrelated.push(cell);\n }\n }\n break;\n }\n }\n\n return unrelated;\n}\n","import type { SizeTuple } from \"../../diagram/interfaces\";\nimport type { Cell, InitialCell, NodeCell } from \"../interfaces\";\nimport { isInitialNodeCell } from \"./asserts\";\n\nexport function initializeCells(\n initialCells: InitialCell[] | undefined,\n {\n defaultNodeSize,\n }: {\n defaultNodeSize: SizeTuple;\n }\n): Cell[] {\n const originalCells = initialCells ?? [];\n const finalCells: Cell[] = originalCells.map<Cell>((cell) => {\n if (\n !isInitialNodeCell(cell) ||\n (cell.view?.width !== undefined && cell.view?.height !== undefined)\n ) {\n return cell as NodeCell;\n }\n return {\n ...cell,\n view: {\n width: defaultNodeSize[0],\n height: defaultNodeSize[1],\n ...cell.view,\n },\n } as NodeCell;\n });\n return finalCells;\n}\n","import type {\n ActiveTarget,\n ActiveTargetOfEdge,\n ActiveTargetOfMulti,\n ActiveTargetOfNode,\n} from \"../interfaces\";\n\nexport function sameTarget(\n a: ActiveTarget | null | undefined,\n b: ActiveTarget | null | undefined\n): boolean {\n return a\n ? !!b &&\n a.type === b.type &&\n (a.type === \"multi\"\n ? a.targets.length === (b as ActiveTargetOfMulti).targets.length &&\n a.targets.every((targetA) =>\n (b as ActiveTargetOfMulti).targets.some((targetB) =>\n sameTarget(targetA, targetB)\n )\n )\n : a.type === \"node\" || a.type === \"decorator\"\n ? a.id === (b as ActiveTargetOfNode).id\n : a.source === (b as ActiveTargetOfEdge).source &&\n a.target === (b as ActiveTargetOfEdge).target)\n : !b;\n}\n","import type { ActiveTarget, ActiveTargetOfSingular } from \"../interfaces\";\nimport { sameTarget } from \"./sameTarget\";\n\nexport function targetIsActive(\n target: ActiveTargetOfSingular,\n activeTarget: ActiveTarget | null | undefined\n): boolean {\n return (\n !!activeTarget &&\n (activeTarget.type === \"multi\"\n ? activeTarget.targets\n : [activeTarget]\n ).some((active) => sameTarget(active, target))\n );\n}\n","import type { TransformLiteral } from \"../../diagram/interfaces\";\nimport type { Cell } from \"../interfaces\";\nimport { isEdgeCell } from \"./asserts\";\n\nexport interface TransformToCenterOptions {\n canvasWidth: number;\n canvasHeight: number;\n scaleRange?: [min: number, max: number];\n}\n\nexport function transformToCenter(\n cells: Cell[],\n { canvasWidth, canvasHeight, scaleRange }: TransformToCenterOptions\n): TransformLiteral {\n let left = Infinity;\n let top = Infinity;\n let right = -Infinity;\n let bottom = -Infinity;\n let empty = true;\n for (const cell of cells) {\n if (!isEdgeCell(cell)) {\n empty = false;\n const { view } = cell;\n const r = view.x + view.width;\n const b = view.y + view.height;\n if (view.x < left) {\n left = view.x;\n }\n if (r > right) {\n right = r;\n }\n if (view.y < top) {\n top = view.y;\n }\n if (b > bottom) {\n bottom = b;\n }\n }\n }\n\n const width = right - left;\n const height = bottom - top;\n\n const scale =\n scaleRange && !empty && (width > canvasWidth || height > canvasHeight)\n ? Math.max(\n Math.min(canvasWidth / width, canvasHeight / height, scaleRange[1]),\n scaleRange[0]\n )\n : 1;\n\n const x = empty ? 0 : (canvasWidth - width * scale) / 2 - left * scale;\n const y = empty ? 0 : (canvasHeight - height * scale) / 2 - top * scale;\n\n return { x, y, k: scale };\n}\n","import { without } from \"lodash\";\nimport type {\n RangeTuple,\n SizeTuple,\n TransformLiteral,\n} from \"../../diagram/interfaces\";\nimport { DEFAULT_NODE_GAP, SYMBOL_FOR_SIZE_INITIALIZED } from \"../constants\";\nimport type {\n Cell,\n InitialCell,\n LayoutType,\n NodeCell,\n NodeId,\n NodeView,\n} from \"../interfaces\";\nimport { isDecoratorCell, isEdgeCell, isNodeCell } from \"./asserts\";\nimport { initializeCells } from \"./initializeCells\";\nimport { transformToCenter } from \"./transformToCenter\";\nimport { forceLayout } from \"../../shared/canvas/forceLayout\";\nimport { dagreLayout } from \"../../shared/canvas/dagreLayout\";\nimport { sameTarget } from \"./sameTarget\";\n\nexport function updateCells({\n cells,\n layout,\n previousCells,\n defaultNodeSize,\n canvasWidth,\n canvasHeight,\n scaleRange,\n transform,\n reason,\n parent,\n allowEdgeToArea,\n}: {\n cells: InitialCell[] | undefined;\n layout?: LayoutType;\n previousCells: Cell[];\n defaultNodeSize: SizeTuple;\n canvasWidth: number;\n canvasHeight: number;\n scaleRange: RangeTuple;\n transform: TransformLiteral;\n reason?: \"add-related-nodes\";\n parent?: NodeId;\n allowEdgeToArea?: boolean;\n}): {\n cells: Cell[];\n updated: Cell[];\n shouldReCenter: boolean;\n} {\n const isManualLayout = layout !== \"force\" && layout !== \"dagre\";\n const newCells = initializeCells(cells, { defaultNodeSize });\n const updateCandidates: NodeCell[] = [];\n let shouldReCenter = false;\n\n const previousSizeInitializedNodes = new Map<string, NodeCell>();\n let previousShouldCentered = false;\n for (const cell of previousCells) {\n if (isDecoratorCell(cell)) {\n previousShouldCentered = true;\n } else if (isNodeCell(cell)) {\n previousShouldCentered = true;\n if (cell[SYMBOL_FOR_SIZE_INITIALIZED]) {\n previousSizeInitializedNodes.set(cell.id, cell);\n }\n }\n }\n\n const nodesMap = new Map<string, NodeCell>();\n for (const cell of newCells) {\n if (isNodeCell(cell)) {\n nodesMap.set(cell.id, cell);\n const previousNode = previousSizeInitializedNodes.get(cell.id);\n if (previousNode) {\n cell.view.width = previousNode.view.width;\n cell.view.height = previousNode.view.height;\n cell[SYMBOL_FOR_SIZE_INITIALIZED] = true;\n }\n }\n }\n\n let handled = false;\n\n if (reason === \"add-related-nodes\" && parent) {\n // Place these unpositioned downstream nodes below the parent node, and\n // on the right side of the positioned siblings.\n const downstreamNodeIds = new Set<string>();\n for (const cell of newCells) {\n if (\n isEdgeCell(cell) &&\n cell.source === parent &&\n cell.target !== parent\n ) {\n downstreamNodeIds.add(cell.target);\n }\n }\n const parentNode = nodesMap.get(parent);\n if (parentNode?.view.x !== undefined && parentNode.view.y !== undefined) {\n handled = true;\n /**\n * 临时解决一次性添加多层的节点手工布局报错\n */\n if (isManualLayout) {\n for (const cell of newCells) {\n if (\n (isNodeCell(cell) && cell.view.x === undefined) ||\n (isNodeCell(cell) && cell.view.y === undefined)\n ) {\n downstreamNodeIds.add(cell.id);\n }\n }\n }\n const downstreamNodes = [...downstreamNodeIds]\n .map((id) => nodesMap.get(id))\n .filter(Boolean) as NodeCell[];\n let rightMostNode: NodeCell | undefined = undefined;\n for (const node of downstreamNodes) {\n if (node.view.x !== undefined && node.view.y !== undefined) {\n // Find the rightmost node that is below the parent node.\n if (\n (!rightMostNode || node.view.x > rightMostNode.view.x) &&\n node.view.y > parentNode.view.y\n ) {\n rightMostNode = node;\n }\n } else {\n // Unpositioned nodes\n updateCandidates.push(node);\n }\n }\n if (updateCandidates.length > 0 && isManualLayout) {\n let nextX: number;\n let nextY: number;\n if (rightMostNode) {\n // Place unpositioned nodes on the right side of the rightmost positioned siblings.\n nextX =\n rightMostNode.view.x + rightMostNode.view.width + DEFAULT_NODE_GAP;\n nextY = rightMostNode.view.y;\n } else {\n // If there are no positioned siblings, just place them below the parent.\n const totalWidth = updateCandidates.reduce(\n (acc, node) => acc + node.view.width + DEFAULT_NODE_GAP,\n -DEFAULT_NODE_GAP\n );\n nextX =\n parentNode.view.x - totalWidth / 2 + parentNode.view.width / 2;\n nextY = parentNode.view.y + parentNode.view.height + DEFAULT_NODE_GAP;\n }\n for (const node of updateCandidates) {\n node.view.x = nextX;\n node.view.y = nextY;\n nextX += node.view.width + DEFAULT_NODE_GAP;\n }\n }\n }\n }\n\n if (!handled) {\n // By default, place unpositioned nodes in a grid.\n let maxWidth = defaultNodeSize[0];\n let maxHeight = defaultNodeSize[1];\n const positionedNodes: NodeCell[] = [];\n let hasDecorators = false;\n for (const cell of newCells) {\n if (isNodeCell(cell)) {\n if (cell.view.width > maxWidth) {\n maxWidth = cell.view.width;\n }\n if (cell.view.height > maxHeight) {\n maxHeight = cell.view.height;\n }\n if (cell.view.x === undefined || cell.view.y === undefined) {\n updateCandidates.push(cell);\n } else {\n positionedNodes.push(cell);\n }\n } else if (isDecoratorCell(cell)) {\n hasDecorators = true;\n }\n }\n\n if (isManualLayout) {\n if (!previousShouldCentered) {\n // If the previous cells are not centered, use the centered transform instead.\n transform = transformToCenter(without(newCells, ...updateCandidates), {\n canvasWidth,\n canvasHeight,\n scaleRange,\n });\n }\n\n let getNodeView: (id: NodeId) => NodeView;\n\n // If there is no positioned nodes, or only one while without decorators,\n // then there is no relative positions, we can place the nodes with dagre layout.\n // Otherwise, use the force layout.\n if (\n positionedNodes.length === 0 ||\n (positionedNodes.length === 1 && !hasDecorators)\n ) {\n // The positioned node (if exists) will be updated.\n updateCandidates.push(...positionedNodes);\n ({ getNodeView } = dagreLayout({ cells: newCells, allowEdgeToArea }));\n // Only re-center when there is no cells previous,\n // or the cell ids are not changed (this happens when updateCells called by backend right after dropNode).\n shouldReCenter =\n previousCells.length === 0 ||\n (previousCells.length === newCells.length &&\n previousCells.every((cell, index) =>\n sameTarget(cell, newCells[index])\n ));\n } else {\n ({ getNodeView } = forceLayout({\n cells: newCells,\n fixedPosition: true,\n allowEdgeToArea,\n center: [\n (canvasWidth / 2 - transform.x) / transform.k,\n (canvasHeight / 2 - transform.y) / transform.k,\n ],\n }));\n }\n\n for (const cell of newCells) {\n if (isNodeCell(cell)) {\n const view = getNodeView(cell.id);\n cell.view.x = view.x;\n cell.view.y = view.y;\n }\n }\n }\n }\n\n return { cells: newCells, updated: updateCandidates, shouldReCenter };\n}\n","import type { Reducer } from \"react\";\nimport type { DrawCanvasAction } from \"./interfaces\";\nimport type { Cell, NodeCell } from \"../interfaces\";\nimport { isNodeCell } from \"../processors/asserts\";\nimport { SYMBOL_FOR_SIZE_INITIALIZED } from \"../constants\";\n\nexport const cells: Reducer<Cell[], DrawCanvasAction> = (state, action) => {\n switch (action.type) {\n case \"drop-node\":\n return insertCellAfter(\n state,\n action.payload,\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n );\n case \"drop-decorator\": {\n if (action.payload.decorator === \"text\") {\n return [...state, action.payload];\n }\n return insertCellAfter(\n state,\n action.payload,\n (cell) => cell.type === \"decorator\" && cell.decorator === \"area\"\n );\n }\n case \"add-nodes\": {\n const index =\n state.findLastIndex(\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n ) + 1;\n return [\n ...state.slice(0, index),\n ...action.payload,\n ...state.slice(index),\n ];\n }\n case \"add-edge\":\n // Add the edge to just next to the previous last edge or area decorator.\n // If not found, append to the start.\n return insertCellAfter(\n state,\n action.payload,\n (cell) =>\n cell.type === \"edge\" ||\n (cell.type === \"decorator\" && cell.decorator === \"area\")\n );\n case \"move-cells\": {\n let matched = false;\n const newState = state.map((cell) => {\n const newCell = action.payload.find(\n (move) => cell.type === move.type && cell.id === move.id\n );\n if (newCell) {\n matched = true;\n return {\n ...cell,\n view: { ...(cell as NodeCell).view, x: newCell.x, y: newCell.y },\n };\n }\n return cell;\n });\n return matched ? newState : state;\n }\n case \"resize-cell\": {\n const { type, id, width, height } = action.payload;\n const index = state.findIndex(\n (cell) => cell.type === type && cell.id === id\n );\n if (index !== -1) {\n const node = state[index] as NodeCell;\n return [\n ...state.slice(0, index),\n { ...node, view: { ...node.view, width, height } },\n ...state.slice(index + 1),\n ];\n }\n return state;\n }\n case \"update-cells\":\n return action.payload;\n case \"update-node-size\":\n return state.map((cell) =>\n isNodeCell(cell) && cell.id === action.payload.id\n ? {\n ...cell,\n [SYMBOL_FOR_SIZE_INITIALIZED]: true,\n view: action.payload.size\n ? {\n ...cell.view,\n width: action.payload.size[0],\n height: action.payload.size[1],\n }\n : cell.view,\n }\n : cell\n );\n }\n return state;\n};\n\nfunction insertCellAfter(\n cells: Cell[],\n newCell: Cell,\n after: (cell: Cell) => boolean\n) {\n const index = cells.findLastIndex(after) + 1;\n return [...cells.slice(0, index), newCell, ...cells.slice(index)];\n}\n","import { Reducer } from \"react\";\nimport type { DrawCanvasAction, DrawCanvasState } from \"./interfaces\";\nimport { cells } from \"./cells\";\nimport { layoutKey } from \"./layoutKey\";\n\ntype ReducersMapObject<S, A> = {\n [K in keyof S]: Reducer<S[K], A>;\n};\n\nfunction combineReducers<S, A>(\n reducers: ReducersMapObject<S, A>\n): Reducer<S, A> {\n return ((state, action) =>\n Object.fromEntries(\n Object.entries<Reducer<any, A>>(reducers).map(([key, value]) => [\n key,\n value(state[key as keyof S], action),\n ])\n )) as Reducer<S, A>;\n}\n\nexport const rootReducer = combineReducers<DrawCanvasState, DrawCanvasAction>({\n cells,\n layoutKey,\n});\n","import type { Reducer } from \"react\";\nimport type { DrawCanvasAction } from \"./interfaces\";\n\nexport const layoutKey: Reducer<number, DrawCanvasAction> = (state, action) => {\n switch (action.type) {\n case \"update-node-size\":\n return action.layoutKey;\n default:\n return state;\n }\n};\n","import * as React from \"react\";\nconst SvgCenter = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={24} height={24} viewBox=\"0 0 24 24\" {...props}><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\" /></svg>;\nexport default SvgCenter;","import * as React from \"react\";\nconst SvgZoomIn = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={128} height={128} className=\"icon\" viewBox=\"0 0 1024 1024\" {...props}><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\" /><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\" /></svg>;\nexport default SvgZoomIn;","import * as React from \"react\";\nconst SvgZoomOut = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={128} height={128} className=\"icon\" viewBox=\"0 0 1024 1024\" {...props}><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\" /><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\" /></svg>;\nexport default SvgZoomOut;","import React, { useCallback, useMemo, useRef } from \"react\";\nimport { ConfigProvider, Slider, theme } from \"antd\";\nimport { StyleProvider, createCache } from \"@ant-design/cssinjs\";\nimport { useCurrentTheme } from \"@next-core/react-runtime\";\nimport type { RangeTuple } from \"../../diagram/interfaces\";\nimport CenterSVG from \"./icons/center.svg\";\nimport ZoomInSVG from \"./icons/zoom-in.svg\";\nimport ZoomOutSVG from \"./icons/zoom-out.svg\";\n\nexport interface ZoomBarComponentProps {\n shadowRoot: ShadowRoot;\n scale: number;\n scaleRange: RangeTuple;\n onZoomChange(value: number): void;\n onReCenter(): void;\n}\n\nexport function ZoomBarComponent({\n shadowRoot,\n scale,\n scaleRange,\n onZoomChange,\n onReCenter,\n}: ZoomBarComponentProps): JSX.Element | null {\n const currentTheme = useCurrentTheme();\n const cache = useMemo(() => createCache(), []);\n const zoomBarRef = useRef<HTMLDivElement | null>(null);\n const min = scaleRange[0] * 100;\n const max = scaleRange[1] * 100;\n const value = scale * 100;\n const step = 5;\n\n const tooltip = useMemo(() => {\n return {\n formatter: (value: number | undefined) => `${value}%`,\n placement: \"left\" as const,\n getPopupContainer: () => zoomBarRef.current!,\n };\n }, []);\n\n const onZoomIn = useCallback(() => {\n onZoomChange(Math.min(value + step, max));\n }, [max, onZoomChange, value]);\n\n const onZoomOut = useCallback(() => {\n onZoomChange(Math.max(value - step, min));\n }, [min, onZoomChange, value]);\n\n return (\n <ConfigProvider\n theme={{\n algorithm:\n currentTheme === \"dark-v2\"\n ? theme.darkAlgorithm\n : theme.defaultAlgorithm,\n }}\n >\n <StyleProvider\n container={shadowRoot}\n // Auto clear injected styles after unmount\n autoClear\n cache={cache}\n // Set hashPriority to \"high\" to disable `:where()` usage for compatibility\n hashPriority=\"high\"\n >\n <div className=\"zoom-bar\" ref={zoomBarRef}>\n <div className=\"center-button\" onClick={onReCenter} role=\"button\">\n <CenterSVG />\n </div>\n <div className=\"zoom-slider\">\n <div className=\"zoom-button\" role=\"button\" onClick={onZoomIn}>\n <ZoomInSVG />\n </div>\n <Slider\n min={min}\n max={max}\n value={value}\n step={step}\n vertical\n included={false}\n tooltip={tooltip}\n onChange={onZoomChange}\n />\n <div className=\"zoom-button\" role=\"button\" onClick={onZoomOut}>\n <ZoomOutSVG />\n </div>\n </div>\n </div>\n </StyleProvider>\n </ConfigProvider>\n );\n}\n","import { pick } from \"lodash\";\nimport dagre from \"@dagrejs/dagre\";\nimport { extractPartialRectTuple } from \"../../diagram/processors/extractPartialRectTuple\";\nimport type {\n Cell,\n ForceNode,\n LayoutOptionsDagre,\n NodeId,\n NodeView,\n} from \"../../draw-canvas/interfaces\";\nimport {\n isEdgeCell,\n isNodeCell,\n isNodeOrAreaDecoratorCell,\n} from \"../../draw-canvas/processors/asserts\";\nimport type { FullRectTuple } from \"../../diagram/interfaces\";\n\nexport interface DagreLayoutOptions {\n cells: Cell[];\n layoutOptions?: LayoutOptionsDagre;\n allowEdgeToArea?: boolean;\n}\n\nexport function dagreLayout({\n cells,\n layoutOptions,\n allowEdgeToArea,\n}: DagreLayoutOptions): {\n getNodeView: (id: NodeId) => NodeView;\n nodePaddings: FullRectTuple;\n} {\n const { nodePadding, ...dagreGraphOptions } = {\n nodePadding: 0,\n rankdir: \"TB\",\n ranksep: 50,\n edgesep: 10,\n nodesep: 50,\n // align: undefined,\n ...pick(layoutOptions, [\n \"nodePadding\",\n \"rankdir\",\n \"ranksep\",\n \"edgesep\",\n \"nodesep\",\n \"align\",\n ]),\n };\n const nodePaddings = extractPartialRectTuple(nodePadding);\n\n if (!cells.some(isNodeCell)) {\n // Dagre cannot render empty nodes\n return {\n getNodeView: () => null!,\n nodePaddings,\n };\n }\n\n const graph = new dagre.graphlib.Graph<ForceNode>();\n graph.setGraph(dagreGraphOptions);\n // Default to assigning a new object as a label for each new edge.\n graph.setDefaultEdgeLabel(function () {\n return {};\n });\n for (const cell of cells) {\n if (\n (allowEdgeToArea && isNodeOrAreaDecoratorCell(cell)) ||\n isNodeCell(cell)\n ) {\n graph.setNode(cell.id, {\n id: cell.id,\n width: cell.view.width + nodePaddings[1] + nodePaddings[3],\n height: cell.view.height + nodePaddings[0] + nodePaddings[2],\n });\n } else if (isEdgeCell(cell)) {\n graph.setEdge(cell.source, cell.target);\n }\n }\n dagre.layout(graph);\n\n return {\n getNodeView: (id: NodeId) => graph.node(id),\n nodePaddings,\n };\n}\n","import { pick } from \"lodash\";\nimport {\n forceCollide,\n forceLink,\n forceManyBody,\n forceSimulation,\n forceX,\n forceY,\n type Simulation,\n} from \"d3-force\";\nimport type {\n Cell,\n ForceCollideOptions,\n ForceLink,\n ForceNode,\n LayoutOptionsForce,\n NodeId,\n NodeView,\n} from \"../../draw-canvas/interfaces\";\nimport {\n isEdgeCell,\n isNodeCell,\n isNodeOrAreaDecoratorCell,\n} from \"../../draw-canvas/processors/asserts\";\nimport { extractPartialRectTuple } from \"../../diagram/processors/extractPartialRectTuple\";\nimport type { FullRectTuple, PositionTuple } from \"../../diagram/interfaces\";\n\nexport interface ForceLayoutOptions {\n cells: Cell[];\n layoutOptions?: LayoutOptionsForce;\n center?: PositionTuple;\n fixedPosition?: boolean;\n allowEdgeToArea?: boolean;\n}\n\nexport function forceLayout({\n cells,\n layoutOptions,\n center,\n fixedPosition,\n allowEdgeToArea,\n}: ForceLayoutOptions): {\n getNodeView: (id: NodeId) => NodeView;\n nodePaddings: FullRectTuple;\n} {\n const { nodePadding, collide } = {\n nodePadding: 0,\n ...pick(layoutOptions, [\"nodePadding\"]),\n collide:\n layoutOptions?.collide !== false\n ? ({\n radiusDiff: 18,\n strength: 1,\n iterations: 1,\n ...(layoutOptions?.collide === true\n ? null\n : (layoutOptions?.collide as ForceCollideOptions)),\n } as Required<ForceCollideOptions>)\n : (false as const),\n };\n const nodePaddings = extractPartialRectTuple(nodePadding);\n const forceNodes: ForceNode[] = [];\n const forceLinks: ForceLink[] = [];\n const nodesMap = new Map<NodeId, ForceNode>();\n for (const cell of cells) {\n if (\n (allowEdgeToArea && isNodeOrAreaDecoratorCell(cell)) ||\n isNodeCell(cell)\n ) {\n const node: ForceNode = {\n id: cell.id,\n width: cell.view.width + nodePaddings[1] + nodePaddings[3],\n height: cell.view.height + nodePaddings[0] + nodePaddings[2],\n ...(fixedPosition ? { fx: cell.view.x, fy: cell.view.y } : null),\n };\n forceNodes.push(node);\n nodesMap.set(node.id, node);\n } else if (isEdgeCell(cell)) {\n forceLinks.push({ source: cell.source, target: cell.target });\n }\n }\n\n const linkSimulation = forceLink<ForceNode, ForceLink>(forceLinks).id(\n (d) => d.id\n );\n const simulation = forceSimulation<ForceNode, ForceLink>(forceNodes)\n .force(\"link\", linkSimulation)\n .force(\"x\", forceX(center?.[0]))\n .force(\"y\", forceY(center?.[1]))\n .force(\"charge\", forceManyBody());\n\n if (collide) {\n simulation.force(\n \"collide\",\n forceCollide<ForceNode>()\n .radius(\n (d) =>\n Math.sqrt(d.width ** 2 + d.height ** 2) / 2 + collide.radiusDiff\n )\n .strength(collide.strength)\n .iterations(collide.iterations)\n );\n }\n\n simulation.stop();\n manuallyTickToTheEnd(simulation);\n\n return {\n getNodeView: (id: NodeId) => nodesMap.get(id) as NodeView,\n nodePaddings,\n };\n}\n\nfunction manuallyTickToTheEnd(\n simulation: Simulation<ForceNode, ForceLink>\n): void {\n // Manually tick to the end.\n simulation.tick(\n Math.ceil(\n Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay())\n )\n );\n}\n","import React, { useEffect, useRef, useState } from \"react\";\nimport type { ActiveTarget } from \"../../draw-canvas/interfaces\";\nimport { sameTarget } from \"../../draw-canvas/processors/sameTarget\";\n\nexport interface UseActiveTargetOptions {\n cellsRef: React.RefObject<SVGGElement>;\n activeTarget?: ActiveTarget | null;\n onActiveTargetChange(target: ActiveTarget | null): void;\n}\n\nexport type UseActiveTargetResult = ActiveTarget | null;\n\nexport function useActiveTarget({\n cellsRef,\n activeTarget: _activeTarget,\n onActiveTargetChange,\n}: UseActiveTargetOptions): UseActiveTargetResult {\n const newActiveTarget = _activeTarget ?? null;\n const [activeTarget, setActiveTarget] = useState<ActiveTarget | null>(\n newActiveTarget\n );\n\n useEffect(() => {\n setActiveTarget((previous) =>\n sameTarget(previous, newActiveTarget) ? previous : newActiveTarget\n );\n }, [newActiveTarget]);\n\n const activeTargetChangeInitialized = useRef(false);\n useEffect(() => {\n if (!activeTargetChangeInitialized.current) {\n activeTargetChangeInitialized.current = true;\n return;\n }\n onActiveTargetChange(activeTarget);\n }, [activeTarget, onActiveTargetChange]);\n\n useEffect(() => {\n if (!activeTarget) {\n return;\n }\n const resetActiveTarget = (e: MouseEvent) => {\n const path = e.composedPath();\n const cellsContainerIndex = path.indexOf(cellsRef.current!);\n // Reset active target to null when clicking outside of the cells container,\n // Or inside the cells container but not on any cell.\n if (cellsContainerIndex <= 0) {\n setActiveTarget(null);\n }\n };\n document.addEventListener(\"click\", resetActiveTarget);\n return () => {\n document.removeEventListener(\"click\", resetActiveTarget);\n };\n }, [activeTarget, cellsRef]);\n\n return activeTarget;\n}\n","import type { AlignOrigin, NormalizedAlignOrigin } from \"../interfaces\";\n\nconst KeywordMap = new Map([\n [\"center\", 0.5],\n [\"left\", 0],\n [\"right\", 1],\n [\"top\", 0],\n [\"bottom\", 1],\n]);\n\nexport function normalizeAlignOrigin(\n alignOrigin: AlignOrigin | undefined\n): NormalizedAlignOrigin {\n const origin = alignOrigin ?? [0.5, 0.5];\n return [\n normalizeAlignAxis(origin[0], \"x\"),\n normalizeAlignAxis(origin[1], \"y\"),\n ];\n}\n\nfunction normalizeAlignAxis(value: string | number, axis: \"x\" | \"y\"): number {\n if (typeof value === \"string\") {\n const newX = KeywordMap.get(value);\n if (newX !== undefined) {\n return newX;\n }\n const matches = value.match(/^(-?\\d+(?:\\.\\d+)?)%$/);\n if (matches) {\n return Number(matches[1]) / 100;\n }\n // eslint-disable-next-line no-console\n console.error(\"Unexpected align origin %s:\", axis, value);\n } else if (typeof value === \"number\") {\n return value;\n } else {\n // eslint-disable-next-line no-console\n console.error(\n \"Unexpected align origin %s, expected %s, received %s:\",\n axis,\n \"string | number\",\n typeof value,\n value\n );\n }\n\n return 0.5;\n}\n","import { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { ZoomBehavior } from \"d3-zoom\";\nimport type {\n Cell,\n LayoutOptions,\n LayoutOptionsForce,\n LayoutOptionsDagre,\n LayoutType,\n NodeId,\n NodeView,\n} from \"../../draw-canvas/interfaces\";\nimport type { FullRectTuple, RangeTuple } from \"../../diagram/interfaces\";\nimport { useAutoCenter } from \"./useAutoCenter\";\nimport {\n isNodeCell,\n isNodeOrAreaDecoratorCell,\n isNodeOrEdgeCell,\n} from \"../../draw-canvas/processors/asserts\";\nimport {\n SYMBOL_FOR_LAYOUT_INITIALIZED,\n SYMBOL_FOR_SIZE_INITIALIZED,\n} from \"../../draw-canvas/constants\";\nimport type { DrawCanvasAction } from \"../../draw-canvas/reducers/interfaces\";\nimport { forceLayout } from \"./forceLayout\";\nimport { dagreLayout } from \"./dagreLayout\";\nimport { normalizeAlignOrigin } from \"../../draw-canvas/processors/normalizeAlignOrigin\";\n\nexport interface UseLayoutOptions {\n layout: LayoutType;\n layoutOptions?: LayoutOptions;\n rootRef: React.RefObject<SVGSVGElement>;\n cells: Cell[];\n zoomable?: boolean;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n scaleRange: RangeTuple;\n layoutKey: number;\n allowEdgeToArea?: boolean;\n dispatch: (value: DrawCanvasAction) => void;\n}\n\nexport function useLayout({\n layout,\n layoutOptions,\n rootRef,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n layoutKey,\n allowEdgeToArea,\n dispatch,\n}: UseLayoutOptions) {\n const [layoutInitialized, setLayoutInitialized] = useState(\n layout !== \"force\" && layout !== \"dagre\"\n );\n\n const layoutKeyRef = useRef(layoutKey);\n\n const getNextLayoutKey = useCallback(() => {\n return ++layoutKeyRef.current;\n }, []);\n\n const [centered, setCentered] = useAutoCenter({\n rootRef,\n layoutInitialized,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n });\n\n const previousLayoutRef = useRef<Cell[] | null>(null);\n\n useEffect(() => {\n // Wait for all nodes to be size-initialized before layout.\n if (\n cells.some(\n (cell) => isNodeCell(cell) && !cell[SYMBOL_FOR_SIZE_INITIALIZED]\n ) ||\n // Skip layout if no cells.\n cells.length === 0\n ) {\n return;\n }\n\n if (layout !== \"force\" && layout !== \"dagre\") {\n setLayoutInitialized(true);\n return;\n }\n\n // DO NOT re-layout if layout key mismatched.\n // DO NOT re-layout if nodes and edges not changed.\n if (\n layoutKeyRef.current !== layoutKey ||\n isSameArray(previousLayoutRef.current, cells.filter(isNodeOrEdgeCell))\n ) {\n // Layout key mismatch happens when this effect is performed after\n // update-node-size dispatched but not yet applied.\n // If didn't ignore mismatched layout, it will cause the update-cells\n // action overwrites those update-node-size actions.\n return;\n }\n\n let getNodeView: (id: NodeId) => NodeView;\n let nodePaddings: FullRectTuple;\n\n if (layout === \"force\") {\n ({ getNodeView, nodePaddings } = forceLayout({\n cells,\n layoutOptions: layoutOptions as LayoutOptionsForce,\n allowEdgeToArea,\n }));\n } else {\n ({ getNodeView, nodePaddings } = dagreLayout({\n cells,\n layoutOptions: layoutOptions as LayoutOptionsDagre,\n allowEdgeToArea,\n }));\n }\n\n const alignOrigin = normalizeAlignOrigin(layoutOptions?.alignOrigin);\n\n const newCells: Cell[] = cells.map((cell) => {\n if (\n (allowEdgeToArea && isNodeOrAreaDecoratorCell(cell)) ||\n isNodeCell(cell)\n ) {\n const nodeView = getNodeView(cell.id);\n return {\n ...cell,\n view: {\n ...cell.view,\n x: nodeView.x! - nodeView.width * alignOrigin[0] + nodePaddings[3],\n y: nodeView.y! - nodeView.height * alignOrigin[1] + nodePaddings[0],\n },\n [SYMBOL_FOR_LAYOUT_INITIALIZED]: true,\n };\n }\n return cell;\n });\n previousLayoutRef.current = newCells.filter(isNodeOrEdgeCell);\n\n dispatch({ type: \"update-cells\", payload: newCells });\n // setCentered(false);\n setLayoutInitialized(true);\n }, [cells, dispatch, layout, layoutKey, layoutOptions /* , setCentered */]);\n\n return { centered, setCentered, getNextLayoutKey };\n}\n\nfunction isSameArray<T = unknown>(a: T[] | null, b: T[]): boolean {\n return a?.length === b.length && a.every((v, i) => v === b[i]);\n}\n","import React, { useEffect, useState } from \"react\";\nimport { select } from \"d3-selection\";\nimport { ZoomTransform, type ZoomBehavior } from \"d3-zoom\";\nimport type { RangeTuple } from \"../../diagram/interfaces\";\nimport { SYMBOL_FOR_SIZE_INITIALIZED } from \"../../draw-canvas/constants\";\nimport type { Cell } from \"../../draw-canvas/interfaces\";\nimport {\n isDecoratorCell,\n isNodeCell,\n} from \"../../draw-canvas/processors/asserts\";\nimport { transformToCenter } from \"../../draw-canvas/processors/transformToCenter\";\n\nexport interface UseAutoCenterOptions {\n rootRef: React.RefObject<SVGSVGElement>;\n cells: Cell[];\n layoutInitialized: boolean;\n zoomable?: boolean;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n scaleRange: RangeTuple;\n}\n\nexport type UseAutoCenterResult = [\n centered: boolean,\n setCentered: React.Dispatch<React.SetStateAction<boolean>>,\n];\n\nexport function useAutoCenter({\n rootRef,\n cells,\n layoutInitialized,\n zoomable,\n zoomer,\n scaleRange,\n}: UseAutoCenterOptions): UseAutoCenterResult {\n const [centered, setCentered] = useState(false);\n\n useEffect(() => {\n const root = rootRef.current;\n if (\n !root ||\n !layoutInitialized ||\n centered ||\n !cells.some((cell) => isNodeCell(cell) || isDecoratorCell(cell)) ||\n cells.some(\n (cell) => isNodeCell(cell) && !cell[SYMBOL_FOR_SIZE_INITIALIZED]\n )\n ) {\n return;\n }\n const { k, x, y } = transformToCenter(cells, {\n canvasWidth: root.clientWidth,\n canvasHeight: root.clientHeight,\n scaleRange: zoomable ? scaleRange : undefined,\n });\n // istanbul ignore next\n if (process.env.NODE_ENV !== \"test\") {\n // jsdom doesn't support svg baseVal yet.\n // https://github.com/jsdom/jsdom/issues/2531\n zoomer.transform(select(root), new ZoomTransform(k, x, y));\n }\n setCentered(true);\n }, [\n cells,\n centered,\n layoutInitialized,\n rootRef,\n scaleRange,\n zoomable,\n zoomer,\n ]);\n\n useEffect(() => {\n // Reset auto centering when nodes and decorators are all removed.\n if (!cells.some((cell) => isNodeCell(cell) || isDecoratorCell(cell))) {\n setCentered(false);\n }\n }, [cells]);\n\n return [centered, setCentered];\n}\n","import { useMemo } from \"react\";\nimport { __secret_internals, checkIfByTransform } from \"@next-core/runtime\";\nimport { findIndex, isUndefined, omitBy } from \"lodash\";\nimport type {\n Cell,\n ComputedEdgeLineConf,\n EdgeCell,\n EdgeLineConf,\n LineMarker,\n} from \"../../draw-canvas/interfaces\";\nimport { isEdgeCell } from \"../../draw-canvas/processors/asserts\";\nimport {\n DEFAULT_LINE_STROKE_COLOR,\n DEFAULT_LINE_STROKE_WIDTH,\n DEFAULT_LINE_INTERACT_STROKE_WIDTH,\n DEFAULT_LINE_INTERACT_SHOW_START_ARROW,\n DEFAULT_LINE_INTERACT_SHOW_END_ARROW,\n DEFAULT_LINE_INTERACT_ANIMATE_DURATION,\n} from \"../../draw-canvas/constants\";\n\nexport interface UseLineMarkersOptions {\n cells: Cell[];\n defaultEdgeLines: EdgeLineConf[] | undefined;\n markerPrefix: string;\n}\n\nexport function useLineMarkers({\n cells,\n defaultEdgeLines,\n markerPrefix,\n}: UseLineMarkersOptions): [\n lineConfMap: WeakMap<EdgeCell, ComputedEdgeLineConf>,\n markers: LineMarker[],\n] {\n return useMemo(() => {\n // Always put the default stroke marker at the first position,\n // since the connecting line will use it.\n const markers: LineMarker[] = [{ strokeColor: DEFAULT_LINE_STROKE_COLOR }];\n const map = new WeakMap<EdgeCell, ComputedEdgeLineConf>();\n for (const cell of cells) {\n if (isEdgeCell(cell)) {\n const computedLineConf =\n __secret_internals.legacyDoTransform(\n { edge: cell },\n defaultEdgeLines?.find((item) =>\n checkIfByTransform(item, { edge: cell })\n )\n ) ?? {};\n const lineConf = {\n dashed: false,\n strokeColor: DEFAULT_LINE_STROKE_COLOR,\n strokeWidth: DEFAULT_LINE_STROKE_WIDTH,\n interactStrokeWidth: DEFAULT_LINE_INTERACT_STROKE_WIDTH,\n showStartArrow: DEFAULT_LINE_INTERACT_SHOW_START_ARROW,\n showEndArrow: DEFAULT_LINE_INTERACT_SHOW_END_ARROW,\n animate: {\n useAnimate: false,\n duration: DEFAULT_LINE_INTERACT_ANIMATE_DURATION,\n },\n ...omitBy(computedLineConf, isUndefined),\n } as ComputedEdgeLineConf;\n if (lineConf.parallelGap === undefined) {\n lineConf.parallelGap = lineConf.interactStrokeWidth;\n }\n const markerEndIndex = addMarker(\n { strokeColor: lineConf.strokeColor },\n markers\n );\n lineConf.markerArrow = `url(#${markerPrefix}${markerEndIndex})`;\n map.set(cell, lineConf);\n }\n }\n return [map, markers];\n }, [cells, defaultEdgeLines, markerPrefix]);\n}\n\nfunction addMarker(marker: LineMarker, markers: LineMarker[]): number {\n let markerIndex = findIndex(markers, marker);\n if (markerIndex === -1) {\n markerIndex = markers.push(marker) - 1;\n }\n return markerIndex;\n}\n","import { useMemo } from \"react\";\nimport type { Cell, LayoutType } from \"../../draw-canvas/interfaces\";\nimport { isNodeCell } from \"../../draw-canvas/processors/asserts\";\nimport {\n SYMBOL_FOR_LAYOUT_INITIALIZED,\n SYMBOL_FOR_SIZE_INITIALIZED,\n} from \"../../draw-canvas/constants\";\n\nexport interface UseReadyOptions {\n cells: Cell[];\n layout: LayoutType;\n centered: boolean;\n}\n\nexport function useReady({ cells, layout, centered }: UseReadyOptions) {\n const ready = useMemo(\n () =>\n centered &&\n cells.every(\n (cell) =>\n !isNodeCell(cell) ||\n (cell[SYMBOL_FOR_SIZE_INITIALIZED] &&\n ((layout !== \"force\" && layout !== \"dagre\") ||\n cell[SYMBOL_FOR_LAYOUT_INITIALIZED]))\n ),\n [cells, centered, layout]\n );\n return ready;\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { select } from \"d3-selection\";\nimport { zoom, type ZoomBehavior } from \"d3-zoom\";\nimport type { RangeTuple, TransformLiteral } from \"../../diagram/interfaces\";\nimport {\n DEFAULT_SCALE_RANGE_MIN,\n DEFAULT_SCALE_RANGE_MAX,\n} from \"../../draw-canvas/constants\";\nimport type { ActiveTarget } from \"../../draw-canvas/interfaces\";\n\nexport interface UseZoomOptions {\n rootRef: React.RefObject<SVGSVGElement>;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n draggable?: boolean;\n ctrlDraggable?: boolean;\n scaleRange?: RangeTuple;\n onSwitchActiveTarget?(target: ActiveTarget | null): void;\n}\n\nexport interface UseZoomResult {\n grabbing: boolean;\n transform: TransformLiteral;\n scaleRange: RangeTuple;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n}\n\nexport function useZoom({\n rootRef,\n zoomable,\n scrollable,\n pannable,\n draggable,\n ctrlDraggable,\n scaleRange: _scaleRange,\n onSwitchActiveTarget,\n}: UseZoomOptions): UseZoomResult {\n const [grabbing, setGrabbing] = useState(false);\n const [transform, setTransform] = useState<TransformLiteral>({\n k: 1,\n x: 0,\n y: 0,\n });\n\n const scaleRange = useMemo(\n () =>\n _scaleRange ??\n ([DEFAULT_SCALE_RANGE_MIN, DEFAULT_SCALE_RANGE_MAX] as RangeTuple),\n [_scaleRange]\n );\n\n const zoomer = useMemo(() => zoom<SVGSVGElement, unknown>(), []);\n\n // istanbul ignore next: d3-zoom currently hard to test\n useEffect(() => {\n let moved = false;\n zoomer\n .scaleExtent(zoomable ? scaleRange : [1, 1])\n .on(\"start\", () => {\n moved = false;\n setGrabbing(true);\n })\n .on(\"zoom\", (e: { transform: TransformLiteral }) => {\n moved = true;\n setTransform(e.transform);\n })\n .on(\"end\", () => {\n setGrabbing(false);\n if (!moved) {\n onSwitchActiveTarget?.(null);\n }\n })\n .filter(\n (event) =>\n (event.type === \"wheel\" ||\n (ctrlDraggable ? draggable || event.ctrlKey : !event.ctrlKey)) &&\n !event.button\n );\n }, [\n onSwitchActiveTarget,\n scaleRange,\n zoomable,\n zoomer,\n ctrlDraggable,\n draggable,\n ]);\n\n useEffect(() => {\n if (ctrlDraggable) {\n const onContextMenu = (e: MouseEvent) => {\n if (e.ctrlKey) {\n e.preventDefault();\n }\n };\n document.addEventListener(\"contextmenu\", onContextMenu, true);\n return () => {\n document.removeEventListener(\"contextmenu\", onContextMenu, true);\n };\n }\n }, [ctrlDraggable]);\n\n // istanbul ignore next: d3-zoom currently hard to test\n useEffect(() => {\n const root = rootRef.current;\n if (!root) {\n return;\n }\n\n const rootSelection = select(root);\n\n const unsetZoom = () => {\n rootSelection\n .on(\".zoom\", null)\n .on(\".zoom.custom\", null)\n .on(\"wheel\", null);\n };\n\n if (!(zoomable || scrollable || pannable)) {\n unsetZoom();\n return;\n }\n\n if (zoomable || scrollable) {\n // Do not override default d3 zoom handler.\n // Only handles *panning*\n rootSelection.on(\n \"wheel.zoom.custom\",\n (e: WheelEvent & { wheelDeltaX: number; wheelDeltaY: number }) => {\n // Mac OS trackpad pinch event is emitted as a wheel.zoom and d3.event.ctrlKey set to true\n if (!e.ctrlKey) {\n // Stop immediate propagation for default d3 zoom handler\n e.stopImmediatePropagation();\n if (scrollable) {\n e.preventDefault();\n zoomer.translateBy(\n rootSelection,\n e.wheelDeltaX / 5,\n e.wheelDeltaY / 5\n );\n }\n }\n // zoomer.scaleBy(rootSelection, Math.pow(2, defaultWheelDelta(e)))\n }\n );\n }\n\n rootSelection\n .call(zoomer)\n .on(\"wheel\", (e: WheelEvent) => {\n e.preventDefault();\n })\n .on(\"dblclick.zoom\", null);\n\n if ((!draggable && !ctrlDraggable) || !pannable) {\n rootSelection.on(\"mousedown.zoom\", null);\n }\n\n if (!pannable) {\n rootSelection\n .on(\"touchstart.zoom\", null)\n .on(\"touchmove.zoom\", null)\n .on(\"touchend.zoom\", null);\n }\n\n return unsetZoom;\n }, [\n ctrlDraggable,\n draggable,\n pannable,\n rootRef,\n scrollable,\n zoomable,\n zoomer,\n ]);\n\n return { grabbing, transform, zoomer, scaleRange };\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.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-inline:5px}.zoom-slider .ant-slider-vertical .ant-slider-rail{width:2px}.zoom-slider .ant-slider-vertical .ant-slider-handle{width:6px;height:6px;inset-inline-start: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;inset-inline-start:-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;inset-block-start:0;inset-inline-start:0}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden;--animation-dasharray:48;--stroke-dashoffset:96;--dasharray:4}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}@keyframes dashedAnimation{0%{stroke-dashoffset:var(--stroke-dashoffset)}to{stroke-dashoffset:0}}@keyframes solidAnimation{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}.decorator-area .area,\n.decorator-container .container{fill:rgba(119,141,195,0.1);stroke:none;stroke-width:0}.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}.line.dashed{stroke-dasharray:var(--dasharray)}.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 .text-container{display:flex;align-items:center;justify-content:center;padding:0.5em;text-align:center;font-size:16px;background-color:rgba(119,141,195,0.6);overflow:hidden}.decorator-container .horizontal{height:max-content;width:100%}.decorator-container .vertical{width:max-content;height:100%;writing-mode:vertical-rl}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n"],"names":["MarkerComponent","_ref","Component","id","type","strokeColor","EntityRelationZeroOrOneMarker","EntityRelationZeroOrManyMarker","ArrowMarker","React","_ref2","viewBox","refX","refY","markerWidth","markerHeight","orient","strokeLinejoin","d","stroke","strokeWidth","fill","_ref3","_ref4","getDirectLinePoints","source","target","parallelGap","doTwoNodesOverlap","p0","p1","xDiff","yDiff","dx","x","dy","y","angle","Math","atan2","cos","PI","sin","line","sourceIntersections","getIntersections","targetIntersections","length","rect","vertices","width","height","possibleLines","i","push","intersections","item","intersection","intersect","x1","y1","x2","y2","x3","y3","x4","y4","denominator","ua","ub","a","b","paddingA","paddingB","A","getNodesWithPadding","B","left","min","right","max","top","bottom","node","padding","extractPartialRectTuple","value","Array","isArray","v0","v1","findNodeOrAreaDecorator","cells","find","cell","isNodeOrAreaDecoratorCell","EdgeComponent","_pathRef$current","_pathRef$current$getT","edge","lineConfMap","pathRef","useRef","sourceNode","useMemo","targetNode","lineConf","get","some","isEdgeCell","view","nodeViewToNodeRect","interactStrokeWidth","ref","className","classNames","dashed","animate","useAnimate","style","duration","DEFAULT_LINE_INTERACT_ANIMATE_DURATION","current","getTotalLength","call","markerStart","showStartArrow","markerArrow","markerEnd","showEndArrow","NodeComponent","degraded","degradedNodeLabel","defaultNodeBricks","onResize","memoizedData","memoizedValue","setMemoizedValue","useState","useEffect","prev","isEqual","useDeepMemo","data","specifiedUseBrick","useBrick","observerRef","_defaultNodeBricks$fi","checkIfByTransform","label","String","__secret_internals","legacyDoTransform","refCallback","useCallback","element","prevObserver","disconnect","setTimeout","observer","ResizeObserver","offsetWidth","offsetHeight","observe","degradedRefCallBack","g","size","getBBox","ReactUseBrick","cx","cy","r","handleMouseDown","event","action","scale","layout","activeTarget","onCellsMoving","onCellsMoved","onCellResizing","onCellResized","onSwitchActiveTarget","stopPropagation","targetIsActive","cellToTarget","isAutoLayout","activeCells","filter","c","forEach","isContainerDecoratorCell","isNodeCell","containerId","movableActiveCells","isDecoratorCell","from","clientX","clientY","originals","map","position","moved","handleMove","e","finished","movement","getMovement","payloads","decorator","undefined","onMouseMove","onMouseUp","document","removeEventListener","addEventListener","DecoratorArea","transform","readOnly","resizeHandleRef","resizeHandle","onMouseDown","k","DecoratorText","onDecoratorTextEditing","onDecoratorTextChange","text","currentLabel","setCurrentLabel","editingLabel","setEditingLabel","editingLabelInitialized","shouldEmitLabelChange","setShouldEmitLabelChange","handleEnableEdit","preventDefault","textContent","_ref$current","parentElement","clientWidth","clientHeight","focus","selectAllText","editing","handleInput","handleBlur","onDoubleClick","contentEditable","onInput","onBlur","range","createRange","selectNodeContents","selection","window","getSelection","removeAllRanges","addRange","DecoratorContainer","direction","textRef","titleForeignRect","setTitleForeignRect","useLayoutEffect","_textRef$current","textParentEle","includes","isNoManualLayout","DecoratorComponent","SpecifiedComponent","console","error","computeContainerRect","minX","Infinity","minY","maxX","maxY","n","isFinite","CellComponent","dragNodeToContainerActive","unrelatedCells","onCellContextMenu","onCellClick","onNodeBrickResize","onCellMouseEnter","onCellMouseLeave","gRef","unrelated","sameTarget","containerRect","containCells","handleContextMenu","handleCellClick","handleMouseEnter","handleMouseLeave","active","faded","onContextMenu","onClick","onMouseEnter","onMouseLeave","SYMBOL_FOR_SIZE_INITIALIZED","Symbol","for","SYMBOL_FOR_LAYOUT_INITIALIZED","DEFAULT_NODE_SIZE","DEFAULT_NODE_GAP","DEFAULT_AREA_WIDTH","DEFAULT_AREA_HEIGHT","DEFAULT_SCALE_RANGE_MIN","DEFAULT_SCALE_RANGE_MAX","DEFAULT_LINE_STROKE_COLOR","DEFAULT_LINE_STROKE_WIDTH","DEFAULT_LINE_INTERACT_STROKE_WIDTH","DEFAULT_LINE_INTERACT_SHOW_START_ARROW","DEFAULT_LINE_INTERACT_SHOW_END_ARROW","DEFAULT_DEGRADED_THRESHOLD","isInitialNodeCell","isNodeOrEdgeCell","isTextDecoratorCell","pick","getUnrelatedCells","connectLineState","allowEdgeToArea","existedTargets","Set","add","has","nodesMap","Map","activeNodeIds","relatedNodeIds","targets","set","initializeCells","initialCells","defaultNodeSize","_cell$view","_cell$view2","every","targetA","targetB","transformToCenter","canvasWidth","canvasHeight","scaleRange","empty","updateCells","previousCells","reason","parent","isManualLayout","newCells","updateCandidates","shouldReCenter","previousSizeInitializedNodes","previousShouldCentered","previousNode","handled","downstreamNodeIds","parentNode","downstreamNodes","Boolean","rightMostNode","nextX","nextY","totalWidth","reduce","acc","maxWidth","maxHeight","positionedNodes","hasDecorators","getNodeView","without","dagreLayout","index","forceLayout","fixedPosition","center","updated","insertCellAfter","newCell","after","findLastIndex","slice","rootReducer","reducers","state","payload","matched","newState","move","findIndex","layoutKey","Object","fromEntries","entries","key","props","_extends","xmlns","ZoomBarComponent","shadowRoot","onZoomChange","onReCenter","currentTheme","useCurrentTheme","cache","createCache","zoomBarRef","tooltip","formatter","placement","getPopupContainer","onZoomIn","onZoomOut","ConfigProvider","theme","algorithm","darkAlgorithm","defaultAlgorithm","StyleProvider","container","autoClear","hashPriority","role","CenterSVG","ZoomInSVG","Slider","step","vertical","included","onChange","ZoomOutSVG","layoutOptions","nodePadding","dagreGraphOptions","rankdir","ranksep","edgesep","nodesep","nodePaddings","graph","dagre","Graph","setGraph","setDefaultEdgeLabel","setNode","setEdge","collide","radiusDiff","strength","iterations","forceNodes","forceLinks","fx","fy","linkSimulation","forceLink","simulation","forceSimulation","force","forceX","forceY","forceManyBody","forceCollide","radius","sqrt","stop","tick","ceil","log","alphaMin","alphaDecay","manuallyTickToTheEnd","useActiveTarget","cellsRef","_activeTarget","onActiveTargetChange","newActiveTarget","setActiveTarget","previous","activeTargetChangeInitialized","resetActiveTarget","composedPath","indexOf","KeywordMap","normalizeAlignAxis","axis","newX","matches","match","Number","useLayout","rootRef","zoomable","zoomer","dispatch","layoutInitialized","setLayoutInitialized","layoutKeyRef","getNextLayoutKey","centered","setCentered","root","select","ZoomTransform","useAutoCenter","previousLayoutRef","v","alignOrigin","origin","normalizeAlignOrigin","nodeView","useLineMarkers","defaultEdgeLines","markerPrefix","markers","WeakMap","computedLineConf","omitBy","isUndefined","markerEndIndex","addMarker","marker","markerIndex","useReady","useZoom","scrollable","pannable","draggable","ctrlDraggable","_scaleRange","grabbing","setGrabbing","setTransform","zoom","scaleExtent","on","ctrlKey","button","rootSelection","unsetZoom","stopImmediatePropagation","translateBy","wheelDeltaX","wheelDeltaY","___CSS_LOADER_EXPORT___","module","toString"],"sourceRoot":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 6215.a8907b75.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[6215],{7581:(e,t,n)=>{n.r(t);var i,a=n(4635),s=n(918),l=n(6902),o=n(5536),r=n(6121),h=n(829),c=n(2740),d=n(8769),u=n.n(d),p=n(4782),g=n(1389),f=(n(9583),n(7566)),A=n(1517),y=n(3373),v=n.n(y),m=n(1030),b=n(9126),k=n(8892),w=n(5157),x=n(8308),_=n(9576),M=n(9137),E=n(2547),C=n(1803),N=n(3739),W=n(9191),T=n(6671),R=n(8060),L=n(2448),S=n(8657),$=n(8069),z=n(1324),B=n(821),D=n(9741),P=n(2673),O=n(5987);let H,I,K,Y,U,X,j,V,q,Z,F,J,G,Q,ee,te,ne,ie,ae,se,le,oe,re,he,ce,de,ue,pe,ge,fe,Ae,ye,ve,me,be,ke,we,xe,_e,Me,Ee,Ce,Ne,We,Te,Re,Le,Se,$e,ze,Be,De,Pe,Oe;const{defineElement:He,property:Ie,event:Ke,method:Ye}=(0,p.createDecorators)(),Ue=(0,d.forwardRef)(wt);let Xe;var je=new WeakMap,Ve=new WeakMap,qe=new WeakMap,Ze=new WeakMap,Fe=new WeakMap,Je=new WeakMap,Ge=new WeakMap,Qe=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,it=new WeakMap,at=new WeakMap,st=new WeakMap,lt=new WeakMap,ot=new WeakSet,rt=new WeakMap,ht=new WeakMap,ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,ft=new WeakMap,At=new WeakMap,yt=new WeakMap,vt=new WeakMap,mt=new WeakMap,bt=new WeakMap;class kt extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,ot),(0,s.A)(this,je,(H(this),K(this))),(0,s.A)(this,Ve,(Y(this),U(this))),(0,s.A)(this,qe,(X(this),j(this))),(0,s.A)(this,Ze,(V(this),q(this))),(0,s.A)(this,Fe,(Z(this),F(this))),(0,s.A)(this,Je,(J(this),G(this))),(0,s.A)(this,Ge,(Q(this),ee(this))),(0,s.A)(this,Qe,(te(this),ne(this))),(0,s.A)(this,et,(ie(this),ae(this))),(0,s.A)(this,tt,(se(this),le(this))),(0,s.A)(this,nt,(oe(this),re(this,!0))),(0,s.A)(this,it,(he(this),ce(this,!0))),(0,s.A)(this,at,(de(this),ue(this,!0))),(0,s.A)(this,st,(pe(this),ge(this))),(0,s.A)(this,lt,(fe(this),Ae(this))),(0,s.A)(this,rt,(me(this),e=>{(0,o.A)(ot,this,ye).emit(e)})),(0,s.A)(this,ht,be(this)),(0,s.A)(this,ct,(xe(this),e=>{(0,o.A)(ot,this,ke).emit(e)})),(0,s.A)(this,dt,_e(this)),(0,s.A)(this,ut,(Ce(this),e=>{(0,o.A)(ot,this,Me).emit(e)})),(0,s.A)(this,pt,Ne(this)),(0,s.A)(this,gt,(Re(this),e=>{(0,o.A)(ot,this,We).emit(e)})),(0,s.A)(this,ft,Le(this)),(0,s.A)(this,At,(ze(this),e=>{(0,o.A)(ot,this,Se).emit(e)})),(0,s.A)(this,yt,Be(this)),(0,s.A)(this,vt,(Oe(this),e=>{(0,o.A)(ot,this,De).emit(e)})),(0,s.A)(this,mt,(e=>{(0,P.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,bt,(0,d.createRef)())}get layout(){return(0,h.A)(je,this)}set layout(e){(0,r.A)(je,this,e)}get nodes(){return(0,h.A)(Ve,this)}set nodes(e){(0,r.A)(Ve,this,e)}get edges(){return(0,h.A)(qe,this)}set edges(e){(0,r.A)(qe,this,e)}get nodeBricks(){return(0,h.A)(Ze,this)}set nodeBricks(e){(0,r.A)(Ze,this,e)}get lines(){return(0,h.A)(Fe,this)}set lines(e){(0,r.A)(Fe,this,e)}get layoutOptions(){return(0,h.A)(Je,this)}set layoutOptions(e){(0,r.A)(Je,this,e)}get activeTarget(){return(0,h.A)(Ge,this)}set activeTarget(e){(0,r.A)(Ge,this,e)}get disableKeyboardAction(){return(0,h.A)(Qe,this)}set disableKeyboardAction(e){(0,r.A)(Qe,this,e)}get connectNodes(){return(0,h.A)(et,this)}set connectNodes(e){(0,r.A)(et,this,e)}get dragNodes(){return(0,h.A)(tt,this)}set dragNodes(e){(0,r.A)(tt,this,e)}get zoomable(){return(0,h.A)(nt,this)}set zoomable(e){(0,r.A)(nt,this,e)}get scrollable(){return(0,h.A)(it,this)}set scrollable(e){(0,r.A)(it,this,e)}get pannable(){return(0,h.A)(at,this)}set pannable(e){(0,r.A)(at,this,e)}get scaleRange(){return(0,h.A)(st,this)}set scaleRange(e){(0,r.A)(st,this,e)}callOnLineLabel(e,t){for(var n,i=arguments.length,a=new Array(i>2?i-2:0),s=2;s<i;s++)a[s-2]=arguments[s];null===(n=(0,h.A)(bt,this).current)||void 0===n||n.callOnLineLabel(e,t,...a)}render(){return u().createElement(Ue,{ref:(0,h.A)(bt,this),layout:this.layout,nodes:this.nodes,edges:this.edges,nodeBricks:this.nodeBricks,lines:this.lines,layoutOptions:this.layoutOptions,connectNodes:this.connectNodes,dragNodes:this.dragNodes,activeTarget:this.activeTarget,disableKeyboardAction:this.disableKeyboardAction,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:(0,h.A)(rt,this),onSwitchActiveTarget:(0,h.A)(mt,this),onNodeDelete:(0,h.A)(ct,this),onEdgeDelete:(0,h.A)(ut,this),onLineClick:(0,h.A)(gt,this),onLineDoubleClick:(0,h.A)(At,this),onNodesConnect:(0,h.A)(vt,this)})}}function wt(e,t){let{layout:n,nodes:i,edges:a,nodeBricks:s,lines:l,layoutOptions:o,connectNodes:r,dragNodes:h,activeTarget:c,disableKeyboardAction:p,zoomable:g,scrollable:y,pannable:B,scaleRange:H,onActiveTargetChange:I,onSwitchActiveTarget:K,onNodeDelete:Y,onEdgeDelete:U,onLineClick:X,onLineDoubleClick:j,onNodesConnect:V}=e;const[q,Z]=(0,d.useState)(!1),[F,J]=(0,d.useState)(0),[G,Q]=(0,d.useState)(null),[ee,te]=(0,d.useState)(!1),[ne,ie]=(0,d.useState)(0),[ae,se]=(0,d.useState)(null),[le,oe]=(0,d.useState)([]),[re,he]=(0,d.useState)(!1),[ce,de]=(0,d.useState)({k:1,x:0,y:0}),ue=(0,d.useRef)(new Map),pe=(0,d.useRef)(null),ge=(0,d.useRef)(null),[fe,Ae]=(0,d.useState)(!1),{userViewReady:ye,userViewNodesMap:ve,saveUserView:me}=(0,D._)(null==h?void 0:h.save),[be,ke]=(0,d.useState)([0,0]),[we,xe]=(0,d.useState)(null),[_e,Me]=(0,d.useState)("initial"),[Ee,Ce]=(0,d.useState)(null);(0,d.useImperativeHandle)(t,(()=>({callOnLineLabel(e,t){for(var n,i=arguments.length,a=new Array(i>2?i-2:0),s=2;s<i;s++)a[s-2]=arguments[s];null==ae||null===(n=ae.get(e))||void 0===n||null===(n=n.firstElementChild)||void 0===n||n[t](...a)}}))),(0,d.useEffect)((()=>{const e=e=>{(0,L.P)(e,{nodes:i,nodesRefRepository:G,connectNodes:r,dragNodes:h,scale:ce.k,setConnectLineState:xe,setConnectLineTo:ke,setManualLayoutStatus:Me,setNodeMovement:Ce,onSwitchActiveTarget:K,onNodesConnect:V})},t=ge.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[i,r,h,ce.k,G,V,K]);const{normalizedLines:Ne,normalizedLinesMap:We,markers:Te}=(0,d.useMemo)((()=>(0,M.t)(a,l)),[a,l]),Re=(0,d.useMemo)((()=>Ne.flatMap((e=>{let t,n,{line:{text:i,label:a,$id:s},edge:l}=e;return i||a?(a?(t="label",n=[].concat(a)):(t="text",n=[].concat(i)),n.map((e=>({[t]:e,id:`${s}-${e.placement??"center"}`,edge:l})))):[]}))),[Ne]),{nodes:Le,edges:Se}=(0,$.o)({layout:n,nodes:i,edges:a,manualLayoutStatus:_e,userViewReady:ye,userViewNodesMap:ve,nodeMovement:Ee,nodesRefRepository:G,lineLabelsRefRepository:ae,normalizedLinesMap:We,layoutOptions:o,nodesRenderId:F,lineLabelsRenderId:ne});(0,d.useEffect)((()=>{"finished"===_e&&me(Le.map((e=>({id:e.id,x:e.x,y:e.y}))))}),[_e]);const $e=(0,d.useMemo)((()=>(0,_.R)(Se,Le,Ne)),[Ne,Le,Se]),ze=c??null,[Be,De]=(0,d.useState)(ze);(0,d.useEffect)((()=>{De((e=>(0,P.c)(e,ze)?e:ze))}),[ze]);const Pe=(0,d.useRef)(!1);(0,d.useEffect)((()=>{Pe.current?null==I||I(Be):Pe.current=!0}),[Be,I]),(0,d.useEffect)((()=>{const e=pe.current;if(!e||p)return;const t=e=>{const t=(0,w.a)(e,{renderedNodes:Le,activeTarget:Be});"delete-node"===(null==t?void 0:t.action)?null==Y||Y(t.node):"delete-edge"===(null==t?void 0:t.action)?null==U||U(t.edge):"switch-active-node"===(null==t?void 0:t.action)&&t.node&&(null==K||K({type:"node",nodeId:t.node.id}))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[Be,Le,p,K,Y,U]);const Oe=(0,d.useCallback)((e=>{e&&(J((e=>e+1)),Q(e)),Z((t=>t||!!e))}),[]),He=(0,d.useCallback)((e=>{e&&(ie((e=>e+1)),se(e)),te((t=>t||!!e))}),[]),Ie=(0,d.useMemo)((()=>H??[S.sS,S.Yt]),[H]),Ke=(0,d.useMemo)((()=>(0,A.s_)()),[]);(0,d.useEffect)((()=>{let e=!1;Ke.scaleExtent(g?Ie:[1,1]).on("start",(()=>{e=!1,he(!0)})).on("zoom",(t=>{e=!0,de(t.transform)})).on("end",(()=>{he(!1),e||null==K||K(null)}))}),[K,Ie,g,Ke]),(0,d.useEffect)((()=>{const e=pe.current;if(!e)return;const t=(0,f.A)(e),n=()=>{t.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(g||y||B)return(g||y)&&t.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),y&&(e.preventDefault(),Ke.translateBy(t,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),t.call(Ke).on("wheel",(e=>e.preventDefault())).on("dblclick.zoom",null),B||t.on("mousedown.zoom",null).on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),n;n()}),[B,y,g,Ke]),(0,d.useEffect)((()=>{const e=pe.current;if(0===Le.length||!e||fe)return;const{k:t,x:n,y:i}=(0,x.r)(Le,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:g?Ie:void 0});Ke.transform((0,f.A)(e),new A.uV(t,n,i)),Ae(!0)}),[fe,Le,Ie,g,Ke]);const Ye=(0,d.useMemo)((()=>`${(0,m.uniqueId)("diagram-")}-`),[]),Ue=`${Ye}line-arrow-`,Xe=`${Ye}mask-`,je=`${Ye}active-line-`;(0,d.useEffect)((()=>{oe((e=>(0,R.z)(e,$e,ue.current)))}),[$e]);const[Ve,qe]=u().useState(new Map);return(0,d.useEffect)((()=>{if(!ae)return;(0,z.F)(le,ae);const e=new b.A((()=>{qe((0,O.G)(le,ae))}));for(const t of ae.values())e.observe(t);return()=>{e.disconnect()}}),[ne,ae,le]),"dagre"!==n&&"force"!==n?u().createElement("div",null,`Diagram layout not supported: "${n}"`):u().createElement("div",{className:v()("diagram",{ready:q&&fe,grabbing:re,pannable:B}),tabIndex:-1,ref:pe},u().createElement("svg",{width:"100%",height:"100%",className:"lines"},u().createElement("defs",null,Te.map(((e,t)=>{let{type:n,strokeColor:i}=e;return u().createElement(N.c,{key:t,id:`${Ue}${t}`,type:n,strokeColor:i})})),[...Ve].map((e=>{let[t,n]=e;return u().createElement(W.y,{key:t,lineId:t,rects:n,maskPrefix:Xe,renderedLineLabels:le})})),u().createElement("marker",{id:`${je}start`,viewBox:"0 0 8 8",refX:4,refY:4,markerWidth:8,markerHeight:8,orient:"auto"},u().createElement("path",{d:"M 0.5 0.5 H 7.5 V 7.5 H 0.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"})),u().createElement("marker",{id:`${je}end`,viewBox:"0 0 14 8",refX:3,refY:4,markerWidth:14,markerHeight:8,orient:"auto"},u().createElement("path",{d:"M 0.5 1.5 L 5.5 4 L 0.5 6.5 z",stroke:"var(--palette-blue-3)",strokeWidth:1,fill:"var(--palette-blue-3)"}),u().createElement("path",{d:"M 6.5 0.5 H 13.5 V 7.5 H 6.5 Z",stroke:"var(--palette-gray-7)",strokeWidth:1,fill:"var(--palette-gray-1)"}))),u().createElement("g",{transform:`translate(${ce.x} ${ce.y}) scale(${ce.k})`},$e.map((e=>u().createElement(C.m,{key:e.line.$id,line:e,linePaths:ue.current,lineMaskRects:Ve,maskPrefix:Xe,markerPrefix:Ue,activeLineMarkerPrefix:je,active:"edge"===(null==Be?void 0:Be.type)&&Be.edge.source===e.edge.source&&Be.edge.target===e.edge.target,activeRelated:"node"===(null==Be?void 0:Be.type)&&(e.edge.source===Be.nodeId||e.edge.target===Be.nodeId),onLineClick:X,onLineDoubleClick:j}))))),u().createElement("div",{className:v()("line-labels",{ready:ee}),style:{left:ce.x,top:ce.y,transform:`scale(${ce.k})`}},u().createElement(E.d2,{labels:Re,onRendered:He})),u().createElement("div",{className:"nodes",ref:ge,style:{left:ce.x,top:ce.y,transform:`scale(${ce.k})`}},u().createElement(k.p,{nodes:i,nodeBricks:s,onRendered:Oe})),u().createElement(T.w,{connectLineState:we,connectLineTo:be,markerPrefix:Ue}))}i=kt,({e:[K,Y,U,X,j,V,q,Z,F,J,G,Q,ee,te,ne,ie,ae,se,le,oe,re,he,ce,de,ue,pe,ge,fe,Ae,ye,ve,me,be,ke,we,xe,_e,Me,Ee,Ce,Ne,We,Te,Re,Le,Se,$e,ze,Be,De,Pe,Oe,H],c:[Xe,I]}=(0,c.A)(i,[He("eo-diagram",{styleTexts:[B.A]})],[[Ie({type:String}),1,"layout"],[Ie({attribute:!1}),1,"nodes"],[Ie({attribute:!1}),1,"edges"],[Ie({attribute:!1}),1,"nodeBricks"],[Ie({attribute:!1}),1,"lines"],[Ie({attribute:!1}),1,"layoutOptions"],[Ie({attribute:!1}),1,"activeTarget"],[Ie({type:Boolean}),1,"disableKeyboardAction"],[Ie({attribute:!1}),1,"connectNodes"],[Ie({attribute:!1}),1,"dragNodes"],[Ie({type:Boolean}),1,"zoomable"],[Ie({type:Boolean}),1,"scrollable"],[Ie({type:Boolean}),1,"pannable"],[Ie({attribute:!1}),1,"scaleRange"],[Ke({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,h.A)(lt,e),(e,t)=>(0,r.A)(lt,e,t)],[Ke({type:"node.delete"}),1,"nodeDelete",e=>(0,h.A)(ht,e),(e,t)=>(0,r.A)(ht,e,t)],[Ke({type:"edge.delete"}),1,"edgeDelete",e=>(0,h.A)(dt,e),(e,t)=>(0,r.A)(dt,e,t)],[Ke({type:"line.click"}),1,"lineClick",e=>(0,h.A)(pt,e),(e,t)=>(0,r.A)(pt,e,t)],[Ke({type:"line.dblclick"}),1,"lineDoubleClick",e=>(0,h.A)(ft,e),(e,t)=>(0,r.A)(ft,e,t)],[Ke({type:"nodes.connect"}),1,"connectNodes",e=>(0,h.A)(yt,e),(e,t)=>(0,r.A)(yt,e,t)],[Ye(),2,"callOnLineLabel"]],0,(e=>bt.has((0,l.A)(e))),g.ReactNextElement)),I();var xt,_t=n(3971);let Mt,Et,Ct,Nt,Wt,Tt,Rt,Lt,St,$t,zt,Bt,Dt,Pt;const{defineElement:Ot,property:Ht,event:It,method:Kt}=(0,p.createDecorators)(),Yt=(0,d.forwardRef)(en);let Ut;var Xt=new WeakMap,jt=new WeakMap,Vt=new WeakMap,qt=new WeakSet,Zt=new WeakMap,Ft=new WeakMap,Jt=new WeakMap,Gt=new WeakMap;class Qt extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,qt),(0,s.A)(this,Xt,(Mt(this),Ct(this))),(0,s.A)(this,jt,(Nt(this),Wt(this))),(0,s.A)(this,Vt,(Tt(this),Rt(this))),(0,s.A)(this,Zt,($t(this),e=>{(0,o.A)(qt,this,Lt).emit(e)})),(0,s.A)(this,Ft,zt(this)),(0,s.A)(this,Jt,(Pt(this),e=>{(0,o.A)(qt,this,Bt).emit(e)})),(0,s.A)(this,Gt,(0,d.createRef)())}get label(){return(0,h.A)(Xt,this)}set label(e){(0,r.A)(Xt,this,e)}get type(){return(0,h.A)(jt,this)}set type(e){(0,r.A)(jt,this,e)}enableEditing(){var e;null===(e=(0,h.A)(Gt,this).current)||void 0===e||e.enableEditing()}render(){return u().createElement(Yt,{ref:(0,h.A)(Gt,this),label:this.label,onLabelEditingChange:(0,h.A)(Zt,this),onLabelChange:(0,h.A)(Jt,this)})}}function en(e,t){let{label:n,onLabelChange:i,onLabelEditingChange:a}=e;const s=n??"",[l,o]=(0,d.useState)(s),[r,h]=(0,d.useState)(!1),c=(0,d.useRef)(!1),[p,g]=(0,d.useState)(!1),f=(0,d.useRef)(null);(0,d.useImperativeHandle)(t,(()=>({enableEditing(){h(!0)}}))),(0,d.useEffect)((()=>{o(s)}),[s]);const A=(0,d.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),h(!0)}),[]);(0,d.useEffect)((()=>{var e,t;r&&(null===(e=f.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=f.current)||void 0===t||t.select())}),[r]),(0,d.useEffect)((()=>{c.current?null==a||a(r):c.current=!0}),[r,a]);const y=(0,d.useCallback)((e=>{o(e.target.value)}),[]),m=(0,d.useCallback)((e=>{const t=e.key||e.keyCode||e.which;var n;"Enter"!==t&&13!==t||null===(n=f.current)||void 0===n||n.blur()}),[]),b=(0,d.useCallback)((()=>{h(!1),g(!0)}),[]);(0,d.useEffect)((()=>{p&&(null==i||i(l),g(!1))}),[l,i,p]);const k=(0,d.useCallback)((e=>{e.stopPropagation()}),[]);return u().createElement("div",{className:v()("label",{editing:r,empty:!l}),onDoubleClick:k,onMouseDown:k},u().createElement("input",{className:"label-input",value:l,ref:f,onChange:y,onKeyDown:m,onBlur:b}),u().createElement("div",{className:"label-text",onDoubleClick:A},l))}xt=Qt,({e:[Ct,Nt,Wt,Tt,Rt,Lt,St,$t,zt,Bt,Dt,Pt,Mt],c:[Ut,Et]}=(0,c.A)(xt,[Ot("diagram.editable-label",{styleTexts:[_t.A]})],[[Ht(),1,"label"],[Ht({render:!1}),1,"type"],[It({type:"label.editing.change"}),1,"labelEditingChange",e=>(0,h.A)(Vt,e),(e,t)=>(0,r.A)(Vt,e,t)],[It({type:"label.change"}),1,"labelChange",e=>(0,h.A)(Ft,e),(e,t)=>(0,r.A)(Ft,e,t)],[Kt(),2,"enableEditing"]],0,(e=>Gt.has((0,l.A)(e))),g.ReactNextElement)),Et();var tn=n(2559),nn=n(3518),an=n(5748),sn=n(531),ln=n(8185),on=n(4197),rn=n(2140);function hn(e){let{connectLineState:t,transform:n,markerEnd:i,onConnect:a}=e;const[s,l]=(0,d.useState)(null);return(0,d.useEffect)((()=>{t&&l(t.from)}),[t]),(0,d.useEffect)((()=>{if(t){const e=e=>{l([(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},i=e=>{e.stopPropagation()},s=e=>{e.stopPropagation(),o(),a(t,[(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k])},o=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mousedown",i,{capture:!0}),document.removeEventListener("click",s,{capture:!0}),l(null)};return document.addEventListener("mousemove",e),document.addEventListener("mousedown",i,{capture:!0}),document.addEventListener("click",s,{capture:!0}),o}}),[t,a,n]),u().createElement("path",{className:v()("connect-line",{connecting:!!t&&s&&(s[0]-t.from[0])**2+(s[1]-t.from[1])**2>25}),d:t&&s?`M${t.from.join(" ")}L${s.join(" ")}`:"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:`url(#${i})`})}var cn=n(3783),dn=n(2098),un=n(227),pn=n(3033),gn=n(8091),fn=n(1819),An=n(7099),yn=n(1484),vn=n(8197),mn=n(7531);var bn,kn=n(3012),wn=n(6237),xn=n(9386);function _n(e,t,n){const i=t.filter((e=>(0,sn.N)(e))),a=e.filter((e=>(0,sn.t2)(e))).map((e=>e.id)),s=e.filter((e=>{const t=i.find((t=>t.id===e.id)),n=(null==t?void 0:t.containerId)&&a.includes(t.containerId);return(0,sn.N)(e)&&!n}));s.forEach((e=>{const n=e.x,i=e.x+e.width,a=e.y,s=e.y+e.height,l=t.filter((e=>(0,sn.t2)(e)));for(const t of l){const l=t.view.x,o=t.view.x+t.view.width,r=t.view.y,h=t.view.y+t.view.height;if(n>=l&&i<=o&&a>=r&&s<=h){e.containerCell=t;break}}}));let l=[];return l=s.filter((e=>{var t;const n=i.find((t=>t.id===e.id));return(null==n?void 0:n.containerId)!==(null===(t=e.containerCell)||void 0===t?void 0:t.id)})),l.length>0&&(null==n||n(l)),l}let Mn,En,Cn,Nn,Wn,Tn,Rn,Ln,Sn,$n,zn,Bn,Dn,Pn,On,Hn,In,Kn,Yn,Un,Xn,jn,Vn,qn,Zn,Fn,Jn,Gn,Qn,ei,ti,ni,ii,ai,si,li,oi,ri,hi,ci,di,ui,pi,gi,fi,Ai,yi,vi,mi,bi,ki,wi,xi,_i,Mi,Ei,Ci,Ni,Wi,Ti,Ri,Li,Si,$i,zi,Bi,Di,Pi,Oi,Hi,Ii,Ki,Yi,Ui,Xi,ji,Vi,qi,Zi,Fi,Ji,Gi,Qi,ea,ta,na;const ia=(0,nn.unwrapProvider)("basic.lock-body-scroll"),{defineElement:aa,property:sa,method:la,event:oa}=(0,p.createDecorators)(),ra=u().forwardRef(ts);let ha;var ca=new WeakMap,da=new WeakMap,ua=new WeakMap,pa=new WeakMap,ga=new WeakMap,fa=new WeakMap,Aa=new WeakMap,ya=new WeakMap,va=new WeakMap,ma=new WeakMap,ba=new WeakMap,ka=new WeakMap,wa=new WeakMap,xa=new WeakMap,_a=new WeakMap,Ma=new WeakMap,Ea=new WeakMap,Ca=new WeakMap,Na=new WeakMap,Wa=new WeakSet,Ta=new WeakMap,Ra=new WeakMap,La=new WeakMap,Sa=new WeakMap,$a=new WeakMap,za=new WeakMap,Ba=new WeakMap,Da=new WeakMap,Pa=new WeakMap,Oa=new WeakMap,Ha=new WeakMap,Ia=new WeakMap,Ka=new WeakMap,Ya=new WeakMap,Ua=new WeakMap,Xa=new WeakMap,ja=new WeakMap,Va=new WeakMap,qa=new WeakMap,Za=new WeakMap,Fa=new WeakMap,Ja=new WeakMap,Ga=new WeakMap;class Qa extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Wa),(0,s.A)(this,ca,(Mn(this),Cn(this))),(0,s.A)(this,da,(Nn(this),Wn(this))),(0,s.A)(this,ua,(Tn(this),Rn(this))),(0,s.A)(this,pa,(Ln(this),Sn(this,[pn.HP,pn.HP]))),(0,s.A)(this,ga,($n(this),zn(this))),(0,s.A)(this,fa,(Bn(this),Dn(this))),(0,s.A)(this,Aa,(Pn(this),On(this))),(0,s.A)(this,ya,(Hn(this),In(this))),(0,s.A)(this,va,(Kn(this),Yn(this))),(0,s.A)(this,ma,(Un(this),Xn(this))),(0,s.A)(this,ba,(jn(this),Vn(this,!0))),(0,s.A)(this,ka,(qn(this),Zn(this,!0))),(0,s.A)(this,wa,(Fn(this),Jn(this,!0))),(0,s.A)(this,xa,(Gn(this),Qn(this,!0))),(0,s.A)(this,_a,(ei(this),ti(this,!1))),(0,s.A)(this,Ma,(ni(this),ii(this))),(0,s.A)(this,Ea,(ai(this),si(this))),(0,s.A)(this,Ca,(li(this),oi(this))),(0,s.A)(this,Na,(ri(this),hi(this))),(0,s.A)(this,Ta,(ui(this),e=>{(0,o.A)(Wa,this,ci).emit(e)})),(0,s.A)(this,Ra,(e=>{(0,ln.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,La,pi(this)),(0,s.A)(this,Sa,(Ai(this),yi(this))),(0,s.A)(this,$a,(bi(this),e=>{(0,o.A)(Wa,this,vi).emit(e),"node"===e.type&&(0,o.A)(Wa,this,gi).emit(e)})),(0,s.A)(this,za,ki(this)),(0,s.A)(this,Ba,(_i(this),e=>{(0,o.A)(Wa,this,wi).emit(e)})),(0,s.A)(this,Da,Mi(this)),(0,s.A)(this,Pa,(Ni(this),e=>{(0,o.A)(Wa,this,Ei).emit(e)})),(0,s.A)(this,Oa,Wi(this)),(0,s.A)(this,Ha,(Li(this),Si(this))),(0,s.A)(this,Ia,(Bi(this),e=>{(0,o.A)(Wa,this,$i).emit(e),"node"===e.type&&(0,o.A)(Wa,this,Ti).emit(e)})),(0,s.A)(this,Ka,Di(this)),(0,s.A)(this,Ya,(Hi(this),e=>{(0,o.A)(Wa,this,Pi).emit(e)})),(0,s.A)(this,Ua,Ii(this)),(0,s.A)(this,Xa,(Ui(this),e=>{(0,o.A)(Wa,this,Ki).emit(e)})),(0,s.A)(this,ja,Xi(this)),(0,s.A)(this,Va,(qi(this),e=>{(0,o.A)(Wa,this,ji).emit(e)})),(0,s.A)(this,qa,Zi(this)),(0,s.A)(this,Za,(Gi(this),e=>{(0,o.A)(Wa,this,Fi).emit(e)})),(0,s.A)(this,Fa,Qi(this)),(0,s.A)(this,Ja,(na(this),e=>{(0,o.A)(Wa,this,ea).emit(e)})),(0,s.A)(this,Ga,(0,d.createRef)())}get cells(){return(0,h.A)(ca,this)}set cells(e){(0,r.A)(ca,this,e)}get layout(){return(0,h.A)(da,this)}set layout(e){(0,r.A)(da,this,e)}get layoutOptions(){return(0,h.A)(ua,this)}set layoutOptions(e){(0,r.A)(ua,this,e)}get defaultNodeSize(){return(0,h.A)(pa,this)}set defaultNodeSize(e){(0,r.A)(pa,this,e)}get defaultNodeBricks(){return(0,h.A)(ga,this)}set defaultNodeBricks(e){(0,r.A)(ga,this,e)}get degradedThreshold(){return(0,h.A)(fa,this)}set degradedThreshold(e){(0,r.A)(fa,this,e)}get degradedNodeLabel(){return(0,h.A)(Aa,this)}set degradedNodeLabel(e){(0,r.A)(Aa,this,e)}get defaultEdgeLines(){return(0,h.A)(ya,this)}set defaultEdgeLines(e){(0,r.A)(ya,this,e)}get activeTarget(){return(0,h.A)(va,this)}set activeTarget(e){(0,r.A)(va,this,e)}get fadeUnrelatedCells(){return(0,h.A)(ma,this)}set fadeUnrelatedCells(e){(0,r.A)(ma,this,e)}get zoomable(){return(0,h.A)(ba,this)}set zoomable(e){(0,r.A)(ba,this,e)}get scrollable(){return(0,h.A)(ka,this)}set scrollable(e){(0,r.A)(ka,this,e)}get pannable(){return(0,h.A)(wa,this)}set pannable(e){(0,r.A)(wa,this,e)}get selectable(){return(0,h.A)(xa,this)}set selectable(e){(0,r.A)(xa,this,e)}get allowEdgeToArea(){return(0,h.A)(_a,this)}set allowEdgeToArea(e){(0,r.A)(_a,this,e)}get dragBehavior(){return(0,h.A)(Ma,this)}set dragBehavior(e){(0,r.A)(Ma,this,e)}get ctrlDragBehavior(){return(0,h.A)(Ea,this)}set ctrlDragBehavior(e){(0,r.A)(Ea,this,e)}get scaleRange(){return(0,h.A)(Ca,this)}set scaleRange(e){(0,r.A)(Ca,this,e)}async dropNode(e){var t,n;let{id:i,position:a,size:s,data:l,useBrick:o}=e;if(null===(t=(n=document).elementsFromPoint)||void 0===t||null===(t=t.call(n,a[0],a[1]))||void 0===t?void 0:t.includes(this)){var r;const e=this.getBoundingClientRect(),t=(0,h.A)(Ga,this).current.getTransform(),n={type:"node",id:i,view:{..."force"===this.layout||"dagre"===this.layout?null:{x:(a[0]-e.left-t.x)/t.k,y:(a[1]-e.top-t.y)/t.k},width:(null==s?void 0:s[0])??this.defaultNodeSize[0],height:(null==s?void 0:s[1])??this.defaultNodeSize[0]},data:l,useBrick:o};return null===(r=(0,h.A)(Ga,this).current)||void 0===r||r.dropNode(n),n}return null}async dropDecorator(e){var t,n;let{position:i,decorator:a,text:s,direction:l}=e;if(null===(t=(n=document).elementsFromPoint)||void 0===t||null===(t=t.call(n,i[0],i[1]))||void 0===t?void 0:t.includes(this)){var o;const e=this.getBoundingClientRect(),t=(0,h.A)(Ga,this).current.getTransform(),n={type:"decorator",decorator:a,id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),view:{x:(i[0]-e.left-t.x)/t.k,y:(i[1]-e.top-t.y)/t.k,width:pn.N8,height:pn.w1,text:s,direction:l}};return null===(o=(0,h.A)(Ga,this).current)||void 0===o||o.dropDecorator(n),n}return null}async addNodes(e){if(0===e.length)return[];const t=e.map((e=>{let{size:t,useBrick:n,id:i,data:a}=e;return{type:"node",id:i,data:a,view:{width:(null==t?void 0:t[0])??this.defaultNodeSize[0],height:(null==t?void 0:t[1])??this.defaultNodeSize[0]},useBrick:n}}));return(0,h.A)(Ga,this).current.addNodes(t,{defaultNodeSize:this.defaultNodeSize,canvasWidth:this.clientWidth,canvasHeight:this.clientHeight})}async addEdge(e){var t;let{source:n,target:i,data:a}=e;const s={type:"edge",source:n,target:i,data:a};return null===(t=(0,h.A)(Ga,this).current)||void 0===t||t.addEdge(s),s}manuallyConnectNodes(e){return(0,h.A)(Ga,this).current.manuallyConnectNodes(e)}async updateCells(e,t){await(0,tn.A)(Wa,this,es).call(this);const{updated:n}=(0,h.A)(Ga,this).current.updateCells(e,{...t,defaultNodeSize:this.defaultNodeSize,canvasWidth:this.clientWidth,canvasHeight:this.clientHeight});return{updated:n}}disconnectedCallback(){super.disconnectedCallback(),ia(this,!1)}render(){return u().createElement(ra,{host:this,ref:(0,h.A)(Ga,this),layout:this.layout,layoutOptions:this.layoutOptions,cells:this.cells,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,dragBehavior:this.dragBehavior,ctrlDragBehavior:this.ctrlDragBehavior,scaleRange:this.scaleRange,allowEdgeToArea:this.allowEdgeToArea,onActiveTargetChange:(0,h.A)(Ta,this),onSwitchActiveTarget:(0,h.A)(Ra,this),onCellMove:(0,h.A)($a,this),onCellsMove:(0,h.A)(Ba,this),onCellResize:(0,h.A)(Pa,this),onCellDelete:(0,h.A)(Ia,this),onCellsDelete:(0,h.A)(Ya,this),onCellContextMenu:(0,h.A)(Xa,this),onDecoratorTextChange:(0,h.A)(Va,this),onContainerContainerChange:(0,h.A)(Za,this),onScaleChange:(0,h.A)(Ja,this)})}}function es(){return new Promise((e=>{const t=()=>{(0,h.A)(Ga,this).current?e():setTimeout(t,10)};t()}))}function ts(e,t){let{host:n,layout:i,layoutOptions:a,cells:s,defaultNodeSize:l,defaultNodeBricks:o,defaultEdgeLines:r,degradedThreshold:h,degradedNodeLabel:c,activeTarget:p,fadeUnrelatedCells:g,zoomable:A,scrollable:y,pannable:b,dragBehavior:k,ctrlDragBehavior:w,scaleRange:x,allowEdgeToArea:_,onActiveTargetChange:M,onSwitchActiveTarget:E,onCellMove:C,onCellResize:W,onCellDelete:T,onCellsMove:R,onCellsDelete:L,onCellContextMenu:S,onDecoratorTextChange:$,onScaleChange:z,onContainerContainerChange:B}=e;const[{cells:D,layoutKey:P},O]=(0,d.useReducer)(an.d,s,(e=>({cells:(0,cn.C)(e,{defaultNodeSize:l}),layoutKey:0}))),H=(0,d.useMemo)((()=>D.filter(sn.N).length>=(h??pn.pC)),[D,h]),I=(0,d.useRef)(null),K=(0,d.useRef)(null),Y=(0,d.useRef)(null),[U,X]=(0,d.useState)([]),[j,V]=(0,d.useState)([]),{grabbing:q,transform:Z,zoomer:F,scaleRange:J}=(0,gn.f)({rootRef:I,zoomable:A,scrollable:y,pannable:b,draggable:"grab"===k,ctrlDraggable:"grab"===w,scaleRange:x,onSwitchActiveTarget:E});(0,d.useEffect)((()=>{z(Z.k)}),[z,Z.k]);const[G,Q]=(0,d.useState)(null),[ee,te]=(0,d.useState)(null),{centered:ne,setCentered:ie,getNextLayoutKey:ae}=(0,yn.g)({layout:i,layoutOptions:a,rootRef:I,cells:D,zoomable:A,zoomer:F,scaleRange:J,layoutKey:P,allowEdgeToArea:_,dispatch:O});(0,d.useImperativeHandle)(t,(()=>({dropNode(e){"dagre"!==i&&"force"!==i&&ie(!0),O({type:"drop-node",payload:e})},dropDecorator(e){"dagre"!==i&&"force"!==i&&ie(!0),O({type:"drop-decorator",payload:e})},addNodes(e,t){let{defaultNodeSize:n,canvasWidth:a,canvasHeight:s}=t;const l=D.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1,o=[...D.slice(0,l),...e,...D.slice(l)],{cells:r,updated:h,shouldReCenter:c}=(0,dn.L)({cells:o,layout:i,previousCells:D,defaultNodeSize:n,canvasWidth:a,canvasHeight:s,scaleRange:J,transform:Z,allowEdgeToArea:_});return c&&ie(!1),O({type:"update-cells",payload:r}),h.filter((t=>e.includes(t)))},addEdge(e){O({type:"add-edge",payload:e})},updateCells(e,t){const{shouldReCenter:n,...a}=(0,dn.L)({...t,layout:i,previousCells:D,cells:e,scaleRange:J,transform:Z,allowEdgeToArea:_});return n&&ie(!1),O({type:"update-cells",payload:a.cells}),a},getTransform:()=>Z,manuallyConnectNodes(e){const t=D.find((t=>(_&&(0,sn.o6)(t)||(0,sn.N)(t))&&t.id===e));if(t){const e=I.current.getBoundingClientRect();return te({source:t,from:[t.view.x+t.view.width/2,t.view.y+t.view.height/2],offset:[e.left,e.top]}),new Promise(((e,t)=>{Y.current={resolve:e,reject:t}}))}return Promise.reject(null)}})),[D,i,J,ie,Z,_]);const se=(0,d.useCallback)(((e,t)=>{var n;for(let n=D.length-1;n>=0;n--){const a=D[n];if((_&&(0,sn.o6)(a)||(0,sn.N)(a))&&a.id!==e.source.id&&a.view.x<t[0]&&a.view.x+a.view.width>t[0]&&a.view.y<t[1]&&a.view.y+a.view.height>t[1]){var i;null===(i=Y.current)||void 0===i||i.resolve({source:e.source,target:a});break}}null===(n=Y.current)||void 0===n||n.reject(null),te(null)}),[D]);(0,d.useEffect)((()=>{ia(n,!(!ee&&!G))}),[ee,n,G]);const le=(0,fn.J)({cellsRef:K,activeTarget:p,onActiveTargetChange:M}),[oe,re]=(0,d.useState)([]);(0,d.useEffect)((()=>{const e=g?(0,un.Y)(D,ee,le,_):[];re((t=>0===t.length&&0===e.length?t:e))}),[le,D,ee,g,_]),(0,d.useEffect)((()=>{const e=I.current;if(!e||U.length>0)return;const t=e=>{const t=function(e,t){let{cells:n,activeTarget:i}=t;const a=n.filter((e=>(0,on.Q)(e,i)));if(0!==a.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:a}}}(e,{cells:D,activeTarget:le});"delete-cells"===(null==t?void 0:t.action)&&(L(t.cells),1===t.cells.length&&T(t.cells[0]))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[le,D,U.length,T,L]);const he=`${(0,d.useMemo)((()=>`${(0,m.uniqueId)("diagram-")}-`),[])}line-arrow-`,ce=(0,d.useCallback)((e=>{O({type:"move-cells",payload:e});const t=[];_n(e,D).forEach((e=>{var n,i;null!==(n=e.containerCell)&&void 0!==n&&n.id&&t.push(null===(i=e.containerCell)||void 0===i?void 0:i.id)})),V(t)}),[D]),de=(0,d.useCallback)((e=>{O({type:"move-cells",payload:e}),R(e),1===e.length&&C(e[0]),_n(e,D,B),V([])}),[C,R,D,B]),ue=(0,d.useCallback)((e=>{O({type:"resize-cell",payload:e})}),[]),pe=(0,d.useCallback)((e=>{O({type:"resize-cell",payload:e}),W(e)}),[W]),ge=(0,d.useCallback)((e=>{let{id:t,editing:n}=e;X(n?e=>e.includes(t)?e:[...e,t]:e=>e.filter((e=>e!==t)))}),[]),fe=(0,d.useCallback)(((e,t)=>{const n=ae();O({type:"update-node-size",payload:{id:e,size:t},layoutKey:n})}),[ae]),Ae=(0,d.useCallback)((e=>{F.scaleTo((0,f.A)(I.current),e/100)}),[F]),ye=(0,d.useCallback)((()=>{ie(!1)}),[ie]),[ve,me]=(0,mn.d)({cells:D,defaultEdgeLines:r,markerPrefix:he}),be=(0,vn.H)({cells:D,layout:i,centered:ne});return(0,d.useEffect)((()=>{const e=I.current;if(!e||"lasso"!==k)return;const t=e.getBoundingClientRect(),n=e=>{!function(e,t){let{transform:n,offset:i,onLassoing:a,onLassoed:s}=t;if(e.ctrlKey||e.button)return;e.stopPropagation();const l=[e.clientX,e.clientY],o=(e.clientX-i[0]-n.x)/n.k,r=(e.clientY-i[1]-n.y)/n.k;let h=!1;const c=(e,t)=>{const i=function(e){return[(e.clientX-l[0])/n.k,(e.clientY-l[1])/n.k]}(e);if(h||(h=i[0]**2+i[1]**2>=9),h){let[e,n]=i,l=o,h=r;e<0&&(l=o+e,e=-e),n<0&&(h=r+n,n=-n),(t?s:a)({x:l,y:h,width:e,height:n})}},d=e=>{c(e)},u=e=>{c(e,!0),h=!1,document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",u)}(e,{transform:Z,offset:[t.left,t.top],onLassoing(e){Q(e)},onLassoed(e){Q(null);const t=[];for(const n of D)if((0,sn.t2)(n)||(0,sn.o6)(n)||(0,sn.Hs)(n)){const i=n.view.x,a=n.view.y;i>=e.x&&i+n.view.width<=e.x+e.width&&a>=e.y&&a+n.view.height<=e.y+e.height&&t.push(n)}null==E||E(t.length>1?{type:"multi",targets:t.map(xn.P)}:1===t.length?(0,xn.P)(t[0]):null)}})};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}}),[Z,D,k,E]),u().createElement(u().Fragment,null,u().createElement("svg",{width:"100%",height:"100%",ref:I,className:v()("root",{grabbing:q,pannable:b,ready:be}),tabIndex:-1},u().createElement("defs",null,me.map(((e,t)=>u().createElement(N.c,{key:t,id:`${he}${t}`,type:"arrow",strokeColor:e.strokeColor})))),u().createElement("g",{transform:`translate(${Z.x} ${Z.y}) scale(${Z.k})`},u().createElement("g",{className:v()("cells",{allowEdgeToArea:_}),ref:K},D.map((e=>u().createElement(rn.m,{key:`${e.type}:${(0,sn.WW)(e)?`${e.source}~${e.target}`:e.id}`,dragNodeToContainerActive:!(0,sn.WW)(e)&&j.includes(e.id),layout:i,cell:e,cells:D,degraded:H,degradedNodeLabel:c,defaultNodeBricks:o,transform:Z,lineConfMap:ve,activeTarget:le,unrelatedCells:oe,onCellsMoving:ce,onCellsMoved:de,onCellResizing:ue,onCellResized:pe,onSwitchActiveTarget:E,onCellContextMenu:S,onDecoratorTextChange:$,onDecoratorTextEditing:ge,onNodeBrickResize:fe})))),u().createElement(hn,{connectLineState:ee,transform:Z,markerEnd:`${he}0`,onConnect:se}),G&&u().createElement("rect",{x:G.x,y:G.y,width:G.width,height:G.height,fill:"var(--palette-gray-5)",fillOpacity:.3,stroke:"var(--palette-gray-5)",strokeDasharray:2}))),u().createElement(An.Y,{shadowRoot:n.shadowRoot,scale:Z.k,scaleRange:J,onZoomChange:Ae,onReCenter:ye}))}bn=Qa,({e:[Cn,Nn,Wn,Tn,Rn,Ln,Sn,$n,zn,Bn,Dn,Pn,On,Hn,In,Kn,Yn,Un,Xn,jn,Vn,qn,Zn,Fn,Jn,Gn,Qn,ei,ti,ni,ii,ai,si,li,oi,ri,hi,ci,di,ui,pi,gi,fi,Ai,yi,vi,mi,bi,ki,wi,xi,_i,Mi,Ei,Ci,Ni,Wi,Ti,Ri,Li,Si,$i,zi,Bi,Di,Pi,Oi,Hi,Ii,Ki,Yi,Ui,Xi,ji,Vi,qi,Zi,Fi,Ji,Gi,Qi,ea,ta,na,Mn],c:[ha,En]}=(0,c.A)(bn,[aa("eo-draw-canvas",{styleTexts:[kn.A,wn.A]})],[[sa({attribute:!1}),1,"cells"],[sa({type:String}),1,"layout"],[sa({attribute:!1}),1,"layoutOptions"],[sa({attribute:!1}),1,"defaultNodeSize"],[sa({attribute:!1}),1,"defaultNodeBricks"],[sa({type:Number}),1,"degradedThreshold"],[sa({attribute:!1}),1,"degradedNodeLabel"],[sa({attribute:!1}),1,"defaultEdgeLines"],[sa({attribute:!1}),1,"activeTarget"],[sa({type:Boolean}),1,"fadeUnrelatedCells"],[sa({type:Boolean}),1,"zoomable"],[sa({type:Boolean}),1,"scrollable"],[sa({type:Boolean}),1,"pannable"],[sa({type:Boolean}),1,"selectable"],[sa({type:Boolean}),1,"allowEdgeToArea"],[sa(),1,"dragBehavior"],[sa(),1,"ctrlDragBehavior"],[sa({attribute:!1}),1,"scaleRange"],[oa({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,h.A)(Na,e),(e,t)=>(0,r.A)(Na,e,t)],[oa({type:"node.move"}),1,"nodeMoveEvent",e=>(0,h.A)(La,e),(e,t)=>(0,r.A)(La,e,t)],[oa({type:"cell.move"}),1,"cellMoveEvent",e=>(0,h.A)(Sa,e),(e,t)=>(0,r.A)(Sa,e,t)],[oa({type:"cells.move"}),1,"cellsMoveEvent",e=>(0,h.A)(za,e),(e,t)=>(0,r.A)(za,e,t)],[oa({type:"cell.resize"}),1,"cellResizeEvent",e=>(0,h.A)(Da,e),(e,t)=>(0,r.A)(Da,e,t)],[oa({type:"node.delete"}),1,"nodeDelete",e=>(0,h.A)(Oa,e),(e,t)=>(0,r.A)(Oa,e,t)],[oa({type:"cell.delete"}),1,"cellDelete",e=>(0,h.A)(Ha,e),(e,t)=>(0,r.A)(Ha,e,t)],[oa({type:"cells.delete"}),1,"cellsDelete",e=>(0,h.A)(Ka,e),(e,t)=>(0,r.A)(Ka,e,t)],[oa({type:"cell.contextmenu"}),1,"cellContextMenu",e=>(0,h.A)(Ua,e),(e,t)=>(0,r.A)(Ua,e,t)],[oa({type:"decorator.text.change"}),1,"decoratorTextChange",e=>(0,h.A)(ja,e),(e,t)=>(0,r.A)(ja,e,t)],[oa({type:"node.container.change"}),1,"containerContainerChange",e=>(0,h.A)(qa,e),(e,t)=>(0,r.A)(qa,e,t)],[oa({type:"scale.change"}),1,"scaleChange",e=>(0,h.A)(Fa,e),(e,t)=>(0,r.A)(Fa,e,t)],[la(),2,"dropNode"],[la(),2,"dropDecorator"],[la(),2,"addNodes"],[la(),2,"addEdge"],[la(),2,"manuallyConnectNodes"],[la(),2,"updateCells"]],0,(e=>Ga.has((0,l.A)(e))),g.ReactNextElement)),En();var ns,is=n(497);let as,ss,ls,os,rs,hs,cs,ds,us,ps,gs,fs,As,ys,vs,ms,bs,ks,ws;const{defineElement:xs,property:_s,event:Ms}=(0,p.createDecorators)();let Es;var Cs,Ns=new WeakMap,Ws=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,Ls=new WeakSet,Ss=new WeakMap,$s=new WeakMap,zs=new WeakMap,Bs=new WeakMap,Ds=new WeakMap;class Ps extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ls),(0,s.A)(this,Ns,ss(this)),(0,s.A)(this,Ws,(ls(this),os(this))),(0,s.A)(this,Ts,(rs(this),hs(this))),(0,s.A)(this,Rs,(cs(this),ds(this))),(0,s.A)(this,Ss,(gs(this),e=>{(0,o.A)(Ls,this,us).emit(e)})),(0,s.A)(this,$s,fs(this)),(0,s.A)(this,zs,(vs(this),e=>{(0,o.A)(Ls,this,As).emit(e)})),(0,s.A)(this,Bs,ms(this)),(0,s.A)(this,Ds,(ws(this),e=>{(0,o.A)(Ls,this,bs).emit(e)}))}get usage(){return(0,h.A)(Ns,this)}set usage(e){(0,r.A)(Ns,this,e)}get status(){return(0,h.A)(Ws,this)}set status(e){(0,r.A)(Ws,this,e)}get decorator(){return(0,h.A)(Ts,this)}set decorator(e){(0,r.A)(Ts,this,e)}render(){return u().createElement(Os,{usage:this.usage,onDragStart:(0,h.A)(Ss,this),onDragMove:(0,h.A)(zs,this),onDragEnd:(0,h.A)(Ds,this)})}}function Os(e){let{usage:t,onDragStart:n,onDragMove:i,onDragEnd:a}=e;const s=(0,d.useCallback)((e=>{if("library"!==t)return;e.stopPropagation(),e.preventDefault();const s=[e.clientX,e.clientY];let l=!1;const o=e=>{l||(l=(e.clientX-s[0])**2+(e.clientY-s[1])**2>=9,l&&(null==n||n([e.clientX,e.clientY]))),l&&(null==i||i([e.clientX,e.clientY]))},r=e=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r),l&&(null==a||a([e.clientX,e.clientY]))};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}),[a,i,n,t]);return u().createElement("div",{onMouseDown:s},u().createElement("slot",null))}let Hs,Is,Ks,Ys,Us,Xs,js,Vs,qs,Zs,Fs,Js,Gs,Qs,el,tl,nl,il,al,sl,ll,ol,rl,hl,cl,dl,ul,pl,gl,fl,Al,yl,vl,ml,bl,kl,wl,xl,_l,Ml,El;ns=Ps,({e:[ss,ls,os,rs,hs,cs,ds,us,ps,gs,fs,As,ys,vs,ms,bs,ks,ws],c:[Es,as]}=(0,c.A)(ns,[xs("diagram.experimental-node",{styleTexts:[is.A]})],[[_s(),1,"usage"],[_s({type:String,render:!1}),1,"status"],[_s({type:String}),1,"decorator"],[Ms({type:"drag.start"}),1,"dragStartEvent",e=>(0,h.A)(Rs,e),(e,t)=>(0,r.A)(Rs,e,t)],[Ms({type:"drag.move"}),1,"dragMoveEvent",e=>(0,h.A)($s,e),(e,t)=>(0,r.A)($s,e,t)],[Ms({type:"drag.end"}),1,"dragEndEvent",e=>(0,h.A)(Bs,e),(e,t)=>(0,r.A)(Bs,e,t)]],0,(e=>Ds.has((0,l.A)(e))),g.ReactNextElement)),as();const{defineElement:Cl,property:Nl,event:Wl}=(0,p.createDecorators)();let Tl;var Rl=new WeakMap,Ll=new WeakMap,Sl=new WeakMap,$l=new WeakMap,zl=new WeakMap,Bl=new WeakMap,Dl=new WeakMap,Pl=new WeakMap,Ol=new WeakMap,Hl=new WeakMap,Il=new WeakMap,Kl=new WeakMap,Yl=new WeakMap,Ul=new WeakMap,Xl=new WeakMap,jl=new WeakSet,Vl=new WeakMap,ql=new WeakMap,Zl=new WeakMap,Fl=new WeakMap,Jl=new WeakMap,Gl=new WeakMap;class Ql extends g.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,jl),(0,s.A)(this,Rl,Is(this)),(0,s.A)(this,Ll,(Ks(this),Ys(this))),(0,s.A)(this,Sl,(Us(this),Xs(this))),(0,s.A)(this,$l,(js(this),Vs(this,[pn.HP,pn.HP]))),(0,s.A)(this,zl,(qs(this),Zs(this))),(0,s.A)(this,Bl,(Fs(this),Js(this))),(0,s.A)(this,Dl,(Gs(this),Qs(this))),(0,s.A)(this,Pl,(el(this),tl(this))),(0,s.A)(this,Ol,(nl(this),il(this))),(0,s.A)(this,Hl,(al(this),sl(this))),(0,s.A)(this,Il,(ll(this),ol(this,!0))),(0,s.A)(this,Kl,(rl(this),hl(this,!0))),(0,s.A)(this,Yl,(cl(this),dl(this,!0))),(0,s.A)(this,Ul,(ul(this),pl(this))),(0,s.A)(this,Xl,(gl(this),fl(this))),(0,s.A)(this,Vl,(vl(this),e=>{(0,o.A)(jl,this,Al).emit(e)})),(0,s.A)(this,ql,(e=>{(0,ln.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,s.A)(this,Zl,ml(this)),(0,s.A)(this,Fl,(wl(this),e=>{(0,o.A)(jl,this,bl).emit(e)})),(0,s.A)(this,Jl,xl(this)),(0,s.A)(this,Gl,(El(this),e=>{(0,o.A)(jl,this,_l).emit(e)}))}get cells(){return(0,h.A)(Rl,this)}set cells(e){(0,r.A)(Rl,this,e)}get layout(){return(0,h.A)(Ll,this)}set layout(e){(0,r.A)(Ll,this,e)}get layoutOptions(){return(0,h.A)(Sl,this)}set layoutOptions(e){(0,r.A)(Sl,this,e)}get defaultNodeSize(){return(0,h.A)($l,this)}set defaultNodeSize(e){(0,r.A)($l,this,e)}get defaultNodeBricks(){return(0,h.A)(zl,this)}set defaultNodeBricks(e){(0,r.A)(zl,this,e)}get degradedThreshold(){return(0,h.A)(Bl,this)}set degradedThreshold(e){(0,r.A)(Bl,this,e)}get degradedNodeLabel(){return(0,h.A)(Dl,this)}set degradedNodeLabel(e){(0,r.A)(Dl,this,e)}get defaultEdgeLines(){return(0,h.A)(Pl,this)}set defaultEdgeLines(e){(0,r.A)(Pl,this,e)}get activeTarget(){return(0,h.A)(Ol,this)}set activeTarget(e){(0,r.A)(Ol,this,e)}get fadeUnrelatedCells(){return(0,h.A)(Hl,this)}set fadeUnrelatedCells(e){(0,r.A)(Hl,this,e)}get zoomable(){return(0,h.A)(Il,this)}set zoomable(e){(0,r.A)(Il,this,e)}get scrollable(){return(0,h.A)(Kl,this)}set scrollable(e){(0,r.A)(Kl,this,e)}get pannable(){return(0,h.A)(Yl,this)}set pannable(e){(0,r.A)(Yl,this,e)}get scaleRange(){return(0,h.A)(Ul,this)}set scaleRange(e){(0,r.A)(Ul,this,e)}render(){return u().createElement(eo,{shadowRoot:this.shadowRoot,cells:this.cells,layout:this.layout,layoutOptions:this.layoutOptions,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:(0,h.A)(Vl,this),onSwitchActiveTarget:(0,h.A)(ql,this),onCellContextMenu:(0,h.A)(Fl,this),onCellClick:(0,h.A)(Gl,this)})}}function eo(e){let{shadowRoot:t,cells:n,layout:i,layoutOptions:a,defaultNodeSize:s,defaultNodeBricks:l,defaultEdgeLines:o,degradedThreshold:r,degradedNodeLabel:h,activeTarget:c,fadeUnrelatedCells:p,zoomable:g,scrollable:A,pannable:y,scaleRange:b,onActiveTargetChange:k,onSwitchActiveTarget:w,onCellContextMenu:x,onCellClick:_}=e;const[{cells:M,layoutKey:E},C]=(0,d.useReducer)(an.d,n,(e=>({cells:(0,cn.C)(e,{defaultNodeSize:s}),layoutKey:1}))),W=(0,d.useMemo)((()=>M.filter(sn.N).length>=(r??pn.pC)),[M,r]),T=(0,d.useRef)(null),R=(0,d.useRef)(null),{grabbing:L,transform:S,zoomer:$,scaleRange:z}=(0,gn.f)({rootRef:T,zoomable:g,scrollable:A,pannable:y,draggable:!0,scaleRange:b,onSwitchActiveTarget:w}),{centered:B,setCentered:D,getNextLayoutKey:P}=(0,yn.g)({layout:i,layoutOptions:a,rootRef:T,cells:M,zoomable:g,zoomer:$,scaleRange:z,layoutKey:E,dispatch:C}),O=(0,d.useCallback)((()=>{D(!1)}),[D]),H=(0,d.useRef)(n);(0,d.useEffect)((()=>{if(n!==H.current){H.current=n;const e=(0,dn.L)({canvasWidth:t.host.clientWidth,canvasHeight:t.host.clientHeight,defaultNodeSize:s,layout:i,previousCells:M,cells:n,scaleRange:z,transform:S});C({type:"update-cells",payload:e.cells})}}),[M,s,n,i,z,t,S]);const I=(0,fn.J)({cellsRef:R,activeTarget:c,onActiveTargetChange:k}),K=`${(0,d.useMemo)((()=>`${(0,m.uniqueId)("diagram-")}-`),[])}line-arrow-`,Y=(0,d.useCallback)(((e,t)=>{C({type:"update-node-size",payload:{id:e,size:t},layoutKey:P()})}),[P]),[U,X]=(0,d.useState)(null),j=(0,d.useCallback)((e=>{X(e)}),[]),V=(0,d.useCallback)((e=>{X((t=>t===e?null:t))}),[]),[q,Z]=(0,d.useState)([]);(0,d.useEffect)((()=>{const e=p?(0,un.Y)(M,null,U):[];Z((t=>0===t.length&&0===e.length?t:e))}),[M,p,U]);const F=(0,d.useCallback)((e=>{$.scaleTo((0,f.A)(T.current),e/100)}),[$]),[J,G]=(0,mn.d)({cells:M,defaultEdgeLines:o,markerPrefix:K}),Q=(0,vn.H)({cells:M,layout:i,centered:B});return u().createElement(u().Fragment,null,u().createElement("svg",{width:"100%",height:"100%",ref:T,className:v()("root",{grabbing:L,pannable:y,ready:Q}),tabIndex:-1},u().createElement("defs",null,G.map(((e,t)=>u().createElement(N.c,{key:t,id:`${K}${t}`,type:"arrow",strokeColor:e.strokeColor})))),u().createElement("g",{transform:`translate(${S.x} ${S.y}) scale(${S.k})`},u().createElement("g",{className:"cells",ref:R},M.map((e=>u().createElement(rn.m,{key:`${e.type}:${(0,sn.WW)(e)?`${e.source}~${e.target}`:e.id}`,layout:i,cell:e,cells:M,degraded:W,degradedNodeLabel:h,defaultNodeBricks:l,lineConfMap:J,transform:S,activeTarget:I,readOnly:!0,unrelatedCells:q,onSwitchActiveTarget:w,onCellContextMenu:x,onCellClick:_,onNodeBrickResize:Y,onCellMouseEnter:p&&(0,sn.N)(e)?j:void 0,onCellMouseLeave:p&&(0,sn.N)(e)?V:void 0})))))),u().createElement(An.Y,{shadowRoot:t,scale:S.k,scaleRange:z,onZoomChange:F,onReCenter:O}))}Cs=Ql,({e:[Is,Ks,Ys,Us,Xs,js,Vs,qs,Zs,Fs,Js,Gs,Qs,el,tl,nl,il,al,sl,ll,ol,rl,hl,cl,dl,ul,pl,gl,fl,Al,yl,vl,ml,bl,kl,wl,xl,_l,Ml,El],c:[Tl,Hs]}=(0,c.A)(Cs,[Cl("eo-display-canvas",{styleTexts:[kn.A,wn.A]})],[[Nl({attribute:!1}),1,"cells"],[Nl({type:String}),1,"layout"],[Nl({attribute:!1}),1,"layoutOptions"],[Nl({attribute:!1}),1,"defaultNodeSize"],[Nl({attribute:!1}),1,"defaultNodeBricks"],[Nl({type:Number}),1,"degradedThreshold"],[Nl({attribute:!1}),1,"degradedNodeLabel"],[Nl({attribute:!1}),1,"defaultEdgeLines"],[Nl({attribute:!1}),1,"activeTarget"],[Nl({type:Boolean}),1,"fadeUnrelatedCells"],[Nl({type:Boolean}),1,"zoomable"],[Nl({type:Boolean}),1,"scrollable"],[Nl({type:Boolean}),1,"pannable"],[Nl({attribute:!1}),1,"scaleRange"],[Wl({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,h.A)(Xl,e),(e,t)=>(0,r.A)(Xl,e,t)],[Wl({type:"cell.contextmenu"}),1,"cellContextMenu",e=>(0,h.A)(Zl,e),(e,t)=>(0,r.A)(Zl,e,t)],[Wl({type:"cell.click"}),1,"cellClick",e=>(0,h.A)(Jl,e),(e,t)=>(0,r.A)(Jl,e,t)]],0,(e=>Gl.has((0,l.A)(e))),g.ReactNextElement)),Hs()},3971:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(6758),a=n.n(i),s=n(935),l=n.n(s)()(a());l.push([e.id,':host{display:block;--local-label-line-height:inherit;--local-label-font-size:inherit;--local-label-color:inherit;--local-label-font-weight:inherit}:host([hidden]){display:none}:host([type="line"]){--local-label-line-height:18px;--local-label-font-size:11px;--local-label-color:var(--color-secondary-text);--local-label-font-weight:400}*{box-sizing:border-box}.label{max-width:168px;margin:-3px}.label-text,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:var(--local-label-line-height);font-size:var(--local-label-font-size);color:var(--local-label-color);font-weight:var(--local-label-font-weight);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;user-select:text}.label-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.label.editing .label-text,\n.label.empty:not(.editing) .label-text,\n.label:not(.editing) .label-input{display:none}',""]);const o=l.toString()},497:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(6758),a=n.n(i),s=n(935),l=n.n(s)()(a());l.push([e.id,'*{box-sizing:border-box}:host{display:block;border:1px solid var(--palette-gray-5);cursor:default;-webkit-user-select:none;user-select:none}:host([hidden]){display:none}:host([usage="dragging"]){opacity:0.75;position:fixed}:host(:not([usage="library"])){background:var(--palette-gray-3);width:60px;height:60px}:host([usage="library"]){width:180px;height:30px;margin-bottom:10px}div{width:100%;height:100%;display:flex;align-items:center;justify-content:center}:host(:not([usage="dragging"]):not([usage="library"]):hover),\n:host([status="highlighted"]){color:var(--palette-blue-5);background:var(--palette-blue-1);border-color:1px solid var(--palette-blue-4)}:host([status="faded"]){opacity:0.3}:host([decorator="area"]){width:100px;height:60px;background:rgba(119,141,195,0.1);border:none}:host([decorator="text"]){width:auto;height:auto;background:none;border:none}',""]);const o=l.toString()},6330:(e,t,n)=>{function i(e,t,n,i,a,s,l){try{var o=e[s](l),r=o.value}catch(e){return void n(e)}o.done?t(r):Promise.resolve(r).then(i,a)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(a,s){var l=e.apply(t,n);function o(e){i(l,a,s,o,r,"next",e)}function r(e){i(l,a,s,o,r,"throw",e)}o(void 0)}))}}n.d(t,{A:()=>a})},780:(e,t,n)=>{n.d(t,{_:()=>s});var i=n(6330),a=n(3496),s=function(){var e=(0,i.A)((function*(e,t,n){return(yield a.http.post("api/gateway/cmdb.instance.CreateInstance/v2/object/".concat(e,"/instance"),t,n)).data}));return function(t,n,i){return e.apply(this,arguments)}}()},8406:(e,t,n)=>{n.d(t,{y:()=>s});var i=n(6330),a=n(3496),s=function(){var e=(0,i.A)((function*(e,t,n){return(yield a.http.post("api/gateway/cmdb.instance.PostSearchV3/v3/object/".concat(e,"/instance/_search"),t,n)).data}));return function(t,n,i){return e.apply(this,arguments)}}()},6841:(e,t,n)=>{n.d(t,{x:()=>s});var i=n(6330),a=n(3496),s=function(){var e=(0,i.A)((function*(e,t,n,i){return(yield a.http.put("api/gateway/cmdb.instance.UpdateInstanceV2/v2/object/".concat(e,"/instance/").concat(t),n,i)).data}));return function(t,n,i,a){return e.apply(this,arguments)}}()},4993:(e,t,n)=>{function i(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function a(e){this._context=e}function s(e){return new a(e)}n.d(t,{Ay:()=>s}),a.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:i(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:i(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}}},4643:(e,t,n)=>{n.d(t,{dJ:()=>a,kl:()=>s});class i{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function a(e){return new i(e,!0)}function s(e){return new i(e,!1)}},482:(e,t,n)=>{function i(e){this._context=e}function a(e){return new i(e)}n.d(t,{A:()=>a}),i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}}},3488:(e,t,n)=>{function i(e){return e<0?-1:1}function a(e,t,n){var a=e._x1-e._x0,s=t-e._x1,l=(e._y1-e._y0)/(a||s<0&&-0),o=(n-e._y1)/(s||a<0&&-0),r=(l*s+o*a)/(a+s);return(i(l)+i(o))*Math.min(Math.abs(l),Math.abs(o),.5*Math.abs(r))||0}function s(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function l(e,t,n){var i=e._x0,a=e._y0,s=e._x1,l=e._y1,o=(s-i)/3;e._context.bezierCurveTo(i+o,a+o*t,s-o,l-o*n,s,l)}function o(e){this._context=e}function r(e){this._context=new h(e)}function h(e){this._context=e}function c(e){return new o(e)}function d(e){return new r(e)}n.d(t,{G:()=>c,N:()=>d}),o.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:l(this,this._t0,s(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,l(this,s(this,n=a(this,e,t)),n);break;default:l(this,this._t0,n=a(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(r.prototype=Object.create(o.prototype)).point=function(e,t){o.prototype.point.call(this,t,e)},h.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,a,s){this._context.bezierCurveTo(t,e,i,n,s,a)}}},6066:(e,t,n)=>{function i(e){this._context=e}function a(e){var t,n,i=e.length-1,a=new Array(i),s=new Array(i),l=new Array(i);for(a[0]=0,s[0]=2,l[0]=e[0]+2*e[1],t=1;t<i-1;++t)a[t]=1,s[t]=4,l[t]=4*e[t]+2*e[t+1];for(a[i-1]=2,s[i-1]=7,l[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=a[t]/s[t-1],s[t]-=n,l[t]-=n*l[t-1];for(a[i-1]=l[i-1]/s[i-1],t=i-2;t>=0;--t)a[t]=(l[t]-a[t+1])/s[t];for(s[i-1]=(e[i]+a[i-1])/2,t=0;t<i-1;++t)s[t]=2*e[t+1]-a[t+1];return[a,s]}function s(e){return new i(e)}n.d(t,{A:()=>s}),i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=a(e),s=a(t),l=0,o=1;o<n;++l,++o)this._context.bezierCurveTo(i[0][l],s[0][l],i[1][l],s[1][l],e[o],t[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}}},3269:(e,t,n)=>{function i(e){return function(){return e}}n.d(t,{A:()=>p}),Array.prototype.slice;var a=n(482);const s=Math.PI,l=2*s,o=1e-6,r=l-o;function h(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class c{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?h:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return h;const n=10**t;return function(e){this._+=e[0];for(let t=1,i=e.length;t<i;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,i){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,t,n,i,a,s){this._append`C${+e},${+t},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(e,t,n,i,a){if(e=+e,t=+t,n=+n,i=+i,(a=+a)<0)throw new Error(`negative radius: ${a}`);let l=this._x1,r=this._y1,h=n-e,c=i-t,d=l-e,u=r-t,p=d*d+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(p>o)if(Math.abs(u*h-c*d)>o&&a){let g=n-l,f=i-r,A=h*h+c*c,y=g*g+f*f,v=Math.sqrt(A),m=Math.sqrt(p),b=a*Math.tan((s-Math.acos((A+p-y)/(2*v*m)))/2),k=b/m,w=b/v;Math.abs(k-1)>o&&this._append`L${e+k*d},${t+k*u}`,this._append`A${a},${a},0,0,${+(u*g>d*f)},${this._x1=e+w*h},${this._y1=t+w*c}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,i,a,h){if(e=+e,t=+t,h=!!h,(n=+n)<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(i),d=n*Math.sin(i),u=e+c,p=t+d,g=1^h,f=h?i-a:a-i;null===this._x1?this._append`M${u},${p}`:(Math.abs(this._x1-u)>o||Math.abs(this._y1-p)>o)&&this._append`L${u},${p}`,n&&(f<0&&(f=f%l+l),f>r?this._append`A${n},${n},0,1,${g},${e-c},${t-d}A${n},${n},0,1,${g},${this._x1=u},${this._y1=p}`:f>o&&this._append`A${n},${n},0,${+(f>=s)},${g},${this._x1=e+n*Math.cos(a)},${this._y1=t+n*Math.sin(a)}`)}rect(e,t,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function d(e){return e[0]}function u(e){return e[1]}function p(e,t){var n=i(!0),s=null,l=a.A,o=null,r=function(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new c(t)}(h);function h(i){var a,h,c,d=(i=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(i)).length,u=!1;for(null==s&&(o=l(c=r())),a=0;a<=d;++a)!(a<d&&n(h=i[a],a,i))===u&&((u=!u)?o.lineStart():o.lineEnd()),u&&o.point(+e(h,a,i),+t(h,a,i));if(c)return o=null,c+""||null}return e="function"==typeof e?e:void 0===e?d:i(e),t="function"==typeof t?t:void 0===t?u:i(t),h.x=function(t){return arguments.length?(e="function"==typeof t?t:i(+t),h):e},h.y=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),h):t},h.defined=function(e){return arguments.length?(n="function"==typeof e?e:i(!!e),h):n},h.curve=function(e){return arguments.length?(l=e,null!=s&&(o=l(s)),h):l},h.context=function(e){return arguments.length?(null==e?s=o=null:o=l(s=e),h):s},h}c.prototype}}]);
|
|
3
|
-
//# sourceMappingURL=6215.a8907b75.js.map
|