"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _i18n = require("@wordpress/i18n");
var _data = require("@wordpress/data");
var _blocks = require("@wordpress/blocks");
var _wordcount = require("@wordpress/wordcount");
var _icons = require("@wordpress/icons");
var _blockIcon = _interopRequireDefault(require("../block-icon"));
var _store = require("../../store");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

function MultiSelectionInspector({
  blocks
}) {
  const words = (0, _wordcount.count)((0, _blocks.serialize)(blocks), 'words');
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
    className: "block-editor-multi-selection-inspector__card",
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockIcon.default, {
      icon: _icons.copy,
      showColors: true
    }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: "block-editor-multi-selection-inspector__card-content",
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        className: "block-editor-multi-selection-inspector__card-title",
        children: (0, _i18n.sprintf)( /* translators: %d: number of blocks */
        (0, _i18n._n)('%d Block', '%d Blocks', blocks.length), blocks.length)
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
        className: "block-editor-multi-selection-inspector__card-description",
        children: (0, _i18n.sprintf)( /* translators: %d: number of words */
        (0, _i18n._n)('%d word selected.', '%d words selected.', words), words)
      })]
    })]
  });
}
var _default = exports.default = (0, _data.withSelect)(select => {
  const {
    getMultiSelectedBlocks
  } = select(_store.store);
  return {
    blocks: getMultiSelectedBlocks()
  };
})(MultiSelectionInspector);
//# sourceMappingURL=index.js.map