import { jsx } from "react/jsx-runtime";
import { ReactFlowProvider } from "../../xyflow/react.js";
import { memo, useMemo } from "react";
import { BaseCanvas } from "../BaseCanvas/index.js";
const MiniCanvasNavigator = /*#__PURE__*/ memo(({ previousCanvas, currentCanvasId, nodeTypes, onNodeClick })=>{
    const nodes = useMemo(()=>previousCanvas.nodes.map((node)=>{
            const isSelected = node.data?.childCanvasId === currentCanvasId;
            return {
                ...node,
                selected: isSelected,
                style: {
                    ...node.style,
                    cursor: node.data?.childCanvasId ? 'pointer' : 'default',
                    opacity: node.data?.childCanvasId ? isSelected ? 1 : 0.8 : 0.6
                }
            };
        }), [
        previousCanvas.nodes,
        currentCanvasId
    ]);
    return /*#__PURE__*/ jsx("div", {
        style: {
            width: 300,
            height: 200,
            background: 'var(--canvas-background)',
            border: '1px solid var(--canvas-border-grid)',
            borderRadius: 8,
            boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)'
        },
        children: /*#__PURE__*/ jsx(ReactFlowProvider, {
            children: /*#__PURE__*/ jsx(BaseCanvas, {
                nodes: nodes,
                edges: previousCanvas.edges,
                nodeTypes: nodeTypes,
                fitView: true,
                fitViewOptions: {
                    padding: 0.1,
                    duration: 0
                },
                mode: "view",
                showBackground: false,
                onNodeClick: onNodeClick,
                panOnDrag: false,
                zoomOnDoubleClick: false,
                zoomOnScroll: false,
                zoomOnPinch: false,
                nodesDraggable: false,
                nodesConnectable: false,
                elementsSelectable: false
            }, previousCanvas.id)
        })
    });
});
MiniCanvasNavigator.displayName = 'MiniCanvasNavigator';
export { MiniCanvasNavigator };
