: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
function useAutoFocusOnHide(_a) {
} = _b, props = __objRest(_b, [
const [autoFocusOnHide, setAutoFocusOnHide] = (0,external_React_.useState)(false);
const mounted = store.useState("mounted");
(0,external_React_.useEffect)(() => {
setAutoFocusOnHide(false);
const onFocusProp = props.onFocus;
const onFocus = useEvent((event) => {
onFocusProp == null ? void 0 : onFocusProp(event);
if (event.defaultPrevented)
setAutoFocusOnHide(true);
const finalFocusRef = (0,external_React_.useRef)(null);
(0,external_React_.useEffect)(() => {
return sync(store, ["anchorElement"], (state) => {
finalFocusRef.current = state.anchorElement;
props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({
finalFocus: finalFocusRef
var NestedHovercardContext = (0,external_React_.createContext)(null);
var useHovercard = createHook(
hideOnHoverOutside = true,
disablePointerEventsOnApproach = !!hideOnHoverOutside
} = _b, props = __objRest(_b, [
"disablePointerEventsOnApproach"
const context = useHovercardProviderContext();
store = store || context;
const ref = (0,external_React_.useRef)(null);
const [nestedHovercards, setNestedHovercards] = (0,external_React_.useState)([]);
const hideTimeoutRef = (0,external_React_.useRef)(0);
const enterPointRef = (0,external_React_.useRef)(null);
const { portalRef, domReady } = usePortalRef(portal, props.portalRef);
const mayHideOnHoverOutside = !!hideOnHoverOutside;
const hideOnHoverOutsideProp = useBooleanEvent(hideOnHoverOutside);
const mayDisablePointerEvents = !!disablePointerEventsOnApproach;
const disablePointerEventsProp = useBooleanEvent(
disablePointerEventsOnApproach
const open = store.useState("open");
const mounted = store.useState("mounted");
(0,external_React_.useEffect)(() => {
if (!mayHideOnHoverOutside && !mayDisablePointerEvents)
const element = ref.current;
const onMouseMove = (event) => {
const { anchorElement, hideTimeout, timeout } = store.getState();
const enterPoint = enterPointRef.current;
const [target] = event.composedPath();
const anchor = anchorElement;
if (isMovingOnHovercard(target, element, anchor, nestedHovercards)) {
enterPointRef.current = target && anchor && contains(anchor, target) ? getEventPoint(event) : null;
window.clearTimeout(hideTimeoutRef.current);
hideTimeoutRef.current = 0;
if (hideTimeoutRef.current)
const currentPoint = getEventPoint(event);
const polygon = getElementPolygon(element, enterPoint);
if (isPointInPolygon(currentPoint, polygon)) {
enterPointRef.current = currentPoint;
if (!disablePointerEventsProp(event))
if (!hideOnHoverOutsideProp(event))
hideTimeoutRef.current = window.setTimeout(() => {
hideTimeoutRef.current = 0;
store == null ? void 0 : store.hide();
}, hideTimeout != null ? hideTimeout : timeout);
addGlobalEventListener("mousemove", onMouseMove, true),
() => clearTimeout(hideTimeoutRef.current)
disablePointerEventsProp,
(0,external_React_.useEffect)(() => {
if (!mayDisablePointerEvents)
const disableEvent = (event) => {
const element = ref.current;
const enterPoint = enterPointRef.current;
const polygon = getElementPolygon(element, enterPoint);
if (isPointInPolygon(getEventPoint(event), polygon)) {
if (!disablePointerEventsProp(event))
// Note: we may need to add pointer events here in the future.
addGlobalEventListener("mouseenter", disableEvent, true),
addGlobalEventListener("mouseover", disableEvent, true),
addGlobalEventListener("mouseout", disableEvent, true),
addGlobalEventListener("mouseleave", disableEvent, true)
}, [domReady, mounted, mayDisablePointerEvents, disablePointerEventsProp]);
(0,external_React_.useEffect)(() => {
store == null ? void 0 : store.setAutoFocusOnShow(false);
}, [store, domReady, open]);
const openRef = useLiveRef(open);
(0,external_React_.useEffect)(() => {
store == null ? void 0 : store.setAutoFocusOnShow(false);
const registerOnParent = (0,external_React_.useContext)(NestedHovercardContext);
useSafeLayoutEffect(() => {
const element = ref.current;
return registerOnParent == null ? void 0 : registerOnParent(element);
}, [modal, portal, mounted, domReady]);
const registerNestedHovercard = (0,external_React_.useCallback)(
setNestedHovercards((prevElements) => [...prevElements, element]);
const parentUnregister = registerOnParent == null ? void 0 : registerOnParent(element);
(prevElements) => prevElements.filter((item) => item !== element)
parentUnregister == null ? void 0 : parentUnregister();
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HovercardScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(NestedHovercardContext.Provider, { value: registerNestedHovercard, children: element }) }),
[store, registerNestedHovercard]
props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), {
ref: useMergeRefs(ref, props.ref)
props = useAutoFocusOnHide(_4R3V3JGP_spreadValues({ store }, props));
const autoFocusOnShow = store.useState(
(state) => modal || state.autoFocusOnShow
props = usePopover(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({
if (isFalsyBooleanCallback(hideOnEscape, event))
requestAnimationFrame(() => {
requestAnimationFrame(() => {
store == null ? void 0 : store.hide();
var Hovercard = createDialogComponent(
createComponent((props) => {
const htmlProps = useHovercard(props);
return _3ORBWXWF_createElement("div", htmlProps);
useHovercardProviderContext
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tooltip/tooltip.js
// src/tooltip/tooltip.tsx
var useTooltip = createHook(
preserveTabOrder = false,
hideOnHoverOutside = true,
hideOnInteractOutside = true
} = _b, props = __objRest(_b, [
const context = useTooltipProviderContext();
store = store || context;
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(TooltipScopedContextProvider, { value: store, children: element }),
const role = store.useState(
(state) => state.type === "description" ? "tooltip" : "none"
props = _4R3V3JGP_spreadValues({ role }, props);
props = useHovercard(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), {
hideOnHoverOutside: (event) => {
if (isFalsyBooleanCallback(hideOnHoverOutside, event))
const anchorElement = store == null ? void 0 : store.getState().anchorElement;
if ("focusVisible" in anchorElement.dataset)
hideOnInteractOutside: (event) => {
if (isFalsyBooleanCallback(hideOnInteractOutside, event))
const anchorElement = store == null ? void 0 : store.getState().anchorElement;
if (contains(anchorElement, event.target))
var Tooltip = createDialogComponent(
createComponent((props) => {
const htmlProps = useTooltip(props);
return _3ORBWXWF_createElement("div", htmlProps);
useTooltipProviderContext
;// CONCATENATED MODULE: external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// CONCATENATED MODULE: external ["wp","deprecated"]
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/shortcut/index.js
* Shortcut component is used to display keyboard shortcuts, and it can be customized with a custom display and aria label if needed.
* import { Shortcut } from '@wordpress/components';
* const MyShortcut = () => {
* <Shortcut shortcut={{ display: 'Ctrl + S', ariaLabel: 'Save' }} />
function Shortcut(props) {
if (typeof shortcut === 'string') {
if (shortcut !== null && typeof shortcut === 'object') {
displayText = shortcut.display;
ariaLabel = shortcut.ariaLabel;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
/* harmony default export */ const build_module_shortcut = (Shortcut);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/utils.js
// eslint-disable-next-line no-restricted-imports
const POSITION_TO_PLACEMENT = {
'bottom left': 'bottom-end',
'bottom center': 'bottom',
'bottom right': 'bottom-start',
'top right': 'top-start',
'middle left left': 'left',
'middle left right': 'left',
'middle left bottom': 'left-end',
'middle left top': 'left-start',
'middle right left': 'right',
'middle right right': 'right',
'middle right bottom': 'right-end',
'middle right top': 'right-start',
'bottom left left': 'bottom-end',
'bottom left right': 'bottom-end',
'bottom left bottom': 'bottom-end',
'bottom left top': 'bottom-end',
'bottom center left': 'bottom',
'bottom center right': 'bottom',
'bottom center bottom': 'bottom',
'bottom center top': 'bottom',
'bottom right left': 'bottom-start',
'bottom right right': 'bottom-start',
'bottom right bottom': 'bottom-start',
'bottom right top': 'bottom-start',
'top left left': 'top-end',
'top left right': 'top-end',
'top left bottom': 'top-end',
'top left top': 'top-end',
'top center left': 'top',
'top center right': 'top',
'top center bottom': 'top',
'top right left': 'top-start',
'top right right': 'top-start',
'top right bottom': 'top-start',
'top right top': 'top-start',
// `middle`/`middle center [corner?]` positions are associated to a fallback
// `bottom` placement because there aren't any corresponding placement values.
'middle center': 'bottom',
'middle center bottom': 'bottom',
'middle center left': 'bottom',
'middle center right': 'bottom',
'middle center top': 'bottom'
* Converts the `Popover`'s legacy "position" prop to the new "placement" prop
* (used by `floating-ui`).
* @param position The legacy position
* @return The corresponding placement
const positionToPlacement = position => {
var _POSITION_TO_PLACEMEN;
return (_POSITION_TO_PLACEMEN = POSITION_TO_PLACEMENT[position]) !== null && _POSITION_TO_PLACEMEN !== void 0 ? _POSITION_TO_PLACEMEN : 'bottom';
* @typedef AnimationOrigin
* @property {number} originX A number between 0 and 1 (in CSS logical properties jargon, 0 is "start", 0.5 is "center", and 1 is "end")
* @property {number} originY A number between 0 and 1 (0 is top, 0.5 is center, and 1 is bottom)
const PLACEMENT_TO_ANIMATION_ORIGIN = {