[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> server-side-render.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["serverSideRender"] =
   2  /******/ (function(modules) { // webpackBootstrap
   3  /******/     // The module cache
   4  /******/     var installedModules = {};
   5  /******/
   6  /******/     // The require function
   7  /******/ 	function __webpack_require__(moduleId) {
   8  /******/
   9  /******/         // Check if module is in cache
  10  /******/         if(installedModules[moduleId]) {
  11  /******/             return installedModules[moduleId].exports;
  12  /******/         }
  13  /******/         // Create a new module (and put it into the cache)
  14  /******/         var module = installedModules[moduleId] = {
  15  /******/             i: moduleId,
  16  /******/             l: false,
  17  /******/             exports: {}
  18  /******/         };
  19  /******/
  20  /******/         // Execute the module function
  21  /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22  /******/
  23  /******/         // Flag the module as loaded
  24  /******/         module.l = true;
  25  /******/
  26  /******/         // Return the exports of the module
  27  /******/         return module.exports;
  28  /******/     }
  29  /******/
  30  /******/
  31  /******/     // expose the modules object (__webpack_modules__)
  32  /******/     __webpack_require__.m = modules;
  33  /******/
  34  /******/     // expose the module cache
  35  /******/     __webpack_require__.c = installedModules;
  36  /******/
  37  /******/     // define getter function for harmony exports
  38  /******/     __webpack_require__.d = function(exports, name, getter) {
  39  /******/         if(!__webpack_require__.o(exports, name)) {
  40  /******/             Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41  /******/         }
  42  /******/     };
  43  /******/
  44  /******/     // define __esModule on exports
  45  /******/     __webpack_require__.r = function(exports) {
  46  /******/         if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47  /******/             Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48  /******/         }
  49  /******/         Object.defineProperty(exports, '__esModule', { value: true });
  50  /******/     };
  51  /******/
  52  /******/     // create a fake namespace object
  53  /******/     // mode & 1: value is a module id, require it
  54  /******/     // mode & 2: merge all properties of value into the ns
  55  /******/     // mode & 4: return value when already ns object
  56  /******/     // mode & 8|1: behave like require
  57  /******/     __webpack_require__.t = function(value, mode) {
  58  /******/         if(mode & 1) value = __webpack_require__(value);
  59  /******/         if(mode & 8) return value;
  60  /******/         if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61  /******/         var ns = Object.create(null);
  62  /******/         __webpack_require__.r(ns);
  63  /******/         Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64  /******/         if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65  /******/         return ns;
  66  /******/     };
  67  /******/
  68  /******/     // getDefaultExport function for compatibility with non-harmony modules
  69  /******/     __webpack_require__.n = function(module) {
  70  /******/         var getter = module && module.__esModule ?
  71  /******/ 			function getDefault() { return module['default']; } :
  72  /******/ 			function getModuleExports() { return module; };
  73  /******/         __webpack_require__.d(getter, 'a', getter);
  74  /******/         return getter;
  75  /******/     };
  76  /******/
  77  /******/     // Object.prototype.hasOwnProperty.call
  78  /******/     __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79  /******/
  80  /******/     // __webpack_public_path__
  81  /******/     __webpack_require__.p = "";
  82  /******/
  83  /******/
  84  /******/     // Load entry module and return exports
  85  /******/     return __webpack_require__(__webpack_require__.s = 483);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 0:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = window["wp"]["element"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 1:
  98  /***/ (function(module, exports) {
  99  
 100  (function() { module.exports = window["wp"]["i18n"]; }());
 101  
 102  /***/ }),
 103  
 104  /***/ 11:
 105  /***/ (function(module, exports) {
 106  
 107  (function() { module.exports = window["wp"]["compose"]; }());
 108  
 109  /***/ }),
 110  
 111  /***/ 12:
 112  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 113  
 114  "use strict";
 115  
 116  // EXPORTS
 117  __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
 118  
 119  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
 120  var arrayWithHoles = __webpack_require__(38);
 121  
 122  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
 123  function _iterableToArrayLimit(arr, i) {
 124    var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
 125  
 126    if (_i == null) return;
 127    var _arr = [];
 128    var _n = true;
 129    var _d = false;
 130  
 131    var _s, _e;
 132  
 133    try {
 134      for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
 135        _arr.push(_s.value);
 136  
 137        if (i && _arr.length === i) break;
 138      }
 139    } catch (err) {
 140      _d = true;
 141      _e = err;
 142    } finally {
 143      try {
 144        if (!_n && _i["return"] != null) _i["return"]();
 145      } finally {
 146        if (_d) throw _e;
 147      }
 148    }
 149  
 150    return _arr;
 151  }
 152  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 153  var unsupportedIterableToArray = __webpack_require__(28);
 154  
 155  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
 156  var nonIterableRest = __webpack_require__(39);
 157  
 158  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
 159  
 160  
 161  
 162  
 163  function _slicedToArray(arr, i) {
 164    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
 165  }
 166  
 167  /***/ }),
 168  
 169  /***/ 14:
 170  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 171  
 172  "use strict";
 173  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
 174  /* harmony import */ var _objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(45);
 175  
 176  function _objectWithoutProperties(source, excluded) {
 177    if (source == null) return {};
 178    var target = Object(_objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
 179    var key, i;
 180  
 181    if (Object.getOwnPropertySymbols) {
 182      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
 183  
 184      for (i = 0; i < sourceSymbolKeys.length; i++) {
 185        key = sourceSymbolKeys[i];
 186        if (excluded.indexOf(key) >= 0) continue;
 187        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
 188        target[key] = source[key];
 189      }
 190    }
 191  
 192    return target;
 193  }
 194  
 195  /***/ }),
 196  
 197  /***/ 2:
 198  /***/ (function(module, exports) {
 199  
 200  (function() { module.exports = window["lodash"]; }());
 201  
 202  /***/ }),
 203  
 204  /***/ 24:
 205  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 206  
 207  "use strict";
 208  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
 209  function _arrayLikeToArray(arr, len) {
 210    if (len == null || len > arr.length) len = arr.length;
 211  
 212    for (var i = 0, arr2 = new Array(len); i < len; i++) {
 213      arr2[i] = arr[i];
 214    }
 215  
 216    return arr2;
 217  }
 218  
 219  /***/ }),
 220  
 221  /***/ 28:
 222  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 223  
 224  "use strict";
 225  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
 226  /* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
 227  
 228  function _unsupportedIterableToArray(o, minLen) {
 229    if (!o) return;
 230    if (typeof o === "string") return Object(_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 231    var n = Object.prototype.toString.call(o).slice(8, -1);
 232    if (n === "Object" && o.constructor) n = o.constructor.name;
 233    if (n === "Map" || n === "Set") return Array.from(o);
 234    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 235  }
 236  
 237  /***/ }),
 238  
 239  /***/ 29:
 240  /***/ (function(module, exports) {
 241  
 242  (function() { module.exports = window["wp"]["url"]; }());
 243  
 244  /***/ }),
 245  
 246  /***/ 3:
 247  /***/ (function(module, exports) {
 248  
 249  (function() { module.exports = window["wp"]["components"]; }());
 250  
 251  /***/ }),
 252  
 253  /***/ 35:
 254  /***/ (function(module, exports) {
 255  
 256  (function() { module.exports = window["wp"]["deprecated"]; }());
 257  
 258  /***/ }),
 259  
 260  /***/ 38:
 261  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 262  
 263  "use strict";
 264  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
 265  function _arrayWithHoles(arr) {
 266    if (Array.isArray(arr)) return arr;
 267  }
 268  
 269  /***/ }),
 270  
 271  /***/ 39:
 272  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 273  
 274  "use strict";
 275  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
 276  function _nonIterableRest() {
 277    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 278  }
 279  
 280  /***/ }),
 281  
 282  /***/ 4:
 283  /***/ (function(module, exports) {
 284  
 285  (function() { module.exports = window["wp"]["data"]; }());
 286  
 287  /***/ }),
 288  
 289  /***/ 45:
 290  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 291  
 292  "use strict";
 293  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
 294  function _objectWithoutPropertiesLoose(source, excluded) {
 295    if (source == null) return {};
 296    var target = {};
 297    var sourceKeys = Object.keys(source);
 298    var key, i;
 299  
 300    for (i = 0; i < sourceKeys.length; i++) {
 301      key = sourceKeys[i];
 302      if (excluded.indexOf(key) >= 0) continue;
 303      target[key] = source[key];
 304    }
 305  
 306    return target;
 307  }
 308  
 309  /***/ }),
 310  
 311  /***/ 483:
 312  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 313  
 314  "use strict";
 315  // ESM COMPAT FLAG
 316  __webpack_require__.r(__webpack_exports__);
 317  
 318  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
 319  var esm_extends = __webpack_require__(8);
 320  
 321  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
 322  var defineProperty = __webpack_require__(5);
 323  
 324  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
 325  var objectWithoutProperties = __webpack_require__(14);
 326  
 327  // EXTERNAL MODULE: external ["wp","element"]
 328  var external_wp_element_ = __webpack_require__(0);
 329  
 330  // EXTERNAL MODULE: external ["wp","data"]
 331  var external_wp_data_ = __webpack_require__(4);
 332  
 333  // EXTERNAL MODULE: external ["wp","deprecated"]
 334  var external_wp_deprecated_ = __webpack_require__(35);
 335  var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
 336  
 337  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
 338  var slicedToArray = __webpack_require__(12);
 339  
 340  // EXTERNAL MODULE: external "lodash"
 341  var external_lodash_ = __webpack_require__(2);
 342  
 343  // EXTERNAL MODULE: external ["wp","compose"]
 344  var external_wp_compose_ = __webpack_require__(11);
 345  
 346  // EXTERNAL MODULE: external ["wp","i18n"]
 347  var external_wp_i18n_ = __webpack_require__(1);
 348  
 349  // EXTERNAL MODULE: external ["wp","apiFetch"]
 350  var external_wp_apiFetch_ = __webpack_require__(50);
 351  var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_);
 352  
 353  // EXTERNAL MODULE: external ["wp","url"]
 354  var external_wp_url_ = __webpack_require__(29);
 355  
 356  // EXTERNAL MODULE: external ["wp","components"]
 357  var external_wp_components_ = __webpack_require__(3);
 358  
 359  // EXTERNAL MODULE: external ["wp","blocks"]
 360  var external_wp_blocks_ = __webpack_require__(9);
 361  
 362  // CONCATENATED MODULE: ./node_modules/@wordpress/server-side-render/build-module/server-side-render.js
 363  
 364  
 365  
 366  
 367  
 368  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; }
 369  
 370  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; }
 371  
 372  /**
 373   * External dependencies
 374   */
 375  
 376  /**
 377   * WordPress dependencies
 378   */
 379  
 380  
 381  
 382  
 383  
 384  
 385  
 386  
 387  function rendererPath(block) {
 388    var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
 389    var urlQueryArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
 390    return Object(external_wp_url_["addQueryArgs"])("/wp/v2/block-renderer/".concat(block), _objectSpread(_objectSpread({
 391      context: 'edit'
 392    }, null !== attributes ? {
 393      attributes: attributes
 394    } : {}), urlQueryArgs));
 395  }
 396  
 397  function DefaultEmptyResponsePlaceholder(_ref) {
 398    var className = _ref.className;
 399    return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
 400      className: className
 401    }, Object(external_wp_i18n_["__"])('Block rendered as empty.'));
 402  }
 403  
 404  function DefaultErrorResponsePlaceholder(_ref2) {
 405    var response = _ref2.response,
 406        className = _ref2.className;
 407    var errorMessage = Object(external_wp_i18n_["sprintf"])( // translators: %s: error message describing the problem
 408    Object(external_wp_i18n_["__"])('Error loading block: %s'), response.errorMsg);
 409    return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
 410      className: className
 411    }, errorMessage);
 412  }
 413  
 414  function DefaultLoadingResponsePlaceholder(_ref3) {
 415    var className = _ref3.className;
 416    return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
 417      className: className
 418    }, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null));
 419  }
 420  
 421  function ServerSideRender(props) {
 422    var attributes = props.attributes,
 423        block = props.block,
 424        className = props.className,
 425        _props$httpMethod = props.httpMethod,
 426        httpMethod = _props$httpMethod === void 0 ? 'GET' : _props$httpMethod,
 427        urlQueryArgs = props.urlQueryArgs,
 428        _props$EmptyResponseP = props.EmptyResponsePlaceholder,
 429        EmptyResponsePlaceholder = _props$EmptyResponseP === void 0 ? DefaultEmptyResponsePlaceholder : _props$EmptyResponseP,
 430        _props$ErrorResponseP = props.ErrorResponsePlaceholder,
 431        ErrorResponsePlaceholder = _props$ErrorResponseP === void 0 ? DefaultErrorResponsePlaceholder : _props$ErrorResponseP,
 432        _props$LoadingRespons = props.LoadingResponsePlaceholder,
 433        LoadingResponsePlaceholder = _props$LoadingRespons === void 0 ? DefaultLoadingResponsePlaceholder : _props$LoadingRespons;
 434    var isMountedRef = Object(external_wp_element_["useRef"])(true);
 435    var fetchRequestRef = Object(external_wp_element_["useRef"])();
 436  
 437    var _useState = Object(external_wp_element_["useState"])(null),
 438        _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
 439        response = _useState2[0],
 440        setResponse = _useState2[1];
 441  
 442    var prevProps = Object(external_wp_compose_["usePrevious"])(props);
 443  
 444    function fetchData() {
 445      if (!isMountedRef.current) {
 446        return;
 447      }
 448  
 449      if (null !== response) {
 450        setResponse(null);
 451      }
 452  
 453      var sanitizedAttributes = attributes && Object(external_wp_blocks_["__experimentalSanitizeBlockAttributes"])(block, attributes); // If httpMethod is 'POST', send the attributes in the request body instead of the URL.
 454      // This allows sending a larger attributes object than in a GET request, where the attributes are in the URL.
 455  
 456  
 457      var isPostRequest = 'POST' === httpMethod;
 458      var urlAttributes = isPostRequest ? null : sanitizedAttributes !== null && sanitizedAttributes !== void 0 ? sanitizedAttributes : null;
 459      var path = rendererPath(block, urlAttributes, urlQueryArgs);
 460      var data = isPostRequest ? {
 461        attributes: sanitizedAttributes !== null && sanitizedAttributes !== void 0 ? sanitizedAttributes : null
 462      } : null; // Store the latest fetch request so that when we process it, we can
 463      // check if it is the current request, to avoid race conditions on slow networks.
 464  
 465      var fetchRequest = fetchRequestRef.current = external_wp_apiFetch_default()({
 466        path: path,
 467        data: data,
 468        method: isPostRequest ? 'POST' : 'GET'
 469      }).then(function (fetchResponse) {
 470        if (isMountedRef.current && fetchRequest === fetchRequestRef.current && fetchResponse) {
 471          setResponse(fetchResponse.rendered);
 472        }
 473      }).catch(function (error) {
 474        if (isMountedRef.current && fetchRequest === fetchRequestRef.current) {
 475          setResponse({
 476            error: true,
 477            errorMsg: error.message
 478          });
 479        }
 480      });
 481      return fetchRequest;
 482    }
 483  
 484    var debouncedFetchData = Object(external_wp_compose_["useDebounce"])(fetchData, 500); // When the component unmounts, set isMountedRef to false. This will
 485    // let the async fetch callbacks know when to stop.
 486  
 487    Object(external_wp_element_["useEffect"])(function () {
 488      return function () {
 489        isMountedRef.current = false;
 490      };
 491    }, []);
 492    Object(external_wp_element_["useEffect"])(function () {
 493      // Don't debounce the first fetch. This ensures that the first render
 494      // shows data as soon as possible
 495      if (prevProps === undefined) {
 496        fetchData();
 497      } else if (!Object(external_lodash_["isEqual"])(prevProps, props)) {
 498        debouncedFetchData();
 499      }
 500    });
 501  
 502    if (response === '') {
 503      return Object(external_wp_element_["createElement"])(EmptyResponsePlaceholder, props);
 504    } else if (!response) {
 505      return Object(external_wp_element_["createElement"])(LoadingResponsePlaceholder, props);
 506    } else if (response.error) {
 507      return Object(external_wp_element_["createElement"])(ErrorResponsePlaceholder, Object(esm_extends["a" /* default */])({
 508        response: response
 509      }, props));
 510    }
 511  
 512    return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], {
 513      className: className
 514    }, response);
 515  }
 516  
 517  // CONCATENATED MODULE: ./node_modules/@wordpress/server-side-render/build-module/index.js
 518  
 519  
 520  
 521  
 522  
 523  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; }
 524  
 525  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; }
 526  
 527  /**
 528   * WordPress dependencies
 529   */
 530  
 531  
 532  
 533  /**
 534   * Internal dependencies
 535   */
 536  
 537  
 538  /**
 539   * Constants
 540   */
 541  
 542  var EMPTY_OBJECT = {};
 543  var ExportedServerSideRender = Object(external_wp_data_["withSelect"])(function (select) {
 544    var coreEditorSelect = select('core/editor');
 545  
 546    if (coreEditorSelect) {
 547      var currentPostId = coreEditorSelect.getCurrentPostId(); // For templates and template parts we use a custom ID format.
 548      // Since they aren't real posts, we don't want to use their ID
 549      // for server-side rendering. Since they use a string based ID,
 550      // we can assume real post IDs are numbers.
 551  
 552      if (currentPostId && typeof currentPostId.id === 'number') {
 553        return {
 554          currentPostId: currentPostId
 555        };
 556      }
 557    }
 558  
 559    return EMPTY_OBJECT;
 560  })(function (_ref) {
 561    var _ref$urlQueryArgs = _ref.urlQueryArgs,
 562        urlQueryArgs = _ref$urlQueryArgs === void 0 ? EMPTY_OBJECT : _ref$urlQueryArgs,
 563        currentPostId = _ref.currentPostId,
 564        props = Object(objectWithoutProperties["a" /* default */])(_ref, ["urlQueryArgs", "currentPostId"]);
 565  
 566    var newUrlQueryArgs = Object(external_wp_element_["useMemo"])(function () {
 567      if (!currentPostId) {
 568        return urlQueryArgs;
 569      }
 570  
 571      return build_module_objectSpread({
 572        post_id: currentPostId
 573      }, urlQueryArgs);
 574    }, [currentPostId, urlQueryArgs]);
 575    return Object(external_wp_element_["createElement"])(ServerSideRender, Object(esm_extends["a" /* default */])({
 576      urlQueryArgs: newUrlQueryArgs
 577    }, props));
 578  });
 579  
 580  if (window && window.wp && window.wp.components) {
 581    window.wp.components.ServerSideRender = Object(external_wp_element_["forwardRef"])(function (props, ref) {
 582      external_wp_deprecated_default()('wp.components.ServerSideRender', {
 583        since: '5.3',
 584        alternative: 'wp.serverSideRender'
 585      });
 586      return Object(external_wp_element_["createElement"])(ExportedServerSideRender, Object(esm_extends["a" /* default */])({}, props, {
 587        ref: ref
 588      }));
 589    });
 590  }
 591  
 592  /* harmony default export */ var build_module = __webpack_exports__["default"] = (ExportedServerSideRender);
 593  
 594  
 595  /***/ }),
 596  
 597  /***/ 5:
 598  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 599  
 600  "use strict";
 601  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
 602  function _defineProperty(obj, key, value) {
 603    if (key in obj) {
 604      Object.defineProperty(obj, key, {
 605        value: value,
 606        enumerable: true,
 607        configurable: true,
 608        writable: true
 609      });
 610    } else {
 611      obj[key] = value;
 612    }
 613  
 614    return obj;
 615  }
 616  
 617  /***/ }),
 618  
 619  /***/ 50:
 620  /***/ (function(module, exports) {
 621  
 622  (function() { module.exports = window["wp"]["apiFetch"]; }());
 623  
 624  /***/ }),
 625  
 626  /***/ 8:
 627  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 628  
 629  "use strict";
 630  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
 631  function _extends() {
 632    _extends = Object.assign || function (target) {
 633      for (var i = 1; i < arguments.length; i++) {
 634        var source = arguments[i];
 635  
 636        for (var key in source) {
 637          if (Object.prototype.hasOwnProperty.call(source, key)) {
 638            target[key] = source[key];
 639          }
 640        }
 641      }
 642  
 643      return target;
 644    };
 645  
 646    return _extends.apply(this, arguments);
 647  }
 648  
 649  /***/ }),
 650  
 651  /***/ 9:
 652  /***/ (function(module, exports) {
 653  
 654  (function() { module.exports = window["wp"]["blocks"]; }());
 655  
 656  /***/ })
 657  
 658  /******/ })["default"];


Generated: Thu May 13 01:00:05 2021 Cross-referenced by PHPXref 0.7.1