this["wp"] = this["wp"] || {}; this["wp"]["serverSideRender"] =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "4dqW");
/************************************************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["data"]; }());
/***/ (function(module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__("wx14");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__("rePB");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
var objectWithoutProperties = __webpack_require__("Ff2n");
// EXTERNAL MODULE: external ["wp","element"]
var external_wp_element_ = __webpack_require__("GRId");
// EXTERNAL MODULE: external ["wp","data"]
var external_wp_data_ = __webpack_require__("1ZqX");
// EXTERNAL MODULE: external ["wp","deprecated"]
var external_wp_deprecated_ = __webpack_require__("NMb1");
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
var classCallCheck = __webpack_require__("1OyB");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
var createClass = __webpack_require__("vuIU");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
var inherits = __webpack_require__("Ji7U");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
var possibleConstructorReturn = __webpack_require__("md7G");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
var getPrototypeOf = __webpack_require__("foSv");
// EXTERNAL MODULE: external "lodash"
var external_lodash_ = __webpack_require__("YLtl");
// EXTERNAL MODULE: external ["wp","i18n"]
var external_wp_i18n_ = __webpack_require__("l3Sj");
// EXTERNAL MODULE: external ["wp","apiFetch"]
var external_wp_apiFetch_ = __webpack_require__("ywyh");
var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_);
// EXTERNAL MODULE: external ["wp","url"]
var external_wp_url_ = __webpack_require__("Mmq9");
// EXTERNAL MODULE: external ["wp","components"]
var external_wp_components_ = __webpack_require__("tI+e");
// CONCATENATED MODULE: ./node_modules/@wordpress/server-side-render/build-module/server-side-render.js
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function rendererPath(block) {
var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var urlQueryArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
return Object(external_wp_url_["addQueryArgs"])("/wp/v2/block-renderer/".concat(block), _objectSpread(_objectSpread({
}, null !== attributes ? {
var server_side_render_ServerSideRender = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(ServerSideRender, _Component);
var _super = _createSuper(ServerSideRender);
function ServerSideRender(props) {
Object(classCallCheck["a" /* default */])(this, ServerSideRender);
_this = _super.call(this, props);
Object(createClass["a" /* default */])(ServerSideRender, [{
key: "componentDidMount",
value: function componentDidMount() {
this.isStillMounted = true;
this.fetch(this.props); // Only debounce once the initial fetch occurs to ensure that the first
// renders show data as soon as possible.
this.fetch = Object(external_lodash_["debounce"])(this.fetch, 500);
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.isStillMounted = false;
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
if (!Object(external_lodash_["isEqual"])(prevProps, this.props)) {
value: function fetch(props) {
if (!this.isStillMounted) {
if (null !== this.state.response) {
_props$attributes = props.attributes,
attributes = _props$attributes === void 0 ? null : _props$attributes,
_props$httpMethod = props.httpMethod,
httpMethod = _props$httpMethod === void 0 ? 'GET' : _props$httpMethod,
_props$urlQueryArgs = props.urlQueryArgs,
urlQueryArgs = _props$urlQueryArgs === void 0 ? {} : _props$urlQueryArgs; // If httpMethod is 'POST', send the attributes in the request body instead of the URL.
// This allows sending a larger attributes object than in a GET request, where the attributes are in the URL.
var isPostRequest = 'POST' === httpMethod;
var urlAttributes = isPostRequest ? null : attributes;
var path = rendererPath(block, urlAttributes, urlQueryArgs);
var data = isPostRequest ? {
} : null; // Store the latest fetch request so that when we process it, we can
// check if it is the current request, to avoid race conditions on slow networks.
var fetchRequest = this.currentFetchRequest = external_wp_apiFetch_default()({
method: isPostRequest ? 'POST' : 'GET'
}).then(function (response) {
if (_this2.isStillMounted && fetchRequest === _this2.currentFetchRequest && response) {
response: response.rendered
}).catch(function (error) {
if (_this2.isStillMounted && fetchRequest === _this2.currentFetchRequest) {
value: function render() {
var response = this.state.response;
var _this$props = this.props,
className = _this$props.className,
EmptyResponsePlaceholder = _this$props.EmptyResponsePlaceholder,
ErrorResponsePlaceholder = _this$props.ErrorResponsePlaceholder,
LoadingResponsePlaceholder = _this$props.LoadingResponsePlaceholder;
return Object(external_wp_element_["createElement"])(EmptyResponsePlaceholder, Object(esm_extends["a" /* default */])({
return Object(external_wp_element_["createElement"])(LoadingResponsePlaceholder, Object(esm_extends["a" /* default */])({
} else if (response.error) {
return Object(external_wp_element_["createElement"])(ErrorResponsePlaceholder, Object(esm_extends["a" /* default */])({
return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], {
}(external_wp_element_["Component"]);
server_side_render_ServerSideRender.defaultProps = {
EmptyResponsePlaceholder: function EmptyResponsePlaceholder(_ref) {
var className = _ref.className;
return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
}, Object(external_wp_i18n_["__"])('Block rendered as empty.'));
ErrorResponsePlaceholder: function ErrorResponsePlaceholder(_ref2) {
var response = _ref2.response,
className = _ref2.className;
var errorMessage = Object(external_wp_i18n_["sprintf"])( // translators: %s: error message describing the problem
Object(external_wp_i18n_["__"])('Error loading block: %s'), response.errorMsg);
return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
LoadingResponsePlaceholder: function LoadingResponsePlaceholder(_ref3) {
var className = _ref3.className;
return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
}, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null));
/* harmony default export */ var server_side_render = (server_side_render_ServerSideRender);
// CONCATENATED MODULE: ./node_modules/@wordpress/server-side-render/build-module/index.js
function build_module_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function build_module_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { build_module_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { build_module_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var ExportedServerSideRender = Object(external_wp_data_["withSelect"])(function (select) {
var coreEditorSelect = select('core/editor');
var currentPostId = coreEditorSelect.getCurrentPostId();
currentPostId: currentPostId
var _ref$urlQueryArgs = _ref.urlQueryArgs,
urlQueryArgs = _ref$urlQueryArgs === void 0 ? EMPTY_OBJECT : _ref$urlQueryArgs,
currentPostId = _ref.currentPostId,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["urlQueryArgs", "currentPostId"]);
var newUrlQueryArgs = Object(external_wp_element_["useMemo"])(function () {
return build_module_objectSpread({
}, [currentPostId, urlQueryArgs]);
return Object(external_wp_element_["createElement"])(server_side_render, Object(esm_extends["a" /* default */])({
urlQueryArgs: newUrlQueryArgs
if (window && window.wp && window.wp.components) {
window.wp.components.ServerSideRender = Object(external_wp_element_["forwardRef"])(function (props, ref) {
external_wp_deprecated_default()('wp.components.ServerSideRender', {
alternative: 'wp.serverSideRender'
return Object(external_wp_element_["createElement"])(ExportedServerSideRender, Object(esm_extends["a" /* default */])({}, props, {
/* harmony default export */ var build_module = __webpack_exports__["default"] = (ExportedServerSideRender);
/***/ (function(module, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _objectWithoutProperties; });
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var sourceKeys = Object.keys(source);
for (i = 0; i < sourceKeys.length; i++) {
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose(source, excluded);
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
/***/ (function(module, exports) {
(function() { module.exports = window["wp"]["element"]; }());
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
function _assertThisInitialized(self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");