"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    CanvasPositionControls: ()=>CanvasPositionControls
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const index_cjs_namespaceObject = require("../icons/index.cjs");
const external_layouts_index_cjs_namespaceObject = require("../layouts/index.cjs");
const react_cjs_namespaceObject = require("../xyflow/react.cjs");
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
const external_react_namespaceObject = require("react");
const icon_registry_cjs_namespaceObject = require("../utils/icon-registry.cjs");
const BaseCanvas_constants_cjs_namespaceObject = require("./BaseCanvas/BaseCanvas.constants.cjs");
const external_CanvasTooltip_cjs_namespaceObject = require("./CanvasTooltip.cjs");
const CanvasPositionControls = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ orientation = 'horizontal', fitViewOptions, zoomInOptions, zoomOutOptions, translations, onOrganize })=>{
    const { zoomIn, zoomOut, fitView } = (0, react_cjs_namespaceObject.useReactFlow)();
    const handleZoomIn = (0, external_react_namespaceObject.useCallback)(()=>zoomIn(zoomInOptions), [
        zoomIn,
        zoomInOptions
    ]);
    const handleZoomOut = (0, external_react_namespaceObject.useCallback)(()=>zoomOut(zoomOutOptions), [
        zoomOut,
        zoomOutOptions
    ]);
    const handleFitToView = (0, external_react_namespaceObject.useCallback)(()=>fitView(fitViewOptions ?? BaseCanvas_constants_cjs_namespaceObject.BASE_CANVAS_DEFAULTS.fitViewOptions), [
        fitView,
        fitViewOptions
    ]);
    const handleOrganize = (0, external_react_namespaceObject.useCallback)(()=>onOrganize?.(), [
        onOrganize
    ]);
    const showOrganize = !!onOrganize;
    let RootComponent = external_layouts_index_cjs_namespaceObject.Column;
    let placement = 'left';
    if ('horizontal' === orientation) {
        RootComponent = external_layouts_index_cjs_namespaceObject.Row;
        placement = 'top';
    }
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(RootComponent, {
        "data-testid": "canvas-controls",
        children: [
            showOrganize && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
                content: translations.organize,
                placement: placement,
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
                    variant: "ghost",
                    size: "icon",
                    className: "h-8 w-8",
                    "aria-label": translations.organize,
                    onClick: handleOrganize,
                    children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.OrganizeIcon, {})
                })
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
                content: translations.zoomIn,
                placement: placement,
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
                    variant: "ghost",
                    size: "icon",
                    className: "h-8 w-8",
                    "aria-label": translations.zoomIn,
                    onClick: handleZoomIn,
                    children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
                        icon: "plus",
                        size: 16
                    })
                })
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
                content: translations.zoomOut,
                placement: placement,
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
                    variant: "ghost",
                    size: "icon",
                    className: "h-8 w-8",
                    "aria-label": translations.zoomOut,
                    onClick: handleZoomOut,
                    children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
                        icon: "minus",
                        size: 16
                    })
                })
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
                content: translations.zoomToFit,
                placement: placement,
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
                    variant: "ghost",
                    size: "icon",
                    className: "h-8 w-8",
                    "aria-label": translations.zoomToFit,
                    onClick: handleFitToView,
                    children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ZoomToFitIcon, {})
                })
            })
        ]
    });
});
exports.CanvasPositionControls = __webpack_exports__.CanvasPositionControls;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "CanvasPositionControls"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
