: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// @see packages/block-editor/src/components/inserter/search-items.js
const normalizeInput = input => remove_accents_default()(input).replace(/^\//, '').toLowerCase();
const normalizedSearch = (title, search) => -1 !== normalizeInput(title).indexOf(normalizeInput(search));
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/use-navigation-tree-item.js
const useNavigationTreeItem = (itemId, props) => {
} = useNavigationContext();
} = useNavigationGroupContext();
} = useNavigationMenuContext();
(0,external_wp_element_namespaceObject.useEffect)(() => {
const isMenuActive = activeMenu === menu;
const isItemVisible = !search || props.title !== undefined && normalizedSearch(props.title, search);
_isVisible: isMenuActive && isItemVisible
// Ignore exhaustive-deps rule for now. See https://github.com/WordPress/gutenberg/pull/41639
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [activeMenu, search]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/base.js
function NavigationItemBase(props) {
// Also avoid to pass the `title` and `href` props to the ItemBaseUI styled component.
const [itemId] = (0,external_wp_element_namespaceObject.useState)(`item-${++base_uniqueId}`);
useNavigationTreeItem(itemId, props);
} = useNavigationContext();
if (!navigationTree.getItem(itemId)?._isVisible) {
const classes = dist_clsx('components-navigation__item', className);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemBaseUI, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/item/index.js
const item_noop = () => {};
* @deprecated Use `Navigator` instead.
function NavigationItem(props) {
} = useNavigationContext();
// If hideIfTargetMenuEmpty prop is true
// And the menu we are supposed to navigate to
// Is marked as empty, then we skip rendering the item.
if (hideIfTargetMenuEmpty && navigateToMenu && isMenuEmpty(navigateToMenu)) {
const isActive = item && activeItem === item;
const classes = dist_clsx(className, {
const onItemClick = event => {
setActiveMenu(navigateToMenu);
const navigationIcon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right;
const baseProps = children ? props : {
const itemProps = isText ? restProps : {
'aria-current': isActive ? 'page' : undefined,
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationItemBase, {
children: children || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ItemUI, {
children: [icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemIconUI, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_build_module_icon, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationItemBaseContent, {
}), navigateToMenu && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_build_module_icon, {
/* harmony default export */ const navigation_item = (NavigationItem);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/use-navigation-tree-menu.js
const useNavigationTreeMenu = props => {
} = useNavigationContext();
const key = props.menu || ROOT_MENU;
(0,external_wp_element_namespaceObject.useEffect)(() => {
// Ignore exhaustive-deps rule for now. See https://github.com/WordPress/gutenberg/pull/44090
// eslint-disable-next-line react-hooks/exhaustive-deps
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js
const search = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"
/* harmony default export */ const library_search = (search);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js
/** @typedef {import('react').ComponentType} ComponentType */
* A Higher Order Component used to be provide speak and debounced speak
* @see https://developer.wordpress.org/block-editor/packages/packages-a11y/#speak
* @param {ComponentType} Component The component to be wrapped.
* @return {ComponentType} The wrapped component.
/* harmony default export */ const with_spoken_messages = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)(Component => props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, {
speak: external_wp_a11y_namespaceObject.speak,
debouncedSpeak: (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500)
}), 'withSpokenMessages'));
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/search-control/styles.js
return space(size === 'compact' ? 1 : 2);
const SuffixItemWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? {
} : 0)("display:flex;padding-inline-end:", inlinePadding, ";svg{fill:currentColor;}" + ( true ? "" : 0));
const StyledInputControl = /*#__PURE__*/emotion_styled_base_browser_esm(input_control, true ? {
} : 0)("input[type='search']{&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{-webkit-appearance:none;}}&:not( :focus-within ){--wp-components-color-background:", COLORS.theme.gray[100], ";}" + ( true ? "" : 0));
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/search-control/index.js
if (!onClose && !value) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_build_module_icon, {
searchRef.current?.focus();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_button, {
label: onClose ? (0,external_wp_i18n_namespaceObject.__)('Close search') : (0,external_wp_i18n_namespaceObject.__)('Reset search'),
onClick: onClose !== null && onClose !== void 0 ? onClose : onReset
function UnforwardedSearchControl({
__nextHasNoMarginBottom = false,
label = (0,external_wp_i18n_namespaceObject.__)('Search'),
placeholder = (0,external_wp_i18n_namespaceObject.__)('Search'),
hideLabelFromVision = true,
// @ts-expect-error The `disabled` prop is not yet supported in the SearchControl component.
// Work with the design team (@WordPress/gutenberg-design) if you need this feature.
delete restProps.disabled;
const searchRef = (0,external_wp_element_namespaceObject.useRef)(null);
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(SearchControl, 'components-search-control');
const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
// Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system
// to provide backwards compatibile margin for SearchControl.
// (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.)
// `isBorderless` is still experimental and not a public prop for InputControl yet.
}), [__nextHasNoMarginBottom]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContextSystemProvider, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StyledInputControl, {
__next40pxDefaultSize: true,
hideLabelFromVision: hideLabelFromVision,
ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([searchRef, forwardedRef]),
className: dist_clsx('components-search-control', className),
onChange: nextValue => onChange(nextValue !== null && nextValue !== void 0 ? nextValue : ''),
placeholder: placeholder,
value: value !== null && value !== void 0 ? value : '',
suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SuffixItemWrapper, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SuffixItem, {
* SearchControl components let users display a search control.
* import { SearchControl } from '@wordpress/components';
* import { useState } from '@wordpress/element';
* function MySearchControl( { className, setState } ) {
* const [ searchInput, setSearchInput ] = useState( '' );
* __nextHasNoMarginBottom
* onChange={ setSearchInput }
const SearchControl = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedSearchControl);
/* harmony default export */ const search_control = (SearchControl);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title-search.js
function MenuTitleSearch({
} = useNavigationContext();
} = useNavigationMenuContext();
const inputRef = (0,external_wp_element_namespaceObject.useRef)(null);
// Wait for the slide-in animation to complete before autofocusing the input.
// This prevents scrolling to the input during the animation.
(0,external_wp_element_namespaceObject.useEffect)(() => {
const delayedFocus = setTimeout(() => {
inputRef.current?.focus();
clearTimeout(delayedFocus);
(0,external_wp_element_namespaceObject.useEffect)(() => {
const count = Object.values(items).filter(item => item._isVisible).length;
const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %d: number of results. */
(0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', count), count);
debouncedSpeak(resultsFoundMessage);
// Ignore exhaustive-deps rule for now. See https://github.com/WordPress/gutenberg/pull/44090
// eslint-disable-next-line react-hooks/exhaustive-deps
const onKeyDown = event => {
if (event.code === 'Escape' && !event.defaultPrevented) {
const inputId = `components-navigation__menu-title-search-${menu}`;
const placeholder = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: placeholder for menu search box. %s: menu title */
(0,external_wp_i18n_namespaceObject.__)('Search %s'), title?.toLowerCase()).trim();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MenuTitleSearchControlWrapper, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(search_control, {
__nextHasNoMarginBottom: true,
className: "components-navigation__menu-search-input",
onChange: value => onSearch?.(value),
placeholder: placeholder,
/* harmony default export */ const menu_title_search = (with_spoken_messages(MenuTitleSearch));
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigation/menu/menu-title.js