: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/******/ (() => { // webpackBootstrap
/******/ // The require scope
/******/ var __webpack_require__ = {};
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ __webpack_require__.d(getter, { a: getter });
/******/ /* webpack/runtime/define property getters */
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ /* webpack/runtime/make namespace object */
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/************************************************************************/
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
store: () => (/* reexport */ store)
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js
var selectors_namespaceObject = {};
__webpack_require__.r(selectors_namespaceObject);
__webpack_require__.d(selectors_namespaceObject, {
getDownloadableBlocks: () => (getDownloadableBlocks),
getErrorNoticeForBlock: () => (getErrorNoticeForBlock),
getErrorNotices: () => (getErrorNotices),
getInstalledBlockTypes: () => (getInstalledBlockTypes),
getNewBlockTypes: () => (getNewBlockTypes),
getUnusedBlockTypes: () => (getUnusedBlockTypes),
isInstalling: () => (isInstalling),
isRequestingDownloadableBlocks: () => (isRequestingDownloadableBlocks)
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/actions.js
var actions_namespaceObject = {};
__webpack_require__.r(actions_namespaceObject);
__webpack_require__.d(actions_namespaceObject, {
addInstalledBlockType: () => (addInstalledBlockType),
clearErrorNotice: () => (clearErrorNotice),
fetchDownloadableBlocks: () => (fetchDownloadableBlocks),
installBlockType: () => (installBlockType),
receiveDownloadableBlocks: () => (receiveDownloadableBlocks),
removeInstalledBlockType: () => (removeInstalledBlockType),
setErrorNotice: () => (setErrorNotice),
setIsInstalling: () => (setIsInstalling),
uninstallBlockType: () => (uninstallBlockType)
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-directory/build-module/store/resolvers.js
var resolvers_namespaceObject = {};
__webpack_require__.r(resolvers_namespaceObject);
__webpack_require__.d(resolvers_namespaceObject, {
getDownloadableBlocks: () => (resolvers_getDownloadableBlocks)
;// CONCATENATED MODULE: external ["wp","plugins"]
const external_wp_plugins_namespaceObject = window["wp"]["plugins"];
;// CONCATENATED MODULE: external ["wp","hooks"]
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
;// CONCATENATED MODULE: external ["wp","blocks"]
const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
;// CONCATENATED MODULE: external ["wp","data"]
const external_wp_data_namespaceObject = window["wp"]["data"];
;// CONCATENATED MODULE: external ["wp","element"]
const external_wp_element_namespaceObject = window["wp"]["element"];
;// CONCATENATED MODULE: external ["wp","editor"]
const external_wp_editor_namespaceObject = window["wp"]["editor"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/reducer.js
* Reducer returning an array of downloadable blocks.
* @param {Object} state Current state.
* @param {Object} action Dispatched action.
* @return {Object} Updated state.
const downloadableBlocks = (state = {}, action) => {
case 'FETCH_DOWNLOADABLE_BLOCKS':
case 'RECEIVE_DOWNLOADABLE_BLOCKS':
results: action.downloadableBlocks,
* Reducer managing the installation and deletion of blocks.
* @param {Object} state Current state.
* @param {Object} action Dispatched action.
* @return {Object} Updated state.
const blockManagement = (state = {
case 'ADD_INSTALLED_BLOCK_TYPE':
installedBlockTypes: [...state.installedBlockTypes, action.item]
case 'REMOVE_INSTALLED_BLOCK_TYPE':
installedBlockTypes: state.installedBlockTypes.filter(blockType => blockType.name !== action.item.name)
case 'SET_INSTALLING_BLOCK':
[action.blockId]: action.isInstalling
* Reducer returning an object of error notices.
* @param {Object} state Current state.
* @param {Object} action Dispatched action.
* @return {Object} Updated state.
const errorNotices = (state = {}, action) => {
case 'CLEAR_ERROR_NOTICE':
[action.blockId]: blockId,
/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
;// CONCATENATED MODULE: external ["wp","blockEditor"]
const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/has-block-type.js
* Check if a block list contains a specific block type. Recursively searches
* through `innerBlocks` if they exist.
* @param {Object} blockType A block object to search for.
* @param {Object[]} blocks The list of blocks to look through.
* @return {boolean} Whether the blockType is found.
function hasBlockType(blockType, blocks = []) {
}) => name === blockType.name)) {
for (let i = 0; i < blocks.length; i++) {
if (hasBlockType(blockType, blocks[i].innerBlocks)) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/selectors.js
* Returns true if application is requesting for downloadable blocks.
* @param {Object} state Global application state.
* @param {string} filterValue Search string.
* @return {boolean} Whether a request is in progress for the blocks list.
function isRequestingDownloadableBlocks(state, filterValue) {
var _state$downloadableBl;
return (_state$downloadableBl = state.downloadableBlocks[filterValue]?.isRequesting) !== null && _state$downloadableBl !== void 0 ? _state$downloadableBl : false;
* Returns the available uninstalled blocks.
* @param {Object} state Global application state.
* @param {string} filterValue Search string.
* @return {Array} Downloadable blocks.
function getDownloadableBlocks(state, filterValue) {
var _state$downloadableBl2;
return (_state$downloadableBl2 = state.downloadableBlocks[filterValue]?.results) !== null && _state$downloadableBl2 !== void 0 ? _state$downloadableBl2 : [];
* Returns the block types that have been installed on the server in this
* @param {Object} state Global application state.
* @return {Array} Block type items
function getInstalledBlockTypes(state) {
return state.blockManagement.installedBlockTypes;
* Returns block types that have been installed on the server and used in the
* @param {Object} state Global application state.
* @return {Array} Block type items.
const getNewBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
const usedBlockTree = select(external_wp_blockEditor_namespaceObject.store).getBlocks();
const installedBlockTypes = getInstalledBlockTypes(state);
return installedBlockTypes.filter(blockType => hasBlockType(blockType, usedBlockTree));
* Returns the block types that have been installed on the server but are not
* used in the current post.
* @param {Object} state Global application state.
* @return {Array} Block type items.
const getUnusedBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => {
const usedBlockTree = select(external_wp_blockEditor_namespaceObject.store).getBlocks();
const installedBlockTypes = getInstalledBlockTypes(state);
return installedBlockTypes.filter(blockType => !hasBlockType(blockType, usedBlockTree));
* Returns true if a block plugin install is in progress.
* @param {Object} state Global application state.
* @param {string} blockId Id of the block.
* @return {boolean} Whether this block is currently being installed.
function isInstalling(state, blockId) {
return state.blockManagement.isInstalling[blockId] || false;
* Returns all block error notices.
* @param {Object} state Global application state.
* @return {Object} Object with error notices.
function getErrorNotices(state) {
return state.errorNotices;
* Returns the error notice for a given block.
* @param {Object} state Global application state.
* @param {string} blockId The ID of the block plugin. eg: my-block
* @return {string|boolean} The error text, or false if no error.
function getErrorNoticeForBlock(state, blockId) {
return state.errorNotices[blockId];
;// CONCATENATED MODULE: external ["wp","i18n"]
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
;// CONCATENATED MODULE: external ["wp","apiFetch"]
const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
;// CONCATENATED MODULE: external ["wp","notices"]
const external_wp_notices_namespaceObject = window["wp"]["notices"];
;// CONCATENATED MODULE: external ["wp","url"]
const external_wp_url_namespaceObject = window["wp"]["url"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/load-assets.js
* Load an asset for a block.
* This function returns a Promise that will resolve once the asset is loaded,
* or in the case of Stylesheets and Inline JavaScript, will resolve immediately.
* @param {HTMLElement} el A HTML Element asset to inject.
* @return {Promise} Promise which will resolve when the asset is loaded.
const loadAsset = el => {
return new Promise((resolve, reject) => {
* Reconstruct the passed element, this is required as inserting the Node directly
* won't always fire the required onload events, even if the asset wasn't already loaded.
const newNode = document.createElement(el.nodeName);
['id', 'rel', 'src', 'href', 'type'].forEach(attr => {
newNode[attr] = el[attr];
// Append inline <script> contents.
newNode.appendChild(document.createTextNode(el.innerHTML));
newNode.onload = () => resolve(true);
newNode.onerror = () => reject(new Error('Error loading asset.'));
document.body.appendChild(newNode);
// Resolve Stylesheets and Inline JavaScript immediately.
if ('link' === newNode.nodeName.toLowerCase() || 'script' === newNode.nodeName.toLowerCase() && !newNode.src) {
* Load the asset files for a block
async function loadAssets() {
* Fetch the current URL (post-new.php, or post.php?post=1&action=edit) and compare the
* JavaScript and CSS assets loaded between the pages. This imports the required assets
* for the block into the current page while not requiring that we know them up-front.
* In the future this can be improved by reliance upon block.json and/or a script-loader
const response = await external_wp_apiFetch_default()({
url: document.location.href,
const data = await response.text();
const doc = new window.DOMParser().parseFromString(data, 'text/html');
const newAssets = Array.from(doc.querySelectorAll('link[rel="stylesheet"],script')).filter(asset => asset.id && !document.getElementById(asset.id));
* Load each asset in order, as they may depend upon an earlier loaded script.
* Stylesheets and Inline Scripts will resolve immediately upon insertion.
for (const newAsset of newAssets) {
await loadAsset(newAsset);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/utils/get-plugin-url.js
* Get the plugin's direct API link out of a block-directory response.
* @param {Object} block The block object
* @return {string} The plugin URL, if exists.
function getPluginUrl(block) {
const link = block.links['wp:plugin'] || block.links.self;
if (link && link.length) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-directory/build-module/store/actions.js
* Returns an action object used in signalling that the downloadable blocks
* have been requested and are loading.
* @param {string} filterValue Search string.
* @return {Object} Action object.
function fetchDownloadableBlocks(filterValue) {
type: 'FETCH_DOWNLOADABLE_BLOCKS',
* Returns an action object used in signalling that the downloadable blocks
* @param {Array} downloadableBlocks Downloadable blocks.
* @param {string} filterValue Search string.
* @return {Object} Action object.
function receiveDownloadableBlocks(downloadableBlocks, filterValue) {
type: 'RECEIVE_DOWNLOADABLE_BLOCKS',
* Action triggered to install a block plugin.