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