[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> element.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["element"] =
   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 = 437);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 18:
  91  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92  
  93  "use strict";
  94  
  95  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
  96  var arrayLikeToArray = __webpack_require__(25);
  97  
  98  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
  99  
 100  function _arrayWithoutHoles(arr) {
 101    if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
 102  }
 103  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 104  var iterableToArray = __webpack_require__(35);
 105  
 106  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 107  var unsupportedIterableToArray = __webpack_require__(27);
 108  
 109  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 110  function _nonIterableSpread() {
 111    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 112  }
 113  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 114  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
 115  
 116  
 117  
 118  
 119  function _toConsumableArray(arr) {
 120    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 121  }
 122  
 123  /***/ }),
 124  
 125  /***/ 19:
 126  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 127  
 128  "use strict";
 129  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
 130  /* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43);
 131  
 132  function _objectWithoutProperties(source, excluded) {
 133    if (source == null) return {};
 134    var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
 135    var key, i;
 136  
 137    if (Object.getOwnPropertySymbols) {
 138      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
 139  
 140      for (i = 0; i < sourceSymbolKeys.length; i++) {
 141        key = sourceSymbolKeys[i];
 142        if (excluded.indexOf(key) >= 0) continue;
 143        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
 144        target[key] = source[key];
 145      }
 146    }
 147  
 148    return target;
 149  }
 150  
 151  /***/ }),
 152  
 153  /***/ 2:
 154  /***/ (function(module, exports) {
 155  
 156  (function() { module.exports = this["lodash"]; }());
 157  
 158  /***/ }),
 159  
 160  /***/ 20:
 161  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 162  
 163  "use strict";
 164  
 165  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
 166  var arrayWithHoles = __webpack_require__(38);
 167  
 168  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
 169  function _iterableToArrayLimit(arr, i) {
 170    if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
 171    var _arr = [];
 172    var _n = true;
 173    var _d = false;
 174    var _e = undefined;
 175  
 176    try {
 177      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
 178        _arr.push(_s.value);
 179  
 180        if (i && _arr.length === i) break;
 181      }
 182    } catch (err) {
 183      _d = true;
 184      _e = err;
 185    } finally {
 186      try {
 187        if (!_n && _i["return"] != null) _i["return"]();
 188      } finally {
 189        if (_d) throw _e;
 190      }
 191    }
 192  
 193    return _arr;
 194  }
 195  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 196  var unsupportedIterableToArray = __webpack_require__(27);
 197  
 198  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
 199  var nonIterableRest = __webpack_require__(39);
 200  
 201  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
 202  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; });
 203  
 204  
 205  
 206  
 207  function _slicedToArray(arr, i) {
 208    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
 209  }
 210  
 211  /***/ }),
 212  
 213  /***/ 21:
 214  /***/ (function(module, exports) {
 215  
 216  (function() { module.exports = this["React"]; }());
 217  
 218  /***/ }),
 219  
 220  /***/ 25:
 221  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 222  
 223  "use strict";
 224  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
 225  function _arrayLikeToArray(arr, len) {
 226    if (len == null || len > arr.length) len = arr.length;
 227  
 228    for (var i = 0, arr2 = new Array(len); i < len; i++) {
 229      arr2[i] = arr[i];
 230    }
 231  
 232    return arr2;
 233  }
 234  
 235  /***/ }),
 236  
 237  /***/ 27:
 238  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 239  
 240  "use strict";
 241  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
 242  /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
 243  
 244  function _unsupportedIterableToArray(o, minLen) {
 245    if (!o) return;
 246    if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 247    var n = Object.prototype.toString.call(o).slice(8, -1);
 248    if (n === "Object" && o.constructor) n = o.constructor.name;
 249    if (n === "Map" || n === "Set") return Array.from(n);
 250    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 251  }
 252  
 253  /***/ }),
 254  
 255  /***/ 34:
 256  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 257  
 258  "use strict";
 259  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
 260  function _typeof(obj) {
 261    "@babel/helpers - typeof";
 262  
 263    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
 264      _typeof = function _typeof(obj) {
 265        return typeof obj;
 266      };
 267    } else {
 268      _typeof = function _typeof(obj) {
 269        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
 270      };
 271    }
 272  
 273    return _typeof(obj);
 274  }
 275  
 276  /***/ }),
 277  
 278  /***/ 35:
 279  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 280  
 281  "use strict";
 282  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
 283  function _iterableToArray(iter) {
 284    if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
 285  }
 286  
 287  /***/ }),
 288  
 289  /***/ 38:
 290  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 291  
 292  "use strict";
 293  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
 294  function _arrayWithHoles(arr) {
 295    if (Array.isArray(arr)) return arr;
 296  }
 297  
 298  /***/ }),
 299  
 300  /***/ 39:
 301  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 302  
 303  "use strict";
 304  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
 305  function _nonIterableRest() {
 306    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 307  }
 308  
 309  /***/ }),
 310  
 311  /***/ 43:
 312  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 313  
 314  "use strict";
 315  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
 316  function _objectWithoutPropertiesLoose(source, excluded) {
 317    if (source == null) return {};
 318    var target = {};
 319    var sourceKeys = Object.keys(source);
 320    var key, i;
 321  
 322    for (i = 0; i < sourceKeys.length; i++) {
 323      key = sourceKeys[i];
 324      if (excluded.indexOf(key) >= 0) continue;
 325      target[key] = source[key];
 326    }
 327  
 328    return target;
 329  }
 330  
 331  /***/ }),
 332  
 333  /***/ 437:
 334  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 335  
 336  "use strict";
 337  __webpack_require__.r(__webpack_exports__);
 338  
 339  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
 340  var slicedToArray = __webpack_require__(20);
 341  
 342  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
 343  var esm_typeof = __webpack_require__(34);
 344  
 345  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
 346  var toConsumableArray = __webpack_require__(18);
 347  
 348  // EXTERNAL MODULE: external {"this":"React"}
 349  var external_this_React_ = __webpack_require__(21);
 350  
 351  // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/create-interpolate-element.js
 352  
 353  
 354  
 355  
 356  /**
 357   * External dependencies
 358   */
 359  
 360  var indoc, offset, output, stack;
 361  /**
 362   * Matches tags in the localized string
 363   *
 364   * This is used for extracting the tag pattern groups for parsing the localized
 365   * string and along with the map converting it to a react element.
 366   *
 367   * There are four references extracted using this tokenizer:
 368   *
 369   * match: Full match of the tag (i.e. <strong>, </strong>, <br/>)
 370   * isClosing: The closing slash, it it exists.
 371   * name: The name portion of the tag (strong, br) (if )
 372   * isSelfClosed: The slash on a self closing tag, if it exists.
 373   *
 374   * @type {RegExp}
 375   */
 376  
 377  var tokenizer = /<(\/)?(\w+)\s*(\/)?>/g;
 378  /**
 379   * Tracks recursive-descent parse state.
 380   *
 381   * This is a Stack frame holding parent elements until all children have been
 382   * parsed.
 383   *
 384   * @private
 385   * @param {WPElement} element          A parent element which may still have
 386   *                                     nested children not yet parsed.
 387   * @param {number}    tokenStart       Offset at which parent element first
 388   *                                     appears.
 389   * @param {number}    tokenLength      Length of string marking start of parent
 390   *                                     element.
 391   * @param {number}    prevOffset       Running offset at which parsing should
 392   *                                     continue.
 393   * @param {number}    leadingTextStart Offset at which last closing element
 394   *                                     finished, used for finding text between
 395   *                                     elements
 396   *
 397   * @return {Frame} The stack frame tracking parse progress.
 398   */
 399  
 400  function Frame(element, tokenStart, tokenLength, prevOffset, leadingTextStart) {
 401    return {
 402      element: element,
 403      tokenStart: tokenStart,
 404      tokenLength: tokenLength,
 405      prevOffset: prevOffset,
 406      leadingTextStart: leadingTextStart,
 407      children: []
 408    };
 409  }
 410  /**
 411   * This function creates an interpolated element from a passed in string with
 412   * specific tags matching how the string should be converted to an element via
 413   * the conversion map value.
 414   *
 415   * @example
 416   * For example, for the given string:
 417   *
 418   * "This is a <span>string</span> with <a>a link</a> and a self-closing
 419   * <CustomComponentB/> tag"
 420   *
 421   * You would have something like this as the conversionMap value:
 422   *
 423   * ```js
 424   * {
 425   *     span: <span />,
 426   *     a: <a href={ 'https://github.com' } />,
 427   *     CustomComponentB: <CustomComponent />,
 428   * }
 429   * ```
 430   *
 431   * @param {string}  interpolatedString  The interpolation string to be parsed.
 432   * @param {Object}  conversionMap       The map used to convert the string to
 433   *                                      a react element.
 434   * @throws {TypeError}
 435   * @return {WPElement}  A wp element.
 436   */
 437  
 438  
 439  var create_interpolate_element_createInterpolateElement = function createInterpolateElement(interpolatedString, conversionMap) {
 440    indoc = interpolatedString;
 441    offset = 0;
 442    output = [];
 443    stack = [];
 444    tokenizer.lastIndex = 0;
 445  
 446    if (!create_interpolate_element_isValidConversionMap(conversionMap)) {
 447      throw new TypeError('The conversionMap provided is not valid. It must be an object with values that are WPElements');
 448    }
 449  
 450    do {// twiddle our thumbs
 451    } while (proceed(conversionMap));
 452  
 453    return external_this_React_["createElement"].apply(void 0, [external_this_React_["Fragment"], null].concat(Object(toConsumableArray["a" /* default */])(output)));
 454  };
 455  /**
 456   * Validate conversion map.
 457   *
 458   * A map is considered valid if it's an object and every value in the object
 459   * is a WPElement
 460   *
 461   * @private
 462   *
 463   * @param {Object} conversionMap  The map being validated.
 464   *
 465   * @return {boolean}  True means the map is valid.
 466   */
 467  
 468  
 469  var create_interpolate_element_isValidConversionMap = function isValidConversionMap(conversionMap) {
 470    var isObject = Object(esm_typeof["a" /* default */])(conversionMap) === 'object';
 471    var values = isObject && Object.values(conversionMap);
 472    return isObject && values.length && values.every(function (element) {
 473      return Object(external_this_React_["isValidElement"])(element);
 474    });
 475  };
 476  /**
 477   * This is the iterator over the matches in the string.
 478   *
 479   * @private
 480   *
 481   * @param {Object} conversionMap The conversion map for the string.
 482   *
 483   * @return {boolean} true for continuing to iterate, false for finished.
 484   */
 485  
 486  
 487  function proceed(conversionMap) {
 488    var next = nextToken();
 489  
 490    var _next = Object(slicedToArray["a" /* default */])(next, 4),
 491        tokenType = _next[0],
 492        name = _next[1],
 493        startOffset = _next[2],
 494        tokenLength = _next[3];
 495  
 496    var stackDepth = stack.length;
 497    var leadingTextStart = startOffset > offset ? offset : null;
 498  
 499    if (!conversionMap[name]) {
 500      addText();
 501      return false;
 502    }
 503  
 504    switch (tokenType) {
 505      case 'no-more-tokens':
 506        if (stackDepth !== 0) {
 507          var _stack$pop = stack.pop(),
 508              stackLeadingText = _stack$pop.leadingTextStart,
 509              tokenStart = _stack$pop.tokenStart;
 510  
 511          output.push(indoc.substr(stackLeadingText, tokenStart));
 512        }
 513  
 514        addText();
 515        return false;
 516  
 517      case 'self-closed':
 518        if (0 === stackDepth) {
 519          if (null !== leadingTextStart) {
 520            output.push(indoc.substr(leadingTextStart, startOffset - leadingTextStart));
 521          }
 522  
 523          output.push(conversionMap[name]);
 524          offset = startOffset + tokenLength;
 525          return true;
 526        } // otherwise we found an inner element
 527  
 528  
 529        addChild(new Frame(conversionMap[name], startOffset, tokenLength));
 530        offset = startOffset + tokenLength;
 531        return true;
 532  
 533      case 'opener':
 534        stack.push(new Frame(conversionMap[name], startOffset, tokenLength, startOffset + tokenLength, leadingTextStart));
 535        offset = startOffset + tokenLength;
 536        return true;
 537  
 538      case 'closer':
 539        // if we're not nesting then this is easy - close the block
 540        if (1 === stackDepth) {
 541          closeOuterElement(startOffset);
 542          offset = startOffset + tokenLength;
 543          return true;
 544        } // otherwise we're nested and we have to close out the current
 545        // block and add it as a innerBlock to the parent
 546  
 547  
 548        var stackTop = stack.pop();
 549        var text = indoc.substr(stackTop.prevOffset, startOffset - stackTop.prevOffset);
 550        stackTop.children.push(text);
 551        stackTop.prevOffset = startOffset + tokenLength;
 552        var frame = new Frame(stackTop.element, stackTop.tokenStart, stackTop.tokenLength, startOffset + tokenLength);
 553        frame.children = stackTop.children;
 554        addChild(frame);
 555        offset = startOffset + tokenLength;
 556        return true;
 557  
 558      default:
 559        addText();
 560        return false;
 561    }
 562  }
 563  /**
 564   * Grabs the next token match in the string and returns it's details.
 565   *
 566   * @private
 567   *
 568   * @return {Array}  An array of details for the token matched.
 569   */
 570  
 571  
 572  function nextToken() {
 573    var matches = tokenizer.exec(indoc); // we have no more tokens
 574  
 575    if (null === matches) {
 576      return ['no-more-tokens'];
 577    }
 578  
 579    var startedAt = matches.index;
 580  
 581    var _matches = Object(slicedToArray["a" /* default */])(matches, 4),
 582        match = _matches[0],
 583        isClosing = _matches[1],
 584        name = _matches[2],
 585        isSelfClosed = _matches[3];
 586  
 587    var length = match.length;
 588  
 589    if (isSelfClosed) {
 590      return ['self-closed', name, startedAt, length];
 591    }
 592  
 593    if (isClosing) {
 594      return ['closer', name, startedAt, length];
 595    }
 596  
 597    return ['opener', name, startedAt, length];
 598  }
 599  /**
 600   * Pushes text extracted from the indoc string to the output stack given the
 601   * current rawLength value and offset (if rawLength is provided ) or the
 602   * indoc.length and offset.
 603   *
 604   * @private
 605   */
 606  
 607  
 608  function addText() {
 609    var length = indoc.length - offset;
 610  
 611    if (0 === length) {
 612      return;
 613    }
 614  
 615    output.push(indoc.substr(offset, length));
 616  }
 617  /**
 618   * Pushes a child element to the associated parent element's children for the
 619   * parent currently active in the stack.
 620   *
 621   * @private
 622   *
 623   * @param {Frame}    frame       The Frame containing the child element and it's
 624   *                               token information.
 625   */
 626  
 627  
 628  function addChild(frame) {
 629    var element = frame.element,
 630        tokenStart = frame.tokenStart,
 631        tokenLength = frame.tokenLength,
 632        prevOffset = frame.prevOffset,
 633        children = frame.children;
 634    var parent = stack[stack.length - 1];
 635    var text = indoc.substr(parent.prevOffset, tokenStart - parent.prevOffset);
 636  
 637    if (text) {
 638      parent.children.push(text);
 639    }
 640  
 641    parent.children.push(external_this_React_["cloneElement"].apply(void 0, [element, null].concat(Object(toConsumableArray["a" /* default */])(children))));
 642    parent.prevOffset = prevOffset ? prevOffset : tokenStart + tokenLength;
 643  }
 644  /**
 645   * This is called for closing tags. It creates the element currently active in
 646   * the stack.
 647   *
 648   * @private
 649   *
 650   * @param {number} endOffset Offset at which the closing tag for the element
 651   *                           begins in the string. If this is greater than the
 652   *                           prevOffset attached to the element, then this
 653   *                           helps capture any remaining nested text nodes in
 654   *                           the element.
 655   */
 656  
 657  
 658  function closeOuterElement(endOffset) {
 659    var _stack$pop2 = stack.pop(),
 660        element = _stack$pop2.element,
 661        leadingTextStart = _stack$pop2.leadingTextStart,
 662        prevOffset = _stack$pop2.prevOffset,
 663        tokenStart = _stack$pop2.tokenStart,
 664        children = _stack$pop2.children;
 665  
 666    var text = endOffset ? indoc.substr(prevOffset, endOffset - prevOffset) : indoc.substr(prevOffset);
 667  
 668    if (text) {
 669      children.push(text);
 670    }
 671  
 672    if (null !== leadingTextStart) {
 673      output.push(indoc.substr(leadingTextStart, tokenStart - leadingTextStart));
 674    }
 675  
 676    output.push(external_this_React_["cloneElement"].apply(void 0, [element, null].concat(Object(toConsumableArray["a" /* default */])(children))));
 677  }
 678  
 679  /* harmony default export */ var create_interpolate_element = (create_interpolate_element_createInterpolateElement);
 680  
 681  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
 682  var defineProperty = __webpack_require__(5);
 683  
 684  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
 685  var objectWithoutProperties = __webpack_require__(19);
 686  
 687  // EXTERNAL MODULE: external {"this":"lodash"}
 688  var external_this_lodash_ = __webpack_require__(2);
 689  
 690  // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/react.js
 691  
 692  
 693  
 694  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; }
 695  
 696  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; }
 697  
 698  /**
 699   * External dependencies
 700   */
 701  
 702  
 703  /**
 704   * Object containing a React element.
 705   *
 706   * @typedef {import('react').ReactElement} WPElement
 707   */
 708  
 709  /**
 710   * Object containing a React component.
 711   *
 712   * @typedef {import('react').Component} WPComponent
 713   */
 714  
 715  /**
 716   * Object containing a React synthetic event.
 717   *
 718   * @typedef {import('react').SyntheticEvent} WPSyntheticEvent
 719   */
 720  
 721  /**
 722   * Object that provides utilities for dealing with React children.
 723   */
 724  
 725  
 726  /**
 727   * Creates a copy of an element with extended props.
 728   *
 729   * @param {WPElement} element Element
 730   * @param {?Object}   props   Props to apply to cloned element
 731   *
 732   * @return {WPElement} Cloned element.
 733   */
 734  
 735  
 736  /**
 737   * A base class to create WordPress Components (Refs, state and lifecycle hooks)
 738   */
 739  
 740  
 741  /**
 742   * Creates a context object containing two components: a provider and consumer.
 743   *
 744   * @param {Object} defaultValue A default data stored in the context.
 745   *
 746   * @return {Object} Context object.
 747   */
 748  
 749  
 750  /**
 751   * Returns a new element of given type. Type can be either a string tag name or
 752   * another function which itself returns an element.
 753   *
 754   * @param {?(string|Function)} type     Tag name or element creator
 755   * @param {Object}             props    Element properties, either attribute
 756   *                                      set to apply to DOM node or values to
 757   *                                      pass through to element creator
 758   * @param {...WPElement}       children Descendant elements
 759   *
 760   * @return {WPElement} Element.
 761   */
 762  
 763  
 764  /**
 765   * Returns an object tracking a reference to a rendered element via its
 766   * `current` property as either a DOMElement or Element, dependent upon the
 767   * type of element rendered with the ref attribute.
 768   *
 769   * @return {Object} Ref object.
 770   */
 771  
 772  
 773  /**
 774   * Component enhancer used to enable passing a ref to its wrapped component.
 775   * Pass a function argument which receives `props` and `ref` as its arguments,
 776   * returning an element using the forwarded ref. The return value is a new
 777   * component which forwards its ref.
 778   *
 779   * @param {Function} forwarder Function passed `props` and `ref`, expected to
 780   *                             return an element.
 781   *
 782   * @return {WPComponent} Enhanced component.
 783   */
 784  
 785  
 786  /**
 787   * A component which renders its children without any wrapping element.
 788   */
 789  
 790  
 791  /**
 792   * Checks if an object is a valid WPElement.
 793   *
 794   * @param {Object} objectToCheck The object to be checked.
 795   *
 796   * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.
 797   */
 798  
 799  
 800  /**
 801   * @see https://reactjs.org/docs/react-api.html#reactmemo
 802   */
 803  
 804  
 805  /**
 806   * Component that activates additional checks and warnings for its descendants.
 807   */
 808  
 809  
 810  /**
 811   * @see https://reactjs.org/docs/hooks-reference.html#usecallback
 812   */
 813  
 814  
 815  /**
 816   * @see https://reactjs.org/docs/hooks-reference.html#usecontext
 817   */
 818  
 819  
 820  /**
 821   * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue
 822   */
 823  
 824  
 825  /**
 826   * @see https://reactjs.org/docs/hooks-reference.html#useeffect
 827   */
 828  
 829  
 830  /**
 831   * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
 832   */
 833  
 834  
 835  /**
 836   * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
 837   */
 838  
 839  
 840  /**
 841   * @see https://reactjs.org/docs/hooks-reference.html#usememo
 842   */
 843  
 844  
 845  /**
 846   * @see https://reactjs.org/docs/hooks-reference.html#usereducer
 847   */
 848  
 849  
 850  /**
 851   * @see https://reactjs.org/docs/hooks-reference.html#useref
 852   */
 853  
 854  
 855  /**
 856   * @see https://reactjs.org/docs/hooks-reference.html#usestate
 857   */
 858  
 859  
 860  /**
 861   * @see https://reactjs.org/docs/react-api.html#reactlazy
 862   */
 863  
 864  
 865  /**
 866   * @see https://reactjs.org/docs/react-api.html#reactsuspense
 867   */
 868  
 869  
 870  /**
 871   * Concatenate two or more React children objects.
 872   *
 873   * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.
 874   *
 875   * @return {Array} The concatenated value.
 876   */
 877  
 878  function concatChildren() {
 879    for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
 880      childrenArguments[_key] = arguments[_key];
 881    }
 882  
 883    return childrenArguments.reduce(function (accumulator, children, i) {
 884      external_this_React_["Children"].forEach(children, function (child, j) {
 885        if (child && 'string' !== typeof child) {
 886          child = Object(external_this_React_["cloneElement"])(child, {
 887            key: [i, j].join()
 888          });
 889        }
 890  
 891        accumulator.push(child);
 892      });
 893      return accumulator;
 894    }, []);
 895  }
 896  /**
 897   * Switches the nodeName of all the elements in the children object.
 898   *
 899   * @param {?Object} children Children object.
 900   * @param {string}  nodeName Node name.
 901   *
 902   * @return {?Object} The updated children object.
 903   */
 904  
 905  function switchChildrenNodeName(children, nodeName) {
 906    return children && external_this_React_["Children"].map(children, function (elt, index) {
 907      if (Object(external_this_lodash_["isString"])(elt)) {
 908        return Object(external_this_React_["createElement"])(nodeName, {
 909          key: index
 910        }, elt);
 911      }
 912  
 913      var _elt$props = elt.props,
 914          childrenProp = _elt$props.children,
 915          props = Object(objectWithoutProperties["a" /* default */])(_elt$props, ["children"]);
 916  
 917      return Object(external_this_React_["createElement"])(nodeName, _objectSpread({
 918        key: index
 919      }, props), childrenProp);
 920    });
 921  }
 922  
 923  // EXTERNAL MODULE: external {"this":"ReactDOM"}
 924  var external_this_ReactDOM_ = __webpack_require__(66);
 925  
 926  // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/react-platform.js
 927  /**
 928   * External dependencies
 929   */
 930  
 931  /**
 932   * Creates a portal into which a component can be rendered.
 933   *
 934   * @see https://github.com/facebook/react/issues/10309#issuecomment-318433235
 935   *
 936   * @param {WPElement}   child     Any renderable child, such as an element,
 937   *                                string, or fragment.
 938   * @param {HTMLElement} container DOM node into which element should be rendered.
 939   */
 940  
 941  
 942  /**
 943   * Finds the dom node of a React component.
 944   *
 945   * @param {WPComponent} component Component's instance.
 946   */
 947  
 948  
 949  /**
 950   * Renders a given element into the target DOM node.
 951   *
 952   * @param {WPElement}   element Element to render.
 953   * @param {HTMLElement} target  DOM node into which element should be rendered.
 954   */
 955  
 956  
 957  /**
 958   * Removes any mounted element from the target DOM node.
 959   *
 960   * @param {Element} target DOM node in which element is to be removed
 961   */
 962  
 963  
 964  
 965  // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/utils.js
 966  /**
 967   * External dependencies
 968   */
 969  
 970  /**
 971   * Checks if the provided WP element is empty.
 972   *
 973   * @param {*} element WP element to check.
 974   * @return {boolean} True when an element is considered empty.
 975   */
 976  
 977  var utils_isEmptyElement = function isEmptyElement(element) {
 978    if (Object(external_this_lodash_["isNumber"])(element)) {
 979      return false;
 980    }
 981  
 982    if (Object(external_this_lodash_["isString"])(element) || Object(external_this_lodash_["isArray"])(element)) {
 983      return !element.length;
 984    }
 985  
 986    return !element;
 987  };
 988  
 989  // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/platform.js
 990  /**
 991   * Parts of this source were derived and modified from react-native-web,
 992   * released under the MIT license.
 993   *
 994   * Copyright (c) 2016-present, Nicolas Gallagher.
 995   * Copyright (c) 2015-present, Facebook, Inc.
 996   *
 997   */
 998  var Platform = {
 999    OS: 'web',
1000    select: function select(spec) {
1001      return 'web' in spec ? spec.web : spec.default;
1002    }
1003  };
1004  /**
1005   * Component used to detect the current Platform being used.
1006   * Use Platform.OS === 'web' to detect if running on web enviroment.
1007   *
1008   * This is the same concept as the React Native implementation.
1009   *
1010   * @see https://facebook.github.io/react-native/docs/platform-specific-code#platform-module
1011   *
1012   * Here is an example of how to use the select method:
1013   * @example
1014   * ```js
1015   * import { Platform } from '@wordpress/element';
1016   *
1017   * const placeholderLabel = Platform.select( {
1018   *   native: __( 'Add media' ),
1019   *   web: __( 'Drag images, upload new ones or select files from your library.' ),
1020   * } );
1021   * ```
1022   */
1023  
1024  /* harmony default export */ var platform = (Platform);
1025  
1026  // EXTERNAL MODULE: external {"this":["wp","escapeHtml"]}
1027  var external_this_wp_escapeHtml_ = __webpack_require__(68);
1028  
1029  // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/raw-html.js
1030  
1031  
1032  
1033  function raw_html_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; }
1034  
1035  function raw_html_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { raw_html_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 { raw_html_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1036  
1037  /**
1038   * Internal dependencies
1039   */
1040  
1041  /**
1042   * Component used as equivalent of Fragment with unescaped HTML, in cases where
1043   * it is desirable to render dangerous HTML without needing a wrapper element.
1044   * To preserve additional props, a `div` wrapper _will_ be created if any props
1045   * aside from `children` are passed.
1046   *
1047   * @param {Object} props
1048   * @param {string} props.children HTML to render.
1049   * @param {Object} props.props    Any additonal props to be set on the containing div.
1050   *
1051   * @return {WPComponent} Dangerously-rendering component.
1052   */
1053  
1054  function RawHTML(_ref) {
1055    var children = _ref.children,
1056        props = Object(objectWithoutProperties["a" /* default */])(_ref, ["children"]);
1057  
1058    // The DIV wrapper will be stripped by serializer, unless there are
1059    // non-children props present.
1060    return Object(external_this_React_["createElement"])('div', raw_html_objectSpread({
1061      dangerouslySetInnerHTML: {
1062        __html: children
1063      }
1064    }, props));
1065  }
1066  
1067  // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/serialize.js
1068  
1069  
1070  
1071  
1072  function serialize_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; }
1073  
1074  function serialize_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { serialize_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 { serialize_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1075  
1076  /**
1077   * Parts of this source were derived and modified from fast-react-render,
1078   * released under the MIT license.
1079   *
1080   * https://github.com/alt-j/fast-react-render
1081   *
1082   * Copyright (c) 2016 Andrey Morozov
1083   *
1084   * Permission is hereby granted, free of charge, to any person obtaining a copy
1085   * of this software and associated documentation files (the "Software"), to deal
1086   * in the Software without restriction, including without limitation the rights
1087   * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1088   * copies of the Software, and to permit persons to whom the Software is
1089   * furnished to do so, subject to the following conditions:
1090   *
1091   * The above copyright notice and this permission notice shall be included in
1092   * all copies or substantial portions of the Software.
1093   *
1094   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1095   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1096   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1097   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1098   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1099   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1100   * THE SOFTWARE.
1101   */
1102  
1103  /**
1104   * External dependencies
1105   */
1106  
1107  /**
1108   * WordPress dependencies
1109   */
1110  
1111  
1112  /**
1113   * Internal dependencies
1114   */
1115  
1116  
1117  
1118  
1119  var _createContext = Object(external_this_React_["createContext"])(),
1120      Provider = _createContext.Provider,
1121      Consumer = _createContext.Consumer;
1122  
1123  var ForwardRef = Object(external_this_React_["forwardRef"])(function () {
1124    return null;
1125  });
1126  /**
1127   * Valid attribute types.
1128   *
1129   * @type {Set}
1130   */
1131  
1132  var ATTRIBUTES_TYPES = new Set(['string', 'boolean', 'number']);
1133  /**
1134   * Element tags which can be self-closing.
1135   *
1136   * @type {Set}
1137   */
1138  
1139  var SELF_CLOSING_TAGS = new Set(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']);
1140  /**
1141   * Boolean attributes are attributes whose presence as being assigned is
1142   * meaningful, even if only empty.
1143   *
1144   * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes
1145   * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3
1146   *
1147   * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]
1148   *     .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )
1149   *     .reduce( ( result, tr ) => Object.assign( result, {
1150   *         [ tr.firstChild.textContent.trim() ]: true
1151   *     } ), {} ) ).sort();
1152   *
1153   * @type {Set}
1154   */
1155  
1156  var BOOLEAN_ATTRIBUTES = new Set(['allowfullscreen', 'allowpaymentrequest', 'allowusermedia', 'async', 'autofocus', 'autoplay', 'checked', 'controls', 'default', 'defer', 'disabled', 'download', 'formnovalidate', 'hidden', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nomodule', 'novalidate', 'open', 'playsinline', 'readonly', 'required', 'reversed', 'selected', 'typemustmatch']);
1157  /**
1158   * Enumerated attributes are attributes which must be of a specific value form.
1159   * Like boolean attributes, these are meaningful if specified, even if not of a
1160   * valid enumerated value.
1161   *
1162   * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute
1163   * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3
1164   *
1165   * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]
1166   *     .filter( ( tr ) => /^("(.+?)";?\s*)+/.test( tr.lastChild.textContent.trim() ) )
1167   *     .reduce( ( result, tr ) => Object.assign( result, {
1168   *         [ tr.firstChild.textContent.trim() ]: true
1169   *     } ), {} ) ).sort();
1170   *
1171   * Some notable omissions:
1172   *
1173   *  - `alt`: https://blog.whatwg.org/omit-alt
1174   *
1175   * @type {Set}
1176   */
1177  
1178  var ENUMERATED_ATTRIBUTES = new Set(['autocapitalize', 'autocomplete', 'charset', 'contenteditable', 'crossorigin', 'decoding', 'dir', 'draggable', 'enctype', 'formenctype', 'formmethod', 'http-equiv', 'inputmode', 'kind', 'method', 'preload', 'scope', 'shape', 'spellcheck', 'translate', 'type', 'wrap']);
1179  /**
1180   * Set of CSS style properties which support assignment of unitless numbers.
1181   * Used in rendering of style properties, where `px` unit is assumed unless
1182   * property is included in this set or value is zero.
1183   *
1184   * Generated via:
1185   *
1186   * Object.entries( document.createElement( 'div' ).style )
1187   *     .filter( ( [ key ] ) => (
1188   *         ! /^(webkit|ms|moz)/.test( key ) &&
1189   *         ( e.style[ key ] = 10 ) &&
1190   *         e.style[ key ] === '10'
1191   *     ) )
1192   *     .map( ( [ key ] ) => key )
1193   *     .sort();
1194   *
1195   * @type {Set}
1196   */
1197  
1198  var CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set(['animation', 'animationIterationCount', 'baselineShift', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'columnCount', 'cx', 'cy', 'fillOpacity', 'flexGrow', 'flexShrink', 'floodOpacity', 'fontWeight', 'gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart', 'lineHeight', 'opacity', 'order', 'orphans', 'r', 'rx', 'ry', 'shapeImageThreshold', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'tabSize', 'widows', 'x', 'y', 'zIndex', 'zoom']);
1199  /**
1200   * Returns true if the specified string is prefixed by one of an array of
1201   * possible prefixes.
1202   *
1203   * @param {string}   string   String to check.
1204   * @param {string[]} prefixes Possible prefixes.
1205   *
1206   * @return {boolean} Whether string has prefix.
1207   */
1208  
1209  function hasPrefix(string, prefixes) {
1210    return prefixes.some(function (prefix) {
1211      return string.indexOf(prefix) === 0;
1212    });
1213  }
1214  /**
1215   * Returns true if the given prop name should be ignored in attributes
1216   * serialization, or false otherwise.
1217   *
1218   * @param {string} attribute Attribute to check.
1219   *
1220   * @return {boolean} Whether attribute should be ignored.
1221   */
1222  
1223  function isInternalAttribute(attribute) {
1224    return 'key' === attribute || 'children' === attribute;
1225  }
1226  /**
1227   * Returns the normal form of the element's attribute value for HTML.
1228   *
1229   * @param {string} attribute Attribute name.
1230   * @param {*}      value     Non-normalized attribute value.
1231   *
1232   * @return {string} Normalized attribute value.
1233   */
1234  
1235  
1236  function getNormalAttributeValue(attribute, value) {
1237    switch (attribute) {
1238      case 'style':
1239        return renderStyle(value);
1240    }
1241  
1242    return value;
1243  }
1244  /**
1245   * Returns the normal form of the element's attribute name for HTML.
1246   *
1247   * @param {string} attribute Non-normalized attribute name.
1248   *
1249   * @return {string} Normalized attribute name.
1250   */
1251  
1252  
1253  function getNormalAttributeName(attribute) {
1254    switch (attribute) {
1255      case 'htmlFor':
1256        return 'for';
1257  
1258      case 'className':
1259        return 'class';
1260    }
1261  
1262    return attribute.toLowerCase();
1263  }
1264  /**
1265   * Returns the normal form of the style property name for HTML.
1266   *
1267   * - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color'
1268   * - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor'
1269   * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform'
1270   *
1271   * @param {string} property Property name.
1272   *
1273   * @return {string} Normalized property name.
1274   */
1275  
1276  
1277  function getNormalStylePropertyName(property) {
1278    if (Object(external_this_lodash_["startsWith"])(property, '--')) {
1279      return property;
1280    }
1281  
1282    if (hasPrefix(property, ['ms', 'O', 'Moz', 'Webkit'])) {
1283      return '-' + Object(external_this_lodash_["kebabCase"])(property);
1284    }
1285  
1286    return Object(external_this_lodash_["kebabCase"])(property);
1287  }
1288  /**
1289   * Returns the normal form of the style property value for HTML. Appends a
1290   * default pixel unit if numeric, not a unitless property, and not zero.
1291   *
1292   * @param {string} property Property name.
1293   * @param {*}      value    Non-normalized property value.
1294   *
1295   * @return {*} Normalized property value.
1296   */
1297  
1298  
1299  function getNormalStylePropertyValue(property, value) {
1300    if (typeof value === 'number' && 0 !== value && !CSS_PROPERTIES_SUPPORTS_UNITLESS.has(property)) {
1301      return value + 'px';
1302    }
1303  
1304    return value;
1305  }
1306  /**
1307   * Serializes a React element to string.
1308   *
1309   * @param {WPElement} element       Element to serialize.
1310   * @param {?Object}   context       Context object.
1311   * @param {?Object}   legacyContext Legacy context object.
1312   *
1313   * @return {string} Serialized element.
1314   */
1315  
1316  
1317  function renderElement(element, context) {
1318    var legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1319  
1320    if (null === element || undefined === element || false === element) {
1321      return '';
1322    }
1323  
1324    if (Array.isArray(element)) {
1325      return renderChildren(element, context, legacyContext);
1326    }
1327  
1328    switch (Object(esm_typeof["a" /* default */])(element)) {
1329      case 'string':
1330        return Object(external_this_wp_escapeHtml_["escapeHTML"])(element);
1331  
1332      case 'number':
1333        return element.toString();
1334    }
1335  
1336    var type = element.type,
1337        props = element.props;
1338  
1339    switch (type) {
1340      case external_this_React_["StrictMode"]:
1341      case external_this_React_["Fragment"]:
1342        return renderChildren(props.children, context, legacyContext);
1343  
1344      case RawHTML:
1345        var children = props.children,
1346            wrapperProps = Object(objectWithoutProperties["a" /* default */])(props, ["children"]);
1347  
1348        return renderNativeComponent(Object(external_this_lodash_["isEmpty"])(wrapperProps) ? null : 'div', serialize_objectSpread({}, wrapperProps, {
1349          dangerouslySetInnerHTML: {
1350            __html: children
1351          }
1352        }), context, legacyContext);
1353    }
1354  
1355    switch (Object(esm_typeof["a" /* default */])(type)) {
1356      case 'string':
1357        return renderNativeComponent(type, props, context, legacyContext);
1358  
1359      case 'function':
1360        if (type.prototype && typeof type.prototype.render === 'function') {
1361          return renderComponent(type, props, context, legacyContext);
1362        }
1363  
1364        return renderElement(type(props, legacyContext), context, legacyContext);
1365    }
1366  
1367    switch (type && type.$$typeof) {
1368      case Provider.$$typeof:
1369        return renderChildren(props.children, props.value, legacyContext);
1370  
1371      case Consumer.$$typeof:
1372        return renderElement(props.children(context || type._currentValue), context, legacyContext);
1373  
1374      case ForwardRef.$$typeof:
1375        return renderElement(type.render(props), context, legacyContext);
1376    }
1377  
1378    return '';
1379  }
1380  /**
1381   * Serializes a native component type to string.
1382   *
1383   * @param {?string} type          Native component type to serialize, or null if
1384   *                                rendering as fragment of children content.
1385   * @param {Object}  props         Props object.
1386   * @param {?Object} context       Context object.
1387   * @param {?Object} legacyContext Legacy context object.
1388   *
1389   * @return {string} Serialized element.
1390   */
1391  
1392  function renderNativeComponent(type, props, context) {
1393    var legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1394    var content = '';
1395  
1396    if (type === 'textarea' && props.hasOwnProperty('value')) {
1397      // Textarea children can be assigned as value prop. If it is, render in
1398      // place of children. Ensure to omit so it is not assigned as attribute
1399      // as well.
1400      content = renderChildren(props.value, context, legacyContext);
1401      props = Object(external_this_lodash_["omit"])(props, 'value');
1402    } else if (props.dangerouslySetInnerHTML && typeof props.dangerouslySetInnerHTML.__html === 'string') {
1403      // Dangerous content is left unescaped.
1404      content = props.dangerouslySetInnerHTML.__html;
1405    } else if (typeof props.children !== 'undefined') {
1406      content = renderChildren(props.children, context, legacyContext);
1407    }
1408  
1409    if (!type) {
1410      return content;
1411    }
1412  
1413    var attributes = renderAttributes(props);
1414  
1415    if (SELF_CLOSING_TAGS.has(type)) {
1416      return '<' + type + attributes + '/>';
1417    }
1418  
1419    return '<' + type + attributes + '>' + content + '</' + type + '>';
1420  }
1421  /**
1422   * Serializes a non-native component type to string.
1423   *
1424   * @param {Function} Component     Component type to serialize.
1425   * @param {Object}   props         Props object.
1426   * @param {?Object}  context       Context object.
1427   * @param {?Object}  legacyContext Legacy context object.
1428   *
1429   * @return {string} Serialized element
1430   */
1431  
1432  function renderComponent(Component, props, context) {
1433    var legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1434    var instance = new Component(props, legacyContext);
1435  
1436    if (typeof instance.getChildContext === 'function') {
1437      Object.assign(legacyContext, instance.getChildContext());
1438    }
1439  
1440    var html = renderElement(instance.render(), context, legacyContext);
1441    return html;
1442  }
1443  /**
1444   * Serializes an array of children to string.
1445   *
1446   * @param {Array}   children      Children to serialize.
1447   * @param {?Object} context       Context object.
1448   * @param {?Object} legacyContext Legacy context object.
1449   *
1450   * @return {string} Serialized children.
1451   */
1452  
1453  function renderChildren(children, context) {
1454    var legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1455    var result = '';
1456    children = Object(external_this_lodash_["castArray"])(children);
1457  
1458    for (var i = 0; i < children.length; i++) {
1459      var child = children[i];
1460      result += renderElement(child, context, legacyContext);
1461    }
1462  
1463    return result;
1464  }
1465  /**
1466   * Renders a props object as a string of HTML attributes.
1467   *
1468   * @param {Object} props Props object.
1469   *
1470   * @return {string} Attributes string.
1471   */
1472  
1473  
1474  function renderAttributes(props) {
1475    var result = '';
1476  
1477    for (var key in props) {
1478      var attribute = getNormalAttributeName(key);
1479  
1480      if (!Object(external_this_wp_escapeHtml_["isValidAttributeName"])(attribute)) {
1481        continue;
1482      }
1483  
1484      var value = getNormalAttributeValue(key, props[key]); // If value is not of serializeable type, skip.
1485  
1486      if (!ATTRIBUTES_TYPES.has(Object(esm_typeof["a" /* default */])(value))) {
1487        continue;
1488      } // Don't render internal attribute names.
1489  
1490  
1491      if (isInternalAttribute(key)) {
1492        continue;
1493      }
1494  
1495      var isBooleanAttribute = BOOLEAN_ATTRIBUTES.has(attribute); // Boolean attribute should be omitted outright if its value is false.
1496  
1497      if (isBooleanAttribute && value === false) {
1498        continue;
1499      }
1500  
1501      var isMeaningfulAttribute = isBooleanAttribute || hasPrefix(key, ['data-', 'aria-']) || ENUMERATED_ATTRIBUTES.has(attribute); // Only write boolean value as attribute if meaningful.
1502  
1503      if (typeof value === 'boolean' && !isMeaningfulAttribute) {
1504        continue;
1505      }
1506  
1507      result += ' ' + attribute; // Boolean attributes should write attribute name, but without value.
1508      // Mere presence of attribute name is effective truthiness.
1509  
1510      if (isBooleanAttribute) {
1511        continue;
1512      }
1513  
1514      if (typeof value === 'string') {
1515        value = Object(external_this_wp_escapeHtml_["escapeAttribute"])(value);
1516      }
1517  
1518      result += '="' + value + '"';
1519    }
1520  
1521    return result;
1522  }
1523  /**
1524   * Renders a style object as a string attribute value.
1525   *
1526   * @param {Object} style Style object.
1527   *
1528   * @return {string} Style attribute value.
1529   */
1530  
1531  function renderStyle(style) {
1532    // Only generate from object, e.g. tolerate string value.
1533    if (!Object(external_this_lodash_["isPlainObject"])(style)) {
1534      return style;
1535    }
1536  
1537    var result;
1538  
1539    for (var property in style) {
1540      var value = style[property];
1541  
1542      if (null === value || undefined === value) {
1543        continue;
1544      }
1545  
1546      if (result) {
1547        result += ';';
1548      } else {
1549        result = '';
1550      }
1551  
1552      var normalName = getNormalStylePropertyName(property);
1553      var normalValue = getNormalStylePropertyValue(property, value);
1554      result += normalName + ':' + normalValue;
1555    }
1556  
1557    return result;
1558  }
1559  /* harmony default export */ var serialize = (renderElement);
1560  
1561  // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/index.js
1562  /* concated harmony reexport __experimentalCreateInterpolateElement */__webpack_require__.d(__webpack_exports__, "__experimentalCreateInterpolateElement", function() { return create_interpolate_element; });
1563  /* concated harmony reexport Children */__webpack_require__.d(__webpack_exports__, "Children", function() { return external_this_React_["Children"]; });
1564  /* concated harmony reexport cloneElement */__webpack_require__.d(__webpack_exports__, "cloneElement", function() { return external_this_React_["cloneElement"]; });
1565  /* concated harmony reexport Component */__webpack_require__.d(__webpack_exports__, "Component", function() { return external_this_React_["Component"]; });
1566  /* concated harmony reexport createContext */__webpack_require__.d(__webpack_exports__, "createContext", function() { return external_this_React_["createContext"]; });
1567  /* concated harmony reexport createElement */__webpack_require__.d(__webpack_exports__, "createElement", function() { return external_this_React_["createElement"]; });
1568  /* concated harmony reexport createRef */__webpack_require__.d(__webpack_exports__, "createRef", function() { return external_this_React_["createRef"]; });
1569  /* concated harmony reexport forwardRef */__webpack_require__.d(__webpack_exports__, "forwardRef", function() { return external_this_React_["forwardRef"]; });
1570  /* concated harmony reexport Fragment */__webpack_require__.d(__webpack_exports__, "Fragment", function() { return external_this_React_["Fragment"]; });
1571  /* concated harmony reexport isValidElement */__webpack_require__.d(__webpack_exports__, "isValidElement", function() { return external_this_React_["isValidElement"]; });
1572  /* concated harmony reexport memo */__webpack_require__.d(__webpack_exports__, "memo", function() { return external_this_React_["memo"]; });
1573  /* concated harmony reexport StrictMode */__webpack_require__.d(__webpack_exports__, "StrictMode", function() { return external_this_React_["StrictMode"]; });
1574  /* concated harmony reexport useCallback */__webpack_require__.d(__webpack_exports__, "useCallback", function() { return external_this_React_["useCallback"]; });
1575  /* concated harmony reexport useContext */__webpack_require__.d(__webpack_exports__, "useContext", function() { return external_this_React_["useContext"]; });
1576  /* concated harmony reexport useDebugValue */__webpack_require__.d(__webpack_exports__, "useDebugValue", function() { return external_this_React_["useDebugValue"]; });
1577  /* concated harmony reexport useEffect */__webpack_require__.d(__webpack_exports__, "useEffect", function() { return external_this_React_["useEffect"]; });
1578  /* concated harmony reexport useImperativeHandle */__webpack_require__.d(__webpack_exports__, "useImperativeHandle", function() { return external_this_React_["useImperativeHandle"]; });
1579  /* concated harmony reexport useLayoutEffect */__webpack_require__.d(__webpack_exports__, "useLayoutEffect", function() { return external_this_React_["useLayoutEffect"]; });
1580  /* concated harmony reexport useMemo */__webpack_require__.d(__webpack_exports__, "useMemo", function() { return external_this_React_["useMemo"]; });
1581  /* concated harmony reexport useReducer */__webpack_require__.d(__webpack_exports__, "useReducer", function() { return external_this_React_["useReducer"]; });
1582  /* concated harmony reexport useRef */__webpack_require__.d(__webpack_exports__, "useRef", function() { return external_this_React_["useRef"]; });
1583  /* concated harmony reexport useState */__webpack_require__.d(__webpack_exports__, "useState", function() { return external_this_React_["useState"]; });
1584  /* concated harmony reexport lazy */__webpack_require__.d(__webpack_exports__, "lazy", function() { return external_this_React_["lazy"]; });
1585  /* concated harmony reexport Suspense */__webpack_require__.d(__webpack_exports__, "Suspense", function() { return external_this_React_["Suspense"]; });
1586  /* concated harmony reexport concatChildren */__webpack_require__.d(__webpack_exports__, "concatChildren", function() { return concatChildren; });
1587  /* concated harmony reexport switchChildrenNodeName */__webpack_require__.d(__webpack_exports__, "switchChildrenNodeName", function() { return switchChildrenNodeName; });
1588  /* concated harmony reexport createPortal */__webpack_require__.d(__webpack_exports__, "createPortal", function() { return external_this_ReactDOM_["createPortal"]; });
1589  /* concated harmony reexport findDOMNode */__webpack_require__.d(__webpack_exports__, "findDOMNode", function() { return external_this_ReactDOM_["findDOMNode"]; });
1590  /* concated harmony reexport render */__webpack_require__.d(__webpack_exports__, "render", function() { return external_this_ReactDOM_["render"]; });
1591  /* concated harmony reexport unmountComponentAtNode */__webpack_require__.d(__webpack_exports__, "unmountComponentAtNode", function() { return external_this_ReactDOM_["unmountComponentAtNode"]; });
1592  /* concated harmony reexport isEmptyElement */__webpack_require__.d(__webpack_exports__, "isEmptyElement", function() { return utils_isEmptyElement; });
1593  /* concated harmony reexport Platform */__webpack_require__.d(__webpack_exports__, "Platform", function() { return platform; });
1594  /* concated harmony reexport renderToString */__webpack_require__.d(__webpack_exports__, "renderToString", function() { return serialize; });
1595  /* concated harmony reexport RawHTML */__webpack_require__.d(__webpack_exports__, "RawHTML", function() { return RawHTML; });
1596  
1597  
1598  
1599  
1600  
1601  
1602  
1603  
1604  
1605  /***/ }),
1606  
1607  /***/ 5:
1608  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1609  
1610  "use strict";
1611  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
1612  function _defineProperty(obj, key, value) {
1613    if (key in obj) {
1614      Object.defineProperty(obj, key, {
1615        value: value,
1616        enumerable: true,
1617        configurable: true,
1618        writable: true
1619      });
1620    } else {
1621      obj[key] = value;
1622    }
1623  
1624    return obj;
1625  }
1626  
1627  /***/ }),
1628  
1629  /***/ 66:
1630  /***/ (function(module, exports) {
1631  
1632  (function() { module.exports = this["ReactDOM"]; }());
1633  
1634  /***/ }),
1635  
1636  /***/ 68:
1637  /***/ (function(module, exports) {
1638  
1639  (function() { module.exports = this["wp"]["escapeHtml"]; }());
1640  
1641  /***/ })
1642  
1643  /******/ });


Generated: Sat Apr 4 01:00:03 2020 Cross-referenced by PHPXref 0.7.1