"use strict";

exports.__esModule = true;
exports.BulkActionToolbar = void 0;
exports._BulkActionToolbar = _BulkActionToolbar;
var _designSystem = require("@wix/design-system");
var _react = _interopRequireWildcard(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _ToolbarCollectionContext = require("../ToolbarCollectionContext");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/BulkActionToolbar/BulkActionToolbar.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function _BulkActionToolbar(props) {
  var _toolbarCollectionSta;
  const {
    actionButton
  } = props;
  const toolbarCollectionState = (0, _ToolbarCollectionContext.useToolbarCollectionContext)();
  const {
    collection,
    hasToolbarTabs,
    featuredComponents
  } = toolbarCollectionState;
  const {
    value: exportButton
  } = featuredComponents.exportButton;
  const TagsAssignButton = (_toolbarCollectionSta = toolbarCollectionState.tagsCollectionState) == null ? void 0 : _toolbarCollectionSta.components.AssignButton;
  const {
    bulkSelect: {
      selectedCountOrTotal: selectedCount
    },
    translate: t
  } = collection;
  return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    minHeight: "60px",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 28,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.TableToolbar, {
    removeVerticalPadding: hasToolbarTabs,
    dataHook: "bulk-action-toolbar",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 29,
      columnNumber: 7
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.TableToolbar.ItemGroup, {
    position: "start",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 33,
      columnNumber: 9
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.TableToolbar.Item, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 34,
      columnNumber: 11
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.TableToolbar.SelectedCount, {
    dataHook: "selected-count",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 35,
      columnNumber: 13
    }
  }, t('cairo.bulkSelected', {
    num: selectedCount
  }))), TagsAssignButton && /*#__PURE__*/_react.default.createElement(_designSystem.TableToolbar.Item, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 42,
      columnNumber: 13
    }
  }, /*#__PURE__*/_react.default.createElement(TagsAssignButton, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 43,
      columnNumber: 15
    }
  })), exportButton && /*#__PURE__*/_react.default.createElement(_designSystem.TableToolbar.Item, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 47,
      columnNumber: 13
    }
  }, /*#__PURE__*/(0, _react.cloneElement)(exportButton, {
    toolbarType: 'default'
  }))), actionButton && /*#__PURE__*/_react.default.createElement(_designSystem.TableToolbar.ItemGroup, {
    position: "end",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 55,
      columnNumber: 11
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.TableToolbar.Item, {
    layout: "button",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 56,
      columnNumber: 13
    }
  }, actionButton))));
}
const BulkActionToolbar = exports.BulkActionToolbar = (0, _mobxReactLite.observer)(_BulkActionToolbar);
//# sourceMappingURL=BulkActionToolbar.js.map