"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.DefaultBlockAppender = void 0;
var _compose = require("@wordpress/compose");
var _data = require("@wordpress/data");
var _defaultBlockAppender = _interopRequireDefault(require("../default-block-appender"));
var _withClientId = _interopRequireDefault(require("./with-client-id"));
var _store = require("../../store");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const DefaultBlockAppender = ({
  clientId
}) => {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_defaultBlockAppender.default, {
    rootClientId: clientId
  });
};
exports.DefaultBlockAppender = DefaultBlockAppender;
var _default = exports.default = (0, _compose.compose)([_withClientId.default, (0, _data.withSelect)((select, {
  clientId
}) => {
  const {
    getBlockOrder
  } = select(_store.store);
  const blockClientIds = getBlockOrder(clientId);
  return {
    lastBlockClientId: blockClientIds[blockClientIds.length - 1]
  };
})])(DefaultBlockAppender);
//# sourceMappingURL=default-block-appender.js.map