: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Dispatches a control action for triggering a synchronous registry select.
* Note: This control synchronously returns the current selector value, triggering the
* resolution, but not waiting for it.
* @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
* @param {string} selectorName The name of the selector.
* @param {Array} args Arguments for the selector.
* import { controls } from '@wordpress/data';
* // Action generator using `select`.
* export function* myAction() {
* const isEditorSideBarOpened = yield controls.select( 'core/edit-post', 'isEditorSideBarOpened' );
* // Do stuff with the result from the `select`.
* @return {Object} The control descriptor.
function controls_select(storeNameOrDescriptor, selectorName, ...args) {
storeKey: isObject(storeNameOrDescriptor) ? storeNameOrDescriptor.name : storeNameOrDescriptor,
* Dispatches a control action for triggering and resolving a registry select.
* Note: when this control action is handled, it automatically considers
* selectors that may have a resolver. In such case, it will return a `Promise` that resolves
* after the selector finishes resolving, with the final result value.
* @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
* @param {string} selectorName The name of the selector
* @param {Array} args Arguments for the selector.
* import { controls } from '@wordpress/data';
* // Action generator using resolveSelect
* export function* myAction() {
* const isSidebarOpened = yield controls.resolveSelect( 'core/edit-post', 'isEditorSideBarOpened' );
* // do stuff with the result from the select.
* @return {Object} The control descriptor.
function resolveSelect(storeNameOrDescriptor, selectorName, ...args) {
storeKey: isObject(storeNameOrDescriptor) ? storeNameOrDescriptor.name : storeNameOrDescriptor,
* Dispatches a control action for triggering a registry dispatch.
* @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
* @param {string} actionName The name of the action to dispatch
* @param {Array} args Arguments for the dispatch action.
* import { controls } from '@wordpress/data-controls';
* // Action generator using dispatch
* export function* myAction() {
* yield controls.dispatch( 'core/editor', 'togglePublishSidebar' );
* // do some other things.
* @return {Object} The control descriptor.
function dispatch(storeNameOrDescriptor, actionName, ...args) {
storeKey: isObject(storeNameOrDescriptor) ? storeNameOrDescriptor.name : storeNameOrDescriptor,
const builtinControls = {
[SELECT]: createRegistryControl(registry => ({
}) => registry.select(storeKey)[selectorName](...args)),
[RESOLVE_SELECT]: createRegistryControl(registry => ({
const method = registry.select(storeKey)[selectorName].hasResolver ? 'resolveSelect' : 'select';
return registry[method](storeKey)[selectorName](...args);
[DISPATCH]: createRegistryControl(registry => ({
}) => registry.dispatch(storeKey)[actionName](...args))
;// CONCATENATED MODULE: external ["wp","privateApis"]
const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/lock-unlock.js
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/data');
;// CONCATENATED MODULE: ./node_modules/is-promise/index.mjs
function isPromise(obj) {
return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/promise-middleware.js
* Simplest possible promise redux middleware.
* @type {import('redux').Middleware}
const promiseMiddleware = () => next => action => {
return action.then(resolvedAction => {
return next(resolvedAction);
/* harmony default export */ const promise_middleware = (promiseMiddleware);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js
/** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */
* Creates a middleware handling resolvers cache invalidation.
* @param {WPDataRegistry} registry Registry for which to create the middleware.
* @param {string} storeName Name of the store for which to create the middleware.
* @return {Function} Middleware function.
const createResolversCacheMiddleware = (registry, storeName) => () => next => action => {
const resolvers = registry.select(storeName).getCachedResolvers();
const resolverEntries = Object.entries(resolvers);
resolverEntries.forEach(([selectorName, resolversByArgs]) => {
const resolver = registry.stores[storeName]?.resolvers?.[selectorName];
if (!resolver || !resolver.shouldInvalidate) {
resolversByArgs.forEach((value, args) => {
// Works around a bug in `EquivalentKeyMap` where `map.delete` merely sets an entry value
// to `undefined` and `map.forEach` then iterates also over these orphaned entries.
if (value === undefined) {
// resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector.
// If the value is "finished" or "error" it means this resolver has finished its resolution which means we need
// to invalidate it, if it's true it means it's inflight and the invalidation is not necessary.
if (value.status !== 'finished' && value.status !== 'error') {
if (!resolver.shouldInvalidate(action, ...args)) {
// Trigger cache invalidation
registry.dispatch(storeName).invalidateResolution(selectorName, args);
/* harmony default export */ const resolvers_cache_middleware = (createResolversCacheMiddleware);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/thunk-middleware.js
function createThunkMiddleware(args) {
return () => next => action => {
if (typeof action === 'function') {
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/utils.js
* Higher-order reducer creator which creates a combined reducer object, keyed
* by a property on the action object.
* @param actionProperty Action property by which to key object.
* @return Higher-order reducer.
const onSubKey = actionProperty => reducer => (state = {}, action) => {
// Retrieve subkey from action. Do not track if undefined; useful for cases
// where reducer is scoped by action shape.
const key = action[actionProperty];
// Avoid updating state if unchanged. Note that this also accounts for a
// reducer which returns undefined on a key which is not yet tracked.
const nextKeyState = reducer(state[key], action);
if (nextKeyState === state[key]) {
* Normalize selector argument array by defaulting `undefined` value to an empty array
* and removing trailing `undefined` values.
* @param args Selector argument array
* @return Normalized state key array
function selectorArgsToStateKey(args) {
if (args === undefined || args === null) {
while (idx > 0 && args[idx - 1] === undefined) {
return idx === len ? args : args.slice(0, idx);
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/reducer.js
* Reducer function returning next state for selector resolution of
* selectorName -> EquivalentKeyMap<Array,boolean>
const subKeysIsResolved = onSubKey('selectorName')((state = new (equivalent_key_map_default())(), action) => {
const nextState = new (equivalent_key_map_default())(state);
nextState.set(selectorArgsToStateKey(action.args), {
case 'FINISH_RESOLUTION':
const nextState = new (equivalent_key_map_default())(state);
nextState.set(selectorArgsToStateKey(action.args), {
const nextState = new (equivalent_key_map_default())(state);
nextState.set(selectorArgsToStateKey(action.args), {
case 'START_RESOLUTIONS':
const nextState = new (equivalent_key_map_default())(state);
for (const resolutionArgs of action.args) {
nextState.set(selectorArgsToStateKey(resolutionArgs), {
case 'FINISH_RESOLUTIONS':
const nextState = new (equivalent_key_map_default())(state);
for (const resolutionArgs of action.args) {
nextState.set(selectorArgsToStateKey(resolutionArgs), {
const nextState = new (equivalent_key_map_default())(state);
action.args.forEach((resolutionArgs, idx) => {
const resolutionState = {
const error = action.errors[idx];
resolutionState.error = error;
nextState.set(selectorArgsToStateKey(resolutionArgs), resolutionState);
case 'INVALIDATE_RESOLUTION':
const nextState = new (equivalent_key_map_default())(state);
nextState.delete(selectorArgsToStateKey(action.args));
* Reducer function returning next state for selector resolution, object form:
* selectorName -> EquivalentKeyMap<Array, boolean>
* @param state Current state.
* @param action Dispatched action.
const isResolved = (state = {}, action) => {
case 'INVALIDATE_RESOLUTION_FOR_STORE':
case 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR':
if (action.selectorName in state) {
[action.selectorName]: removedSelector,
case 'FINISH_RESOLUTION':
case 'START_RESOLUTIONS':
case 'FINISH_RESOLUTIONS':
case 'INVALIDATE_RESOLUTION':
return subKeysIsResolved(state, action);
/* harmony default export */ const metadata_reducer = (isResolved);
;// CONCATENATED MODULE: ./node_modules/rememo/rememo.js
/** @typedef {(...args: any[]) => *[]} GetDependants */
/** @typedef {() => void} Clear */
* getDependants: GetDependants,
* @property {?CacheNode|undefined} [prev] Previous node.
* @property {?CacheNode|undefined} [next] Next node.
* @property {*[]} args Function arguments for cache entry.
* @property {*} val Function result.
* @property {Clear} clear Function to clear cache.
* @property {boolean} [isUniqueByDependants] Whether dependants are valid in
* considering cache uniqueness. A cache is unique if dependents are all arrays
* @property {CacheNode?} [head] Cache head.
* @property {*[]} [lastDependants] Dependants from previous invocation.
* Arbitrary value used as key for referencing cache object in WeakMap tree.
* Returns the first argument as the sole entry in an array.
* @param {T} value Value to return.
* @return {[T]} Value returned as entry in array.
function arrayOf(value) {
* Returns true if the value passed is object-like, or false otherwise. A value
* is object-like if it can support property assignment, e.g. object or array.
* @param {*} value Value to test.
* @return {boolean} Whether value is object-like.
function isObjectLike(value) {
return !!value && 'object' === typeof value;
* Creates and returns a new cache object.
* @return {Cache} Cache object.
* Returns true if entries within the two arrays are strictly equal by
* reference from a starting index.
* @param {*[]} a First array.
* @param {*[]} b Second array.
* @param {number} fromIndex Index from which to start comparison.
* @return {boolean} Whether arrays are shallowly equal.
function isShallowEqual(a, b, fromIndex) {
if (a.length !== b.length) {
for (i = fromIndex; i < a.length; i++) {