@next-bricks/diagram 0.46.2 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +5 -5
- package/dist/chunks/4192.5903f562.js +2 -0
- package/dist/chunks/4192.5903f562.js.map +1 -0
- package/dist/chunks/9711.58afee04.js +2 -0
- package/dist/chunks/9711.58afee04.js.map +1 -0
- package/dist/chunks/9961.813fbbe3.js +2 -0
- package/dist/chunks/9961.813fbbe3.js.map +1 -0
- package/dist/chunks/editable-label.1bd84f29.js +3 -0
- package/dist/chunks/{editable-label.224a6514.js.map → editable-label.1bd84f29.js.map} +1 -1
- package/dist/chunks/eo-display-canvas.31ead79a.js +2 -0
- package/dist/chunks/eo-display-canvas.31ead79a.js.map +1 -0
- package/dist/chunks/{eo-draw-canvas.7ee23e06.js → eo-draw-canvas.a5b81b45.js} +2 -2
- package/dist/chunks/eo-draw-canvas.a5b81b45.js.map +1 -0
- package/dist/chunks/{main.2a2456a9.js → main.463fee46.js} +2 -2
- package/dist/chunks/{main.2a2456a9.js.map → main.463fee46.js.map} +1 -1
- package/dist/examples.json +4 -4
- package/dist/index.a3714a79.js +2 -0
- package/dist/{index.7f471621.js.map → index.a3714a79.js.map} +1 -1
- package/dist/manifest.json +145 -145
- package/dist/types.json +3832 -3760
- package/dist-types/diagram/interfaces.d.ts +1 -1
- package/dist-types/draw-canvas/interfaces.d.ts +14 -3
- package/dist-types/shared/canvas/useLineMarkers.d.ts +2 -0
- package/docs/eo-display-canvas.md +13 -7
- package/docs/eo-draw-canvas.md +8 -0
- package/package.json +2 -2
- package/dist/chunks/4192.d6afa672.js +0 -2
- package/dist/chunks/4192.d6afa672.js.map +0 -1
- package/dist/chunks/6055.c26f35cf.js +0 -2
- package/dist/chunks/6055.c26f35cf.js.map +0 -1
- package/dist/chunks/9711.b1a2a5bc.js +0 -2
- package/dist/chunks/9711.b1a2a5bc.js.map +0 -1
- package/dist/chunks/editable-label.224a6514.js +0 -3
- package/dist/chunks/eo-display-canvas.162cc0f1.js +0 -2
- package/dist/chunks/eo-display-canvas.162cc0f1.js.map +0 -1
- package/dist/chunks/eo-draw-canvas.7ee23e06.js.map +0 -1
- package/dist/index.7f471621.js +0 -2
- /package/dist/chunks/{editable-label.224a6514.js.LICENSE.txt → editable-label.1bd84f29.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunks/9711.58afee04.js","mappings":"upBA8DA,MAAM,cAAEA,GAAa,SAAEC,GAAUC,MAAK,UAAEC,KAAWC,EAAAA,EAAAA,oBAuBtCC,IAAqBC,EAAAA,EAAAA,YAAWC,IAE7C,IAAAC,GAAA,IAAAC,GAAA,IAAAC,QAAAC,GAAA,IAAAD,QAAAE,GAAA,IAAAF,QAAAG,GAAA,IAAAH,QAAAI,GAAA,IAAAJ,QAAAK,GAAA,IAAAL,QAAAM,GAAA,IAAAN,QAAAO,GAAA,IAAAP,QAAAQ,GAAA,IAAAR,QAAAS,GAAA,IAAAT,QAAAU,GAAA,IAAAV,QAAAW,GAAA,IAAAX,QAAAY,GAAA,IAAAZ,QAAAa,GAAA,IAAAb,QAAAc,GAAA,IAAAd,QAAAe,GAAA,IAAAC,QAAAC,GAAA,IAAAjB,QAAAkB,GAAA,IAAAlB,QAAAmB,GAAA,IAAAnB,QAAAoB,GAAA,IAAApB,QAAAqB,GAAA,IAAArB,QAAAsB,GAAA,IAAAtB,QAAAuB,GAAA,IAAAvB,QAAAwB,GAAA,IAAAxB,QAAAyB,GAAA,IAAAzB,QAAA0B,GAAA,IAAA1B,QAAA2B,GAAA,IAAA3B,QAAA4B,GAAA,IAAA5B,QAAA6B,GAAA,IAAA7B,QAIA,MAAA8B,WAGwBC,EAAAA,iBAA2CC,WAAAA,GAAA,SAAAC,YAAAC,EAAAA,EAAAA,GAAA,KAAAnB,KACjEoB,EAAAA,EAAAA,GAAA,KAAApC,IAAAqC,EAAA,MAAAC,EAAA,SAAAF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AyCRA,KAAQ,oBAkCRA,KAAQ,eAsBRA,KAAQ,cAaRA,KAAQ,2BAKRA,KAAQ,qBAAAqU,GAAA0N,GAAAzN,KAAAC,EAAAA,EAAAA,GAAAF,KAhVgB/R,EAAAA,mBAAgBuR,G,kECnLvC0b,E,MAA0B,GAA4B,KAE1DA,EAAwBhF,KAAK,CAACiF,EAAOloB,GAAI,24BAGS,KAElD,QAAeioB,EAAwBnB,U,iECPnCmB,E,MAA0B,GAA4B,KAE1DA,EAAwBhF,KAAK,CAACiF,EAAOloB,GAAI,g2BACkT,KAE3V,QAAeioB,EAAwBnB,U","sources":["webpack:///./src/diagram/index.tsx","webpack:///./src/editable-label/index.tsx","webpack:///./src/experimental-node/index.tsx","webpack:///./src/display-canvas/index.tsx","webpack:///./src/draw-canvas/index.tsx","webpack:///./src/editable-label/styles.shadow.css","webpack:///./src/experimental-node/styles.shadow.css"],"sourcesContent":["import React, {\n createRef,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { EventEmitter, createDecorators } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport \"@next-core/theme\";\nimport { select } from \"d3-selection\";\nimport { ZoomTransform, zoom } from \"d3-zoom\";\nimport classNames from \"classnames\";\nimport { uniqueId } from \"lodash\";\nimport ResizeObserver from \"resize-observer-polyfill\";\nimport type {\n DiagramEdge,\n DiagramNode,\n LayoutOptions,\n LineConf,\n NodeBrickConf,\n PositionTuple,\n RefRepository,\n RenderedLineLabel,\n TransformLiteral,\n LineTarget,\n ConnectLineDetail,\n ConnectNodesOptions,\n ConnectLineState,\n ActiveTarget,\n RangeTuple,\n LineLabel,\n LineLabelConf,\n TextOptions,\n DragNodesOptions,\n NodeMovement,\n ManualLayoutStatus,\n LineMaskRects,\n} from \"./interfaces\";\nimport { NodeComponentGroup } from \"./NodeComponent\";\nimport { handleKeyboard } from \"./processors/handleKeyboard\";\nimport { transformToCenter } from \"./processors/transformToCenter\";\nimport { getRenderedLines } from \"./processors/getRenderedLines\";\nimport { normalizeLinesAndMarkers } from \"./processors/normalizeLinesAndMarkers\";\nimport { LineLabelComponentGroup } from \"./LineLabelComponent\";\nimport { LineComponent } from \"./LineComponent\";\nimport { MarkerComponent } from \"./MarkerComponent\";\nimport { LineMaskComponent } from \"./LineMaskComponent\";\nimport { ConnectLineComponent } from \"./ConnectLineComponent\";\nimport { getRenderedLineLabels } from \"./processors/getRenderedLineLabels\";\nimport { handleNodesMouseDown } from \"./processors/handleNodesMouseDown\";\nimport { DEFAULT_SCALE_RANGE_MAX, DEFAULT_SCALE_RANGE_MIN } from \"./constants\";\nimport { useRenderedDiagram } from \"./hooks/useRenderedDiagram\";\nimport { adjustLineLabels } from \"./processors/adjustLineLabels\";\nimport styleText from \"./styles.shadow.css\";\nimport { useUserView } from \"./hooks/useUserView\";\nimport { sameTarget } from \"./processors/sameTarget\";\nimport { getLineMaskRects } from \"./processors/getLineMaskRects\";\n\nconst { defineElement, property, event, method } = createDecorators();\n\nexport interface EoDiagramProps {\n layout?: \"dagre\" | \"force\";\n nodes?: DiagramNode[];\n edges?: DiagramEdge[];\n nodeBricks?: NodeBrickConf[];\n lines?: LineConf[];\n layoutOptions?: LayoutOptions;\n connectNodes?: ConnectNodesOptions;\n dragNodes?: DragNodesOptions;\n activeTarget?: ActiveTarget | null;\n disableKeyboardAction?: boolean;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n scaleRange?: RangeTuple;\n}\n\nexport interface DiagramRef {\n callOnLineLabel(id: string, method: string, ...args: unknown[]): void;\n}\n\nexport const EoDiagramComponent = forwardRef(LegacyEoDiagramComponent);\n\n/**\n * 构件 `eo-diagram`\n */\nexport\n@defineElement(\"eo-diagram\", {\n styleTexts: [styleText],\n})\nclass EoDiagram extends ReactNextElement implements EoDiagramProps {\n /**\n * @required\n */\n @property({ type: String })\n accessor layout: \"dagre\" | \"force\" | undefined;\n\n @property({ attribute: false })\n accessor nodes: DiagramNode[] | undefined;\n\n @property({ attribute: false })\n accessor edges: DiagramEdge[] | undefined;\n\n @property({ attribute: false })\n accessor nodeBricks: NodeBrickConf[] | undefined;\n\n @property({ attribute: false })\n accessor lines: LineConf[] | undefined;\n\n @property({ attribute: false })\n accessor layoutOptions: LayoutOptions | undefined;\n\n @property({ attribute: false })\n accessor activeTarget: ActiveTarget | null | undefined;\n\n @property({ type: Boolean })\n accessor disableKeyboardAction: boolean | undefined;\n\n @property({ attribute: false })\n accessor connectNodes: ConnectNodesOptions | undefined;\n\n @property({ attribute: false })\n accessor dragNodes: DragNodesOptions | undefined;\n\n @property({ type: Boolean })\n accessor zoomable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor scrollable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor pannable: boolean | undefined = true;\n\n @property({ attribute: false })\n accessor scaleRange: RangeTuple | undefined;\n\n @event({ type: \"activeTarget.change\" })\n accessor #activeTargetChangeEvent!: EventEmitter<ActiveTarget | null>;\n\n #handleActiveTargetChange = (target: ActiveTarget | null) => {\n this.#activeTargetChangeEvent.emit(target);\n };\n\n @event({ type: \"node.delete\" })\n accessor #nodeDelete!: EventEmitter<DiagramNode>;\n\n #handleNodeDelete = (node: DiagramNode) => {\n this.#nodeDelete.emit(node);\n };\n\n @event({ type: \"edge.delete\" })\n accessor #edgeDelete!: EventEmitter<DiagramEdge>;\n\n #handleEdgeDelete = (edge: DiagramEdge) => {\n this.#edgeDelete.emit(edge);\n };\n\n @event({ type: \"line.click\" })\n accessor #lineClick!: EventEmitter<LineTarget>;\n\n #handleLineClick = (line: LineTarget) => {\n this.#lineClick.emit(line);\n };\n\n @event({ type: \"line.dblclick\" })\n accessor #lineDoubleClick!: EventEmitter<LineTarget>;\n\n #handleLineDoubleClick = (line: LineTarget) => {\n this.#lineDoubleClick.emit(line);\n };\n\n @event({ type: \"nodes.connect\" })\n accessor #connectNodes!: EventEmitter<ConnectLineDetail>;\n\n #handleNodesConnect = (detail: ConnectLineDetail) => {\n this.#connectNodes.emit(detail);\n };\n\n #handleSwitchActiveTarget = (target: ActiveTarget | null) => {\n if (!sameTarget(target, this.activeTarget)) {\n this.activeTarget = target;\n }\n };\n\n #diagramRef = createRef<DiagramRef>();\n\n @method()\n callOnLineLabel(id: string, method: string, ...args: unknown[]) {\n this.#diagramRef.current?.callOnLineLabel(id, method, ...args);\n }\n\n render() {\n return (\n <EoDiagramComponent\n ref={this.#diagramRef}\n layout={this.layout}\n nodes={this.nodes}\n edges={this.edges}\n nodeBricks={this.nodeBricks}\n lines={this.lines}\n layoutOptions={this.layoutOptions}\n connectNodes={this.connectNodes}\n dragNodes={this.dragNodes}\n activeTarget={this.activeTarget}\n disableKeyboardAction={this.disableKeyboardAction}\n zoomable={this.zoomable}\n scrollable={this.scrollable}\n pannable={this.pannable}\n scaleRange={this.scaleRange}\n onActiveTargetChange={this.#handleActiveTargetChange}\n onSwitchActiveTarget={this.#handleSwitchActiveTarget}\n onNodeDelete={this.#handleNodeDelete}\n onEdgeDelete={this.#handleEdgeDelete}\n onLineClick={this.#handleLineClick}\n onLineDoubleClick={this.#handleLineDoubleClick}\n onNodesConnect={this.#handleNodesConnect}\n />\n );\n }\n}\n\nexport interface EoDiagramComponentProps extends EoDiagramProps {\n onActiveTargetChange?(target: ActiveTarget | null): void;\n onSwitchActiveTarget?(target: ActiveTarget | null): void;\n onNodeDelete?(node: DiagramNode): void;\n onEdgeDelete?(edge: DiagramEdge): void;\n onLineClick?(line: LineTarget): void;\n onLineDoubleClick?(line: LineTarget): void;\n onNodesConnect?(detail: ConnectLineDetail): void;\n}\n\nexport function LegacyEoDiagramComponent(\n {\n layout,\n nodes,\n edges,\n nodeBricks,\n lines,\n layoutOptions,\n connectNodes,\n dragNodes,\n activeTarget: _activeTarget,\n disableKeyboardAction,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onActiveTargetChange,\n onSwitchActiveTarget,\n onNodeDelete,\n onEdgeDelete,\n onLineClick,\n onLineDoubleClick,\n onNodesConnect,\n }: EoDiagramComponentProps,\n ref: React.Ref<DiagramRef>\n) {\n const [nodesReady, setNodesReady] = useState(false);\n const [nodesRenderId, setNodesRenderId] = useState(0);\n const [nodesRefRepository, setNodesRefRepository] =\n useState<RefRepository | null>(null);\n const [lineLabelsReady, setLineLabelsReady] = useState(false);\n const [lineLabelsRenderId, setLineLabelsRenderId] = useState(0);\n const [lineLabelsRefRepository, setLineLabelsRefRepository] =\n useState<RefRepository | null>(null);\n const [renderedLineLabels, setRenderedLineLabels] = useState<\n RenderedLineLabel[]\n >([]);\n\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 linePathsRef = useRef(new Map<string, SVGPathElement | null>());\n\n const rootRef = useRef<HTMLDivElement>(null);\n const nodesRef = useRef<HTMLDivElement>(null);\n const [centered, setCentered] = useState(false);\n\n const { userViewReady, userViewNodesMap, saveUserView } = useUserView(\n dragNodes?.save\n );\n\n const [connectLineTo, setConnectLineTo] = useState<PositionTuple>([0, 0]);\n const [connectLineState, setConnectLineState] =\n useState<ConnectLineState | null>(null);\n const [manualLayoutStatus, setManualLayoutStatus] =\n useState<ManualLayoutStatus>(\"initial\");\n const [nodeMovement, setNodeMovement] = useState<NodeMovement | null>(null);\n\n useImperativeHandle(ref, () => ({\n callOnLineLabel(id, method, ...args) {\n (\n lineLabelsRefRepository?.get(id)\n ?.firstElementChild as unknown as Record<string, Function>\n )?.[method](...args);\n },\n }));\n\n useEffect(() => {\n const onNodesMouseDown = (event: MouseEvent) => {\n handleNodesMouseDown(event, {\n nodes,\n nodesRefRepository,\n connectNodes,\n dragNodes,\n scale: transform.k,\n setConnectLineState,\n setConnectLineTo,\n setManualLayoutStatus,\n setNodeMovement,\n onSwitchActiveTarget,\n onNodesConnect,\n });\n };\n // Bind mousedown event manually, since the React event handler can't work with\n // d3-zoom inside shadow DOM.\n const nodesContainer = nodesRef.current;\n nodesContainer?.addEventListener(\"mousedown\", onNodesMouseDown);\n return () => {\n nodesContainer?.removeEventListener(\"mousedown\", onNodesMouseDown);\n };\n }, [\n nodes,\n connectNodes,\n dragNodes,\n transform.k,\n nodesRefRepository,\n onNodesConnect,\n onSwitchActiveTarget,\n ]);\n\n const { normalizedLines, normalizedLinesMap, markers } = useMemo(\n () => normalizeLinesAndMarkers(edges, lines),\n [edges, lines]\n );\n\n const lineLabels = useMemo(() => {\n return normalizedLines.flatMap(({ line: { text, label, $id }, edge }) => {\n if (!text && !label) {\n return [] as LineLabel[];\n }\n\n let key: \"label\" | \"text\";\n let list: LineLabelConf[] | TextOptions[];\n if (label) {\n key = \"label\";\n list = ([] as LineLabelConf[]).concat(label);\n } else {\n key = \"text\";\n list = ([] as TextOptions[]).concat(text!);\n }\n\n return list.map<LineLabel>((item) => ({\n [key as \"label\"]: item as LineLabelConf,\n id: `${$id}-${item.placement ?? \"center\"}`,\n edge,\n }));\n });\n }, [normalizedLines]);\n\n const { nodes: renderedNodes, edges: renderedEdges } = useRenderedDiagram({\n layout,\n nodes,\n edges,\n manualLayoutStatus,\n userViewReady,\n userViewNodesMap,\n nodeMovement,\n nodesRefRepository,\n lineLabelsRefRepository,\n normalizedLinesMap,\n layoutOptions,\n nodesRenderId,\n lineLabelsRenderId,\n });\n\n useEffect(\n () => {\n if (manualLayoutStatus === \"finished\") {\n saveUserView(\n renderedNodes.map((node) => ({\n id: node.id,\n x: node.x,\n y: node.y,\n }))\n );\n }\n },\n // Only save user view when manual layout is just finished.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [manualLayoutStatus]\n );\n\n const renderedLines = useMemo(\n () => getRenderedLines(renderedEdges, renderedNodes, normalizedLines),\n [normalizedLines, renderedNodes, renderedEdges]\n );\n\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 const root = rootRef.current;\n if (!root || disableKeyboardAction) {\n return;\n }\n const onKeydown = (event: KeyboardEvent) => {\n const action = handleKeyboard(event, {\n renderedNodes,\n activeTarget,\n });\n\n if (action?.action === \"delete-node\") {\n onNodeDelete?.(action.node);\n } else if (action?.action === \"delete-edge\") {\n onEdgeDelete?.(action.edge);\n } else if (action?.action === \"switch-active-node\" && action.node) {\n onSwitchActiveTarget?.({ type: \"node\", nodeId: action.node.id });\n }\n };\n root.addEventListener(\"keydown\", onKeydown);\n return () => {\n root.removeEventListener(\"keydown\", onKeydown);\n };\n }, [\n activeTarget,\n renderedNodes,\n disableKeyboardAction,\n onSwitchActiveTarget,\n onNodeDelete,\n onEdgeDelete,\n ]);\n\n const handleNodesRendered = useCallback(\n (refRepository: RefRepository | null) => {\n if (refRepository) {\n setNodesRenderId((previous) => previous + 1);\n setNodesRefRepository(refRepository);\n }\n setNodesReady((previous) => previous || !!refRepository);\n },\n []\n );\n\n const handleLineLabelsRendered = useCallback(\n (refRepository: RefRepository | null) => {\n if (refRepository) {\n setLineLabelsRenderId((previous) => previous + 1);\n setLineLabelsRefRepository(refRepository);\n }\n setLineLabelsReady((previous) => previous || !!refRepository);\n },\n []\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<HTMLDivElement, unknown>(), []);\n\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 }, [onSwitchActiveTarget, scaleRange, zoomable, zoomer]);\n\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) => e.preventDefault())\n .on(\"dblclick.zoom\", null);\n\n if (!pannable) {\n rootSelection\n .on(\"mousedown.zoom\", null)\n .on(\"touchstart.zoom\", null)\n .on(\"touchmove.zoom\", null)\n .on(\"touchend.zoom\", null);\n }\n\n return unsetZoom;\n }, [pannable, scrollable, zoomable, zoomer]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (renderedNodes.length === 0 || !root || centered) {\n return;\n }\n const { k, x, y } = transformToCenter(renderedNodes, {\n canvasWidth: root.clientWidth,\n canvasHeight: root.clientHeight,\n scaleRange: zoomable ? scaleRange : undefined,\n });\n zoomer.transform(select(root), new ZoomTransform(k, x, y));\n setCentered(true);\n }, [centered, renderedNodes, scaleRange, zoomable, zoomer]);\n\n const defPrefix = useMemo(() => `${uniqueId(\"diagram-\")}-`, []);\n const markerPrefix = `${defPrefix}line-arrow-`;\n const maskPrefix = `${defPrefix}mask-`;\n const activeLineMarkerPrefix = `${defPrefix}active-line-`;\n\n useEffect(() => {\n setRenderedLineLabels((previous) =>\n getRenderedLineLabels(previous, renderedLines, linePathsRef.current)\n );\n }, [renderedLines]);\n\n const [lineMaskRects, setLineMaskRects] = React.useState<LineMaskRects>(\n new Map()\n );\n\n useEffect(() => {\n if (!lineLabelsRefRepository) {\n return;\n }\n const updateLineMaskRects = () => {\n setLineMaskRects(\n getLineMaskRects(renderedLineLabels, lineLabelsRefRepository)\n );\n };\n\n adjustLineLabels(renderedLineLabels, lineLabelsRefRepository);\n\n const observer = new ResizeObserver(updateLineMaskRects);\n for (const lineLabel of lineLabelsRefRepository.values()) {\n observer.observe(lineLabel);\n }\n return () => {\n observer.disconnect();\n };\n }, [lineLabelsRenderId, lineLabelsRefRepository, renderedLineLabels]);\n\n if (layout !== \"dagre\" && layout !== \"force\") {\n return <div>{`Diagram layout not supported: \"${layout}\"`}</div>;\n }\n\n return (\n <div\n className={classNames(\"diagram\", {\n ready: nodesReady && centered,\n grabbing,\n pannable,\n })}\n tabIndex={-1}\n ref={rootRef}\n >\n <svg width=\"100%\" height=\"100%\" className=\"lines\">\n <defs>\n {markers.map(({ type, strokeColor }, index) => (\n <MarkerComponent\n key={index}\n id={`${markerPrefix}${index}`}\n type={type}\n strokeColor={strokeColor}\n />\n ))}\n {[...lineMaskRects].map(([lineId, rects]) => (\n <LineMaskComponent\n key={lineId}\n lineId={lineId}\n rects={rects}\n maskPrefix={maskPrefix}\n renderedLineLabels={renderedLineLabels}\n />\n ))}\n <marker\n id={`${activeLineMarkerPrefix}start`}\n viewBox=\"0 0 8 8\"\n refX={4}\n refY={4}\n markerWidth={8}\n markerHeight={8}\n orient=\"auto\"\n >\n <path\n d=\"M 0.5 0.5 H 7.5 V 7.5 H 0.5 Z\"\n stroke=\"var(--palette-gray-7)\"\n strokeWidth={1}\n fill=\"var(--palette-gray-1)\"\n />\n </marker>\n <marker\n id={`${activeLineMarkerPrefix}end`}\n viewBox=\"0 0 14 8\"\n refX={3}\n refY={4}\n markerWidth={14}\n markerHeight={8}\n orient=\"auto\"\n >\n <path\n d=\"M 0.5 1.5 L 5.5 4 L 0.5 6.5 z\"\n stroke=\"var(--palette-blue-3)\"\n strokeWidth={1}\n fill=\"var(--palette-blue-3)\"\n />\n <path\n d=\"M 6.5 0.5 H 13.5 V 7.5 H 6.5 Z\"\n stroke=\"var(--palette-gray-7)\"\n strokeWidth={1}\n fill=\"var(--palette-gray-1)\"\n />\n </marker>\n </defs>\n <g\n transform={`translate(${transform.x} ${transform.y}) scale(${transform.k})`}\n >\n {renderedLines.map((line) => (\n <LineComponent\n key={line.line.$id}\n line={line}\n linePaths={linePathsRef.current}\n lineMaskRects={lineMaskRects}\n maskPrefix={maskPrefix}\n markerPrefix={markerPrefix}\n activeLineMarkerPrefix={activeLineMarkerPrefix}\n active={\n activeTarget?.type === \"edge\" &&\n activeTarget.edge.source === line.edge.source &&\n activeTarget.edge.target === line.edge.target\n }\n activeRelated={\n activeTarget?.type === \"node\" &&\n (line.edge.source === activeTarget.nodeId ||\n line.edge.target === activeTarget.nodeId)\n }\n onLineClick={onLineClick}\n onLineDoubleClick={onLineDoubleClick}\n />\n ))}\n </g>\n </svg>\n <div\n className={classNames(\"line-labels\", { ready: lineLabelsReady })}\n style={{\n left: transform.x,\n top: transform.y,\n transform: `scale(${transform.k})`,\n }}\n >\n <LineLabelComponentGroup\n labels={lineLabels}\n onRendered={handleLineLabelsRendered}\n />\n </div>\n <div\n className=\"nodes\"\n ref={nodesRef}\n style={{\n left: transform.x,\n top: transform.y,\n transform: `scale(${transform.k})`,\n }}\n >\n <NodeComponentGroup\n nodes={nodes}\n nodeBricks={nodeBricks}\n // nodePositions={nodePositions}\n onRendered={handleNodesRendered}\n />\n </div>\n <ConnectLineComponent\n connectLineState={connectLineState}\n connectLineTo={connectLineTo}\n markerPrefix={markerPrefix}\n />\n </div>\n );\n}\n","import React, {\n createRef,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\nimport { EventEmitter, createDecorators } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport \"@next-core/theme\";\nimport classNames from \"classnames\";\nimport styleText from \"./styles.shadow.css\";\n\nconst { defineElement, property, event, method } = createDecorators();\n\nexport interface EditableLabelProps {\n label?: string;\n type?: LabelType;\n}\n\nexport type LabelType = \"line\" | \"default\";\n\nexport interface EditableLabelRef {\n enableEditing(): void;\n}\n\nexport const EditableLabelComponent = forwardRef(LegacyEditableLabelComponent);\n\n/**\n * 构件 `diagram.editable-label`\n */\nexport\n@defineElement(\"diagram.editable-label\", {\n styleTexts: [styleText],\n})\nclass EditableLabel extends ReactNextElement implements EditableLabelProps {\n @property()\n accessor label: string | undefined;\n\n @property({ render: false })\n accessor type: LabelType | undefined;\n\n @event({ type: \"label.editing.change\" })\n accessor #labelEditingChange!: EventEmitter<boolean>;\n\n #handleLabelEditingChange = (value: boolean) => {\n this.#labelEditingChange.emit(value);\n };\n\n @event({ type: \"label.change\" })\n accessor #labelChange!: EventEmitter<string>;\n\n #handleLabelChange = (value: string) => {\n this.#labelChange.emit(value);\n };\n\n @method()\n enableEditing() {\n this.#editableLabelRef.current?.enableEditing();\n }\n\n #editableLabelRef = createRef<EditableLabelRef>();\n\n render() {\n return (\n <EditableLabelComponent\n ref={this.#editableLabelRef}\n label={this.label}\n onLabelEditingChange={this.#handleLabelEditingChange}\n onLabelChange={this.#handleLabelChange}\n />\n );\n }\n}\n\nexport interface EditableLabelComponentProps extends EditableLabelProps {\n onLabelEditingChange?(value: boolean): void;\n onLabelChange?(value: string): void;\n}\n\nexport function LegacyEditableLabelComponent(\n {\n label: _label,\n onLabelChange,\n onLabelEditingChange,\n }: EditableLabelComponentProps,\n ref: React.Ref<EditableLabelRef>\n) {\n const label = _label ?? \"\";\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 labelInputRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(ref, () => ({\n enableEditing() {\n setEditingLabel(true);\n },\n }));\n\n useEffect(() => {\n setCurrentLabel(label);\n }, [label]);\n\n const handleEditLabel = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setEditingLabel(true);\n }, []);\n\n useEffect(() => {\n if (editingLabel) {\n // Prevent scroll when focusing.\n // Otherwise the diagram svg may be clipped in Chrome.\n labelInputRef.current?.focus({ preventScroll: true });\n labelInputRef.current?.select();\n }\n }, [editingLabel]);\n\n useEffect(() => {\n if (editingLabelInitialized.current) {\n onLabelEditingChange?.(editingLabel);\n } else {\n editingLabelInitialized.current = true;\n }\n }, [editingLabel, onLabelEditingChange]);\n\n const handleInputChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setCurrentLabel(event.target.value);\n },\n []\n );\n\n const handleInputKeydown = useCallback((event: React.KeyboardEvent) => {\n const key =\n event.key ||\n /* istanbul ignore next: compatibility */ event.keyCode ||\n /* istanbul ignore next: compatibility */ event.which;\n if (key === \"Enter\" || key === 13) {\n labelInputRef.current?.blur();\n }\n }, []);\n\n const handleInputBlur = useCallback(() => {\n setEditingLabel(false);\n setShouldEmitLabelChange(true);\n }, []);\n\n useEffect(() => {\n if (shouldEmitLabelChange) {\n onLabelChange?.(currentLabel);\n setShouldEmitLabelChange(false);\n }\n }, [currentLabel, onLabelChange, shouldEmitLabelChange]);\n\n const stopPropagation = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n }, []);\n\n return (\n <div\n className={classNames(\"label\", {\n editing: editingLabel,\n empty: !currentLabel,\n })}\n onDoubleClick={stopPropagation}\n onMouseDown={stopPropagation}\n >\n <input\n className=\"label-input\"\n value={currentLabel}\n ref={labelInputRef}\n onChange={handleInputChange}\n onKeyDown={handleInputKeydown}\n onBlur={handleInputBlur}\n />\n <div className=\"label-text\" onDoubleClick={handleEditLabel}>\n {currentLabel}\n </div>\n </div>\n );\n}\n","// istanbul ignore file: experimental only\nimport React, { useCallback } from \"react\";\nimport { createDecorators, type EventEmitter } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport \"@next-core/theme\";\nimport type { PositionTuple } from \"../diagram/interfaces\";\nimport styleText from \"./styles.shadow.css\";\nimport type { DecoratorType } from \"../draw-canvas/interfaces\";\n\nconst { defineElement, property, event } = createDecorators();\n\ntype ExperimentalUsage = \"library\" | \"dragging\" | \"default\";\ntype NodeStatus = \"highlighted\" | \"faded\" | \"default\";\n\nexport interface ExperimentalNodeProps {\n usage?: ExperimentalUsage;\n status?: NodeStatus;\n}\n\n/**\n * 构件 `diagram.experimental-node`\n */\nexport\n@defineElement(\"diagram.experimental-node\", {\n styleTexts: [styleText],\n})\nclass ExperimentalNode\n extends ReactNextElement\n implements ExperimentalNodeProps\n{\n @property()\n accessor usage: ExperimentalUsage | undefined;\n\n // 最终节点应该统一实现这个字段,保持类型一致\n @property({ type: String, render: false })\n accessor status: NodeStatus | undefined;\n\n // 最终节点应该统一实现这个字段,保持类型一致\n @property({ type: String })\n accessor decorator: DecoratorType | undefined;\n\n @event({ type: \"drag.start\" })\n accessor #dragStartEvent!: EventEmitter<PositionTuple>;\n\n #handleDragStart = (position: PositionTuple) => {\n this.#dragStartEvent.emit(position);\n };\n\n @event({ type: \"drag.move\" })\n accessor #dragMoveEvent!: EventEmitter<PositionTuple>;\n\n #handleDragMove = (position: PositionTuple) => {\n this.#dragMoveEvent.emit(position);\n };\n\n @event({ type: \"drag.end\" })\n accessor #dragEndEvent!: EventEmitter<PositionTuple>;\n\n #handleDragEnd = (position: PositionTuple) => {\n this.#dragEndEvent.emit(position);\n };\n\n render() {\n return (\n <ExperimentalNodeComponent\n usage={this.usage}\n onDragStart={this.#handleDragStart}\n onDragMove={this.#handleDragMove}\n onDragEnd={this.#handleDragEnd}\n />\n );\n }\n}\n\nexport interface ExperimentalNodeComponentProps extends ExperimentalNodeProps {\n onDragStart?(position: PositionTuple): void;\n onDragMove?(position: PositionTuple): void;\n onDragEnd?(position: PositionTuple): void;\n}\n\nexport function ExperimentalNodeComponent({\n usage,\n onDragStart,\n onDragMove,\n onDragEnd,\n}: ExperimentalNodeComponentProps) {\n const handleMouseDown = useCallback(\n (event: React.MouseEvent) => {\n if (usage !== \"library\") {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n const from: PositionTuple = [event.clientX, event.clientY];\n let moved = false;\n const onMouseMove = (e: MouseEvent) => {\n if (!moved) {\n moved = (e.clientX - from[0]) ** 2 + (e.clientY - from[1]) ** 2 >= 9;\n if (moved) {\n onDragStart?.([e.clientX, e.clientY]);\n }\n }\n if (moved) {\n onDragMove?.([e.clientX, e.clientY]);\n }\n };\n const onMouseUp = (e: MouseEvent) => {\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n if (moved) {\n onDragEnd?.([e.clientX, e.clientY]);\n }\n };\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n },\n [onDragEnd, onDragMove, onDragStart, usage]\n );\n\n return (\n <div onMouseDown={handleMouseDown}>\n <slot />\n </div>\n );\n}\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from \"react\";\nimport { createDecorators, type EventEmitter } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport \"@next-core/theme\";\nimport { uniqueId } from \"lodash\";\nimport classNames from \"classnames\";\nimport { select } from \"d3-selection\";\nimport type { RangeTuple, SizeTuple } from \"../diagram/interfaces\";\nimport type {\n ActiveTarget,\n InitialCell,\n NodeBrickConf,\n CellContextMenuDetail,\n EdgeLineConf,\n Cell,\n LayoutType,\n LayoutOptions,\n} from \"../draw-canvas/interfaces\";\nimport { MarkerComponent } from \"../diagram/MarkerComponent\";\nimport { sameTarget } from \"../draw-canvas/processors/sameTarget\";\nimport { CellComponent } from \"../draw-canvas/CellComponent\";\nimport { initializeCells } from \"../draw-canvas/processors/initializeCells\";\nimport {\n DEFAULT_DEGRADED_THRESHOLD,\n DEFAULT_NODE_SIZE,\n} from \"../draw-canvas/constants\";\nimport { useZoom } from \"../shared/canvas/useZoom\";\nimport { useActiveTarget } from \"../shared/canvas/useActiveTarget\";\nimport { rootReducer } from \"../draw-canvas/reducers\";\nimport { getUnrelatedCells } from \"../draw-canvas/processors/getUnrelatedCells\";\nimport { isEdgeCell, isNodeCell } from \"../draw-canvas/processors/asserts\";\nimport { ZoomBarComponent } from \"../shared/canvas/ZoomBarComponent\";\nimport { useLayout } from \"../shared/canvas/useLayout\";\nimport { useReady } from \"../shared/canvas/useReady\";\nimport { useLineMarkers } from \"../shared/canvas/useLineMarkers\";\nimport { updateCells } from \"../draw-canvas/processors/updateCells\";\nimport styleText from \"../shared/canvas/styles.shadow.css\";\nimport zoomBarStyleText from \"../shared/canvas/ZoomBarComponent.shadow.css\";\n\nconst { defineElement, property, event } = createDecorators();\n\nexport interface EoDisplayCanvasProps {\n cells: InitialCell[] | undefined;\n layout: LayoutType;\n layoutOptions?: LayoutOptions;\n defaultNodeSize: SizeTuple;\n defaultNodeBricks?: NodeBrickConf[];\n defaultEdgeLines?: EdgeLineConf[];\n degradedThreshold?: number;\n degradedNodeLabel?: string;\n activeTarget?: ActiveTarget | null;\n fadeUnrelatedCells?: boolean;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n scaleRange?: RangeTuple;\n}\n\n/**\n * 用于展示查看的画布。\n */\nexport\n@defineElement(\"eo-display-canvas\", {\n styleTexts: [styleText, zoomBarStyleText],\n})\nclass EoDisplayCanvas extends ReactNextElement implements EoDisplayCanvasProps {\n /**\n * 用于查看的画布可以更新 `cells` 属性。\n */\n @property({ attribute: false })\n accessor cells: InitialCell[] | undefined;\n\n @property({ type: String })\n accessor layout: LayoutType;\n\n @property({ attribute: false })\n accessor layoutOptions: LayoutOptions | undefined;\n\n @property({ attribute: false })\n accessor defaultNodeSize: SizeTuple = [DEFAULT_NODE_SIZE, DEFAULT_NODE_SIZE];\n\n @property({ attribute: false })\n accessor defaultNodeBricks: NodeBrickConf[] | undefined;\n\n /**\n * 当节点数量达到或超过 `degradedThreshold` 时,节点将被降级展示。\n *\n * @default 500\n */\n @property({ type: Number })\n accessor degradedThreshold: number | undefined;\n\n // Set `attribute` to `false` event if it accepts string value.\n // Because when passing like \"<% DATA.node.data.name %>\", it will be\n // evaluated as object temporarily.\n /**\n * 设置节点将降级展示时显示的名称。\n *\n * @default \"<% DATA.node.id %>\"\n */\n @property({ attribute: false })\n accessor degradedNodeLabel: string | undefined;\n\n /**\n * 使用条件判断设置默认的边对应的连线。在 `if` 表达式中 `DATA` 为 `{ edge }`,例如:\n *\n * ```yaml\n * defaultEdgeLines:\n * - if: <% DATA.edge.data?.virtual %>\n * dashed: true\n * ```\n */\n @property({ attribute: false })\n accessor defaultEdgeLines: EdgeLineConf[] | undefined;\n\n @property({ attribute: false })\n accessor activeTarget: ActiveTarget | null | undefined;\n\n /**\n * 当鼠标悬浮到某节点上时,隐藏其他跟该节点无关的元素。\n */\n @property({ type: Boolean })\n accessor fadeUnrelatedCells: boolean | undefined;\n\n @property({ type: Boolean })\n accessor zoomable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor scrollable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor pannable: boolean | undefined = true;\n\n @property({ attribute: false })\n accessor scaleRange: RangeTuple | undefined;\n\n @event({ type: \"activeTarget.change\" })\n accessor #activeTargetChangeEvent!: EventEmitter<ActiveTarget | null>;\n\n #handleActiveTargetChange = (target: ActiveTarget | null) => {\n this.#activeTargetChangeEvent.emit(target);\n };\n\n #handleSwitchActiveTarget = (target: ActiveTarget | null) => {\n if (!sameTarget(target, this.activeTarget)) {\n this.activeTarget = target;\n }\n };\n\n @event({ type: \"cell.contextmenu\" })\n accessor #cellContextMenu!: EventEmitter<CellContextMenuDetail>;\n\n #handleCellContextMenu = (detail: CellContextMenuDetail) => {\n this.#cellContextMenu.emit(detail);\n };\n\n @event({ type: \"cell.click\" })\n accessor #cellClick!: EventEmitter<CellContextMenuDetail>;\n\n #handleCellClick = (detail: CellContextMenuDetail) => {\n this.#cellClick.emit(detail);\n };\n\n render() {\n return (\n <EoDisplayCanvasComponent\n shadowRoot={this.shadowRoot!}\n cells={this.cells}\n layout={this.layout}\n layoutOptions={this.layoutOptions}\n defaultNodeSize={this.defaultNodeSize}\n defaultNodeBricks={this.defaultNodeBricks}\n defaultEdgeLines={this.defaultEdgeLines}\n degradedThreshold={this.degradedThreshold}\n degradedNodeLabel={this.degradedNodeLabel}\n activeTarget={this.activeTarget}\n fadeUnrelatedCells={this.fadeUnrelatedCells}\n zoomable={this.zoomable}\n scrollable={this.scrollable}\n pannable={this.pannable}\n scaleRange={this.scaleRange}\n onActiveTargetChange={this.#handleActiveTargetChange}\n onSwitchActiveTarget={this.#handleSwitchActiveTarget}\n onCellContextMenu={this.#handleCellContextMenu}\n onCellClick={this.#handleCellClick}\n />\n );\n }\n}\n\nexport interface EoDisplayCanvasComponentProps extends EoDisplayCanvasProps {\n shadowRoot: ShadowRoot;\n onActiveTargetChange(target: ActiveTarget | null): void;\n onSwitchActiveTarget(target: ActiveTarget | null): void;\n onCellContextMenu(detail: CellContextMenuDetail): void;\n onCellClick(detail: CellContextMenuDetail): void;\n}\n\nfunction EoDisplayCanvasComponent({\n shadowRoot,\n cells: initialCells,\n layout,\n layoutOptions,\n defaultNodeSize,\n defaultNodeBricks,\n defaultEdgeLines,\n degradedThreshold,\n degradedNodeLabel,\n activeTarget: _activeTarget,\n fadeUnrelatedCells,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onActiveTargetChange,\n onSwitchActiveTarget,\n onCellContextMenu,\n onCellClick,\n}: EoDisplayCanvasComponentProps) {\n const [{ cells, layoutKey }, dispatch] = useReducer(\n rootReducer,\n initialCells,\n (initialCells) => ({\n cells: initializeCells(initialCells, { defaultNodeSize }),\n layoutKey: 1,\n })\n );\n\n // When nodes are greater or equal to threshold, the diagram will be degraded.\n // Thus all nodes will be displayed as simple svg elements instead of bricks.\n const degraded = useMemo(\n () =>\n cells.filter(isNodeCell).length >=\n (degradedThreshold ?? DEFAULT_DEGRADED_THRESHOLD),\n [cells, degradedThreshold]\n );\n\n const rootRef = useRef<SVGSVGElement>(null);\n\n const { grabbing, transform, zoomer, scaleRange } = useZoom({\n rootRef,\n zoomable,\n scrollable,\n pannable,\n draggable: true,\n scaleRange: _scaleRange,\n onSwitchActiveTarget,\n });\n\n const { centered, setCentered, getNextLayoutKey } = useLayout({\n layout,\n layoutOptions,\n rootRef,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n layoutKey,\n dispatch,\n });\n\n const reCenter = useCallback(() => {\n setCentered(false);\n }, [setCentered]);\n\n const previousCellsRef = useRef(initialCells);\n\n useEffect(() => {\n if (initialCells !== previousCellsRef.current) {\n previousCellsRef.current = initialCells;\n const result = updateCells({\n canvasWidth: shadowRoot.host.clientWidth,\n canvasHeight: shadowRoot.host.clientHeight,\n defaultNodeSize,\n layout,\n previousCells: cells,\n cells: initialCells,\n scaleRange,\n transform,\n });\n dispatch({ type: \"update-cells\", payload: result.cells });\n }\n }, [\n cells,\n defaultNodeSize,\n initialCells,\n layout,\n scaleRange,\n shadowRoot,\n transform,\n ]);\n\n const activeTarget = useActiveTarget({\n rootRef,\n activeTarget: _activeTarget,\n onActiveTargetChange,\n });\n\n const defPrefix = useMemo(() => `${uniqueId(\"diagram-\")}-`, []);\n const markerPrefix = `${defPrefix}line-arrow-`;\n\n const handleNodeBrickResize = useCallback(\n (id: string, size: SizeTuple | null) => {\n dispatch({\n type: \"update-node-size\",\n payload: { id, size },\n layoutKey: getNextLayoutKey(),\n });\n },\n [getNextLayoutKey]\n );\n\n const [hoverCell, setHoverCell] = useState<Cell | null>(null);\n const handleCellMouseEnter = useCallback((cell: Cell) => {\n setHoverCell(cell);\n }, []);\n const handleCellMouseLeave = useCallback((cell: Cell) => {\n setHoverCell((prev) => (prev === cell ? null : prev));\n }, []);\n\n const [unrelatedCells, setUnrelatedCells] = useState<Cell[]>([]);\n useEffect(() => {\n const nextUnrelated = fadeUnrelatedCells\n ? getUnrelatedCells(cells, null, hoverCell)\n : [];\n // Do not update the state when prev and next are both empty.\n setUnrelatedCells((prev) =>\n prev.length === 0 && nextUnrelated.length === 0 ? prev : nextUnrelated\n );\n }, [cells, fadeUnrelatedCells, hoverCell]);\n\n const handleZoomSlide = useCallback(\n (value: number) => {\n // istanbul ignore next\n if (process.env.NODE_ENV !== \"test\") {\n zoomer.scaleTo(select(rootRef.current!), value / 100);\n }\n },\n [zoomer]\n );\n\n const { lineConfMap, markers } = useLineMarkers({\n cells,\n defaultEdgeLines,\n markerPrefix,\n });\n\n const ready = useReady({ cells, layout, centered });\n\n return (\n <>\n <svg\n width=\"100%\"\n height=\"100%\"\n ref={rootRef}\n className={classNames(\"root\", { grabbing, pannable, ready })}\n tabIndex={-1}\n >\n <defs>\n {markers.map((marker, index) => (\n <MarkerComponent\n key={index}\n id={`${markerPrefix}${index}`}\n type={marker.markerType}\n strokeColor={marker.strokeColor}\n />\n ))}\n </defs>\n <g\n transform={`translate(${transform.x} ${transform.y}) scale(${transform.k})`}\n >\n <g className=\"cells\">\n {cells.map((cell) => (\n <CellComponent\n key={`${cell.type}:${isEdgeCell(cell) ? `${cell.source}~${cell.target}` : cell.id}`}\n layout={layout}\n cell={cell}\n cells={cells}\n degraded={degraded}\n degradedNodeLabel={degradedNodeLabel}\n defaultNodeBricks={defaultNodeBricks}\n lineConfMap={lineConfMap}\n transform={transform}\n activeTarget={activeTarget}\n readOnly\n unrelatedCells={unrelatedCells}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onCellContextMenu={onCellContextMenu}\n onCellClick={onCellClick}\n onNodeBrickResize={handleNodeBrickResize}\n onCellMouseEnter={\n fadeUnrelatedCells && isNodeCell(cell)\n ? handleCellMouseEnter\n : undefined\n }\n onCellMouseLeave={\n fadeUnrelatedCells && isNodeCell(cell)\n ? handleCellMouseLeave\n : undefined\n }\n />\n ))}\n </g>\n </g>\n </svg>\n <ZoomBarComponent\n shadowRoot={shadowRoot}\n scale={transform.k}\n scaleRange={scaleRange}\n onZoomChange={handleZoomSlide}\n onReCenter={reCenter}\n />\n </>\n );\n}\n","import React, {\n createRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from \"react\";\nimport { createDecorators, type EventEmitter } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport type { UseSingleBrickConf } from \"@next-core/react-runtime\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport \"@next-core/theme\";\nimport { uniqueId } from \"lodash\";\nimport classNames from \"classnames\";\nimport { select } from \"d3-selection\";\nimport type { lockBodyScroll as _lockBodyScroll } from \"@next-bricks/basic/data-providers/lock-body-scroll/lock-body-scroll\";\nimport type {\n NodePosition,\n PositionTuple,\n RangeTuple,\n SizeTuple,\n TransformLiteral,\n} from \"../diagram/interfaces\";\nimport type {\n ActiveTarget,\n Cell,\n EdgeCell,\n InitialCell,\n NodeBrickConf,\n NodeCell,\n NodeId,\n DecoratorCell,\n DecoratorType,\n CellContextMenuDetail,\n ConnectLineState,\n Deferred,\n ConnectNodesDetail,\n EdgeLineConf,\n DecoratorTextChangeDetail,\n NodeView,\n LayoutType,\n LayoutOptions,\n SmartConnectLineState,\n LineConnecterConf,\n Direction,\n EditableLineInfo,\n LineEditorState,\n EdgeView,\n LineSettings,\n} from \"./interfaces\";\nimport { rootReducer } from \"./reducers\";\nimport { MarkerComponent } from \"../diagram/MarkerComponent\";\nimport {\n isContainerDecoratorCell,\n isEdgeCell,\n isEdgeSide,\n isNodeCell,\n isNodeOrAreaDecoratorCell,\n isTextDecoratorCell,\n} from \"./processors/asserts\";\nimport type {\n EdgeViewChangePayload,\n LineTuple,\n MoveCellPayload,\n ResizeCellPayload,\n} from \"./reducers/interfaces\";\nimport { sameTarget } from \"./processors/sameTarget\";\nimport { handleKeyboard } from \"./processors/handleKeyboard\";\nimport { CellComponent } from \"./CellComponent\";\nimport { ConnectLineComponent } from \"./ConnectLineComponent\";\nimport { initializeCells } from \"./processors/initializeCells\";\nimport { updateCells } from \"./processors/updateCells\";\nimport { getUnrelatedCells } from \"./processors/getUnrelatedCells\";\nimport {\n DEFAULT_NODE_SIZE,\n DEFAULT_AREA_WIDTH,\n DEFAULT_AREA_HEIGHT,\n DEFAULT_DEGRADED_THRESHOLD,\n DEFAULT_NODE_PADDING_FOR_SMART_LINES,\n} from \"./constants\";\nimport { useZoom } from \"../shared/canvas/useZoom\";\nimport { useActiveTarget } from \"../shared/canvas/useActiveTarget\";\nimport { ZoomBarComponent } from \"../shared/canvas/ZoomBarComponent\";\nimport { useLayout } from \"../shared/canvas/useLayout\";\nimport { useReady } from \"../shared/canvas/useReady\";\nimport { useLineMarkers } from \"../shared/canvas/useLineMarkers\";\nimport { getConnectPointsOfRectangle } from \"../shared/canvas/shapes/Rectangle\";\nimport { LineConnectorComponent } from \"./LineConnectorComponent\";\nimport { HoverStateContext, type HoverState } from \"./HoverStateContext\";\nimport { handleLasso } from \"./processors/handleLasso\";\nimport styleText from \"../shared/canvas/styles.shadow.css\";\nimport zoomBarStyleText from \"../shared/canvas/ZoomBarComponent.shadow.css\";\nimport { SmartConnectLineComponent } from \"./SmartConnectLineComponent\";\nimport { cellToTarget } from \"./processors/cellToTarget\";\nimport { handleNodeContainedChange } from \"./processors/handleNodeContainedChange\";\nimport { LineEditorComponent } from \"./LineEditorComponent\";\nimport { EditingLineComponent } from \"./EditingLineComponent\";\n\nconst lockBodyScroll = unwrapProvider<typeof _lockBodyScroll>(\n \"basic.lock-body-scroll\"\n);\n\nconst { defineElement, property, method, event } = createDecorators();\n\nexport interface EoDrawCanvasProps {\n cells: InitialCell[] | undefined;\n layout: LayoutType;\n layoutOptions?: LayoutOptions;\n defaultNodeSize: SizeTuple;\n defaultNodeBricks?: NodeBrickConf[];\n defaultEdgeLines?: EdgeLineConf[];\n degradedThreshold?: number;\n degradedNodeLabel?: string;\n activeTarget?: ActiveTarget | null;\n fadeUnrelatedCells?: boolean;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n dragBehavior?: DragBehavior;\n ctrlDragBehavior?: CtrlDragBehavior;\n scaleRange?: RangeTuple;\n lineSettings?: LineSettings;\n lineConnector?: LineConnecterConf | boolean;\n allowEdgeToArea?: boolean;\n}\n\nexport type DragBehavior = \"none\" | \"lasso\" | \"grab\";\nexport type CtrlDragBehavior = \"none\" | \"grab\";\n\nexport interface DropNodeInfo extends AddNodeInfo {\n /** [PointerEvent::clientX, PointerEvent::clientY] */\n position: PositionTuple;\n}\n\nexport interface DropDecoratorInfo {\n decorator: DecoratorType;\n /** [PointerEvent::clientX, PointerEvent::clientY] */\n position: PositionTuple;\n text?: string;\n direction?: Direction;\n}\n\nexport interface AddNodeInfo {\n id: NodeId;\n useBrick?: UseSingleBrickConf;\n data?: unknown;\n size?: SizeTuple;\n}\n\nexport interface AddEdgeInfo {\n source: NodeId;\n target: NodeId;\n data?: unknown;\n}\n\nexport interface UpdateCellsContext {\n reason: \"add-related-nodes\";\n parent: NodeId;\n}\n\nexport interface AddNodesContext {\n defaultNodeSize: SizeTuple;\n canvasWidth: number;\n canvasHeight: number;\n}\n\nexport const EoDrawCanvasComponent = React.forwardRef(\n LegacyEoDrawCanvasComponent\n);\n\n/**\n * 用于手工绘图的画布。\n *\n * 注意:将配套另外一个用于展示的画布构件。\n */\nexport\n@defineElement(\"eo-draw-canvas\", {\n styleTexts: [styleText, zoomBarStyleText],\n})\nclass EoDrawCanvas extends ReactNextElement implements EoDrawCanvasProps {\n /**\n * 仅当初始化时使用,渲染后重新设置 `cells` 将无效。\n */\n @property({ attribute: false })\n accessor cells: InitialCell[] | undefined;\n\n @property({ type: String })\n accessor layout: LayoutType;\n\n @property({ attribute: false })\n accessor layoutOptions: LayoutOptions | undefined;\n\n /**\n * @default [100,20]\n */\n @property({ attribute: false })\n accessor defaultNodeSize: SizeTuple = [DEFAULT_NODE_SIZE, DEFAULT_NODE_SIZE];\n\n @property({ attribute: false })\n accessor defaultNodeBricks: NodeBrickConf[] | undefined;\n\n /**\n * 当节点数量达到或超过 `degradedThreshold` 时,节点将被降级展示。\n *\n * @default 500\n */\n @property({ type: Number })\n accessor degradedThreshold: number | undefined;\n\n // Set `attribute` to `false` even if it accepts string value.\n // Because when passing like \"<% DATA.node.data.name %>\", it will be\n // evaluated as object temporarily.\n /**\n * 设置节点将降级展示时显示的名称。\n *\n * @default \"<% DATA.node.id %>\"\n */\n @property({ attribute: false })\n accessor degradedNodeLabel: string | undefined;\n\n /**\n * 使用条件判断设置默认的边对应的连线。在 `if` 表达式中 `DATA` 为 `{ edge }`,例如:\n *\n * ```yaml\n * defaultEdgeLines:\n * - if: <% DATA.edge.data?.virtual %>\n * dashed: true\n * ```\n */\n @property({ attribute: false })\n accessor defaultEdgeLines: EdgeLineConf[] | undefined;\n\n @property({ attribute: false })\n accessor activeTarget: ActiveTarget | null | undefined;\n\n /**\n * 当 `activeTarget` 不为 `null` 时,隐藏其他跟该 `activeTarget` 无关的元素。\n */\n @property({ type: Boolean })\n accessor fadeUnrelatedCells: boolean | undefined;\n\n @property({ type: Boolean })\n accessor zoomable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor scrollable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor pannable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor allowEdgeToArea: boolean | undefined = false;\n\n /**\n * 按住鼠标拖动时的行为:\n * - `none`:无\n * - `lasso`:绘制选区\n * - `grab`:拖动画布\n *\n * @default \"none\"\n */\n @property()\n accessor dragBehavior: DragBehavior | undefined;\n\n /**\n * 按住 ctrl 键并按住鼠标拖动时的行为:\n * - `none`:无\n * - `grab`:拖动画布\n *\n * @default \"none\"\n */\n @property()\n accessor ctrlDragBehavior: CtrlDragBehavior | undefined;\n\n @property({ attribute: false })\n accessor scaleRange: RangeTuple | undefined;\n\n @property({ attribute: false })\n accessor lineSettings: LineSettings | undefined;\n\n @property({ attribute: false })\n accessor lineConnector: LineConnecterConf | boolean | undefined;\n\n @event({ type: \"activeTarget.change\" })\n accessor #activeTargetChangeEvent!: EventEmitter<ActiveTarget | null>;\n\n #handleActiveTargetChange = (target: ActiveTarget | null) => {\n this.#activeTargetChangeEvent.emit(target);\n };\n\n #handleSwitchActiveTarget = (target: ActiveTarget | null) => {\n if (!sameTarget(target, this.activeTarget)) {\n this.activeTarget = target;\n }\n };\n\n /**\n * @deprecated Use `cell.move` instead.\n */\n @event({ type: \"node.move\" })\n accessor #nodeMoveEvent!: EventEmitter<MoveCellPayload>;\n\n @event({ type: \"cell.move\" })\n accessor #cellMoveEvent!: EventEmitter<MoveCellPayload>;\n\n #handleCellMove = (info: MoveCellPayload) => {\n this.#cellMoveEvent.emit(info);\n if (info.type === \"node\") {\n this.#nodeMoveEvent.emit(info);\n }\n };\n\n @event({ type: \"cells.move\" })\n accessor #cellsMoveEvent!: EventEmitter<MoveCellPayload[]>;\n\n #handleCellsMove = (info: MoveCellPayload[]) => {\n this.#cellsMoveEvent.emit(info);\n };\n\n @event({ type: \"cell.resize\" })\n accessor #cellResizeEvent!: EventEmitter<ResizeCellPayload>;\n\n #handleCellResize = (info: ResizeCellPayload) => {\n this.#cellResizeEvent.emit(info);\n };\n\n /**\n * @deprecated Use `cell.delete` instead.\n */\n @event({ type: \"node.delete\" })\n accessor #nodeDelete!: EventEmitter<Cell>;\n\n @event({ type: \"cell.delete\" })\n accessor #cellDelete!: EventEmitter<Cell>;\n\n #handleCellDelete = (cell: Cell) => {\n this.#cellDelete.emit(cell);\n if (cell.type === \"node\") {\n this.#nodeDelete.emit(cell);\n }\n };\n\n @event({ type: \"cells.delete\" })\n accessor #cellsDelete!: EventEmitter<Cell[]>;\n\n #handleCellsDelete = (cells: Cell[]) => {\n this.#cellsDelete.emit(cells);\n };\n\n @event({ type: \"cell.contextmenu\" })\n accessor #cellContextMenu!: EventEmitter<CellContextMenuDetail>;\n\n #handleCellContextMenu = (detail: CellContextMenuDetail) => {\n this.#cellContextMenu.emit(detail);\n };\n\n /**\n * 通过画布绘图的方式添加边(手动调用 `addEdge` 方法不会触发该事件)。\n */\n @event({ type: \"edge.add\" })\n accessor #edgeAdd!: EventEmitter<ConnectNodesDetail>;\n\n #handleEdgeAdd = (edge: ConnectNodesDetail) => {\n this.#edgeAdd.emit(edge);\n };\n\n @event({ type: \"edge.view.change\" })\n accessor #edgeViewChange!: EventEmitter<EdgeViewChangePayload>;\n\n #handleEdgeViewChange = (detail: EdgeViewChangePayload) => {\n this.#edgeViewChange.emit(detail);\n };\n\n @event({ type: \"decorator.text.change\" })\n accessor #decoratorTextChange!: EventEmitter<DecoratorTextChangeDetail>;\n\n #handleDecoratorTextChange = (detail: DecoratorTextChangeDetail) => {\n this.#decoratorTextChange.emit(detail);\n };\n\n /**\n * node节点跟容器组关系改变事件,有containerCell是新增关系,否则删除关系\n */\n @event({ type: \"node.container.change\" })\n accessor #containerContainerChange!: EventEmitter<MoveCellPayload[]>;\n\n #handleContainerContainerChange = (detail: MoveCellPayload[]) => {\n this.#containerContainerChange.emit(detail);\n };\n\n /**\n * 缩放变化后,从素材库拖拽元素进画布时,拖拽图像应设置对应的缩放比例。\n */\n @event({ type: \"scale.change\" })\n accessor #scaleChange!: EventEmitter<number>;\n\n #handleScaleChange = (scale: number) => {\n this.#scaleChange.emit(scale);\n };\n\n @method()\n async dropNode({\n id,\n position,\n size,\n data,\n useBrick,\n }: DropNodeInfo): Promise<NodeCell | null> {\n // Drag and then drop a node\n const droppedInside = document\n .elementsFromPoint?.(position[0], position[1])\n ?.includes(this);\n if (droppedInside) {\n const boundingClientRect = this.getBoundingClientRect();\n const transform = this.#canvasRef.current!.getTransform();\n const newNode = {\n type: \"node\",\n id,\n view: {\n ...(this.layout === \"force\" || this.layout === \"dagre\"\n ? null\n : {\n x:\n (position[0] - boundingClientRect.left - transform.x) /\n transform.k,\n y:\n (position[1] - boundingClientRect.top - transform.y) /\n transform.k,\n }),\n width: size?.[0] ?? this.defaultNodeSize[0],\n height: size?.[1] ?? this.defaultNodeSize[0],\n },\n data,\n useBrick,\n } as NodeCell;\n this.#canvasRef.current?.dropNode(newNode);\n return newNode;\n }\n return null;\n }\n\n @method()\n async dropDecorator({\n position,\n decorator,\n text,\n direction,\n }: DropDecoratorInfo): Promise<DecoratorCell | null> {\n // Drag and then drop a node\n const droppedInside = document\n .elementsFromPoint?.(position[0], position[1])\n ?.includes(this);\n if (droppedInside) {\n const boundingClientRect = this.getBoundingClientRect();\n const transform = this.#canvasRef.current!.getTransform();\n const newDecorator: DecoratorCell = {\n type: \"decorator\",\n decorator,\n id: uuidV4(),\n view: {\n x:\n (position[0] - boundingClientRect.left - transform.x) / transform.k,\n y: (position[1] - boundingClientRect.top - transform.y) / transform.k,\n width: DEFAULT_AREA_WIDTH,\n height: DEFAULT_AREA_HEIGHT,\n text,\n direction,\n },\n };\n this.#canvasRef.current?.dropDecorator(newDecorator);\n return newDecorator;\n }\n return null;\n }\n\n @method()\n async addNodes(nodes: AddNodeInfo[]): Promise<NodeCell[]> {\n if (nodes.length === 0) {\n return [];\n }\n const newNodes = nodes.map<NodeCell>(({ size, useBrick, id, data }) => ({\n type: \"node\",\n id,\n data,\n view: {\n width: size?.[0] ?? this.defaultNodeSize[0],\n height: size?.[1] ?? this.defaultNodeSize[0],\n } as NodeView,\n useBrick,\n }));\n return this.#canvasRef.current!.addNodes(newNodes, {\n defaultNodeSize: this.defaultNodeSize,\n canvasWidth: this.clientWidth,\n canvasHeight: this.clientHeight,\n });\n }\n\n @method()\n async addEdge({ source, target, data }: AddEdgeInfo): Promise<EdgeCell> {\n const newEdge: EdgeCell = {\n type: \"edge\",\n source,\n target,\n data,\n view: this.lineSettings,\n };\n this.#canvasRef.current?.addEdge(newEdge);\n return newEdge;\n }\n\n @method()\n manuallyConnectNodes(source: NodeId): Promise<ConnectNodesDetail> {\n return this.#canvasRef.current!.manuallyConnectNodes(source);\n }\n\n @method()\n async updateCells(\n cells: InitialCell[],\n ctx?: UpdateCellsContext\n ): Promise<{ updated: Cell[] }> {\n await this.#waitForCanvasRef();\n const { updated } = this.#canvasRef.current!.updateCells(cells, {\n ...ctx,\n defaultNodeSize: this.defaultNodeSize,\n canvasWidth: this.clientWidth,\n canvasHeight: this.clientHeight,\n });\n return { updated };\n }\n\n #waitForCanvasRef() {\n return new Promise<void>((resolve) => {\n const check = () => {\n if (this.#canvasRef.current) {\n resolve();\n } else {\n setTimeout(check, 10);\n }\n };\n check();\n });\n }\n\n #canvasRef = createRef<DrawCanvasRef>();\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n lockBodyScroll(this, false);\n }\n\n render() {\n return (\n <EoDrawCanvasComponent\n host={this}\n ref={this.#canvasRef}\n layout={this.layout}\n layoutOptions={this.layoutOptions}\n cells={this.cells}\n defaultNodeSize={this.defaultNodeSize}\n defaultNodeBricks={this.defaultNodeBricks}\n defaultEdgeLines={this.defaultEdgeLines}\n degradedThreshold={this.degradedThreshold}\n degradedNodeLabel={this.degradedNodeLabel}\n activeTarget={this.activeTarget}\n fadeUnrelatedCells={this.fadeUnrelatedCells}\n zoomable={this.zoomable}\n scrollable={this.scrollable}\n pannable={this.pannable}\n dragBehavior={this.dragBehavior}\n ctrlDragBehavior={this.ctrlDragBehavior}\n scaleRange={this.scaleRange}\n lineSettings={this.lineSettings}\n lineConnector={this.lineConnector}\n allowEdgeToArea={this.allowEdgeToArea}\n onActiveTargetChange={this.#handleActiveTargetChange}\n onSwitchActiveTarget={this.#handleSwitchActiveTarget}\n onCellMove={this.#handleCellMove}\n onCellsMove={this.#handleCellsMove}\n onCellResize={this.#handleCellResize}\n onCellDelete={this.#handleCellDelete}\n onCellsDelete={this.#handleCellsDelete}\n onEdgeAdd={this.#handleEdgeAdd}\n onCellContextMenu={this.#handleCellContextMenu}\n onDecoratorTextChange={this.#handleDecoratorTextChange}\n onContainerContainerChange={this.#handleContainerContainerChange}\n onScaleChange={this.#handleScaleChange}\n onEdgeViewChange={this.#handleEdgeViewChange}\n />\n );\n }\n}\n\nexport interface EoDrawCanvasComponentProps extends EoDrawCanvasProps {\n host: HTMLElement;\n onActiveTargetChange(target: ActiveTarget | null): void;\n onSwitchActiveTarget(target: ActiveTarget | null): void;\n onCellMove(info: MoveCellPayload): void;\n onCellResize(cell: ResizeCellPayload): void;\n onCellDelete(cell: Cell): void;\n onCellsMove(info: MoveCellPayload[]): void;\n onCellsDelete(cells: Cell[]): void;\n onCellContextMenu(detail: CellContextMenuDetail): void;\n onEdgeAdd(detail: ConnectNodesDetail): void;\n onEdgeViewChange(detail: EdgeViewChangePayload): void;\n onDecoratorTextChange(detail: DecoratorTextChangeDetail): void;\n onContainerContainerChange(detail: MoveCellPayload[]): void;\n onScaleChange(scale: number): void;\n}\n\nexport interface DrawCanvasRef {\n dropNode(node: NodeCell): void;\n dropDecorator(decorator: DecoratorCell): void;\n addNodes(nodes: NodeCell[], ctx: AddNodesContext): NodeCell[];\n addEdge(edge: EdgeCell): void;\n manuallyConnectNodes(source: NodeId): Promise<ConnectNodesDetail>;\n updateCells(\n cells: InitialCell[],\n ctx: Partial<UpdateCellsContext> & {\n defaultNodeSize: SizeTuple;\n canvasWidth: number;\n canvasHeight: number;\n }\n ): {\n cells: Cell[];\n updated: Cell[];\n };\n getTransform(): TransformLiteral;\n}\n\nfunction LegacyEoDrawCanvasComponent(\n {\n host,\n layout,\n layoutOptions,\n cells: initialCells,\n defaultNodeSize,\n defaultNodeBricks,\n defaultEdgeLines,\n degradedThreshold,\n degradedNodeLabel,\n activeTarget: _activeTarget,\n fadeUnrelatedCells,\n zoomable,\n scrollable,\n pannable,\n dragBehavior,\n ctrlDragBehavior,\n scaleRange: _scaleRange,\n lineSettings,\n lineConnector,\n allowEdgeToArea,\n onActiveTargetChange,\n onSwitchActiveTarget,\n onCellMove,\n onCellResize,\n onCellDelete,\n onCellsMove,\n onCellsDelete,\n onCellContextMenu,\n onEdgeAdd,\n onDecoratorTextChange,\n onScaleChange,\n onContainerContainerChange,\n onEdgeViewChange,\n }: EoDrawCanvasComponentProps,\n ref: React.Ref<DrawCanvasRef>\n) {\n const [{ cells, layoutKey }, dispatch] = useReducer(\n rootReducer,\n initialCells,\n (initialCells) => ({\n cells: initializeCells(initialCells, { defaultNodeSize }),\n layoutKey: 0,\n })\n );\n\n // When nodes are greater or equal to threshold, the diagram will be degraded.\n // Thus all nodes will be displayed as simple svg elements instead of bricks.\n const degraded = useMemo(\n () =>\n cells.filter(isNodeCell).length >=\n (degradedThreshold ?? DEFAULT_DEGRADED_THRESHOLD),\n [cells, degradedThreshold]\n );\n\n const rootRef = useRef<SVGSVGElement>(null);\n const manualConnectDeferredRef = useRef<Deferred<ConnectNodesDetail> | null>(\n null\n );\n const [editingTexts, setEditingTexts] = useState<string[]>([]);\n const [activeContainers, setActiveContainers] = useState<string[]>([]);\n const { grabbing, transform, zoomer, scaleRange } = useZoom({\n rootRef,\n zoomable,\n scrollable,\n pannable,\n draggable: dragBehavior === \"grab\",\n ctrlDraggable: ctrlDragBehavior === \"grab\",\n scaleRange: _scaleRange,\n onSwitchActiveTarget,\n });\n\n useEffect(() => {\n onScaleChange(transform.k);\n }, [onScaleChange, transform.k]);\n\n const [lassoRect, setLassoRect] = useState<NodeView | null>(null);\n\n const [connectLineState, setConnectLineState] =\n useState<ConnectLineState | null>(null);\n\n const { centered, setCentered, getNextLayoutKey } = useLayout({\n layout,\n layoutOptions,\n rootRef,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n layoutKey,\n allowEdgeToArea,\n dispatch,\n });\n\n useImperativeHandle(\n ref,\n () => ({\n dropNode(node) {\n // Do not apply auto centering when dropping a node in manual layout.\n if (layout !== \"dagre\" && layout !== \"force\") {\n setCentered(true);\n }\n dispatch({ type: \"drop-node\", payload: node });\n },\n dropDecorator(decorator) {\n // Do not apply auto centering when dropping a decorator in manual layout.\n if (layout !== \"dagre\" && layout !== \"force\") {\n setCentered(true);\n }\n dispatch({ type: \"drop-decorator\", payload: decorator });\n },\n addNodes(\n nodes,\n { defaultNodeSize, canvasWidth, canvasHeight }: AddNodesContext\n ) {\n const index =\n cells.findLastIndex(\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n ) + 1;\n const newCells = [\n ...cells.slice(0, index),\n ...nodes,\n ...cells.slice(index),\n ];\n const {\n cells: allCells,\n updated,\n shouldReCenter,\n } = updateCells({\n cells: newCells,\n layout,\n previousCells: cells,\n defaultNodeSize,\n canvasWidth,\n canvasHeight,\n scaleRange,\n transform,\n allowEdgeToArea,\n });\n if (shouldReCenter) {\n setCentered(false);\n }\n dispatch({ type: \"update-cells\", payload: allCells });\n return updated.filter((node) =>\n nodes.includes(node as NodeCell)\n ) as NodeCell[];\n },\n addEdge(edge) {\n dispatch({ type: \"add-edge\", payload: edge });\n },\n updateCells(newCells, ctx) {\n const { shouldReCenter, ...result } = updateCells({\n ...ctx,\n layout,\n previousCells: cells,\n cells: newCells,\n scaleRange,\n transform,\n allowEdgeToArea,\n });\n if (shouldReCenter) {\n setCentered(false);\n }\n dispatch({ type: \"update-cells\", payload: result.cells });\n return result;\n },\n getTransform() {\n return transform;\n },\n manuallyConnectNodes(sourceId) {\n const source = cells.find(\n (cell) => isEdgeSide(cell, allowEdgeToArea) && cell.id === sourceId\n ) as NodeCell | DecoratorCell | undefined;\n if (source) {\n const rect = rootRef.current!.getBoundingClientRect();\n setConnectLineState({\n source,\n from: [\n source.view.x + source.view.width / 2,\n source.view.y + source.view.height / 2,\n ],\n offset: [rect.left, rect.top],\n });\n const promise = new Promise<ConnectNodesDetail>((resolve, reject) => {\n manualConnectDeferredRef.current = { resolve, reject };\n });\n return promise;\n }\n return Promise.reject(null);\n },\n }),\n [cells, layout, scaleRange, setCentered, transform, allowEdgeToArea]\n );\n\n const handleConnect = useCallback(\n (state: ConnectLineState, to: PositionTuple) => {\n // Find the target node from top bo bottom,\n // detect whether the pointer is inside the target node.\n for (let i = cells.length - 1; i >= 0; i--) {\n const cell = cells[i];\n // Currently ignore connecting to self\n if (isEdgeSide(cell, allowEdgeToArea) && cell.id !== state.source.id) {\n if (\n cell.view.x < to[0] &&\n cell.view.x + cell.view.width > to[0] &&\n cell.view.y < to[1] &&\n cell.view.y + cell.view.height > to[1]\n ) {\n manualConnectDeferredRef.current?.resolve({\n source: state.source,\n target: cell,\n });\n break;\n }\n }\n }\n manualConnectDeferredRef.current?.reject(null);\n setConnectLineState(null);\n },\n [allowEdgeToArea, cells]\n );\n const [smartConnectLineState, setSmartConnectLineState] =\n useState<SmartConnectLineState | null>(null);\n\n useEffect(() => {\n lockBodyScroll(\n host,\n !!(connectLineState || !!smartConnectLineState || lassoRect)\n );\n }, [connectLineState, host, smartConnectLineState, lassoRect]);\n\n const activeTarget = useActiveTarget({\n rootRef,\n activeTarget: _activeTarget,\n onActiveTargetChange,\n });\n\n const [unrelatedCells, setUnrelatedCells] = useState<Cell[]>([]);\n useEffect(() => {\n const nextUnrelated = fadeUnrelatedCells\n ? getUnrelatedCells(\n cells,\n connectLineState,\n activeTarget,\n allowEdgeToArea\n )\n : [];\n // Do not update the state when prev and next are both empty.\n setUnrelatedCells((prev) =>\n prev.length === 0 && nextUnrelated.length === 0 ? prev : nextUnrelated\n );\n }, [\n activeTarget,\n cells,\n connectLineState,\n fadeUnrelatedCells,\n allowEdgeToArea,\n ]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root || editingTexts.length > 0) {\n return;\n }\n const onKeydown = (event: KeyboardEvent) => {\n const action = handleKeyboard(event, {\n cells,\n activeTarget,\n });\n\n switch (action?.action) {\n case \"delete-cells\":\n onCellsDelete(action.cells);\n if (action.cells.length === 1) {\n onCellDelete(action.cells[0]);\n }\n break;\n }\n };\n root.addEventListener(\"keydown\", onKeydown);\n return () => {\n root.removeEventListener(\"keydown\", onKeydown);\n };\n }, [activeTarget, cells, editingTexts.length, onCellDelete, onCellsDelete]);\n\n const defPrefix = useMemo(() => `${uniqueId(\"diagram-\")}-`, []);\n const markerPrefix = `${defPrefix}line-arrow-`;\n\n const [guideLines, setGuideLines] = useState<LineTuple[]>([]);\n\n /* istanbul ignore next */\n const handleCellsMoving = useCallback(\n (info: MoveCellPayload[]) => {\n dispatch({ type: \"move-cells\", payload: info });\n const containedIds: string[] = [];\n handleNodeContainedChange(info, cells).forEach((c) => {\n if (c.containerCell?.id) containedIds.push(c.containerCell?.id);\n });\n setActiveContainers(containedIds);\n setGuideLines(info.flatMap((c) => c.guideLines ?? []));\n },\n [cells]\n );\n\n /* istanbul ignore next */\n const handleCellsMoved = useCallback(\n (info: MoveCellPayload[]) => {\n dispatch({ type: \"move-cells\", payload: info });\n onCellsMove(info);\n if (info.length === 1) {\n onCellMove(info[0]);\n }\n handleNodeContainedChange(info, cells, onContainerContainerChange);\n setActiveContainers([]);\n setGuideLines([]);\n },\n [onCellMove, onCellsMove, cells, onContainerContainerChange]\n );\n\n const handleCellResizing = useCallback((info: ResizeCellPayload) => {\n dispatch({ type: \"resize-cell\", payload: info });\n }, []);\n\n const handleCellResized = useCallback(\n (info: ResizeCellPayload) => {\n dispatch({ type: \"resize-cell\", payload: info });\n onCellResize(info);\n },\n [onCellResize]\n );\n\n const handleDecoratorTextEditing = useCallback(\n ({ id, editing }: { id: string; editing: boolean }) => {\n if (editing) {\n setEditingTexts((texts) =>\n texts.includes(id) ? texts : [...texts, id]\n );\n } else {\n setEditingTexts((texts) => texts.filter((text) => text !== id));\n }\n },\n []\n );\n\n const handleNodeBrickResize = useCallback(\n (id: string, size: SizeTuple | null) => {\n const nextLayoutKey = getNextLayoutKey();\n dispatch({\n type: \"update-node-size\",\n payload: { id, size },\n layoutKey: nextLayoutKey,\n });\n },\n [getNextLayoutKey]\n );\n\n const handleZoomSlide = useCallback(\n (value: number) => {\n // istanbul ignore next\n if (process.env.NODE_ENV !== \"test\") {\n zoomer.scaleTo(select(rootRef.current!), value / 100);\n }\n },\n [zoomer]\n );\n\n const reCenter = useCallback(() => {\n setCentered(false);\n }, [setCentered]);\n const { lineConfMap, lineConnectorConf, markers } = useLineMarkers({\n cells,\n defaultEdgeLines,\n lineConnector,\n markerPrefix,\n });\n\n const ready = useReady({ cells, layout, centered });\n\n const [hoverState, setHoverState] = useState<HoverState | null>(null);\n const unsetHoverStateTimeoutRef = useRef<number | null>(null);\n\n const [activeEditableLine, setActiveEditableLine] =\n useState<EditableLineInfo | null>(null);\n const [lineEditorState, setLineEditorState] =\n useState<LineEditorState | null>(null);\n\n // istanbul ignore next\n const handleCellMouseEnter = useCallback(\n (cell: Cell) => {\n if (\n lineConnectorConf &&\n isEdgeSide(cell, allowEdgeToArea) &&\n (!lineEditorState || lineEditorState.type !== \"control\")\n ) {\n if (unsetHoverStateTimeoutRef.current !== null) {\n clearTimeout(unsetHoverStateTimeoutRef.current);\n unsetHoverStateTimeoutRef.current = null;\n }\n const relativePoints = getConnectPointsOfRectangle();\n setHoverState({\n cell,\n relativePoints,\n points: getConnectPoints(relativePoints, cell.view),\n });\n }\n },\n [allowEdgeToArea, lineConnectorConf, lineEditorState]\n );\n\n const handleCellMouseLeave = useCallback(\n (cell: Cell) => {\n if (lineConnectorConf && isNodeCell(cell)) {\n unsetHoverStateTimeoutRef.current = setTimeout(() => {\n setHoverState(null);\n }) as unknown as number;\n }\n },\n [lineConnectorConf]\n );\n\n // istanbul ignore next\n const handleSmartConnect = useCallback(\n (\n source: NodeCell | DecoratorCell,\n target: NodeCell | DecoratorCell,\n exitPosition: NodePosition,\n entryPosition: NodePosition | undefined\n ) => {\n const payload: EdgeViewChangePayload = {\n source: source.id,\n target: target.id,\n view: {\n ...lineSettings,\n exitPosition,\n entryPosition,\n vertices: null,\n },\n };\n const existedEdge = cells.find(\n (cell) =>\n cell.type === \"edge\" &&\n cell.source === source.id &&\n cell.target === target.id\n );\n if (existedEdge) {\n dispatch({\n type: \"change-edge-view\",\n payload,\n });\n onEdgeViewChange?.(payload);\n } else {\n const newEdge: EdgeCell = {\n type: \"edge\",\n ...payload,\n };\n dispatch({\n type: \"add-edge\",\n payload: newEdge,\n });\n onEdgeAdd({\n source,\n target,\n view: newEdge.view,\n });\n }\n },\n [cells, lineSettings, onEdgeAdd, onEdgeViewChange]\n );\n\n // istanbul ignore next\n const handleEdgeChangeView = useCallback(\n (\n source: NodeCell | DecoratorCell,\n target: NodeCell | DecoratorCell,\n view: EdgeView\n ) => {\n const payload: EdgeViewChangePayload = {\n source: source.id,\n target: target.id,\n view,\n };\n dispatch({\n type: \"change-edge-view\",\n payload,\n });\n onEdgeViewChange?.(payload);\n },\n [onEdgeViewChange]\n );\n\n // istanbul ignore next: experimental\n const hoverStateContextValue = useMemo(\n () => ({\n rootRef,\n smartConnectLineState,\n unsetHoverStateTimeoutRef,\n hoverState,\n activeEditableLine,\n lineEditorState,\n setLineEditorState,\n setActiveEditableLine,\n setHoverState,\n setSmartConnectLineState,\n onConnect: handleSmartConnect,\n onChangeEdgeView: handleEdgeChangeView,\n }),\n [\n activeEditableLine,\n handleEdgeChangeView,\n handleSmartConnect,\n hoverState,\n lineEditorState,\n smartConnectLineState,\n ]\n );\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root || dragBehavior !== \"lasso\") {\n return;\n }\n const rootRect = root.getBoundingClientRect();\n const onMouseDown = (event: MouseEvent) => {\n handleLasso(event, {\n transform,\n offset: [rootRect.left, rootRect.top],\n onLassoing(rect) {\n setLassoRect(rect);\n },\n onLassoed(rect) {\n setLassoRect(null);\n const lassoedCells: (NodeCell | DecoratorCell)[] = [];\n for (const cell of cells) {\n if (\n isContainerDecoratorCell(cell) ||\n isNodeOrAreaDecoratorCell(cell) ||\n isTextDecoratorCell(cell)\n ) {\n const x = cell.view.x;\n const y = cell.view.y;\n if (\n x >= rect.x &&\n x + cell.view.width <= rect.x + rect.width &&\n y >= rect.y &&\n y + cell.view.height <= rect.y + rect.height\n ) {\n lassoedCells.push(cell);\n }\n }\n }\n onSwitchActiveTarget?.(\n lassoedCells.length > 1\n ? { type: \"multi\", targets: lassoedCells.map(cellToTarget) }\n : lassoedCells.length === 1\n ? cellToTarget(lassoedCells[0])\n : null\n );\n },\n });\n };\n root.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n root.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [transform, cells, dragBehavior, onSwitchActiveTarget]);\n\n return (\n <HoverStateContext.Provider value={hoverStateContextValue}>\n <svg\n width=\"100%\"\n height=\"100%\"\n ref={rootRef}\n className={classNames(\"root\", { grabbing, pannable, ready })}\n tabIndex={-1}\n >\n <defs>\n {markers.map((marker, index) => (\n <MarkerComponent\n key={index}\n id={`${markerPrefix}${index}`}\n type={marker.markerType}\n strokeColor={marker.strokeColor}\n />\n ))}\n </defs>\n <g\n transform={`translate(${transform.x} ${transform.y}) scale(${transform.k})`}\n >\n <g className={classNames(\"cells\", { allowEdgeToArea })}>\n {cells.map((cell) => (\n <CellComponent\n key={`${cell.type}:${isEdgeCell(cell) ? `${cell.source}~${cell.target}` : cell.id}`}\n dragNodeToContainerActive={\n isEdgeCell(cell) ? false : activeContainers.includes(cell.id)\n }\n layout={layout}\n layoutOptions={layoutOptions}\n cell={cell}\n cells={cells}\n degraded={degraded}\n degradedNodeLabel={degradedNodeLabel}\n defaultNodeBricks={defaultNodeBricks}\n transform={transform}\n lineConfMap={lineConfMap}\n activeTarget={activeTarget}\n unrelatedCells={unrelatedCells}\n allowEdgeToArea={allowEdgeToArea}\n onCellsMoving={handleCellsMoving}\n onCellsMoved={handleCellsMoved}\n onCellResizing={handleCellResizing}\n onCellResized={handleCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onCellContextMenu={onCellContextMenu}\n onDecoratorTextChange={onDecoratorTextChange}\n onDecoratorTextEditing={handleDecoratorTextEditing}\n onNodeBrickResize={handleNodeBrickResize}\n onCellMouseEnter={handleCellMouseEnter}\n onCellMouseLeave={handleCellMouseLeave}\n />\n ))}\n </g>\n <g>\n <ConnectLineComponent\n connectLineState={connectLineState}\n transform={transform}\n markerEnd={`${markerPrefix}0`}\n onConnect={handleConnect}\n />\n </g>\n {lassoRect && (\n <rect\n x={lassoRect.x}\n y={lassoRect.y}\n width={lassoRect.width}\n height={lassoRect.height}\n fill=\"var(--palette-gray-5)\"\n fillOpacity={0.3}\n stroke=\"var(--palette-gray-5)\"\n strokeDasharray={2}\n />\n )}\n {lineConnectorConf && (\n <g>\n <SmartConnectLineComponent\n transform={transform}\n lineSettings={lineSettings}\n options={lineConnectorConf}\n />\n <EditingLineComponent\n transform={transform}\n options={lineConnectorConf}\n />\n </g>\n )}\n <g>\n {guideLines.map((line, index) => (\n <path\n key={index}\n d={`M${line[0].join(\" \")} L${line[1].join(\" \")}`}\n stroke=\"var(--palette-orange-5)\"\n fill=\"none\"\n strokeWidth={1 / transform.k}\n />\n ))}\n </g>\n <g>\n {lineConnectorConf && <LineEditorComponent scale={transform.k} />}\n </g>\n {lineConnectorConf && (\n <LineConnectorComponent\n activeTarget={activeTarget}\n scale={transform.k}\n disabled={!!connectLineState}\n />\n )}\n </g>\n </svg>\n <ZoomBarComponent\n shadowRoot={host.shadowRoot!}\n scale={transform.k}\n scaleRange={scaleRange}\n onZoomChange={handleZoomSlide}\n onReCenter={reCenter}\n />\n </HoverStateContext.Provider>\n );\n}\n\nexport function uuidV4() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\nfunction getConnectPoints(\n relativePoints: ReadonlyArray<NodePosition>,\n view: NodeView,\n border = 1\n) {\n const padding = DEFAULT_NODE_PADDING_FOR_SMART_LINES;\n const halfPadding = padding / 2;\n\n const viewWithBorderAndPadding: NodeView = {\n x: view.x + border / 2 - halfPadding,\n y: view.y + border / 2 - halfPadding,\n width: view.width - border + padding,\n height: view.height - border + padding,\n };\n\n return relativePoints.map((p) => ({\n x: viewWithBorderAndPadding.x + p.x * viewWithBorderAndPadding.width,\n y: viewWithBorderAndPadding.y + p.y * viewWithBorderAndPadding.height,\n }));\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, `: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}`, \"\"]);\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;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:rgba(0,0,0,0.2);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}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n"],"names":["defineElement","property","event","method","createDecorators","EoDiagramComponent","forwardRef","LegacyEoDiagramComponent","_EoDiagram","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_EoDiagram_brand","WeakSet","_handleActiveTargetChange","_P","_handleNodeDelete","_Q","_handleEdgeDelete","_R","_handleLineClick","_S","_handleLineDoubleClick","_T","_handleNodesConnect","_handleSwitchActiveTarget","_diagramRef","EoDiagram","ReactNextElement","constructor","arguments","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","_initProto","_init_layout","_init_extra_layout","_init_nodes","_init_extra_nodes","_init_edges","_init_extra_edges","_init_nodeBricks","_init_extra_nodeBricks","_init_lines","_init_extra_lines","_init_layoutOptions","_init_extra_layoutOptions","_init_activeTarget","_init_extra_activeTarget","_init_disableKeyboardAction","_init_extra_disableKeyboardAction","_init_connectNodes","_init_extra_connectNodes","_init_dragNodes","_init_extra_dragNodes","_init_zoomable","_init_extra_zoomable","_init_scrollable","_init_extra_scrollable","_init_pannable","_init_extra_pannable","_init_scaleRange","_init_extra_scaleRange","_init_activeTargetChangeEvent","_init_extra_activeTargetChangeEvent","target","_classPrivateGetter","this","_get_activeTargetChangeEvent","emit","_init_nodeDelete","_init_extra_nodeDelete","node","_get_nodeDelete","_init_edgeDelete","_init_extra_edgeDelete","edge","_get_edgeDelete","_init_lineClick","_init_extra_lineClick","line","_get_lineClick","_init_lineDoubleClick","_init_extra_lineDoubleClick","_get_lineDoubleClick","_init_connectNodes2","_init_extra_connectNodes2","detail","_get_connectNodes","sameTarget","activeTarget","createRef","layout","_classPrivateFieldGet","v","_classPrivateFieldSet","nodes","edges","nodeBricks","lines","layoutOptions","disableKeyboardAction","connectNodes","dragNodes","zoomable","scrollable","pannable","scaleRange","callOnLineLabel","id","_classPrivateFieldGet2","_len","length","args","Array","_key","current","render","React","ref","onActiveTargetChange","onSwitchActiveTarget","onNodeDelete","onEdgeDelete","onLineClick","onLineDoubleClick","onNodesConnect","_ref","_activeTarget","_scaleRange","nodesReady","setNodesReady","useState","nodesRenderId","setNodesRenderId","nodesRefRepository","setNodesRefRepository","lineLabelsReady","setLineLabelsReady","lineLabelsRenderId","setLineLabelsRenderId","lineLabelsRefRepository","setLineLabelsRefRepository","renderedLineLabels","setRenderedLineLabels","grabbing","setGrabbing","transform","setTransform","k","x","y","linePathsRef","useRef","Map","rootRef","nodesRef","centered","setCentered","userViewReady","userViewNodesMap","saveUserView","useUserView","save","connectLineTo","setConnectLineTo","connectLineState","setConnectLineState","manualLayoutStatus","setManualLayoutStatus","nodeMovement","setNodeMovement","useImperativeHandle","_lineLabelsRefReposit","_len2","_key2","get","firstElementChild","useEffect","onNodesMouseDown","handleNodesMouseDown","scale","nodesContainer","addEventListener","removeEventListener","normalizedLines","normalizedLinesMap","markers","useMemo","normalizeLinesAndMarkers","lineLabels","flatMap","_ref2","key","list","text","label","$id","concat","map","item","placement","renderedNodes","renderedEdges","useRenderedDiagram","renderedLines","getRenderedLines","newActiveTarget","setActiveTarget","previous","activeTargetChangeInitialized","root","onKeydown","action","handleKeyboard","type","nodeId","handleNodesRendered","useCallback","refRepository","handleLineLabelsRendered","DEFAULT_SCALE_RANGE_MIN","DEFAULT_SCALE_RANGE_MAX","zoomer","zoom","moved","scaleExtent","on","e","rootSelection","select","unsetZoom","ctrlKey","stopImmediatePropagation","preventDefault","translateBy","wheelDeltaX","wheelDeltaY","call","transformToCenter","canvasWidth","clientWidth","canvasHeight","clientHeight","undefined","ZoomTransform","defPrefix","uniqueId","markerPrefix","maskPrefix","activeLineMarkerPrefix","getRenderedLineLabels","lineMaskRects","setLineMaskRects","adjustLineLabels","observer","ResizeObserver","updateLineMaskRects","getLineMaskRects","lineLabel","values","observe","disconnect","className","classNames","ready","tabIndex","width","height","_ref3","index","strokeColor","MarkerComponent","_ref4","lineId","rects","LineMaskComponent","viewBox","refX","refY","markerWidth","markerHeight","orient","d","stroke","strokeWidth","fill","LineComponent","linePaths","active","source","activeRelated","style","left","top","LineLabelComponentGroup","labels","onRendered","NodeComponentGroup","ConnectLineComponent","_EoDiagram2","_set_activeTargetChangeEvent","_set_nodeDelete","_set_edgeDelete","_set_lineClick","_set_lineDoubleClick","_set_connectNodes","c","_initClass","_applyDecs","styleTexts","styleText","String","attribute","Boolean","o","_","has","_checkInRHS","EditableLabelComponent","LegacyEditableLabelComponent","_EditableLabel","_EditableLabel_brand","_handleLabelEditingChange","_handleLabelChange","_editableLabelRef","EditableLabel","_init_label","_init_extra_label","_init_type","_init_extra_type","_init_labelEditingChange","_init_extra_labelEditingChange","value","_get_labelEditingChange","_init_labelChange","_init_extra_labelChange","_get_labelChange","enableEditing","onLabelEditingChange","onLabelChange","_label","currentLabel","setCurrentLabel","editingLabel","setEditingLabel","editingLabelInitialized","shouldEmitLabelChange","setShouldEmitLabelChange","labelInputRef","handleEditLabel","stopPropagation","_labelInputRef$curren","_labelInputRef$curren2","focus","preventScroll","handleInputChange","handleInputKeydown","keyCode","which","_labelInputRef$curren3","blur","handleInputBlur","editing","empty","onDoubleClick","onMouseDown","onChange","onKeyDown","onBlur","_EditableLabel2","_set_labelEditingChange","_set_labelChange","_ExperimentalNode","_ExperimentalNode_brand","_handleDragStart","_handleDragMove","_handleDragEnd","ExperimentalNode","_init_usage","_init_extra_usage","_init_status","_init_extra_status","_init_decorator","_init_extra_decorator","_init_dragStartEvent","_init_extra_dragStartEvent","position","_get_dragStartEvent","_init_dragMoveEvent","_init_extra_dragMoveEvent","_get_dragMoveEvent","_init_dragEndEvent","_init_extra_dragEndEvent","_get_dragEndEvent","usage","status","decorator","ExperimentalNodeComponent","onDragStart","onDragMove","onDragEnd","handleMouseDown","from","clientX","clientY","onMouseMove","onMouseUp","document","_ExperimentalNode2","_set_dragStartEvent","_set_dragMoveEvent","_set_dragEndEvent","_EoDisplayCanvas","_EoDisplayCanvas_brand","_handleCellContextMenu","_handleCellClick","EoDisplayCanvas","_init_cells","_init_extra_cells","_init_defaultNodeSize","DEFAULT_NODE_SIZE","_init_extra_defaultNodeSize","_init_defaultNodeBricks","_init_extra_defaultNodeBricks","_init_degradedThreshold","_init_extra_degradedThreshold","_init_degradedNodeLabel","_init_extra_degradedNodeLabel","_init_defaultEdgeLines","_init_extra_defaultEdgeLines","_init_fadeUnrelatedCells","_init_extra_fadeUnrelatedCells","_init_cellContextMenu","_init_extra_cellContextMenu","_get_cellContextMenu","_init_cellClick","_init_extra_cellClick","_get_cellClick","cells","defaultNodeSize","defaultNodeBricks","degradedThreshold","degradedNodeLabel","defaultEdgeLines","fadeUnrelatedCells","EoDisplayCanvasComponent","shadowRoot","onCellContextMenu","onCellClick","initialCells","layoutKey","dispatch","useReducer","rootReducer","initializeCells","degraded","filter","isNodeCell","DEFAULT_DEGRADED_THRESHOLD","useZoom","draggable","getNextLayoutKey","useLayout","reCenter","previousCellsRef","result","updateCells","host","previousCells","payload","useActiveTarget","handleNodeBrickResize","size","hoverCell","setHoverCell","handleCellMouseEnter","cell","handleCellMouseLeave","prev","unrelatedCells","setUnrelatedCells","nextUnrelated","getUnrelatedCells","handleZoomSlide","scaleTo","lineConfMap","useLineMarkers","useReady","marker","markerType","CellComponent","isEdgeCell","readOnly","onNodeBrickResize","onCellMouseEnter","onCellMouseLeave","ZoomBarComponent","onZoomChange","onReCenter","_EoDisplayCanvas2","_set_cellContextMenu","_set_cellClick","zoomBarStyleText","Number","lockBodyScroll","unwrapProvider","EoDrawCanvasComponent","LegacyEoDrawCanvasComponent","_EoDrawCanvas","_EoDrawCanvas_brand","_U","_V","_handleCellMove","_W","_handleCellsMove","_X","_handleCellResize","_Y","_Z","_handleCellDelete","_a","_handleCellsDelete","_b","_c","_handleEdgeAdd","_d","_handleEdgeViewChange","_e","_handleDecoratorTextChange","_f","_handleContainerContainerChange","_g","_handleScaleChange","_canvasRef","EoDrawCanvas","_init_allowEdgeToArea","_init_extra_allowEdgeToArea","_init_dragBehavior","_init_extra_dragBehavior","_init_ctrlDragBehavior","_init_extra_ctrlDragBehavior","_init_lineSettings","_init_extra_lineSettings","_init_lineConnector","_init_extra_lineConnector","_init_nodeMoveEvent","_init_extra_nodeMoveEvent","_init_cellMoveEvent","_init_extra_cellMoveEvent","info","_get_cellMoveEvent","_get_nodeMoveEvent","_init_cellsMoveEvent","_init_extra_cellsMoveEvent","_get_cellsMoveEvent","_init_cellResizeEvent","_init_extra_cellResizeEvent","_get_cellResizeEvent","_init_cellDelete","_init_extra_cellDelete","_get_cellDelete","_init_cellsDelete","_init_extra_cellsDelete","_get_cellsDelete","_init_edgeAdd","_init_extra_edgeAdd","_get_edgeAdd","_init_edgeViewChange","_init_extra_edgeViewChange","_get_edgeViewChange","_init_decoratorTextChange","_init_extra_decoratorTextChange","_get_decoratorTextChange","_init_containerContainerChange","_init_extra_containerContainerChange","_get_containerContainerChange","_init_scaleChange","_init_extra_scaleChange","_get_scaleChange","allowEdgeToArea","dragBehavior","ctrlDragBehavior","lineSettings","lineConnector","dropNode","_document$elementsFro","_document","data","useBrick","elementsFromPoint","includes","boundingClientRect","getBoundingClientRect","getTransform","newNode","view","dropDecorator","_document$elementsFro2","_document2","direction","_classPrivateFieldGet3","newDecorator","uuidV4","DEFAULT_AREA_WIDTH","DEFAULT_AREA_HEIGHT","addNodes","newNodes","addEdge","_classPrivateFieldGet4","newEdge","manuallyConnectNodes","ctx","_assertClassBrand","_waitForCanvasRef","updated","disconnectedCallback","super","onCellMove","onCellsMove","onCellResize","onCellDelete","onCellsDelete","onEdgeAdd","onDecoratorTextChange","onContainerContainerChange","onScaleChange","onEdgeViewChange","Promise","resolve","check","setTimeout","_ref5","manualConnectDeferredRef","editingTexts","setEditingTexts","activeContainers","setActiveContainers","ctrlDraggable","lassoRect","setLassoRect","_ref6","findLastIndex","newCells","slice","allCells","shouldReCenter","sourceId","find","isEdgeSide","rect","offset","reject","handleConnect","state","to","_manualConnectDeferre2","i","_manualConnectDeferre","smartConnectLineState","setSmartConnectLineState","guideLines","setGuideLines","handleCellsMoving","containedIds","handleNodeContainedChange","forEach","_c$containerCell","_c$containerCell2","containerCell","push","handleCellsMoved","handleCellResizing","handleCellResized","handleDecoratorTextEditing","_ref7","texts","nextLayoutKey","lineConnectorConf","hoverState","setHoverState","unsetHoverStateTimeoutRef","activeEditableLine","setActiveEditableLine","lineEditorState","setLineEditorState","clearTimeout","relativePoints","getConnectPointsOfRectangle","points","getConnectPoints","handleSmartConnect","exitPosition","entryPosition","vertices","handleEdgeChangeView","hoverStateContextValue","onConnect","onChangeEdgeView","rootRect","handleLasso","onLassoing","onLassoed","lassoedCells","isContainerDecoratorCell","isNodeOrAreaDecoratorCell","isTextDecoratorCell","targets","cellToTarget","HoverStateContext","Provider","dragNodeToContainerActive","onCellsMoving","onCellsMoved","onCellResizing","onCellResized","onDecoratorTextEditing","markerEnd","fillOpacity","strokeDasharray","SmartConnectLineComponent","options","EditingLineComponent","join","LineEditorComponent","LineConnectorComponent","disabled","replace","r","Math","random","toString","border","padding","DEFAULT_NODE_PADDING_FOR_SMART_LINES","halfPadding","viewWithBorderAndPadding","p","_EoDrawCanvas2","_set_nodeMoveEvent","_set_cellMoveEvent","_set_cellsMoveEvent","_set_cellResizeEvent","_set_cellDelete","_set_cellsDelete","_set_edgeAdd","_set_edgeViewChange","_set_decoratorTextChange","_set_containerContainerChange","_set_scaleChange","___CSS_LOADER_EXPORT___","module"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[9961],{4932:(e,t,n)=>{n.d(t,{m:()=>R});var o=n(8769),r=n.n(o),i=n(3373),a=n.n(i),l=n(531),c=n(3033),s=n(8653),d=n(967);function u(e,t){return e.find((e=>(0,l.o6)(e)&&e.id===t))}var v=n(9978),f=n(7531);function h(e){var t,n;let{edge:i,cells:h,lineConfMap:m,active:g}=e;const{setActiveEditableLine:p}=(0,v.s)(),y=(0,o.useRef)(null),w=(0,o.useMemo)((()=>u(h,i.source)),[h,i.source]),x=(0,o.useMemo)((()=>u(h,i.target)),[h,i.target]),E=(0,o.useMemo)((()=>m.get(i)),[i,m]),k=(0,o.useMemo)((()=>{var e;return(0,l.jw)(null===(e=i.view)||void 0===e?void 0:e.type)&&h.some((e=>{var t;return(0,l.WW)(e)&&e.source===i.target&&e.target===i.source&&(0,l.jw)(null===(t=e.view)||void 0===t?void 0:t.type)}))?E.parallelGap:0}),[h,i.source,i.target,i.view,E.parallelGap]),b=(0,o.useMemo)((()=>w&&x&&null!=w.view.x&&null!=x.view.x?(0,d.V)(w.view,x.view,i.view,k):null),[i.view,k,w,x]),I=(0,o.useMemo)((()=>{const e=E.type;return(0,s.S)(b,"curve"===e?E.curveType:"curveLinear",0,1)}),[E,b]);if((0,o.useEffect)((()=>{p((e=>g?b&&w&&x?{edge:i,source:w,target:x,linePoints:b,lineType:E.type,lineCurveType:E.curveType,parallelGap:k}:null:null!=e&&e.edge&&e.edge.source===i.source&&e.edge.target===i.target?null:e))}),[g,i,E.curveType,E.type,b,p,w,x,k]),!I||!b)return null;let C,S;const L=(0,f.I)(E);for(const e of L)"start"===e.placement?C=E.$markerStartUrl:S=E.$markerEndUrl;return r().createElement(r().Fragment,null,r().createElement("path",{d:I,fill:"none",stroke:"transparent",strokeWidth:E.interactStrokeWidth}),r().createElement("path",{ref:y,className:a()("line",{dashed:E.dashed,dotted:E.dotted,[(E.dashed?"dashed":E.dotted?"dotted":"solid")+"-animation"]:E.animate.useAnimate}),style:{"--time":`${E.animate.duration??c.Be}s`,"--solid-length":null===(t=y.current)||void 0===t||null===(n=t.getTotalLength)||void 0===n?void 0:n.call(t)},d:I,fill:"none",stroke:E.strokeColor,strokeWidth:E.strokeWidth,markerStart:C,markerEnd:S}),r().createElement("path",{className:"line-active-bg",d:I,fill:"none"}))}var m=n(5068),g=n(7619),p=n(1030),y=n(9126);function w(e){let{node:t,degraded:n,degradedNodeLabel:i,defaultNodeBricks:a,onResize:l}=e;const c=function(e){const[t,n]=(0,o.useState)(e);return(0,o.useEffect)((()=>{n((t=>(0,p.isEqual)(t,e)?t:e))}),[e]),t}({node:{id:t.id,data:t.data}}),s=t.useBrick,d=(0,o.useRef)(null),u=(0,o.useMemo)((()=>{var e;return n?null:s??(null==a||null===(e=a.find((e=>(0,g.checkIfByTransform)(e,c))))||void 0===e?void 0:e.useBrick)}),[n,s,a,c]),v=(0,o.useMemo)((()=>n?String(g.__secret_internals.legacyDoTransform(c,i??"<% DATA.node.id %>")):""),[n,i,c]),f=(0,o.useCallback)((e=>{const n=d.current;n&&(n.disconnect(),d.current=null),e?setTimeout((()=>{const n=new y.A((()=>{l(t.id,[e.offsetWidth,e.offsetHeight])}));n.observe(e),d.current=n})):l(t.id,null)}),[t.id,l]),h=(0,o.useCallback)((e=>{if(e){const n=e.getBBox();l(t.id,[n.width,n.height])}else l(t.id,null)}),[t.id,l]);return u?r().createElement("foreignObject",{width:9999,height:9999,className:"node"},u&&r().createElement(m.ReactUseBrick,{useBrick:u,data:c,refCallback:f})):n?r().createElement("g",{className:"degraded",ref:h},r().createElement("circle",{cx:8,cy:8,r:8}),r().createElement("text",{x:8,y:32},v)):null}var x=n(9386),E=n(4197);function k(e,t){let{action:n,cell:o,scale:r,layout:i,layoutOptions:a,activeTarget:s,cells:d,onCellsMoving:u,onCellsMoved:v,onCellResizing:f,onCellResized:h,onSwitchActiveTarget:m}=t;if(e.stopPropagation(),"resize"!==n&&(0,E.Q)(o,s)||null==m||m((0,x.P)(o)),(0,l.WW)(o))return;const g=[],p="multi"===(null==s?void 0:s.type)&&"move"===n?d.filter((e=>(0,E.Q)(e,s))):[o];p.forEach((e=>{g.push(e),"move"===n&&(0,l.t2)(e)&&g.push(...d.filter((t=>(0,l.N)(t)&&t.containerId===e.id&&!p.includes(t))))}));const y="force"===i||"dagre"===i,w=g.filter((e=>(0,l.N)(e)&&!y||(0,l.mH)(e)));if(0===w.length)return;const k=function(e){const t=e?!0===e?{grid:!0,object:!0}:e:null,n=null!=t&&t.grid?!0===t.grid?{}:t.grid:null,o=null!=t&&t.object?!0===t.object?{}:t.object:null;return{grid:n?{size:n.size??c.gx}:null,object:o?{distance:o.distance??c.ld}:null}}(null==a?void 0:a.snap),I=[e.clientX,e.clientY],C=w.map((e=>({cell:e,position:"move"===n?[e.view.x,e.view.y]:[e.view.width,e.view.height],center:"move"!==n||(0,l.WW)(e)?null:b(e.view)}))),S=C[0].position;let L=C.map((e=>{let{position:t}=e;return t})),M=[];if("move"===n&&k.object){const e=d.filter((e=>!(0,l.WW)(e)&&!g.includes(e)));M=e.map((e=>({cell:e,center:b(e.view)})))}let z=!1;const P=(e,t)=>{const i=function(e){return[(e.clientX-I[0])/r,(e.clientY-I[1])/r]}(e);let a,c,s,d,m;if(!k.grid&&!k.object||e.altKey)a=C.map((e=>{let{position:t}=e;return[t[0]+i[0],t[1]+i[1]]})),z||(z=i[0]**2+i[1]**2>=9);else{let e=1/0,t=1/0;const n=[...i];if(k.object){const o=k.object.distance;let r,a,l,u,v=0,f=0;for(const{cell:c,center:[s,h]}of M)for(const{cell:g,center:p}of C){const[y,w]=p,x=Math.abs(y+i[0]-s),E=Math.abs(w+i[1]-h),k=E<o&&E<t;x<o&&x<e&&(e=x,n[0]=s-y,d=g,l=c,r=[s,h],v=w),k&&(t=E,n[1]=h-w,m=g,u=c,a=[s,h],f=y)}if(l&&l===u){const e=l.view.height/2,t=l.view.width/2;c=[[r[0],r[1]-e],[r[0],r[1]+e]],s=[[a[0]-t,a[1]],[a[0]+t,a[1]]]}else r&&(c=[r,[r[0],v+n[1]]]),a&&(s=[a,[f+n[0],a[1]]])}if(k.grid){const o=k.grid.size,r=[Math.round((S[0]+i[0])/o)*o,Math.round((S[1]+i[1])/o)*o],a=[r[0]-S[0],r[1]-S[1]],l=Math.abs(a[0]-i[0]),u=Math.abs(a[1]-i[1]);l<e&&(e=l,n[0]=a[0],c=void 0,d=void 0),u<t&&(t=u,n[1]=a[1],s=void 0,m=void 0)}a=C.map((e=>{let{position:t}=e;return[Math.round(t[0]+n[0]),Math.round(t[1]+n[1])]})),(a[0][0]!==L[0][0]||a[0][1]!==L[0][1])&&(L=a,z=!0)}if(z)if("move"===n){var g;const e=C.map(((e,n)=>{let{cell:o}=e;return{type:o.type,id:o.id,x:a[n][0],y:a[n][1],width:o.view.width,height:o.view.height,decorator:(0,l.mH)(o)?o.decorator:void 0,guideLines:t?void 0:[...d===o?[c]:[],...m===o?[s]:[]]}}));null===(g=t?v:u)||void 0===g||g(e)}else{var p;null===(p=t?h:f)||void 0===p||p({type:o.type,id:o.id,width:a[0][0],height:a[0][1]})}},N=e=>{P(e)},R=e=>{P(e,!0),z=!1,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",R)};document.addEventListener("mousemove",N),document.addEventListener("mouseup",R)}function b(e){return[e.x+e.width/2,e.y+e.height/2]}function I(e){let{cell:t,transform:n,readOnly:i,layoutOptions:a,activeTarget:l,cells:c,onCellResizing:s,onCellResized:d,onSwitchActiveTarget:u}=e;const v=r().useRef(null);return(0,o.useEffect)((()=>{const e=v.current;if(!e||i)return;const o=e=>{k(e,{action:"resize",cell:t,scale:n.k,layoutOptions:a,activeTarget:l,cells:c,onCellResizing:s,onCellResized:d,onSwitchActiveTarget:u})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[l,t,c,a,d,s,u,i,n.k]),r().createElement("g",{className:"decorator-area"},r().createElement("rect",{width:t.view.width,height:t.view.height,className:"area"}),!i&&r().createElement("g",{ref:v,className:"resize-handle",transform:`translate(${t.view.width-20} ${t.view.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})))}function C(e){let{cell:t,readOnly:n,onDecoratorTextEditing:i,onDecoratorTextChange:l}=e;const c=t.view.text??"",[s,d]=(0,o.useState)(c),[u,v]=(0,o.useState)(!1),f=(0,o.useRef)(!1),[h,m]=(0,o.useState)(!1),g=(0,o.useRef)(null),p=(0,o.useCallback)((e=>{n||(e.preventDefault(),e.stopPropagation(),v(!0))}),[n]);(0,o.useEffect)((()=>{const e=g.current;e&&e.textContent!==s&&(e.textContent=s)}),[s]),(0,o.useEffect)((()=>{var e;const n=null===(e=g.current)||void 0===e?void 0:e.parentElement;n&&(t.view.width=n.clientWidth,t.view.height=n.clientHeight)}),[s,t.id]),(0,o.useEffect)((()=>{u&&g.current&&(g.current.focus(),S(g.current)),null==i||i({id:t.id,editing:u})}),[t.id,u,i]),(0,o.useEffect)((()=>{f.current?null==i||i({id:t.id,editing:u}):f.current=!0}),[t.id,u,i]);const y=(0,o.useCallback)((e=>{n||d(e.target.textContent)}),[n]),w=(0,o.useCallback)((()=>{n||(v(!1),m(!0))}),[n]);return(0,o.useEffect)((()=>{h&&(null==l||l({id:t.id,view:{...t.view,text:s}}),m(!1))}),[t,s,l,h]),r().createElement("foreignObject",{className:"decorator-text"},r().createElement("div",{className:a()("text-container",{editing:u}),onDoubleClick:p},r().createElement("div",{className:"text",contentEditable:u,ref:g,onInput:y,onBlur:w})))}function S(e){const t=document.createRange();t.selectNodeContents(e);const n=window.getSelection();n.removeAllRanges(),n.addRange(t)}var L=n(9068);function M(e){let{cell:t,transform:n,readOnly:i,layout:c,view:s,activeTarget:d,cells:u,onCellResizing:v,onCellResized:f,onSwitchActiveTarget:h,onDecoratorTextEditing:m,onDecoratorTextChange:g}=e;const y=(0,p.get)(t.view,"text",""),w=(0,p.get)(t.view,"direction","top"),x=(0,o.useRef)(null),E=r().useRef(null),[b,I]=(0,o.useState)(!1),[C,M]=(0,o.useState)(y),[z,P]=(0,o.useState)(!1),[N,R]=(0,o.useState)(),[A,T]=(0,o.useState)({x:0,y:0,width:t.view.width,height:t.view.height}),H=(0,o.useCallback)((e=>{i||(e.preventDefault(),e.stopPropagation(),I(!0))}),[i]),Z=(0,o.useCallback)((e=>{i||M(e.target.textContent)}),[i]),D=(0,o.useCallback)((()=>{i||(I(!1),P(!0),R((0,L.uuidV4)()))}),[i]);return(0,o.useEffect)((()=>{M(y)}),[y]),(0,o.useEffect)((()=>{const e=x.current;e&&e.textContent!==C&&(e.textContent=C)}),[C]),(0,o.useEffect)((()=>{var e;const t=null===(e=x.current)||void 0===e?void 0:e.parentElement;if(t){const{clientWidth:e,clientHeight:n}=t;if(["left","right"].includes(w)){const t={width:e,height:s.height,x:"left"===w?-e:s.width,y:0};T(t)}else{const e={width:s.width,height:n,x:0,y:"top"===w?-n:s.height};T(e)}}}),[s,C,w,N]),(0,o.useEffect)((()=>{b&&x.current&&(x.current.focus(),S(x.current)),null==m||m({id:t.id,editing:b})}),[t.id,b,m]),(0,o.useEffect)((()=>{z&&(null==g||g({id:t.id,view:{...s,text:C}}),P(!1))}),[t,s,C,g,z]),(0,o.useEffect)((()=>{const e=E.current;if(!e||i)return;const o=e=>{k(e,{action:"resize",cell:t,scale:n.k,activeTarget:d,cells:u,onCellResizing:v,onCellResized:f,onSwitchActiveTarget:h})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[d,t,u,f,v,h,i,n.k]),r().createElement("g",{className:"decorator-container"},r().createElement("foreignObject",A,r().createElement("div",{className:a()("text-container",{editing:b,[["left","right"].includes(w)?"vertical":"horizontal"]:!0}),onDoubleClick:H},r().createElement("div",{className:"text",contentEditable:b,ref:x,onInput:Z,onBlur:D}))),r().createElement("rect",{width:s.width,height:s.height,className:"container"}),!i&&!(0,l.OD)(c)&&r().createElement("g",{ref:E,className:"resize-handle",transform:`translate(${s.width-20} ${s.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})))}function z(e){let t,{cell:n,view:o,transform:i,readOnly:a,layout:l,layoutOptions:c,activeTarget:s,cells:d,onCellResizing:u,onCellResized:v,onSwitchActiveTarget:f,onDecoratorTextEditing:h,onDecoratorTextChange:m}=e;switch(n.decorator){case"container":t=M;break;case"area":t=I;break;case"text":t=C;break;default:return console.error(`Unknown decorator: ${n.decorator}`),null}return r().createElement(t,{cell:n,view:o,transform:i,readOnly:a,layout:l,layoutOptions:c,activeTarget:s,cells:d,onCellResizing:u,onCellResized:v,onSwitchActiveTarget:f,onDecoratorTextEditing:h,onDecoratorTextChange:m})}var P=n(8185);function N(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;return e.forEach((e=>{const{x:i,y:a,width:l,height:c}=e.view;i<t&&(t=i),a<n&&(n=a),i+l>o&&(o=i+l),a+c>r&&(r=a+c)})),[t,o,n,r].some((e=>isFinite(e)))?{x:t-20,y:n-20,width:o-t+40,height:r-n+40}:{}}function R(e){let{layout:t,layoutOptions:n,cell:i,cells:c,degraded:s,degradedNodeLabel:d,defaultNodeBricks:u,lineConfMap:f,activeTarget:m,dragNodeToContainerActive:g,readOnly:y,transform:b,unrelatedCells:I,allowEdgeToArea:C,onCellsMoving:S,onCellsMoved:L,onCellResizing:M,onCellResized:R,onSwitchActiveTarget:A,onCellContextMenu:T,onCellClick:H,onDecoratorTextEditing:Z,onDecoratorTextChange:D,onNodeBrickResize:W,onCellMouseEnter:j,onCellMouseLeave:B}=e;const{lineEditorState:V,smartConnectLineState:O,setSmartConnectLineState:U,onConnect:G,setLineEditorState:$,onChangeEdgeView:X}=(0,v.s)(),Y=(0,o.useRef)(null),Q=(0,o.useMemo)((()=>I.some((e=>(0,P.c)(e,i)))),[i,I]),F=(0,o.useMemo)((()=>{if((0,l.t2)(i)&&(0,l.OD)(t)){const e=c.filter((e=>(0,l.N)(e)&&e.containerId===i.id)),t={...i.view,...N(e)};return i.view=t,t}return(0,l.WW)(i)?void 0:(0,p.get)(i,"view",{x:0,y:0,width:0,height:0})}),[t,i,c]);(0,o.useEffect)((()=>{const e=Y.current;if(!e)return;const o=e=>{y||(0,l.t2)(i)&&(0,l.OD)(t)?e.stopPropagation():k(e,{layout:t,layoutOptions:n,action:"move",cell:i,scale:b.k,activeTarget:m,cells:c,onCellsMoving:S,onCellsMoved:L,onSwitchActiveTarget:A})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[t,n,i,m,c,L,S,A,y,b.k]),(0,o.useEffect)((()=>{const e=Y.current;if(!e||!(0,l.bo)(i,C)||!(O||V&&"control"!==V.type))return;const t=e=>{if(e.preventDefault(),e.stopPropagation(),O)O.source!==i&&(null==G||G(O.source,i,O.exitPosition,void 0)),U(null);else if(V){const{type:e,source:t,target:n,edge:{view:o}}=V,r="entry"===e;(r?n:t)===i&&(r?null==X||X(t,n,{...o,entryPosition:null}):null==X||X(t,n,{...o,exitPosition:null})),$(null)}};return e.addEventListener("mouseup",t),()=>{e.removeEventListener("mouseup",t)}}),[C,i,V,X,G,$,U,O]);const J=(0,o.useCallback)((e=>{y&&"decorator"===i.type||(e.preventDefault(),A((0,x.P)(i)),T({cell:i,clientX:e.clientX,clientY:e.clientY}))}),[i,T,A,y]),K=(0,o.useCallback)((e=>{H&&"decorator"!==i.type&&H({cell:i,clientX:e.clientX,clientY:e.clientY})}),[i,H]),_=(0,o.useCallback)((()=>{null==j||j(i)}),[i,j]),q=(0,o.useCallback)((()=>{null==B||B(i)}),[i,B]),ee=(0,E.Q)(i,m);return r().createElement("g",{className:a()("cell",{active:ee,faded:Q,"read-only":y,"container-active":g}),ref:Y,transform:"edge"===i.type||null==i.view.x?void 0:`translate(${F.x} ${F.y})`,onContextMenu:J,onClick:K,onMouseEnter:_,onMouseLeave:q},(0,l.N)(i)?r().createElement(w,{node:i,degraded:s,degradedNodeLabel:d,defaultNodeBricks:u,onResize:W}):(0,l.WW)(i)?r().createElement(h,{edge:i,cells:c,lineConfMap:f,active:ee}):(0,l.mH)(i)?r().createElement(z,{cell:i,view:F,transform:b,readOnly:y,layout:t,layoutOptions:n,activeTarget:m,cells:c,onCellResizing:M,onCellResized:R,onSwitchActiveTarget:A,onDecoratorTextEditing:Z,onDecoratorTextChange:D}):null)}},3639:(e,t,n)=>{n.d(t,{w:()=>l});var o=n(8769),r=n.n(o),i=n(3373),a=n.n(i);function l(e){let{connectLineState:t,transform:n,markerEnd:i,onConnect:l}=e;const[c,s]=(0,o.useState)(null);return(0,o.useEffect)((()=>{t&&s(t.from)}),[t]),(0,o.useEffect)((()=>{if(t){const e=e=>[(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k],o=t=>{s(e(t))},r=e=>{e.stopPropagation()},i=n=>{n.stopPropagation(),a(),l(t,e(n))},a=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mousedown",r,{capture:!0}),document.removeEventListener("click",i,{capture:!0}),s(null)};return document.addEventListener("mousemove",o),document.addEventListener("mousedown",r,{capture:!0}),document.addEventListener("click",i,{capture:!0}),a}}),[t,l,n]),r().createElement("path",{className:a()("connect-line",{connecting:!!t&&c&&(c[0]-t.from[0])**2+(c[1]-t.from[1])**2>25}),d:t&&c?`M${t.from.join(" ")}L${c.join(" ")}`:"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:`url(#${i})`})}},1825:(e,t,n)=>{n.d(t,{W:()=>f});var o=n(8769),r=n.n(o),i=n(3373),a=n.n(i),l=n(8653),c=n(9978),s=n(1030),d=n(967);function u(e,t){const{control:n,linePoints:o}=e,r=[],[i,a]=t,l=o[0],c=o[o.length-1];0===n.index&&r.push("ns"===n.direction?{x:l.x,y:a}:{x:i,y:l.y});for(let e=1;e<o.length-1;e++){const t=o[e];r.push(e===n.index||e===n.index+1?"ns"===n.direction?{x:t.x,y:a}:{x:i,y:t.y}:t)}return n.index===o.length-2&&r.push("ns"===n.direction?{x:c.x,y:a}:{x:i,y:c.y}),(0,d.P)(l,r,c)}var v=n(7531);function f(e){let{transform:t,options:n}=e;const[i,f]=(0,o.useState)(null),{activeEditableLine:h,hoverState:m,lineEditorState:g,setLineEditorState:p,onChangeEdgeView:y}=(0,c.s)(),w=(0,o.useRef)(!1);(0,o.useEffect)((()=>{g||setTimeout((()=>{w.current=!1}),0)}),[g]),(0,o.useEffect)((()=>{if(!g)return;w.current=!1;const{type:e,offset:n,from:o}=g,r=r=>{const i={x:(r.clientX-t.x-n[0])/t.k,y:(r.clientY-t.y-n[1])/t.k};let a=1/0;if("control"===e&&!r.altKey){const{linePoints:e,control:t}=g,n="ns"===t.direction?"y":"x",o=t[n],r=e.filter(((n,o)=>0===o||o===e.length-1||o!==t.index&&o!==t.index+1)),l=5;for(const e of r){const t=Math.abs(e[n]-i[n]);t<=l&&t<a&&(i[n]=e[n],a=t,w.current||o===i[n]||(w.current=!0))}}if(a===1/0&&!w.current){const e=(r.clientX-o[0])/t.k,n=(r.clientY-o[1])/t.k;w.current=e**2+n**2>=9}return[i.x,i.y]},i=e=>{const t=r(e);w.current&&f(t)};function a(e){if(e.preventDefault(),l(),"control"===(null==g?void 0:g.type)){const t=r(e);if(w.current){const{source:e,target:n,edge:{view:o}}=g;null==y||y(e,n,{...o,vertices:u(g,t)})}}}function l(){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",a),f(null),p(null)}return document.addEventListener("mousemove",i),document.addEventListener("mouseup",a),l}),[g,t,p,y]),(0,o.useEffect)((()=>{if(!h)return;const e=e=>{w.current&&(e.stopPropagation(),e.preventDefault())};return document.body.addEventListener("click",e),()=>{document.body.removeEventListener("click",e)}}),[h]);const x=(0,o.useMemo)((()=>{var e;const t=function(e,t,n){if(!e||!(t||"control"!==e.type&&void 0!==(null==n?void 0:n.activePointIndex)))return null;const{type:o,source:r,target:i,edge:{view:a}}=e,{exitPosition:l,entryPosition:c,vertices:v}=a??{},f=(0,s.pick)(a,["type","curveType"]);if("control"===o){const n=u(e,t);return(0,d.V)(r.view,i.view,{...f,exitPosition:l,entryPosition:c,vertices:n})}if(void 0!==(null==n?void 0:n.activePointIndex)){const e=n.relativePoints[n.activePointIndex];return(0,d.V)(r.view,i.view,{...f,..."entry"===o?{exitPosition:l,entryPosition:e}:{exitPosition:e,entryPosition:c},vertices:v})}const[h,m]=t;return"entry"===o?(0,d.V)(r.view,{x:h,y:m,width:0,height:0},{...f,exitPosition:l,vertices:v}):(0,d.V)({x:h,y:m,width:0,height:0},i.view,{...f,entryPosition:c,vertices:v})}(g,i,m);return(0,l.S)(t,"curve"===(null==g||null===(e=g.edge.view)||void 0===e?void 0:e.type)?g.edge.view.curveType:"curveLinear",0,1)}),[i,m,g]);let E,k;const b=(0,v.I)(n);for(const e of b)"start"===e.placement?E=n.$editingStartMarkerUrl:k=n.$editingEndMarkerUrl;return r().createElement("path",{className:a()("editing-line",{editing:!(!g||!i)}),d:x,fill:"none",stroke:n.editingStrokeColor,markerStart:E,markerEnd:k})}},9978:(e,t,n)=>{n.d(t,{H:()=>i,s:()=>a});var o=n(8769),r=n.n(o);const i=r().createContext({rootRef:{current:null},smartConnectLineState:null,unsetHoverStateTimeoutRef:{current:null},hoverState:null,activeEditableLine:null,lineEditorState:null,setLineEditorState:()=>{},setActiveEditableLine:()=>{},setHoverState:()=>{},setSmartConnectLineState:()=>{}});function a(){return r().useContext(i)}},2722:(e,t,n)=>{n.d(t,{T:()=>v});var o=n(8769),r=n.n(o),i=n(9978),a=n(4197),l=n(3033);const c="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSI1cHgiIGhlaWdodD0iNXB4IiB2ZXJzaW9uPSIxLjEiPjxwYXRoIGQ9Im0gMCAwIEwgNSA1IE0gMCA1IEwgNSAwIiBzdHJva2Utd2lkdGg9IjIiIHN0eWxlPSJzdHJva2Utb3BhY2l0eTowLjQiIHN0cm9rZT0iI2ZmZmZmZiIvPjxwYXRoIGQ9Im0gMCAwIEwgNSA1IE0gMCA1IEwgNSAwIiBzdHJva2U9IiMyOWI2ZjIiLz48L3N2Zz4=",s=5,d=8,u=s/2;function v(e){let{activeTarget:t,scale:n,disabled:c}=e;const{unsetHoverStateTimeoutRef:s,hoverState:u,setHoverState:v,smartConnectLineState:h,lineEditorState:m}=(0,i.s)(),g=(0,o.useCallback)((()=>{null!==s.current&&(clearTimeout(s.current),s.current=null)}),[s]),p=(0,o.useCallback)((()=>{g(),v((e=>void 0===(null==e?void 0:e.activePointIndex)?e:{...u,activePointIndex:void 0}))}),[u,v,g]),y=(0,o.useCallback)((()=>{s.current=setTimeout((()=>{v(null)}))}),[v,s]),w=!c&&u&&(!!h||(m?"entry"===m.type?u.cell===m.target:"exit"===m.type&&u.cell===m.source:!(0,a.Q)(u.cell,t)&&!function(e){return e&&("edge"===e.type||"multi"===e.type&&e.targets.some((e=>"edge"===e.type)))}(t))),x=l.XK,E=x/2;return r().createElement("g",{onMouseEnter:p,onMouseLeave:y},w&&r().createElement(r().Fragment,null,r().createElement("rect",{x:u.cell.view.x-E,y:u.cell.view.y-E,width:u.cell.view.width+x,height:u.cell.view.height+x,fill:"none",stroke:"transparent",strokeWidth:2*d/n,pointerEvents:"stroke"}),void 0!==u.activePointIndex&&r().createElement("circle",{cx:u.points[u.activePointIndex].x,cy:u.points[u.activePointIndex].y,r:d/n,fill:"lightgreen",fillOpacity:.5,pointerEvents:"none"}),u.points.map(((e,t)=>r().createElement(f,{key:t,index:t,point:e,scale:n,unsetActivePointIndex:p,unsetTimeout:g})))))}function f(e){let{index:t,point:n,scale:a,unsetTimeout:l,unsetActivePointIndex:v}=e;const{rootRef:f,smartConnectLineState:h,hoverState:m,setHoverState:g,setSmartConnectLineState:p,onConnect:y,lineEditorState:w,setLineEditorState:x,onChangeEdgeView:E}=(0,i.s)(),k=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const e=k.current,n=o=>{"mousemove"===o.type&&(null==e||e.removeEventListener(o.type,n)),l(),g((e=>e&&e.activePointIndex!==t?{...m,activePointIndex:t}:e))};return null==e||e.addEventListener("mouseenter",n),null==e||e.addEventListener("mousemove",n),()=>{null==e||e.removeEventListener("mouseenter",n),null==e||e.removeEventListener("mousemove",n)}}),[m,t,g,l]),(0,o.useEffect)((()=>{if(w)return;const e=e=>{e.preventDefault(),e.stopPropagation();const n=f.current.getBoundingClientRect(),o=m.points[t];p({source:m.cell,from:[o.x,o.y],offset:[n.left,n.top],exitPosition:m.relativePoints[t]})},n=k.current;return null==n||n.addEventListener("mousedown",e),()=>{null==n||n.removeEventListener("mousedown",e)}}),[m,t,w,f,p]),(0,o.useEffect)((()=>{const e=e=>{if(e.preventDefault(),e.stopPropagation(),h)h.source!==(null==m?void 0:m.cell)&&(null==y||y(h.source,m.cell,h.exitPosition,m.relativePoints[m.activePointIndex])),p(null);else if(w){const e=m.relativePoints[m.activePointIndex],{type:t,source:n,target:o,edge:{view:r}}=w;"entry"===t?null==E||E(n,o,{...r,entryPosition:e}):null==E||E(n,o,{...r,exitPosition:e}),x(null)}},t=k.current;return null==t||t.addEventListener("mouseup",e),()=>{null==t||t.removeEventListener("mouseup",e)}}),[h,m,y,p,w,E,x]),r().createElement("g",{ref:k,onMouseLeave:v},r().createElement("circle",{cx:n.x,cy:n.y,r:d,fill:"transparent"}),r().createElement("image",{x:n.x-u/a,y:n.y-u/a,width:s/a,height:s/a,xlinkHref:c,preserveAspectRatio:"none"}))}},2202:(e,t,n)=>{n.d(t,{F:()=>v});var o=n(9575),r=n(8769),i=n.n(r),a=n(9978),l=n(531);const c="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyMnB4IiBoZWlnaHQ9IjIycHgiIHZlcnNpb249IjEuMSI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iNyIgc3Ryb2tlPSIjZmZmIiBmaWxsPSIjMjliNmYyIi8+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iMyIgc3Ryb2tlPSIjZmZmIiBmaWxsPSJ0cmFuc3BhcmVudCIvPjwvc3ZnPg==",s="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyMnB4IiBoZWlnaHQ9IjIycHgiIHZlcnNpb249IjEuMSI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iNyIgc3Ryb2tlPSIjZmZmIiBmaWxsPSIjMDFiZDIyIi8+PHBhdGggZD0ibSA4IDggTCAxNCAxNE0gOCAxNCBMIDE0IDgiIHN0cm9rZT0iI2ZmZiIvPjwvc3ZnPg==",d="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiIHZlcnNpb249IjEuMSI+PGNpcmNsZSBjeD0iOSIgY3k9IjkiIHI9IjUiIHN0cm9rZT0iI2ZmZiIgZmlsbD0iIzI5YjZmMiIvPjwvc3ZnPg==",u=22;function v(e){let{scale:t}=e;const{rootRef:n,activeEditableLine:v,setLineEditorState:f}=(0,a.s)(),h=(0,r.useRef)(null),m=(0,r.useRef)(null),g=(0,r.useRef)([]);(0,r.useEffect)((()=>{const e=h.current,t=m.current;if(!e||!t||!v)return;const o=e=>t=>{t.stopPropagation(),t.preventDefault();const o=n.current.getBoundingClientRect();f({...v,offset:[o.left,o.top],from:[t.clientX,t.clientY],type:e})},r=o("exit"),i=o("entry");return e.addEventListener("mousedown",r),t.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",r),t.removeEventListener("mousedown",i)}}),[v,n,f]);const p=(0,r.useMemo)((()=>{var e;return v&&!(0,l.jw)(null===(e=v.edge.view)||void 0===e?void 0:e.type)?function(e){const t=[];let n=e[0],o=1;for(;o<e.length;){const r=e[o],i=n.y===r.y,a=n.x===r.x;if(!i||!a){const e=i?"ns":"ew";t.push({direction:e,index:o-1,x:(n.x+r.x)/2,y:(n.y+r.y)/2})}n=r,o++}return t}(v.linePoints):[]}),[v]);(0,r.useEffect)((()=>{if(!v)return;const e=g.current,t=p.map((e=>(e=>t=>{t.stopPropagation(),t.preventDefault();const o=n.current.getBoundingClientRect();f({...v,offset:[o.left,o.top],from:[t.clientX,t.clientY],type:"control",control:e})})(e)));return e.forEach(((e,n)=>{null==e||e.addEventListener("mousedown",t[n])})),()=>{e.forEach(((e,n)=>{null==e||e.removeEventListener("mousedown",t[n])}))}}),[v,p,n,f]);const y=(0,r.useRef)(null);if((0,r.useEffect)((()=>{const e=y.current,t=e=>{e.stopPropagation(),e.preventDefault()};return null==e||e.addEventListener("click",t),()=>{null==e||e.removeEventListener("click",t)}}),[]),!v)return null;const{linePoints:w,edge:{view:x}}=v,{exitPosition:E,entryPosition:k}=x??{},b={width:u/t,height:u/t,preserveAspectRatio:"none",cursor:"pointer",pointerEvents:"fill"},I=w[0],C=w[w.length-1],S=u/t/2;return i().createElement("g",{ref:y},i().createElement("image",(0,o.A)({ref:h},b,{x:I.x-S,y:I.y-S,xlinkHref:E?s:c})),p.map(((e,t)=>i().createElement("image",(0,o.A)({key:t,ref:e=>{g.current[t]=e}},b,{x:e.x-S,y:e.y-S,xlinkHref:d,cursor:"ns"===e.direction?"row-resize":"col-resize"})))),i().createElement("image",(0,o.A)({ref:m},b,{x:C.x-S,y:C.y-S,xlinkHref:k?s:c})))}},1103:(e,t,n)=>{n.d(t,{X:()=>u});var o=n(8769),r=n.n(o),i=n(3373),a=n.n(i),l=n(8653),c=n(9978),s=n(967),d=n(7531);function u(e){let{transform:t,lineSettings:n,options:i}=e;const[u,v]=(0,o.useState)(null),{hoverState:f,smartConnectLineState:h,setSmartConnectLineState:m}=(0,c.s)();(0,o.useEffect)((()=>{if(h)return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),o;function e(e){v([(e.clientX-t.x-h.offset[0])/t.k,(e.clientY-t.y-h.offset[1])/t.k])}function n(e){e.preventDefault(),o()}function o(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n),v(null),m(null)}}),[m,h,t]);const g=(0,o.useMemo)((()=>{const e=function(e,t,n,o){if(!e||!t&&void 0===(null==n?void 0:n.activePointIndex))return null;const r=e.source.view;if(void 0!==(null==n?void 0:n.activePointIndex))return(0,s.V)(r,n.cell.view,{...o,exitPosition:e.exitPosition,entryPosition:n.relativePoints[n.activePointIndex]});const[i,a]=t;return(0,s.V)(r,{x:i,y:a,width:0,height:0},{...o,exitPosition:e.exitPosition})}(h,u,f,n);return(0,l.S)(e,"curve"===i.type?i.curveType:"curveLinear",0,1)}),[u,f,h,i,n]);let p,y;const w=(0,d.I)(i);for(const e of w)"start"===e.placement?p=i.$markerStartUrl:y=i.$markerEndUrl;return r().createElement("path",{className:a()("connect-line",{connecting:!(!h||!u)}),d:g,fill:"none",stroke:i.strokeColor,strokeWidth:i.strokeWidth,markerStart:p,markerEnd:y})}},3033:(e,t,n)=>{n.d(t,{Be:()=>g,CV:()=>o,HP:()=>i,Ie:()=>f,N8:()=>l,Ub:()=>m,VO:()=>v,XK:()=>E,XV:()=>h,Yt:()=>d,gx:()=>y,ld:()=>w,mF:()=>u,p6:()=>x,pC:()=>p,sS:()=>s,sz:()=>a,w1:()=>c,xc:()=>r});const o=Symbol.for("size-initialized"),r=Symbol.for("layout-initialized"),i=20,a=36,l=180,c=120,s=.5,d=2,u="gray",v=1,f=15,h=!1,m=!0,g=1,p=500,y=10,w=5,x=5,E=0},531:(e,t,n)=>{function o(e){return"node"===e.type}function r(e){return"decorator"===e.type}function i(e){return"node"===e.type}function a(e){return"edge"===e.type}function l(e){return"node"===e.type||"edge"===e.type}function c(e){return"node"===e.type||"decorator"===e.type&&"area"===e.decorator}function s(e,t){return"node"===e.type||!!t&&"decorator"===e.type&&"area"===e.decorator}function d(e){return"decorator"===e.type&&"text"===e.decorator}function u(e){return"decorator"===e.type&&"container"===e.decorator}function v(e){return!["manual",void 0].includes(e)}function f(e){return!("polyline"===e||"curve"===e)}n.d(t,{Hs:()=>d,N:()=>o,OD:()=>v,WW:()=>a,bo:()=>s,jw:()=>f,mH:()=>r,nv:()=>l,o6:()=>c,t2:()=>u,vC:()=>i})},9386:(e,t,n)=>{n.d(t,{P:()=>r});var o=n(1030);function r(e){return"edge"===e.type?(0,o.pick)(e,["type","source","target","data"]):(0,o.pick)(e,["type","id","data"])}},227:(e,t,n)=>{n.d(t,{Y:()=>r});var o=n(4197);function r(e,t,n,r){const i=[];if(t){const n=new Set;for(const o of e)"edge"===o.type&&o.source===t.source.id&&n.add(o.target);for(const t of e)switch(t.type){case"node":n.has(t.id)&&i.push(t);break;case"decorator":r&&"text"!=t.decorator&&!n.has(t.id)||i.push(t);break;default:i.push(t)}}else switch(null==n?void 0:n.type){case"multi":{const t=new Map,r=new Set,a=new Set;for(const e of n.targets)"node"===e.type&&(r.add(e.id),a.add(e.id));for(const l of e)"node"===l.type?t.set(l.id,l):"edge"===l.type?r.has(l.source)?a.add(l.target):r.has(l.target)?a.add(l.source):(0,o.Q)(l,n)||i.push(l):(0,o.Q)(l,n)||i.push(l);for(const[e,n]of t)a.has(e)||i.push(n);break}case"node":{const t=new Map,o=new Set([n.id]);for(const r of e)"node"===r.type?t.set(r.id,r):"edge"===r.type?r.source===n.id?o.add(r.target):r.target===n.id?o.add(r.source):i.push(r):i.push(r);for(const[e,n]of t)o.has(e)||i.push(n);break}case"edge":for(const t of e)("edge"===t.type?(0,o.Q)(t,n):"node"===t.type&&(t.id===n.source||t.id===n.target))||i.push(t)}return i}},5114:(e,t,n)=>{n.d(t,{a:()=>r});var o=n(4197);function r(e,t){let{cells:n,activeTarget:r}=t;const i=n.filter((e=>(0,o.Q)(e,r)));if(0!==i.length)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cells",cells:i}}}},2219:(e,t,n)=>{function o(e,t){let{transform:n,offset:o,onLassoing:r,onLassoed:i}=t;if(e.ctrlKey||e.button)return;e.stopPropagation();const a=[e.clientX,e.clientY],l=(e.clientX-o[0]-n.x)/n.k,c=(e.clientY-o[1]-n.y)/n.k;let s=!1;const d=(e,t)=>{const o=function(e){return[(e.clientX-a[0])/n.k,(e.clientY-a[1])/n.k]}(e);if(s||(s=o[0]**2+o[1]**2>=9),s){let[e,n]=o,a=l,s=c;e<0&&(a=l+e,e=-e),n<0&&(s=c+n,n=-n),(t?i:r)({x:a,y:s,width:e,height:n})}},u=e=>{d(e)},v=e=>{d(e,!0),s=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",v)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",v)}n.d(t,{F:()=>o})},1991:(e,t,n)=>{n.d(t,{_:()=>r});var o=n(531);function r(e,t,n){const r=t.filter((e=>(0,o.N)(e))),i=e.filter((e=>(0,o.t2)(e))).map((e=>e.id)),a=e.filter((e=>{const t=r.find((t=>t.id===e.id)),n=(null==t?void 0:t.containerId)&&i.includes(t.containerId);return(0,o.N)(e)&&!n}));a.forEach((e=>{const n=e.x,r=e.x+e.width,i=e.y,a=e.y+e.height,l=t.filter((e=>(0,o.t2)(e)));for(const t of l){const o=t.view.x,l=t.view.x+t.view.width,c=t.view.y,s=t.view.y+t.view.height;if(n>=o&&r<=l&&i>=c&&a<=s){e.containerCell=t;break}}}));let l=[];return l=a.filter((e=>{var t;const n=r.find((t=>t.id===e.id));return(null==n?void 0:n.containerId)!==(null===(t=e.containerCell)||void 0===t?void 0:t.id)})),l.length>0&&(null==n||n(l)),l}},3783:(e,t,n)=>{n.d(t,{C:()=>r});var o=n(531);function r(e,t){let{defaultNodeSize:n}=t;return(e??[]).map((e=>{var t,r;return!(0,o.vC)(e)||void 0!==(null===(t=e.view)||void 0===t?void 0:t.width)&&void 0!==(null===(r=e.view)||void 0===r?void 0:r.height)?e:{...e,view:{width:n[0],height:n[1],...e.view}}}))}},8185:(e,t,n)=>{function o(e,t){return e?!!t&&e.type===t.type&&("multi"===e.type?e.targets.length===t.targets.length&&e.targets.every((e=>t.targets.some((t=>o(e,t))))):"node"===e.type||"decorator"===e.type?e.id===t.id:e.source===t.source&&e.target===t.target):!t}n.d(t,{c:()=>o})},4197:(e,t,n)=>{n.d(t,{Q:()=>r});var o=n(8185);function r(e,t){return!!t&&("multi"===t.type?t.targets:[t]).some((t=>(0,o.c)(t,e)))}},908:(e,t,n)=>{n.d(t,{r:()=>r});var o=n(531);function r(e,t){let{canvasWidth:n,canvasHeight:r,scaleRange:i}=t,a=1/0,l=1/0,c=-1/0,s=-1/0,d=!0;for(const t of e)if(!(0,o.WW)(t)){d=!1;const{view:e}=t,n=e.x+e.width,o=e.y+e.height;e.x<a&&(a=e.x),n>c&&(c=n),e.y<l&&(l=e.y),o>s&&(s=o)}const u=c-a,v=s-l,f=i&&!d&&(u>n||v>r)?Math.max(Math.min(n/u,r/v,i[1]),i[0]):1;return{x:d?0:(n-u*f)/2-a*f,y:d?0:(r-v*f)/2-l*f,k:f}}},2098:(e,t,n)=>{n.d(t,{L:()=>u});var o=n(1030),r=n(3033),i=n(531),a=n(3783),l=n(908),c=n(6170),s=n(9127),d=n(8185);function u(e){let{cells:t,layout:n,previousCells:u,defaultNodeSize:v,canvasWidth:f,canvasHeight:h,scaleRange:m,transform:g,reason:p,parent:y,allowEdgeToArea:w}=e;const x="force"!==n&&"dagre"!==n,E=(0,a.C)(t,{defaultNodeSize:v}),k=[];let b=!1;const I=new Map;let C=!1;for(const e of u)(0,i.mH)(e)?C=!0:(0,i.N)(e)&&(C=!0,e[r.CV]&&I.set(e.id,e));const S=new Map;for(const e of E)if((0,i.N)(e)){S.set(e.id,e);const t=I.get(e.id);t&&(e.view.width=t.view.width,e.view.height=t.view.height,e[r.CV]=!0)}let L=!1;if("add-related-nodes"===p&&y){const e=new Set;for(const t of E)(0,i.WW)(t)&&t.source===y&&t.target!==y&&e.add(t.target);const t=S.get(y);if(void 0!==(null==t?void 0:t.view.x)&&void 0!==t.view.y){if(L=!0,x)for(const t of E)((0,i.N)(t)&&void 0===t.view.x||(0,i.N)(t)&&void 0===t.view.y)&&e.add(t.id);const n=[...e].map((e=>S.get(e))).filter(Boolean);let o;for(const e of n)void 0!==e.view.x&&void 0!==e.view.y?(!o||e.view.x>o.view.x)&&e.view.y>t.view.y&&(o=e):k.push(e);if(k.length>0&&x){let e,n;if(o)e=o.view.x+o.view.width+r.sz,n=o.view.y;else{const o=k.reduce(((e,t)=>e+t.view.width+r.sz),-r.sz);e=t.view.x-o/2+t.view.width/2,n=t.view.y+t.view.height+r.sz}for(const t of k)t.view.x=e,t.view.y=n,e+=t.view.width+r.sz}}}if(!L){let e=v[0],t=v[1];const n=[];let r=!1;for(const o of E)(0,i.N)(o)?(o.view.width>e&&(e=o.view.width),o.view.height>t&&(t=o.view.height),void 0===o.view.x||void 0===o.view.y?k.push(o):n.push(o)):(0,i.mH)(o)&&(r=!0);if(x){let e;C||(g=(0,l.r)((0,o.without)(E,...k),{canvasWidth:f,canvasHeight:h,scaleRange:m})),0===n.length||1===n.length&&!r?(k.push(...n),({getNodeView:e}=(0,s.C)({cells:E,allowEdgeToArea:w})),b=0===u.length||u.length===E.length&&u.every(((e,t)=>(0,d.c)(e,E[t])))):({getNodeView:e}=(0,c.k)({cells:E,fixedPosition:!0,allowEdgeToArea:w,center:[(f/2-g.x)/g.k,(h/2-g.y)/g.k]}));for(const t of E)if((0,i.N)(t)){const n=e(t.id);t.view.x=n.x,t.view.y=n.y}}}return{cells:E,updated:k,shouldReCenter:b}}},5748:(e,t,n)=>{n.d(t,{d:()=>a});var o=n(531),r=n(3033);function i(e,t,n){const o=e.findLastIndex(n)+1;return[...e.slice(0,o),t,...e.slice(o)]}const a=(l={cells:(e,t)=>{switch(t.type){case"drop-node":return i(e,t.payload,(e=>!("decorator"===e.type&&"text"===e.decorator)));case"drop-decorator":return"text"===t.payload.decorator?[...e,t.payload]:i(e,t.payload,(e=>"decorator"===e.type&&"area"===e.decorator));case"add-nodes":{const n=e.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1;return[...e.slice(0,n),...t.payload,...e.slice(n)]}case"add-edge":{const n=e.findIndex((e=>"edge"===e.type&&e.source===t.payload.source&&e.target===t.payload.target));return-1===n?i(e,t.payload,(e=>"edge"===e.type||"decorator"===e.type&&"area"===e.decorator)):[...e.slice(0,n),t.payload,...e.slice(n+1)]}case"change-edge-view":{const n=e.findIndex((e=>"edge"===e.type&&e.source===t.payload.source&&e.target===t.payload.target));return-1===n?e:[...e.slice(0,n),{...e[n],view:{...e[n].view,...t.payload.view}},...e.slice(n+1)]}case"move-cells":{let n=!1;const o=e.map((e=>{const o=t.payload.find((t=>e.type===t.type&&e.id===t.id));return o?(n=!0,{...e,view:{...e.view,x:o.x,y:o.y}}):e}));return n?o:e}case"resize-cell":{const{type:n,id:o,width:r,height:i}=t.payload,a=e.findIndex((e=>e.type===n&&e.id===o));if(-1!==a){const t=e[a];return[...e.slice(0,a),{...t,view:{...t.view,width:r,height:i}},...e.slice(a+1)]}return e}case"update-cells":return t.payload;case"update-node-size":return e.map((e=>(0,o.N)(e)&&e.id===t.payload.id?{...e,[r.CV]:!0,view:t.payload.size?{...e.view,width:t.payload.size[0],height:t.payload.size[1]}:e.view}:e))}return e},layoutKey:(e,t)=>"update-node-size"===t.type?t.layoutKey:e},(e,t)=>Object.fromEntries(Object.entries(l).map((n=>{let[o,r]=n;return[o,r(e[o],t)]}))));var l},7099:(e,t,n)=>{n.d(t,{Y:()=>h});var o=n(8769),r=n.n(o),i=n(2588),a=n(6768),l=n(6308),c=n(6257),s=n(5068),d=n(9575);const u=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),o.createElement("path",{d:"M12 0a.5.5 0 0 1 .5.5v2.013a9.5 9.5 0 0 1 8.987 8.988L23.5 11.5a.5.5 0 0 1 0 1h-2.013a9.5 9.5 0 0 1-8.987 8.987V23.5a.5.5 0 0 1-1 0v-2.013A9.5 9.5 0 0 1 2.514 12.5H.5a.5.5 0 0 1 0-1h2.013A9.5 9.5 0 0 1 11.5 2.514V.5A.5.5 0 0 1 12 0M3.514 11.5H7.5a.5.5 0 0 1 0 1H3.514a8.5 8.5 0 0 0 7.987 7.986L11.5 16.5a.5.5 0 0 1 1 0v3.986a8.5 8.5 0 0 0 7.986-7.986H16.5a.5.5 0 0 1 0-1h3.986A8.5 8.5 0 0 0 12.5 3.515V7.5a.5.5 0 0 1-1 0V3.514a8.5 8.5 0 0 0-7.986 7.987zm8.486-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3"})),v=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),o.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),o.createElement("path",{d:"M744.448 486.4h-204.8V281.6a25.6 25.6 0 1 0-51.2 0v204.8h-204.8a25.6 25.6 0 0 0 0 51.2h204.8v204.8a25.6 25.6 0 0 0 51.2 0V537.6h204.8a25.6 25.6 0 0 0 0-51.2"})),f=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),o.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),o.createElement("path",{d:"M744.448 486.4H280.064a25.6 25.6 0 1 0 0 51.2h464.384a25.6 25.6 0 0 0 0-51.2"}));function h(e){let{shadowRoot:t,scale:n,scaleRange:d,onZoomChange:h,onReCenter:m}=e;const g=(0,s.useCurrentTheme)(),p=(0,o.useMemo)((()=>(0,c.VC)()),[]),y=(0,o.useRef)(null),w=100*d[0],x=100*d[1],E=100*n,k=(0,o.useMemo)((()=>({formatter:e=>`${e}%`,placement:"left",getPopupContainer:()=>y.current})),[]),b=(0,o.useCallback)((()=>{h(Math.min(E+5,x))}),[x,h,E]),I=(0,o.useCallback)((()=>{h(Math.max(E-5,w))}),[w,h,E]);return r().createElement(i.Ay,{theme:{algorithm:"dark-v2"===g?a.A.darkAlgorithm:a.A.defaultAlgorithm}},r().createElement(c.N7,{container:t,autoClear:!0,cache:p,hashPriority:"high"},r().createElement("div",{className:"zoom-bar",ref:y},r().createElement("div",{className:"center-button",onClick:m,role:"button"},r().createElement(u,null)),r().createElement("div",{className:"zoom-slider"},r().createElement("div",{className:"zoom-button",role:"button",onClick:b},r().createElement(v,null)),r().createElement(l.A,{min:w,max:x,value:E,step:5,vertical:!0,included:!1,tooltip:k,onChange:h}),r().createElement("div",{className:"zoom-button",role:"button",onClick:I},r().createElement(f,null))))))}},9127:(e,t,n)=>{n.d(t,{C:()=>c});var o=n(1030),r=n(7586),i=n.n(r),a=n(8802),l=n(531);function c(e){let{cells:t,layoutOptions:n,allowEdgeToArea:r}=e;const{nodePadding:c,...s}={nodePadding:0,rankdir:"TB",ranksep:50,edgesep:10,nodesep:50,...(0,o.pick)(n,["nodePadding","rankdir","ranksep","edgesep","nodesep","align"])},d=(0,a.D)(c);if(!t.some(l.N))return{getNodeView:()=>null,nodePaddings:d};const u=new(i().graphlib.Graph);u.setGraph(s),u.setDefaultEdgeLabel((function(){return{}}));for(const e of t)r&&(0,l.o6)(e)||(0,l.N)(e)?u.setNode(e.id,{id:e.id,width:e.view.width+d[1]+d[3],height:e.view.height+d[0]+d[2]}):(0,l.WW)(e)&&u.setEdge(e.source,e.target);return i().layout(u),{getNodeView:e=>u.node(e),nodePaddings:d}}},6170:(e,t,n)=>{n.d(t,{k:()=>v});var o=n(1030),r=n(6149),i=n(4842),a=n(1945),l=n(9418),c=n(3854),s=n(7931),d=n(531),u=n(8802);function v(e){let{cells:t,layoutOptions:n,center:v,fixedPosition:f,allowEdgeToArea:h}=e;const{nodePadding:m,collide:g}={nodePadding:0,...(0,o.pick)(n,["nodePadding"]),collide:!1!==(null==n?void 0:n.collide)&&{radiusDiff:18,strength:1,iterations:1,...!0===(null==n?void 0:n.collide)?null:null==n?void 0:n.collide}},p=(0,u.D)(m),y=[],w=[],x=new Map;for(const e of t)if(h&&(0,d.o6)(e)||(0,d.N)(e)){const t={id:e.id,width:e.view.width+p[1]+p[3],height:e.view.height+p[0]+p[2],...f?{fx:e.view.x,fy:e.view.y}:null};y.push(t),x.set(t.id,t)}else(0,d.WW)(e)&&w.push({source:e.source,target:e.target});const E=(0,r.A)(w).id((e=>e.id)),k=(0,i.A)(y).force("link",E).force("x",(0,a.A)(null==v?void 0:v[0])).force("y",(0,l.A)(null==v?void 0:v[1])).force("charge",(0,c.A)());return g&&k.force("collide",(0,s.A)().radius((e=>Math.sqrt(e.width**2+e.height**2)/2+g.radiusDiff)).strength(g.strength).iterations(g.iterations)),k.stop(),function(e){e.tick(Math.ceil(Math.log(e.alphaMin())/Math.log(1-e.alphaDecay())))}(k),{getNodeView:e=>x.get(e),nodePaddings:p}}},967:(e,t,n)=>{n.d(t,{V:()=>u,P:()=>v});var o=n(1030),r=n(8875),i=n(4059);function a(e,t){return{x:e.x+e.width/2,y:e.y+e.height/2,width:e.width+t,height:e.height+t}}var l=n(3033),c=n(3188),s=n(531);const d=["right","top","left","bottom"];function u(e,t,n,u){var p,y;const{type:w,vertices:x,exitPosition:E,entryPosition:k}=n??{};if((0,s.jw)(w))return(0,c.h)(a(e,E?l.XK:l.p6),a(t,k?l.XK:l.p6),u,n);if(null!=x&&x.length){const n=x[0],o=x[x.length-1];let r,i,a,l;if(E)r=h(e,E);else{let i;if(x.length>1?i=x[1]:k&&(i=h(t,k)),i)r=m(n,e,n.y===i.y);else{const n=o.y<t.y||o.y>t.y+t.height?"ns":"ew";({point:r,direction:a}=g(e,t,x,n))}}if(k)i=h(t,k);else{let r;if(x.length>1?r=x[x.length-2]:E&&(r=h(e,E)),r)i=m(o,t,o.y===r.y);else{const o=n.x<e.x||n.x>e.x+e.width?"ew":"ns";({point:i,direction:l}=g(t,e,x.slice().reverse(),o))}}const{x:c,y:s}=r,{x:d,y:u}=i,f=[r,...x,i],p=[...x];return n&&n.x!==c&&n.y!==s&&p.unshift("ns"===a?{x:c,y:n.y}:"ew"===a?{x:n.x,y:s}:n.x===f[2].x?{x:c,y:n.y}:{x:n.x,y:s}),o&&o.x!==d&&o.y!==u&&p.push("ns"===l?{x:d,y:o.y}:"ew"===l?{x:o.x,y:u}:o.x===f[f.length-3].x?{x:d,y:o.y}:{x:o.x,y:u}),[r,...v(r,p,i),i]}const b=E??f(t,e),I=k??f(e,t),{x:C,y:S}=h(e,b),{x:L,y:M}=h(t,I),z=(0,r.X)(),P=(null===(p=z.find((e=>e.x===b.x&&e.y===b.y)))||void 0===p?void 0:p.d)??d,N=(null===(y=z.find((e=>e.x===I.x&&e.y===I.y)))||void 0===y?void 0:y.d)??d,R=[...P],A=[...N];C<L?((0,o.pull)(R,"left"),(0,o.pull)(A,"right")):((0,o.pull)(R,"right"),(0,o.pull)(A,"left")),S<M?((0,o.pull)(R,"top"),(0,o.pull)(A,"bottom")):((0,o.pull)(R,"bottom"),(0,o.pull)(A,"top"));const T=R[0]??P[0],H=A[0]??N[0],Z="left"===T||"right"===T?b.y:b.x,D="left"===H||"right"===H?I.y:I.x;return(0,i.o)(a(e,l.XK),a(t,l.XK),T,H,Z,D)}function v(e,t,n){const o=[];let r,i=e,a=0;for(;a<t.length;){const e=t[a],l=e.x!==i.x,c=e.y!==i.y;if(l||c){const c=l?"ew":"ns";if(c!==r){const l=a===t.length-1?n:t[a+1],s=l.x!==e.x,d=l.y!==e.y;(s||d)&&c!==(s?"ew":"ns")&&(r=c,o.push(e),i=e)}}a++}return o}function f(e,t){return t.y+t.height<e.y?{x:.5,y:1}:t.y>e.y+e.height?{x:.5,y:0}:t.x<e.x?{x:1,y:.5}:{x:0,y:.5}}function h(e,t){const n=l.XK/2;return{x:e.x-n+t.x*(e.width+l.XK),y:e.y-n+t.y*(e.height+l.XK)}}function m(e,t,n){let o,r,i,a,c;if(n?(o="y",r="x",i="height",a="width"):(o="x",r="y",i="width",a="height"),t[r]+t[a]<e[r]&&(c={[o]:.5,[r]:1}),t[r]>e[r]&&(c={[o]:.5,[r]:0}),c)return h(t,c);const s=t[o]<e[o]?1:0;return{[o]:t[o]-l.XK/2+s*(t[i]+l.XK),[r]:e[r]}}function g(e,t,n,o){let r,i,a,l,c,s,d,u;"ns"===o?(a="x",l="y",c="width",s="height",d="ns",u="ew"):(a="y",l="x",c="height",s="width",d="ew",u="ns");const v=n[0];if(v[a]>=e[a]&&v[a]<=e[a]+e[c])if(v[l]>e[l]+e[s])r={[a]:v[a],[l]:e[l]+e[s]},i=d;else if(v[l]<e[l])r={[a]:v[a],[l]:e[l]},i=d;else{const o=n[1]??t;r={[a]:v[a],[l]:o[l]<v[l]?v[l]:e[l]+e[s]},i=d}else v[l]<e[l]?(r={[a]:e[a]+e[c]/2,[l]:e[l]},i=d):v[l]>e[l]+e[s]?(r={[a]:e[a]+e[c]/2,[l]:e[l]+e[s]},i=d):v[a]<e[a]?(r={[a]:e[a],[l]:v[l]},i=u):(r={[a]:e[a]+e[c],[l]:v[l]},i=u);return{point:r,direction:i}}},8875:(e,t,n)=>{n.d(t,{G:()=>a,X:()=>i});const o=[{x:0,y:0,d:["top","left"]},{x:.5,y:0,d:["top"]},{x:1,y:0,d:["top","right"]},{x:0,y:.5,d:["left"]},{x:1,y:.5,d:["right"]},{x:0,y:1,d:["bottom","left"]},{x:.5,y:1,d:["bottom"]},{x:1,y:1,d:["bottom","right"]}],r=o.map((e=>({x:e.x,y:e.y})));function i(){return o}function a(){return r}},1819:(e,t,n)=>{n.d(t,{J:()=>i});var o=n(8769),r=n(8185);function i(e){let{rootRef:t,activeTarget:n,onActiveTargetChange:i}=e;const a=n??null,[l,c]=(0,o.useState)(a);(0,o.useEffect)((()=>{c((e=>(0,r.c)(e,a)?e:a))}),[a]);const s=(0,o.useRef)(!1);return(0,o.useEffect)((()=>{s.current?i(l):s.current=!0}),[l,i]),(0,o.useEffect)((()=>{if(!l)return;const e=e=>{e.composedPath().indexOf(t.current)<=0&&c(null)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[l,t]),l}},1484:(e,t,n)=>{n.d(t,{g:()=>f});var o=n(8769),r=n(7566),i=n(9047),a=n(3033),l=n(531),c=n(908),s=n(6170),d=n(9127);const u=new Map([["center",.5],["left",0],["right",1],["top",0],["bottom",1]]);function v(e,t){if("string"==typeof e){const n=u.get(e);if(void 0!==n)return n;const o=e.match(/^(-?\d+(?:\.\d+)?)%$/);if(o)return Number(o[1])/100;console.error("Unexpected align origin %s:",t,e)}else{if("number"==typeof e)return e;console.error("Unexpected align origin %s, expected %s, received %s:",t,"string | number",typeof e,e)}return.5}function f(e){let{layout:t,layoutOptions:n,rootRef:u,cells:f,zoomable:h,zoomer:m,scaleRange:g,layoutKey:p,allowEdgeToArea:y,dispatch:w}=e;const[x,E]=(0,o.useState)("force"!==t&&"dagre"!==t),k=(0,o.useRef)(p),b=(0,o.useCallback)((()=>++k.current),[]),[I,C]=function(e){let{rootRef:t,cells:n,layoutInitialized:s,zoomable:d,zoomer:u,scaleRange:v}=e;const[f,h]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{const e=t.current;if(!e||!s||f||!n.some((e=>(0,l.N)(e)||(0,l.mH)(e)))||n.some((e=>(0,l.N)(e)&&!e[a.CV])))return;const{k:o,x:m,y:g}=(0,c.r)(n,{canvasWidth:e.clientWidth,canvasHeight:e.clientHeight,scaleRange:d?v:void 0});u.transform((0,r.A)(e),new i.uV(o,m,g)),h(!0)}),[n,f,s,t,v,d,u]),(0,o.useEffect)((()=>{n.some((e=>(0,l.N)(e)||(0,l.mH)(e)))||h(!1)}),[n]),[f,h]}({rootRef:u,layoutInitialized:x,cells:f,zoomable:h,zoomer:m,scaleRange:g}),S=(0,o.useRef)(null);return(0,o.useEffect)((()=>{if(f.some((e=>(0,l.N)(e)&&!e[a.CV]))||0===f.length)return;if("force"!==t&&"dagre"!==t)return void E(!0);if(k.current!==p||(e=S.current,o=f.filter(l.nv),(null==e?void 0:e.length)===o.length&&e.every(((e,t)=>e===o[t]))))return;var e,o;let r,i;({getNodeView:r,nodePaddings:i}="force"===t?(0,s.k)({cells:f,layoutOptions:n,allowEdgeToArea:y}):(0,d.C)({cells:f,layoutOptions:n,allowEdgeToArea:y}));const c=function(e){const t=e??[.5,.5];return[v(t[0],"x"),v(t[1],"y")]}(null==n?void 0:n.alignOrigin),u=f.map((e=>{if(y&&(0,l.o6)(e)||(0,l.N)(e)){const t=r(e.id);return{...e,view:{...e.view,x:t.x-t.width*c[0]+i[3],y:t.y-t.height*c[1]+i[0]},[a.xc]:!0}}return e}));S.current=u.filter(l.nv),w({type:"update-cells",payload:u}),E(!0)}),[f,w,t,p,n]),{centered:I,setCentered:C,getNextLayoutKey:b}}},7531:(e,t,n)=>{n.d(t,{I:()=>s,d:()=>c});var o=n(8769),r=n(7619),i=n(1030),a=n(531),l=n(3033);function c(e){let{cells:t,defaultEdgeLines:n,markerPrefix:c,lineConnector:v}=e;return(0,o.useMemo)((()=>{const e=[{strokeColor:l.mF,markerType:"arrow"}];let o=null;if(v){o={...u(),editingStrokeColor:"var(--palette-blue-5)",...(0,i.omitBy)(!0===v?{}:v,i.isUndefined)};const t=s(o);for(const n of t){const{placement:t,type:r}=n,i=r??"arrow",a=d({strokeColor:o.strokeColor,markerType:i},e),l=d({strokeColor:o.editingStrokeColor,markerType:i},e);"start"===t?(o.$markerStartUrl=`url(#${c}${a})`,o.$editingStartMarkerUrl=`url(#${c}${l})`):(o.$markerEndUrl=`url(#${c}${a})`,o.$editingEndMarkerUrl=`url(#${c}${l})`)}}const f=new WeakMap;for(const o of t)if((0,a.WW)(o)){const t=r.__secret_internals.legacyDoTransform({edge:o},null==n?void 0:n.find((e=>(0,r.checkIfByTransform)(e,{edge:o}))))??{},a={...u(),...(0,i.omitBy)(t,i.isUndefined),...(0,i.omitBy)(o.view,i.isUndefined)};void 0===a.parallelGap&&(a.parallelGap=a.interactStrokeWidth);const l=s(a);for(const t of l){const{placement:n,type:o}=t,r=o??"arrow",i=d({strokeColor:a.strokeColor,markerType:r},e);"start"===n?a.$markerStartUrl=`url(#${c}${i})`:a.$markerEndUrl=`url(#${c}${i})`}f.set(o,a)}return{lineConfMap:f,lineConnectorConf:o,markers:e}}),[t,n,v,c])}function s(e){let t=[];return e.markers?t=e.markers:(e.showStartArrow&&t.push({type:"arrow",placement:"start"}),e.showEndArrow&&t.push({type:"arrow",placement:"end"})),t}function d(e,t){let n=(0,i.findIndex)(t,e);return-1===n&&(n=t.push(e)-1),n}function u(){return{type:"straight",dashed:!1,strokeColor:l.mF,strokeWidth:l.VO,interactStrokeWidth:l.Ie,showStartArrow:l.XV,showEndArrow:l.Ub,animate:{useAnimate:!1,duration:l.Be}}}},8197:(e,t,n)=>{n.d(t,{H:()=>a});var o=n(8769),r=n(531),i=n(3033);function a(e){let{cells:t,layout:n,centered:a}=e;return(0,o.useMemo)((()=>a&&t.every((e=>!(0,r.N)(e)||e[i.CV]&&("force"!==n&&"dagre"!==n||e[i.xc])))),[t,a,n])}},8091:(e,t,n)=>{n.d(t,{f:()=>l});var o=n(8769),r=n(7566),i=n(9047),a=n(3033);function l(e){let{rootRef:t,zoomable:n,scrollable:l,pannable:c,draggable:s,ctrlDraggable:d,scaleRange:u,onSwitchActiveTarget:v}=e;const[f,h]=(0,o.useState)(!1),[m,g]=(0,o.useState)({k:1,x:0,y:0}),p=(0,o.useMemo)((()=>u??[a.sS,a.Yt]),[u]),y=(0,o.useMemo)((()=>(0,i.s_)()),[]);return(0,o.useEffect)((()=>{let e=!1;y.scaleExtent(n?p:[1,1]).on("start",(()=>{e=!1,h(!0)})).on("zoom",(t=>{e=!0,g(t.transform)})).on("end",(()=>{h(!1),e||null==v||v(null)})).filter((e=>("wheel"===e.type||(d?s||e.ctrlKey:!e.ctrlKey))&&!e.button))}),[v,p,n,y,d,s]),(0,o.useEffect)((()=>{if(d){const e=e=>{e.ctrlKey&&e.preventDefault()};return document.addEventListener("contextmenu",e,!0),()=>{document.removeEventListener("contextmenu",e,!0)}}}),[d]),(0,o.useEffect)((()=>{const e=t.current;if(!e)return;const o=(0,r.A)(e),i=()=>{o.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(n||l||c)return(n||l)&&o.on("wheel.zoom.custom",(e=>{e.ctrlKey||(e.stopImmediatePropagation(),l&&(e.preventDefault(),y.translateBy(o,e.wheelDeltaX/5,e.wheelDeltaY/5)))})),o.call(y).on("wheel",(e=>{e.preventDefault()})).on("dblclick.zoom",null),(s||d)&&c||o.on("mousedown.zoom",null),c||o.on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),i;i()}),[d,s,c,t,l,n,y]),{grabbing:f,transform:m,zoomer:y,scaleRange:p}}},6237:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(6758),r=n.n(o),i=n(935),a=n.n(i)()(r());a.push([e.id,'.zoom-bar{position:absolute;bottom:20px;right:20px;width:40px;scale:0.8}.zoom-slider,\n.center-button{width:100%;display:flex;align-items:center;border:1px solid var(--antd-background-color-base);border-radius:var(--larger-border-radius);box-shadow:var(--connected-overlay-shadow);background-color:var(--color-fill-bg-container-4)}.zoom-slider{height:140px;padding:8px 0;flex-direction:column}[role="button"]{cursor:pointer}.center-button{justify-content:center;margin-bottom:8px;height:40px}.center-button:hover{border-color:var(--antd-btn-default-hover-border-color)}.center-button path{fill:var(--antd-link-hover-color)}.center-button:hover path{fill:var(--palette-blue-7)}.zoom-button{font-size:16px;line-height:0}.zoom-button svg{width:1em;height:1em;fill:var(--antd-link-hover-color)}.zoom-slider .ant-slider-vertical{padding-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}',""]);const l=a.toString()},3012:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(6758),r=n.n(o),i=n(935),a=n.n(i)()(r());a.push([e.id,"*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden;--animation-dasharray:48;--stroke-dashedoffset:96;--stroke-dottedoffset:24;--dasharray:4;--dotted:1}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}@keyframes solidAnimation{to{stroke-dashoffset:0}}@keyframes dashedAnimation{0%{stroke-dashoffset:var(--stroke-dashedoffset)}to{stroke-dashoffset:0}}@keyframes dottedAnimation{0%{stroke-dashoffset:var(--stroke-dottedoffset)}to{stroke-dashoffset:0}}.solid-animation{stroke-dasharray:var(--solid-length);stroke-dashoffset:var(--solid-length);animation:solidAnimation var(--time) linear infinite}.dashed-animation{animation:dashedAnimation var(--time) linear infinite}.dotted-animation{animation:dottedAnimation var(--time) linear infinite}.decorator-area .area,\n.decorator-container .container{fill:rgba(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}.editing-line{pointer-events:none;stroke-dasharray:var(--dasharray);stroke-width:1}.editing-line:not(.editing){display:none}.line.dashed{stroke-dasharray:var(--dasharray)}.line.dotted{stroke-dasharray:var(--dotted)}.cell.active .decorator-text .text-container{outline:1px dashed var(--palette-blue-5)}.decorator-text .text-container{width:max-content;padding:0.5em}.decorator-text .text:focus{outline:none}.cell.faded{opacity:0.3}.cell.container-active{opacity:1}.cell .node{pointer-events:none}.cell .node > *{position:fixed;pointer-events:auto}.degraded{pointer-events:bounding-box}.degraded circle{fill:rgb(119,141,195)}.degraded text{text-anchor:middle;fill:var(--antd-text-color)}.cell.active .degraded circle,\n.cell.active .degraded text,\n.degraded:hover circle,\n.degraded:hover text{fill:var(--color-brand)}.decorator-container{--defaultSize:24px}.decorator-container .text-container{display:flex;align-items:center;justify-content:center;padding:0.5em;text-align:center;font-size:16px;background-color:rgba(119,141,195,0.6);overflow:hidden}.decorator-container .horizontal{height:max-content;width:100%}:is(.decorator-container .horizontal) .text{min-height:var(--defaultSize)}.decorator-container .vertical{width:max-content;height:100%;writing-mode:vertical-lr;text-orientation:upright;letter-spacing:4px}:is(.decorator-container .vertical) .text{min-width:var(--defaultSize)}",""]);const l=a.toString()}}]);
|
|
2
|
+
//# sourceMappingURL=9961.813fbbe3.js.map
|