"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__, {
    QuickActionsRow: ()=>QuickActionsRow_QuickActionsRow
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
const external_react_namespaceObject = require("react");
const external_constants_cjs_namespaceObject = require("../../constants.cjs");
const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
function QuickActionButton({ action, wide }) {
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
        content: action.title,
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
            type: "button",
            variant: "ghost",
            size: "icon",
            className: wide ? 'h-9 w-14 aspect-auto [&_svg]:size-6' : 'h-9 w-9 [&_svg]:size-6',
            "aria-label": action.title,
            disabled: action.disabled,
            onClick: action.onClick,
            onMouseEnter: action.onMouseEnter,
            onMouseLeave: action.onMouseLeave,
            "data-testid": `toolbox-quick-action-${action.id}`,
            children: action.icon
        })
    });
}
const QuickActionsRow_QuickActionsRow = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(function({ actions }) {
    if (!actions.length) return null;
    const leading = actions.filter((a)=>!a.trailing);
    const trailing = actions.filter((a)=>a.trailing);
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
        className: "flex items-center justify-center gap-3 min-h-11 pb-2 border-b border-border shrink-0",
        style: {
            paddingInline: external_constants_cjs_namespaceObject.TOOLBOX_PADDING_X,
            marginInline: -external_constants_cjs_namespaceObject.TOOLBOX_PADDING_X
        },
        "data-testid": "toolbox-quick-actions",
        children: [
            leading.map((action)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(QuickActionButton, {
                    action: action
                }, action.id)),
            trailing.length > 0 && leading.length > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
                className: "w-px self-stretch mx-1 bg-border shrink-0",
                "data-testid": "toolbox-quick-actions-separator"
            }),
            trailing.map((action)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(QuickActionButton, {
                    action: action,
                    wide: true
                }, action.id))
        ]
    });
});
exports.QuickActionsRow = __webpack_exports__.QuickActionsRow;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "QuickActionsRow"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
