"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _editor = require("@wordpress/editor");
var _data = require("@wordpress/data");
var _components = require("@wordpress/components");
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
var _jsxRuntime = require("react/jsx-runtime");
/**
 * Defines an extensibility slot for the Template sidebar.
 */

/**
 * WordPress dependencies
 */

const {
  Fill,
  Slot
} = (0, _components.createSlotFill)('PluginTemplateSettingPanel');
const PluginTemplateSettingPanel = ({
  children
}) => {
  (0, _deprecated.default)('wp.editSite.PluginTemplateSettingPanel', {
    since: '6.6',
    version: '6.8',
    alternative: 'wp.editor.PluginDocumentSettingPanel'
  });
  const isCurrentEntityTemplate = (0, _data.useSelect)(select => select(_editor.store).getCurrentPostType() === 'wp_template', []);
  if (!isCurrentEntityTemplate) {
    return null;
  }
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Fill, {
    children: children
  });
};
PluginTemplateSettingPanel.Slot = Slot;

/**
 * Renders items in the Template Sidebar below the main information
 * like the Template Card.
 *
 * @deprecated since 6.6. Use `wp.editor.PluginDocumentSettingPanel` instead.
 *
 * @example
 * ```jsx
 * // Using ESNext syntax
 * import { PluginTemplateSettingPanel } from '@wordpress/edit-site';
 *
 * const MyTemplateSettingTest = () => (
 * 		<PluginTemplateSettingPanel>
 *			<p>Hello, World!</p>
 *		</PluginTemplateSettingPanel>
 *	);
 * ```
 *
 * @return {Component} The component to be rendered.
 */
var _default = exports.default = PluginTemplateSettingPanel;
//# sourceMappingURL=index.js.map