[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /******/ (() => { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ 4140: 6 /***/ ((__unused_webpack_module, exports, __webpack_require__) => { 7 8 9 10 var m = __webpack_require__(5795); 11 if (true) { 12 exports.H = m.createRoot; 13 exports.c = m.hydrateRoot; 14 } else { var i; } 15 16 17 /***/ }), 18 19 /***/ 5795: 20 /***/ ((module) => { 21 22 module.exports = window["ReactDOM"]; 23 24 /***/ }) 25 26 /******/ }); 27 /************************************************************************/ 28 /******/ // The module cache 29 /******/ var __webpack_module_cache__ = {}; 30 /******/ 31 /******/ // The require function 32 /******/ function __webpack_require__(moduleId) { 33 /******/ // Check if module is in cache 34 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 35 /******/ if (cachedModule !== undefined) { 36 /******/ return cachedModule.exports; 37 /******/ } 38 /******/ // Create a new module (and put it into the cache) 39 /******/ var module = __webpack_module_cache__[moduleId] = { 40 /******/ // no module.id needed 41 /******/ // no module.loaded needed 42 /******/ exports: {} 43 /******/ }; 44 /******/ 45 /******/ // Execute the module function 46 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 47 /******/ 48 /******/ // Return the exports of the module 49 /******/ return module.exports; 50 /******/ } 51 /******/ 52 /************************************************************************/ 53 /******/ /* webpack/runtime/define property getters */ 54 /******/ (() => { 55 /******/ // define getter functions for harmony exports 56 /******/ __webpack_require__.d = (exports, definition) => { 57 /******/ for(var key in definition) { 58 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 59 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 60 /******/ } 61 /******/ } 62 /******/ }; 63 /******/ })(); 64 /******/ 65 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 66 /******/ (() => { 67 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 68 /******/ })(); 69 /******/ 70 /******/ /* webpack/runtime/make namespace object */ 71 /******/ (() => { 72 /******/ // define __esModule on exports 73 /******/ __webpack_require__.r = (exports) => { 74 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 75 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 76 /******/ } 77 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 78 /******/ }; 79 /******/ })(); 80 /******/ 81 /************************************************************************/ 82 var __webpack_exports__ = {}; 83 // ESM COMPAT FLAG 84 __webpack_require__.r(__webpack_exports__); 85 86 // EXPORTS 87 __webpack_require__.d(__webpack_exports__, { 88 Children: () => (/* reexport */ external_React_namespaceObject.Children), 89 Component: () => (/* reexport */ external_React_namespaceObject.Component), 90 Fragment: () => (/* reexport */ external_React_namespaceObject.Fragment), 91 Platform: () => (/* reexport */ platform), 92 PureComponent: () => (/* reexport */ external_React_namespaceObject.PureComponent), 93 RawHTML: () => (/* reexport */ RawHTML), 94 StrictMode: () => (/* reexport */ external_React_namespaceObject.StrictMode), 95 Suspense: () => (/* reexport */ external_React_namespaceObject.Suspense), 96 cloneElement: () => (/* reexport */ external_React_namespaceObject.cloneElement), 97 concatChildren: () => (/* reexport */ concatChildren), 98 createContext: () => (/* reexport */ external_React_namespaceObject.createContext), 99 createElement: () => (/* reexport */ external_React_namespaceObject.createElement), 100 createInterpolateElement: () => (/* reexport */ create_interpolate_element), 101 createPortal: () => (/* reexport */ external_ReactDOM_.createPortal), 102 createRef: () => (/* reexport */ external_React_namespaceObject.createRef), 103 createRoot: () => (/* reexport */ client/* createRoot */.H), 104 findDOMNode: () => (/* reexport */ external_ReactDOM_.findDOMNode), 105 flushSync: () => (/* reexport */ external_ReactDOM_.flushSync), 106 forwardRef: () => (/* reexport */ external_React_namespaceObject.forwardRef), 107 hydrate: () => (/* reexport */ external_ReactDOM_.hydrate), 108 hydrateRoot: () => (/* reexport */ client/* hydrateRoot */.c), 109 isEmptyElement: () => (/* reexport */ isEmptyElement), 110 isValidElement: () => (/* reexport */ external_React_namespaceObject.isValidElement), 111 lazy: () => (/* reexport */ external_React_namespaceObject.lazy), 112 memo: () => (/* reexport */ external_React_namespaceObject.memo), 113 render: () => (/* reexport */ external_ReactDOM_.render), 114 renderToString: () => (/* reexport */ serialize), 115 startTransition: () => (/* reexport */ external_React_namespaceObject.startTransition), 116 switchChildrenNodeName: () => (/* reexport */ switchChildrenNodeName), 117 unmountComponentAtNode: () => (/* reexport */ external_ReactDOM_.unmountComponentAtNode), 118 useCallback: () => (/* reexport */ external_React_namespaceObject.useCallback), 119 useContext: () => (/* reexport */ external_React_namespaceObject.useContext), 120 useDebugValue: () => (/* reexport */ external_React_namespaceObject.useDebugValue), 121 useDeferredValue: () => (/* reexport */ external_React_namespaceObject.useDeferredValue), 122 useEffect: () => (/* reexport */ external_React_namespaceObject.useEffect), 123 useId: () => (/* reexport */ external_React_namespaceObject.useId), 124 useImperativeHandle: () => (/* reexport */ external_React_namespaceObject.useImperativeHandle), 125 useInsertionEffect: () => (/* reexport */ external_React_namespaceObject.useInsertionEffect), 126 useLayoutEffect: () => (/* reexport */ external_React_namespaceObject.useLayoutEffect), 127 useMemo: () => (/* reexport */ external_React_namespaceObject.useMemo), 128 useReducer: () => (/* reexport */ external_React_namespaceObject.useReducer), 129 useRef: () => (/* reexport */ external_React_namespaceObject.useRef), 130 useState: () => (/* reexport */ external_React_namespaceObject.useState), 131 useSyncExternalStore: () => (/* reexport */ external_React_namespaceObject.useSyncExternalStore), 132 useTransition: () => (/* reexport */ external_React_namespaceObject.useTransition) 133 }); 134 135 ;// external "React" 136 const external_React_namespaceObject = window["React"]; 137 ;// ./node_modules/@wordpress/element/build-module/create-interpolate-element.js 138 /* wp:polyfill */ 139 /** 140 * Internal dependencies 141 */ 142 143 144 /** 145 * Object containing a React element. 146 * 147 * @typedef {import('react').ReactElement} Element 148 */ 149 150 let indoc, offset, output, stack; 151 152 /** 153 * Matches tags in the localized string 154 * 155 * This is used for extracting the tag pattern groups for parsing the localized 156 * string and along with the map converting it to a react element. 157 * 158 * There are four references extracted using this tokenizer: 159 * 160 * match: Full match of the tag (i.e. <strong>, </strong>, <br/>) 161 * isClosing: The closing slash, if it exists. 162 * name: The name portion of the tag (strong, br) (if ) 163 * isSelfClosed: The slash on a self closing tag, if it exists. 164 * 165 * @type {RegExp} 166 */ 167 const tokenizer = /<(\/)?(\w+)\s*(\/)?>/g; 168 169 /** 170 * The stack frame tracking parse progress. 171 * 172 * @typedef Frame 173 * 174 * @property {Element} element A parent element which may still have 175 * @property {number} tokenStart Offset at which parent element first 176 * appears. 177 * @property {number} tokenLength Length of string marking start of parent 178 * element. 179 * @property {number} [prevOffset] Running offset at which parsing should 180 * continue. 181 * @property {number} [leadingTextStart] Offset at which last closing element 182 * finished, used for finding text between 183 * elements. 184 * @property {Element[]} children Children. 185 */ 186 187 /** 188 * Tracks recursive-descent parse state. 189 * 190 * This is a Stack frame holding parent elements until all children have been 191 * parsed. 192 * 193 * @private 194 * @param {Element} element A parent element which may still have 195 * nested children not yet parsed. 196 * @param {number} tokenStart Offset at which parent element first 197 * appears. 198 * @param {number} tokenLength Length of string marking start of parent 199 * element. 200 * @param {number} [prevOffset] Running offset at which parsing should 201 * continue. 202 * @param {number} [leadingTextStart] Offset at which last closing element 203 * finished, used for finding text between 204 * elements. 205 * 206 * @return {Frame} The stack frame tracking parse progress. 207 */ 208 function createFrame(element, tokenStart, tokenLength, prevOffset, leadingTextStart) { 209 return { 210 element, 211 tokenStart, 212 tokenLength, 213 prevOffset, 214 leadingTextStart, 215 children: [] 216 }; 217 } 218 219 /** 220 * This function creates an interpolated element from a passed in string with 221 * specific tags matching how the string should be converted to an element via 222 * the conversion map value. 223 * 224 * @example 225 * For example, for the given string: 226 * 227 * "This is a <span>string</span> with <a>a link</a> and a self-closing 228 * <CustomComponentB/> tag" 229 * 230 * You would have something like this as the conversionMap value: 231 * 232 * ```js 233 * { 234 * span: <span />, 235 * a: <a href={ 'https://github.com' } />, 236 * CustomComponentB: <CustomComponent />, 237 * } 238 * ``` 239 * 240 * @param {string} interpolatedString The interpolation string to be parsed. 241 * @param {Record<string, Element>} conversionMap The map used to convert the string to 242 * a react element. 243 * @throws {TypeError} 244 * @return {Element} A wp element. 245 */ 246 const createInterpolateElement = (interpolatedString, conversionMap) => { 247 indoc = interpolatedString; 248 offset = 0; 249 output = []; 250 stack = []; 251 tokenizer.lastIndex = 0; 252 if (!isValidConversionMap(conversionMap)) { 253 throw new TypeError('The conversionMap provided is not valid. It must be an object with values that are React Elements'); 254 } 255 do { 256 // twiddle our thumbs 257 } while (proceed(conversionMap)); 258 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, ...output); 259 }; 260 261 /** 262 * Validate conversion map. 263 * 264 * A map is considered valid if it's an object and every value in the object 265 * is a React Element 266 * 267 * @private 268 * 269 * @param {Object} conversionMap The map being validated. 270 * 271 * @return {boolean} True means the map is valid. 272 */ 273 const isValidConversionMap = conversionMap => { 274 const isObject = typeof conversionMap === 'object'; 275 const values = isObject && Object.values(conversionMap); 276 return isObject && values.length && values.every(element => (0,external_React_namespaceObject.isValidElement)(element)); 277 }; 278 279 /** 280 * This is the iterator over the matches in the string. 281 * 282 * @private 283 * 284 * @param {Object} conversionMap The conversion map for the string. 285 * 286 * @return {boolean} true for continuing to iterate, false for finished. 287 */ 288 function proceed(conversionMap) { 289 const next = nextToken(); 290 const [tokenType, name, startOffset, tokenLength] = next; 291 const stackDepth = stack.length; 292 const leadingTextStart = startOffset > offset ? offset : null; 293 if (!conversionMap[name]) { 294 addText(); 295 return false; 296 } 297 switch (tokenType) { 298 case 'no-more-tokens': 299 if (stackDepth !== 0) { 300 const { 301 leadingTextStart: stackLeadingText, 302 tokenStart 303 } = stack.pop(); 304 output.push(indoc.substr(stackLeadingText, tokenStart)); 305 } 306 addText(); 307 return false; 308 case 'self-closed': 309 if (0 === stackDepth) { 310 if (null !== leadingTextStart) { 311 output.push(indoc.substr(leadingTextStart, startOffset - leadingTextStart)); 312 } 313 output.push(conversionMap[name]); 314 offset = startOffset + tokenLength; 315 return true; 316 } 317 318 // Otherwise we found an inner element. 319 addChild(createFrame(conversionMap[name], startOffset, tokenLength)); 320 offset = startOffset + tokenLength; 321 return true; 322 case 'opener': 323 stack.push(createFrame(conversionMap[name], startOffset, tokenLength, startOffset + tokenLength, leadingTextStart)); 324 offset = startOffset + tokenLength; 325 return true; 326 case 'closer': 327 // If we're not nesting then this is easy - close the block. 328 if (1 === stackDepth) { 329 closeOuterElement(startOffset); 330 offset = startOffset + tokenLength; 331 return true; 332 } 333 334 // Otherwise we're nested and we have to close out the current 335 // block and add it as a innerBlock to the parent. 336 const stackTop = stack.pop(); 337 const text = indoc.substr(stackTop.prevOffset, startOffset - stackTop.prevOffset); 338 stackTop.children.push(text); 339 stackTop.prevOffset = startOffset + tokenLength; 340 const frame = createFrame(stackTop.element, stackTop.tokenStart, stackTop.tokenLength, startOffset + tokenLength); 341 frame.children = stackTop.children; 342 addChild(frame); 343 offset = startOffset + tokenLength; 344 return true; 345 default: 346 addText(); 347 return false; 348 } 349 } 350 351 /** 352 * Grabs the next token match in the string and returns it's details. 353 * 354 * @private 355 * 356 * @return {Array} An array of details for the token matched. 357 */ 358 function nextToken() { 359 const matches = tokenizer.exec(indoc); 360 // We have no more tokens. 361 if (null === matches) { 362 return ['no-more-tokens']; 363 } 364 const startedAt = matches.index; 365 const [match, isClosing, name, isSelfClosed] = matches; 366 const length = match.length; 367 if (isSelfClosed) { 368 return ['self-closed', name, startedAt, length]; 369 } 370 if (isClosing) { 371 return ['closer', name, startedAt, length]; 372 } 373 return ['opener', name, startedAt, length]; 374 } 375 376 /** 377 * Pushes text extracted from the indoc string to the output stack given the 378 * current rawLength value and offset (if rawLength is provided ) or the 379 * indoc.length and offset. 380 * 381 * @private 382 */ 383 function addText() { 384 const length = indoc.length - offset; 385 if (0 === length) { 386 return; 387 } 388 output.push(indoc.substr(offset, length)); 389 } 390 391 /** 392 * Pushes a child element to the associated parent element's children for the 393 * parent currently active in the stack. 394 * 395 * @private 396 * 397 * @param {Frame} frame The Frame containing the child element and it's 398 * token information. 399 */ 400 function addChild(frame) { 401 const { 402 element, 403 tokenStart, 404 tokenLength, 405 prevOffset, 406 children 407 } = frame; 408 const parent = stack[stack.length - 1]; 409 const text = indoc.substr(parent.prevOffset, tokenStart - parent.prevOffset); 410 if (text) { 411 parent.children.push(text); 412 } 413 parent.children.push((0,external_React_namespaceObject.cloneElement)(element, null, ...children)); 414 parent.prevOffset = prevOffset ? prevOffset : tokenStart + tokenLength; 415 } 416 417 /** 418 * This is called for closing tags. It creates the element currently active in 419 * the stack. 420 * 421 * @private 422 * 423 * @param {number} endOffset Offset at which the closing tag for the element 424 * begins in the string. If this is greater than the 425 * prevOffset attached to the element, then this 426 * helps capture any remaining nested text nodes in 427 * the element. 428 */ 429 function closeOuterElement(endOffset) { 430 const { 431 element, 432 leadingTextStart, 433 prevOffset, 434 tokenStart, 435 children 436 } = stack.pop(); 437 const text = endOffset ? indoc.substr(prevOffset, endOffset - prevOffset) : indoc.substr(prevOffset); 438 if (text) { 439 children.push(text); 440 } 441 if (null !== leadingTextStart) { 442 output.push(indoc.substr(leadingTextStart, tokenStart - leadingTextStart)); 443 } 444 output.push((0,external_React_namespaceObject.cloneElement)(element, null, ...children)); 445 } 446 /* harmony default export */ const create_interpolate_element = (createInterpolateElement); 447 448 ;// ./node_modules/@wordpress/element/build-module/react.js 449 /* wp:polyfill */ 450 /** 451 * External dependencies 452 */ 453 // eslint-disable-next-line @typescript-eslint/no-restricted-imports 454 455 456 /** 457 * Object containing a React element. 458 * 459 * @typedef {import('react').ReactElement} Element 460 */ 461 462 /** 463 * Object containing a React component. 464 * 465 * @typedef {import('react').ComponentType} ComponentType 466 */ 467 468 /** 469 * Object containing a React synthetic event. 470 * 471 * @typedef {import('react').SyntheticEvent} SyntheticEvent 472 */ 473 474 /** 475 * Object containing a React ref object. 476 * 477 * @template T 478 * @typedef {import('react').RefObject<T>} RefObject<T> 479 */ 480 481 /** 482 * Object containing a React ref callback. 483 * 484 * @template T 485 * @typedef {import('react').RefCallback<T>} RefCallback<T> 486 */ 487 488 /** 489 * Object containing a React ref. 490 * 491 * @template T 492 * @typedef {import('react').Ref<T>} Ref<T> 493 */ 494 495 /** 496 * Object that provides utilities for dealing with React children. 497 */ 498 499 500 /** 501 * Creates a copy of an element with extended props. 502 * 503 * @param {Element} element Element 504 * @param {?Object} props Props to apply to cloned element 505 * 506 * @return {Element} Cloned element. 507 */ 508 509 510 /** 511 * A base class to create WordPress Components (Refs, state and lifecycle hooks) 512 */ 513 514 515 /** 516 * Creates a context object containing two components: a provider and consumer. 517 * 518 * @param {Object} defaultValue A default data stored in the context. 519 * 520 * @return {Object} Context object. 521 */ 522 523 524 /** 525 * Returns a new element of given type. Type can be either a string tag name or 526 * another function which itself returns an element. 527 * 528 * @param {?(string|Function)} type Tag name or element creator 529 * @param {Object} props Element properties, either attribute 530 * set to apply to DOM node or values to 531 * pass through to element creator 532 * @param {...Element} children Descendant elements 533 * 534 * @return {Element} Element. 535 */ 536 537 538 /** 539 * Returns an object tracking a reference to a rendered element via its 540 * `current` property as either a DOMElement or Element, dependent upon the 541 * type of element rendered with the ref attribute. 542 * 543 * @return {Object} Ref object. 544 */ 545 546 547 /** 548 * Component enhancer used to enable passing a ref to its wrapped component. 549 * Pass a function argument which receives `props` and `ref` as its arguments, 550 * returning an element using the forwarded ref. The return value is a new 551 * component which forwards its ref. 552 * 553 * @param {Function} forwarder Function passed `props` and `ref`, expected to 554 * return an element. 555 * 556 * @return {Component} Enhanced component. 557 */ 558 559 560 /** 561 * A component which renders its children without any wrapping element. 562 */ 563 564 565 /** 566 * Checks if an object is a valid React Element. 567 * 568 * @param {Object} objectToCheck The object to be checked. 569 * 570 * @return {boolean} true if objectToTest is a valid React Element and false otherwise. 571 */ 572 573 574 /** 575 * @see https://react.dev/reference/react/memo 576 */ 577 578 579 /** 580 * Component that activates additional checks and warnings for its descendants. 581 */ 582 583 584 /** 585 * @see https://react.dev/reference/react/useCallback 586 */ 587 588 589 /** 590 * @see https://react.dev/reference/react/useContext 591 */ 592 593 594 /** 595 * @see https://react.dev/reference/react/useDebugValue 596 */ 597 598 599 /** 600 * @see https://react.dev/reference/react/useDeferredValue 601 */ 602 603 604 /** 605 * @see https://react.dev/reference/react/useEffect 606 */ 607 608 609 /** 610 * @see https://react.dev/reference/react/useId 611 */ 612 613 614 /** 615 * @see https://react.dev/reference/react/useImperativeHandle 616 */ 617 618 619 /** 620 * @see https://react.dev/reference/react/useInsertionEffect 621 */ 622 623 624 /** 625 * @see https://react.dev/reference/react/useLayoutEffect 626 */ 627 628 629 /** 630 * @see https://react.dev/reference/react/useMemo 631 */ 632 633 634 /** 635 * @see https://react.dev/reference/react/useReducer 636 */ 637 638 639 /** 640 * @see https://react.dev/reference/react/useRef 641 */ 642 643 644 /** 645 * @see https://react.dev/reference/react/useState 646 */ 647 648 649 /** 650 * @see https://react.dev/reference/react/useSyncExternalStore 651 */ 652 653 654 /** 655 * @see https://react.dev/reference/react/useTransition 656 */ 657 658 659 /** 660 * @see https://react.dev/reference/react/startTransition 661 */ 662 663 664 /** 665 * @see https://react.dev/reference/react/lazy 666 */ 667 668 669 /** 670 * @see https://react.dev/reference/react/Suspense 671 */ 672 673 674 /** 675 * @see https://react.dev/reference/react/PureComponent 676 */ 677 678 679 /** 680 * Concatenate two or more React children objects. 681 * 682 * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate. 683 * 684 * @return {Array} The concatenated value. 685 */ 686 function concatChildren(...childrenArguments) { 687 return childrenArguments.reduce((accumulator, children, i) => { 688 external_React_namespaceObject.Children.forEach(children, (child, j) => { 689 if (child && 'string' !== typeof child) { 690 child = (0,external_React_namespaceObject.cloneElement)(child, { 691 key: [i, j].join() 692 }); 693 } 694 accumulator.push(child); 695 }); 696 return accumulator; 697 }, []); 698 } 699 700 /** 701 * Switches the nodeName of all the elements in the children object. 702 * 703 * @param {?Object} children Children object. 704 * @param {string} nodeName Node name. 705 * 706 * @return {?Object} The updated children object. 707 */ 708 function switchChildrenNodeName(children, nodeName) { 709 return children && external_React_namespaceObject.Children.map(children, (elt, index) => { 710 if (typeof elt?.valueOf() === 'string') { 711 return (0,external_React_namespaceObject.createElement)(nodeName, { 712 key: index 713 }, elt); 714 } 715 const { 716 children: childrenProp, 717 ...props 718 } = elt.props; 719 return (0,external_React_namespaceObject.createElement)(nodeName, { 720 key: index, 721 ...props 722 }, childrenProp); 723 }); 724 } 725 726 // EXTERNAL MODULE: external "ReactDOM" 727 var external_ReactDOM_ = __webpack_require__(5795); 728 // EXTERNAL MODULE: ./node_modules/react-dom/client.js 729 var client = __webpack_require__(4140); 730 ;// ./node_modules/@wordpress/element/build-module/react-platform.js 731 /** 732 * External dependencies 733 */ 734 735 736 737 /** 738 * Creates a portal into which a component can be rendered. 739 * 740 * @see https://github.com/facebook/react/issues/10309#issuecomment-318433235 741 * 742 * @param {import('react').ReactElement} child Any renderable child, such as an element, 743 * string, or fragment. 744 * @param {HTMLElement} container DOM node into which element should be rendered. 745 */ 746 747 748 /** 749 * Finds the dom node of a React component. 750 * 751 * @param {import('react').ComponentType} component Component's instance. 752 */ 753 754 755 /** 756 * Forces React to flush any updates inside the provided callback synchronously. 757 * 758 * @param {Function} callback Callback to run synchronously. 759 */ 760 761 762 /** 763 * Renders a given element into the target DOM node. 764 * 765 * @deprecated since WordPress 6.2.0. Use `createRoot` instead. 766 * @see https://react.dev/reference/react-dom/render 767 */ 768 769 770 /** 771 * Hydrates a given element into the target DOM node. 772 * 773 * @deprecated since WordPress 6.2.0. Use `hydrateRoot` instead. 774 * @see https://react.dev/reference/react-dom/hydrate 775 */ 776 777 778 /** 779 * Creates a new React root for the target DOM node. 780 * 781 * @since 6.2.0 Introduced in WordPress core. 782 * @see https://react.dev/reference/react-dom/client/createRoot 783 */ 784 785 786 /** 787 * Creates a new React root for the target DOM node and hydrates it with a pre-generated markup. 788 * 789 * @since 6.2.0 Introduced in WordPress core. 790 * @see https://react.dev/reference/react-dom/client/hydrateRoot 791 */ 792 793 794 /** 795 * Removes any mounted element from the target DOM node. 796 * 797 * @deprecated since WordPress 6.2.0. Use `root.unmount()` instead. 798 * @see https://react.dev/reference/react-dom/unmountComponentAtNode 799 */ 800 801 802 ;// ./node_modules/@wordpress/element/build-module/utils.js 803 /** 804 * Checks if the provided WP element is empty. 805 * 806 * @param {*} element WP element to check. 807 * @return {boolean} True when an element is considered empty. 808 */ 809 const isEmptyElement = element => { 810 if (typeof element === 'number') { 811 return false; 812 } 813 if (typeof element?.valueOf() === 'string' || Array.isArray(element)) { 814 return !element.length; 815 } 816 return !element; 817 }; 818 819 ;// ./node_modules/@wordpress/element/build-module/platform.js 820 /** 821 * Parts of this source were derived and modified from react-native-web, 822 * released under the MIT license. 823 * 824 * Copyright (c) 2016-present, Nicolas Gallagher. 825 * Copyright (c) 2015-present, Facebook, Inc. 826 * 827 */ 828 const Platform = { 829 OS: 'web', 830 select: spec => 'web' in spec ? spec.web : spec.default, 831 isWeb: true 832 }; 833 /** 834 * Component used to detect the current Platform being used. 835 * Use Platform.OS === 'web' to detect if running on web environment. 836 * 837 * This is the same concept as the React Native implementation. 838 * 839 * @see https://reactnative.dev/docs/platform-specific-code#platform-module 840 * 841 * Here is an example of how to use the select method: 842 * @example 843 * ```js 844 * import { Platform } from '@wordpress/element'; 845 * 846 * const placeholderLabel = Platform.select( { 847 * native: __( 'Add media' ), 848 * web: __( 'Drag images, upload new ones or select files from your library.' ), 849 * } ); 850 * ``` 851 */ 852 /* harmony default export */ const platform = (Platform); 853 854 ;// ./node_modules/is-plain-object/dist/is-plain-object.mjs 855 /*! 856 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> 857 * 858 * Copyright (c) 2014-2017, Jon Schlinkert. 859 * Released under the MIT License. 860 */ 861 862 function isObject(o) { 863 return Object.prototype.toString.call(o) === '[object Object]'; 864 } 865 866 function isPlainObject(o) { 867 var ctor,prot; 868 869 if (isObject(o) === false) return false; 870 871 // If has modified constructor 872 ctor = o.constructor; 873 if (ctor === undefined) return true; 874 875 // If has modified prototype 876 prot = ctor.prototype; 877 if (isObject(prot) === false) return false; 878 879 // If constructor does not have an Object-specific method 880 if (prot.hasOwnProperty('isPrototypeOf') === false) { 881 return false; 882 } 883 884 // Most likely a plain Object 885 return true; 886 } 887 888 889 890 ;// ./node_modules/tslib/tslib.es6.mjs 891 /****************************************************************************** 892 Copyright (c) Microsoft Corporation. 893 894 Permission to use, copy, modify, and/or distribute this software for any 895 purpose with or without fee is hereby granted. 896 897 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 898 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 899 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 900 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 901 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 902 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 903 PERFORMANCE OF THIS SOFTWARE. 904 ***************************************************************************** */ 905 /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ 906 907 var extendStatics = function(d, b) { 908 extendStatics = Object.setPrototypeOf || 909 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 910 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 911 return extendStatics(d, b); 912 }; 913 914 function __extends(d, b) { 915 if (typeof b !== "function" && b !== null) 916 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 917 extendStatics(d, b); 918 function __() { this.constructor = d; } 919 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 920 } 921 922 var __assign = function() { 923 __assign = Object.assign || function __assign(t) { 924 for (var s, i = 1, n = arguments.length; i < n; i++) { 925 s = arguments[i]; 926 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 927 } 928 return t; 929 } 930 return __assign.apply(this, arguments); 931 } 932 933 function __rest(s, e) { 934 var t = {}; 935 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 936 t[p] = s[p]; 937 if (s != null && typeof Object.getOwnPropertySymbols === "function") 938 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 939 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 940 t[p[i]] = s[p[i]]; 941 } 942 return t; 943 } 944 945 function __decorate(decorators, target, key, desc) { 946 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 947 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 948 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 949 return c > 3 && r && Object.defineProperty(target, key, r), r; 950 } 951 952 function __param(paramIndex, decorator) { 953 return function (target, key) { decorator(target, key, paramIndex); } 954 } 955 956 function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { 957 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } 958 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; 959 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; 960 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); 961 var _, done = false; 962 for (var i = decorators.length - 1; i >= 0; i--) { 963 var context = {}; 964 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; 965 for (var p in contextIn.access) context.access[p] = contextIn.access[p]; 966 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; 967 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); 968 if (kind === "accessor") { 969 if (result === void 0) continue; 970 if (result === null || typeof result !== "object") throw new TypeError("Object expected"); 971 if (_ = accept(result.get)) descriptor.get = _; 972 if (_ = accept(result.set)) descriptor.set = _; 973 if (_ = accept(result.init)) initializers.unshift(_); 974 } 975 else if (_ = accept(result)) { 976 if (kind === "field") initializers.unshift(_); 977 else descriptor[key] = _; 978 } 979 } 980 if (target) Object.defineProperty(target, contextIn.name, descriptor); 981 done = true; 982 }; 983 984 function __runInitializers(thisArg, initializers, value) { 985 var useValue = arguments.length > 2; 986 for (var i = 0; i < initializers.length; i++) { 987 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); 988 } 989 return useValue ? value : void 0; 990 }; 991 992 function __propKey(x) { 993 return typeof x === "symbol" ? x : "".concat(x); 994 }; 995 996 function __setFunctionName(f, name, prefix) { 997 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; 998 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); 999 }; 1000 1001 function __metadata(metadataKey, metadataValue) { 1002 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 1003 } 1004 1005 function __awaiter(thisArg, _arguments, P, generator) { 1006 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 1007 return new (P || (P = Promise))(function (resolve, reject) { 1008 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 1009 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 1010 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 1011 step((generator = generator.apply(thisArg, _arguments || [])).next()); 1012 }); 1013 } 1014 1015 function __generator(thisArg, body) { 1016 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); 1017 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 1018 function verb(n) { return function (v) { return step([n, v]); }; } 1019 function step(op) { 1020 if (f) throw new TypeError("Generator is already executing."); 1021 while (g && (g = 0, op[0] && (_ = 0)), _) try { 1022 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 1023 if (y = 0, t) op = [op[0] & 2, t.value]; 1024 switch (op[0]) { 1025 case 0: case 1: t = op; break; 1026 case 4: _.label++; return { value: op[1], done: false }; 1027 case 5: _.label++; y = op[1]; op = [0]; continue; 1028 case 7: op = _.ops.pop(); _.trys.pop(); continue; 1029 default: 1030 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 1031 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 1032 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 1033 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 1034 if (t[2]) _.ops.pop(); 1035 _.trys.pop(); continue; 1036 } 1037 op = body.call(thisArg, _); 1038 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 1039 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 1040 } 1041 } 1042 1043 var __createBinding = Object.create ? (function(o, m, k, k2) { 1044 if (k2 === undefined) k2 = k; 1045 var desc = Object.getOwnPropertyDescriptor(m, k); 1046 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 1047 desc = { enumerable: true, get: function() { return m[k]; } }; 1048 } 1049 Object.defineProperty(o, k2, desc); 1050 }) : (function(o, m, k, k2) { 1051 if (k2 === undefined) k2 = k; 1052 o[k2] = m[k]; 1053 }); 1054 1055 function __exportStar(m, o) { 1056 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 1057 } 1058 1059 function __values(o) { 1060 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 1061 if (m) return m.call(o); 1062 if (o && typeof o.length === "number") return { 1063 next: function () { 1064 if (o && i >= o.length) o = void 0; 1065 return { value: o && o[i++], done: !o }; 1066 } 1067 }; 1068 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 1069 } 1070 1071 function __read(o, n) { 1072 var m = typeof Symbol === "function" && o[Symbol.iterator]; 1073 if (!m) return o; 1074 var i = m.call(o), r, ar = [], e; 1075 try { 1076 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 1077 } 1078 catch (error) { e = { error: error }; } 1079 finally { 1080 try { 1081 if (r && !r.done && (m = i["return"])) m.call(i); 1082 } 1083 finally { if (e) throw e.error; } 1084 } 1085 return ar; 1086 } 1087 1088 /** @deprecated */ 1089 function __spread() { 1090 for (var ar = [], i = 0; i < arguments.length; i++) 1091 ar = ar.concat(__read(arguments[i])); 1092 return ar; 1093 } 1094 1095 /** @deprecated */ 1096 function __spreadArrays() { 1097 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 1098 for (var r = Array(s), k = 0, i = 0; i < il; i++) 1099 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 1100 r[k] = a[j]; 1101 return r; 1102 } 1103 1104 function __spreadArray(to, from, pack) { 1105 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 1106 if (ar || !(i in from)) { 1107 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 1108 ar[i] = from[i]; 1109 } 1110 } 1111 return to.concat(ar || Array.prototype.slice.call(from)); 1112 } 1113 1114 function __await(v) { 1115 return this instanceof __await ? (this.v = v, this) : new __await(v); 1116 } 1117 1118 function __asyncGenerator(thisArg, _arguments, generator) { 1119 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 1120 var g = generator.apply(thisArg, _arguments || []), i, q = []; 1121 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; 1122 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } 1123 function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } 1124 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 1125 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 1126 function fulfill(value) { resume("next", value); } 1127 function reject(value) { resume("throw", value); } 1128 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 1129 } 1130 1131 function __asyncDelegator(o) { 1132 var i, p; 1133 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 1134 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } 1135 } 1136 1137 function __asyncValues(o) { 1138 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 1139 var m = o[Symbol.asyncIterator], i; 1140 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 1141 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 1142 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 1143 } 1144 1145 function __makeTemplateObject(cooked, raw) { 1146 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 1147 return cooked; 1148 }; 1149 1150 var __setModuleDefault = Object.create ? (function(o, v) { 1151 Object.defineProperty(o, "default", { enumerable: true, value: v }); 1152 }) : function(o, v) { 1153 o["default"] = v; 1154 }; 1155 1156 var ownKeys = function(o) { 1157 ownKeys = Object.getOwnPropertyNames || function (o) { 1158 var ar = []; 1159 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; 1160 return ar; 1161 }; 1162 return ownKeys(o); 1163 }; 1164 1165 function __importStar(mod) { 1166 if (mod && mod.__esModule) return mod; 1167 var result = {}; 1168 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); 1169 __setModuleDefault(result, mod); 1170 return result; 1171 } 1172 1173 function __importDefault(mod) { 1174 return (mod && mod.__esModule) ? mod : { default: mod }; 1175 } 1176 1177 function __classPrivateFieldGet(receiver, state, kind, f) { 1178 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 1179 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); 1180 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 1181 } 1182 1183 function __classPrivateFieldSet(receiver, state, value, kind, f) { 1184 if (kind === "m") throw new TypeError("Private method is not writable"); 1185 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 1186 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); 1187 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 1188 } 1189 1190 function __classPrivateFieldIn(state, receiver) { 1191 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); 1192 return typeof state === "function" ? receiver === state : state.has(receiver); 1193 } 1194 1195 function __addDisposableResource(env, value, async) { 1196 if (value !== null && value !== void 0) { 1197 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); 1198 var dispose, inner; 1199 if (async) { 1200 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); 1201 dispose = value[Symbol.asyncDispose]; 1202 } 1203 if (dispose === void 0) { 1204 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); 1205 dispose = value[Symbol.dispose]; 1206 if (async) inner = dispose; 1207 } 1208 if (typeof dispose !== "function") throw new TypeError("Object not disposable."); 1209 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; 1210 env.stack.push({ value: value, dispose: dispose, async: async }); 1211 } 1212 else if (async) { 1213 env.stack.push({ async: true }); 1214 } 1215 return value; 1216 } 1217 1218 var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { 1219 var e = new Error(message); 1220 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; 1221 }; 1222 1223 function __disposeResources(env) { 1224 function fail(e) { 1225 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; 1226 env.hasError = true; 1227 } 1228 var r, s = 0; 1229 function next() { 1230 while (r = env.stack.pop()) { 1231 try { 1232 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); 1233 if (r.dispose) { 1234 var result = r.dispose.call(r.value); 1235 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); 1236 } 1237 else s |= 1; 1238 } 1239 catch (e) { 1240 fail(e); 1241 } 1242 } 1243 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); 1244 if (env.hasError) throw env.error; 1245 } 1246 return next(); 1247 } 1248 1249 function __rewriteRelativeImportExtension(path, preserveJsx) { 1250 if (typeof path === "string" && /^\.\.?\//.test(path)) { 1251 return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { 1252 return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); 1253 }); 1254 } 1255 return path; 1256 } 1257 1258 /* harmony default export */ const tslib_es6 = ({ 1259 __extends, 1260 __assign, 1261 __rest, 1262 __decorate, 1263 __param, 1264 __esDecorate, 1265 __runInitializers, 1266 __propKey, 1267 __setFunctionName, 1268 __metadata, 1269 __awaiter, 1270 __generator, 1271 __createBinding, 1272 __exportStar, 1273 __values, 1274 __read, 1275 __spread, 1276 __spreadArrays, 1277 __spreadArray, 1278 __await, 1279 __asyncGenerator, 1280 __asyncDelegator, 1281 __asyncValues, 1282 __makeTemplateObject, 1283 __importStar, 1284 __importDefault, 1285 __classPrivateFieldGet, 1286 __classPrivateFieldSet, 1287 __classPrivateFieldIn, 1288 __addDisposableResource, 1289 __disposeResources, 1290 __rewriteRelativeImportExtension, 1291 }); 1292 1293 ;// ./node_modules/lower-case/dist.es2015/index.js 1294 /** 1295 * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt 1296 */ 1297 var SUPPORTED_LOCALE = { 1298 tr: { 1299 regexp: /\u0130|\u0049|\u0049\u0307/g, 1300 map: { 1301 İ: "\u0069", 1302 I: "\u0131", 1303 İ: "\u0069", 1304 }, 1305 }, 1306 az: { 1307 regexp: /\u0130/g, 1308 map: { 1309 İ: "\u0069", 1310 I: "\u0131", 1311 İ: "\u0069", 1312 }, 1313 }, 1314 lt: { 1315 regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, 1316 map: { 1317 I: "\u0069\u0307", 1318 J: "\u006A\u0307", 1319 Į: "\u012F\u0307", 1320 Ì: "\u0069\u0307\u0300", 1321 Í: "\u0069\u0307\u0301", 1322 Ĩ: "\u0069\u0307\u0303", 1323 }, 1324 }, 1325 }; 1326 /** 1327 * Localized lower case. 1328 */ 1329 function localeLowerCase(str, locale) { 1330 var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; 1331 if (lang) 1332 return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); 1333 return lowerCase(str); 1334 } 1335 /** 1336 * Lower case as a function. 1337 */ 1338 function lowerCase(str) { 1339 return str.toLowerCase(); 1340 } 1341 1342 ;// ./node_modules/no-case/dist.es2015/index.js 1343 1344 // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). 1345 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; 1346 // Remove all non-word characters. 1347 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; 1348 /** 1349 * Normalize the string into something other libraries can manipulate easier. 1350 */ 1351 function noCase(input, options) { 1352 if (options === void 0) { options = {}; } 1353 var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; 1354 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); 1355 var start = 0; 1356 var end = result.length; 1357 // Trim the delimiter from around the output string. 1358 while (result.charAt(start) === "\0") 1359 start++; 1360 while (result.charAt(end - 1) === "\0") 1361 end--; 1362 // Transform each token independently. 1363 return result.slice(start, end).split("\0").map(transform).join(delimiter); 1364 } 1365 /** 1366 * Replace `re` in the input string with the replacement value. 1367 */ 1368 function replace(input, re, value) { 1369 if (re instanceof RegExp) 1370 return input.replace(re, value); 1371 return re.reduce(function (input, re) { return input.replace(re, value); }, input); 1372 } 1373 1374 ;// ./node_modules/dot-case/dist.es2015/index.js 1375 1376 1377 function dotCase(input, options) { 1378 if (options === void 0) { options = {}; } 1379 return noCase(input, __assign({ delimiter: "." }, options)); 1380 } 1381 1382 ;// ./node_modules/param-case/dist.es2015/index.js 1383 1384 1385 function paramCase(input, options) { 1386 if (options === void 0) { options = {}; } 1387 return dotCase(input, __assign({ delimiter: "-" }, options)); 1388 } 1389 1390 ;// external ["wp","escapeHtml"] 1391 const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; 1392 ;// ./node_modules/@wordpress/element/build-module/raw-html.js 1393 /* wp:polyfill */ 1394 /** 1395 * Internal dependencies 1396 */ 1397 1398 1399 /** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */ 1400 1401 /** 1402 * Component used as equivalent of Fragment with unescaped HTML, in cases where 1403 * it is desirable to render dangerous HTML without needing a wrapper element. 1404 * To preserve additional props, a `div` wrapper _will_ be created if any props 1405 * aside from `children` are passed. 1406 * 1407 * @param {RawHTMLProps} props Children should be a string of HTML or an array 1408 * of strings. Other props will be passed through 1409 * to the div wrapper. 1410 * 1411 * @return {JSX.Element} Dangerously-rendering component. 1412 */ 1413 function RawHTML({ 1414 children, 1415 ...props 1416 }) { 1417 let rawHtml = ''; 1418 1419 // Cast children as an array, and concatenate each element if it is a string. 1420 external_React_namespaceObject.Children.toArray(children).forEach(child => { 1421 if (typeof child === 'string' && child.trim() !== '') { 1422 rawHtml += child; 1423 } 1424 }); 1425 1426 // The `div` wrapper will be stripped by the `renderElement` serializer in 1427 // `./serialize.js` unless there are non-children props present. 1428 return (0,external_React_namespaceObject.createElement)('div', { 1429 dangerouslySetInnerHTML: { 1430 __html: rawHtml 1431 }, 1432 ...props 1433 }); 1434 } 1435 1436 ;// ./node_modules/@wordpress/element/build-module/serialize.js 1437 /* wp:polyfill */ 1438 /** 1439 * Parts of this source were derived and modified from fast-react-render, 1440 * released under the MIT license. 1441 * 1442 * https://github.com/alt-j/fast-react-render 1443 * 1444 * Copyright (c) 2016 Andrey Morozov 1445 * 1446 * Permission is hereby granted, free of charge, to any person obtaining a copy 1447 * of this software and associated documentation files (the "Software"), to deal 1448 * in the Software without restriction, including without limitation the rights 1449 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 1450 * copies of the Software, and to permit persons to whom the Software is 1451 * furnished to do so, subject to the following conditions: 1452 * 1453 * The above copyright notice and this permission notice shall be included in 1454 * all copies or substantial portions of the Software. 1455 * 1456 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1457 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1458 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1459 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1460 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 1461 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 1462 * THE SOFTWARE. 1463 */ 1464 1465 /** 1466 * External dependencies 1467 */ 1468 1469 1470 1471 /** 1472 * WordPress dependencies 1473 */ 1474 1475 1476 /** 1477 * Internal dependencies 1478 */ 1479 1480 1481 1482 /** @typedef {import('react').ReactElement} ReactElement */ 1483 1484 const { 1485 Provider, 1486 Consumer 1487 } = (0,external_React_namespaceObject.createContext)(undefined); 1488 const ForwardRef = (0,external_React_namespaceObject.forwardRef)(() => { 1489 return null; 1490 }); 1491 1492 /** 1493 * Valid attribute types. 1494 * 1495 * @type {Set<string>} 1496 */ 1497 const ATTRIBUTES_TYPES = new Set(['string', 'boolean', 'number']); 1498 1499 /** 1500 * Element tags which can be self-closing. 1501 * 1502 * @type {Set<string>} 1503 */ 1504 const SELF_CLOSING_TAGS = new Set(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']); 1505 1506 /** 1507 * Boolean attributes are attributes whose presence as being assigned is 1508 * meaningful, even if only empty. 1509 * 1510 * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes 1511 * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3 1512 * 1513 * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ] 1514 * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 ) 1515 * .reduce( ( result, tr ) => Object.assign( result, { 1516 * [ tr.firstChild.textContent.trim() ]: true 1517 * } ), {} ) ).sort(); 1518 * 1519 * @type {Set<string>} 1520 */ 1521 const 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']); 1522 1523 /** 1524 * Enumerated attributes are attributes which must be of a specific value form. 1525 * Like boolean attributes, these are meaningful if specified, even if not of a 1526 * valid enumerated value. 1527 * 1528 * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute 1529 * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3 1530 * 1531 * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ] 1532 * .filter( ( tr ) => /^("(.+?)";?\s*)+/.test( tr.lastChild.textContent.trim() ) ) 1533 * .reduce( ( result, tr ) => Object.assign( result, { 1534 * [ tr.firstChild.textContent.trim() ]: true 1535 * } ), {} ) ).sort(); 1536 * 1537 * Some notable omissions: 1538 * 1539 * - `alt`: https://blog.whatwg.org/omit-alt 1540 * 1541 * @type {Set<string>} 1542 */ 1543 const 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']); 1544 1545 /** 1546 * Set of CSS style properties which support assignment of unitless numbers. 1547 * Used in rendering of style properties, where `px` unit is assumed unless 1548 * property is included in this set or value is zero. 1549 * 1550 * Generated via: 1551 * 1552 * Object.entries( document.createElement( 'div' ).style ) 1553 * .filter( ( [ key ] ) => ( 1554 * ! /^(webkit|ms|moz)/.test( key ) && 1555 * ( e.style[ key ] = 10 ) && 1556 * e.style[ key ] === '10' 1557 * ) ) 1558 * .map( ( [ key ] ) => key ) 1559 * .sort(); 1560 * 1561 * @type {Set<string>} 1562 */ 1563 const 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']); 1564 1565 /** 1566 * Returns true if the specified string is prefixed by one of an array of 1567 * possible prefixes. 1568 * 1569 * @param {string} string String to check. 1570 * @param {string[]} prefixes Possible prefixes. 1571 * 1572 * @return {boolean} Whether string has prefix. 1573 */ 1574 function hasPrefix(string, prefixes) { 1575 return prefixes.some(prefix => string.indexOf(prefix) === 0); 1576 } 1577 1578 /** 1579 * Returns true if the given prop name should be ignored in attributes 1580 * serialization, or false otherwise. 1581 * 1582 * @param {string} attribute Attribute to check. 1583 * 1584 * @return {boolean} Whether attribute should be ignored. 1585 */ 1586 function isInternalAttribute(attribute) { 1587 return 'key' === attribute || 'children' === attribute; 1588 } 1589 1590 /** 1591 * Returns the normal form of the element's attribute value for HTML. 1592 * 1593 * @param {string} attribute Attribute name. 1594 * @param {*} value Non-normalized attribute value. 1595 * 1596 * @return {*} Normalized attribute value. 1597 */ 1598 function getNormalAttributeValue(attribute, value) { 1599 switch (attribute) { 1600 case 'style': 1601 return renderStyle(value); 1602 } 1603 return value; 1604 } 1605 /** 1606 * This is a map of all SVG attributes that have dashes. Map(lower case prop => dashed lower case attribute). 1607 * We need this to render e.g strokeWidth as stroke-width. 1608 * 1609 * List from: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute. 1610 */ 1611 const SVG_ATTRIBUTE_WITH_DASHES_LIST = ['accentHeight', 'alignmentBaseline', 'arabicForm', 'baselineShift', 'capHeight', 'clipPath', 'clipRule', 'colorInterpolation', 'colorInterpolationFilters', 'colorProfile', 'colorRendering', 'dominantBaseline', 'enableBackground', 'fillOpacity', 'fillRule', 'floodColor', 'floodOpacity', 'fontFamily', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontWeight', 'glyphName', 'glyphOrientationHorizontal', 'glyphOrientationVertical', 'horizAdvX', 'horizOriginX', 'imageRendering', 'letterSpacing', 'lightingColor', 'markerEnd', 'markerMid', 'markerStart', 'overlinePosition', 'overlineThickness', 'paintOrder', 'panose1', 'pointerEvents', 'renderingIntent', 'shapeRendering', 'stopColor', 'stopOpacity', 'strikethroughPosition', 'strikethroughThickness', 'strokeDasharray', 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'textAnchor', 'textDecoration', 'textRendering', 'underlinePosition', 'underlineThickness', 'unicodeBidi', 'unicodeRange', 'unitsPerEm', 'vAlphabetic', 'vHanging', 'vIdeographic', 'vMathematical', 'vectorEffect', 'vertAdvY', 'vertOriginX', 'vertOriginY', 'wordSpacing', 'writingMode', 'xmlnsXlink', 'xHeight'].reduce((map, attribute) => { 1612 // The keys are lower-cased for more robust lookup. 1613 map[attribute.toLowerCase()] = attribute; 1614 return map; 1615 }, {}); 1616 1617 /** 1618 * This is a map of all case-sensitive SVG attributes. Map(lowercase key => proper case attribute). 1619 * The keys are lower-cased for more robust lookup. 1620 * Note that this list only contains attributes that contain at least one capital letter. 1621 * Lowercase attributes don't need mapping, since we lowercase all attributes by default. 1622 */ 1623 const CASE_SENSITIVE_SVG_ATTRIBUTES = ['allowReorder', 'attributeName', 'attributeType', 'autoReverse', 'baseFrequency', 'baseProfile', 'calcMode', 'clipPathUnits', 'contentScriptType', 'contentStyleType', 'diffuseConstant', 'edgeMode', 'externalResourcesRequired', 'filterRes', 'filterUnits', 'glyphRef', 'gradientTransform', 'gradientUnits', 'kernelMatrix', 'kernelUnitLength', 'keyPoints', 'keySplines', 'keyTimes', 'lengthAdjust', 'limitingConeAngle', 'markerHeight', 'markerUnits', 'markerWidth', 'maskContentUnits', 'maskUnits', 'numOctaves', 'pathLength', 'patternContentUnits', 'patternTransform', 'patternUnits', 'pointsAtX', 'pointsAtY', 'pointsAtZ', 'preserveAlpha', 'preserveAspectRatio', 'primitiveUnits', 'refX', 'refY', 'repeatCount', 'repeatDur', 'requiredExtensions', 'requiredFeatures', 'specularConstant', 'specularExponent', 'spreadMethod', 'startOffset', 'stdDeviation', 'stitchTiles', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'surfaceScale', 'systemLanguage', 'tableValues', 'targetX', 'targetY', 'textLength', 'viewBox', 'viewTarget', 'xChannelSelector', 'yChannelSelector'].reduce((map, attribute) => { 1624 // The keys are lower-cased for more robust lookup. 1625 map[attribute.toLowerCase()] = attribute; 1626 return map; 1627 }, {}); 1628 1629 /** 1630 * This is a map of all SVG attributes that have colons. 1631 * Keys are lower-cased and stripped of their colons for more robust lookup. 1632 */ 1633 const SVG_ATTRIBUTES_WITH_COLONS = ['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'xmlns:xlink'].reduce((map, attribute) => { 1634 map[attribute.replace(':', '').toLowerCase()] = attribute; 1635 return map; 1636 }, {}); 1637 1638 /** 1639 * Returns the normal form of the element's attribute name for HTML. 1640 * 1641 * @param {string} attribute Non-normalized attribute name. 1642 * 1643 * @return {string} Normalized attribute name. 1644 */ 1645 function getNormalAttributeName(attribute) { 1646 switch (attribute) { 1647 case 'htmlFor': 1648 return 'for'; 1649 case 'className': 1650 return 'class'; 1651 } 1652 const attributeLowerCase = attribute.toLowerCase(); 1653 if (CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]) { 1654 return CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]; 1655 } else if (SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]) { 1656 return paramCase(SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]); 1657 } else if (SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]) { 1658 return SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]; 1659 } 1660 return attributeLowerCase; 1661 } 1662 1663 /** 1664 * Returns the normal form of the style property name for HTML. 1665 * 1666 * - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color' 1667 * - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor' 1668 * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform' 1669 * 1670 * @param {string} property Property name. 1671 * 1672 * @return {string} Normalized property name. 1673 */ 1674 function getNormalStylePropertyName(property) { 1675 if (property.startsWith('--')) { 1676 return property; 1677 } 1678 if (hasPrefix(property, ['ms', 'O', 'Moz', 'Webkit'])) { 1679 return '-' + paramCase(property); 1680 } 1681 return paramCase(property); 1682 } 1683 1684 /** 1685 * Returns the normal form of the style property value for HTML. Appends a 1686 * default pixel unit if numeric, not a unitless property, and not zero. 1687 * 1688 * @param {string} property Property name. 1689 * @param {*} value Non-normalized property value. 1690 * 1691 * @return {*} Normalized property value. 1692 */ 1693 function getNormalStylePropertyValue(property, value) { 1694 if (typeof value === 'number' && 0 !== value && !CSS_PROPERTIES_SUPPORTS_UNITLESS.has(property)) { 1695 return value + 'px'; 1696 } 1697 return value; 1698 } 1699 1700 /** 1701 * Serializes a React element to string. 1702 * 1703 * @param {import('react').ReactNode} element Element to serialize. 1704 * @param {Object} [context] Context object. 1705 * @param {Object} [legacyContext] Legacy context object. 1706 * 1707 * @return {string} Serialized element. 1708 */ 1709 function renderElement(element, context, legacyContext = {}) { 1710 if (null === element || undefined === element || false === element) { 1711 return ''; 1712 } 1713 if (Array.isArray(element)) { 1714 return renderChildren(element, context, legacyContext); 1715 } 1716 switch (typeof element) { 1717 case 'string': 1718 return (0,external_wp_escapeHtml_namespaceObject.escapeHTML)(element); 1719 case 'number': 1720 return element.toString(); 1721 } 1722 const { 1723 type, 1724 props 1725 } = /** @type {{type?: any, props?: any}} */ 1726 element; 1727 switch (type) { 1728 case external_React_namespaceObject.StrictMode: 1729 case external_React_namespaceObject.Fragment: 1730 return renderChildren(props.children, context, legacyContext); 1731 case RawHTML: 1732 const { 1733 children, 1734 ...wrapperProps 1735 } = props; 1736 return renderNativeComponent(!Object.keys(wrapperProps).length ? null : 'div', { 1737 ...wrapperProps, 1738 dangerouslySetInnerHTML: { 1739 __html: children 1740 } 1741 }, context, legacyContext); 1742 } 1743 switch (typeof type) { 1744 case 'string': 1745 return renderNativeComponent(type, props, context, legacyContext); 1746 case 'function': 1747 if (type.prototype && typeof type.prototype.render === 'function') { 1748 return renderComponent(type, props, context, legacyContext); 1749 } 1750 return renderElement(type(props, legacyContext), context, legacyContext); 1751 } 1752 switch (type && type.$$typeof) { 1753 case Provider.$$typeof: 1754 return renderChildren(props.children, props.value, legacyContext); 1755 case Consumer.$$typeof: 1756 return renderElement(props.children(context || type._currentValue), context, legacyContext); 1757 case ForwardRef.$$typeof: 1758 return renderElement(type.render(props), context, legacyContext); 1759 } 1760 return ''; 1761 } 1762 1763 /** 1764 * Serializes a native component type to string. 1765 * 1766 * @param {?string} type Native component type to serialize, or null if 1767 * rendering as fragment of children content. 1768 * @param {Object} props Props object. 1769 * @param {Object} [context] Context object. 1770 * @param {Object} [legacyContext] Legacy context object. 1771 * 1772 * @return {string} Serialized element. 1773 */ 1774 function renderNativeComponent(type, props, context, legacyContext = {}) { 1775 let content = ''; 1776 if (type === 'textarea' && props.hasOwnProperty('value')) { 1777 // Textarea children can be assigned as value prop. If it is, render in 1778 // place of children. Ensure to omit so it is not assigned as attribute 1779 // as well. 1780 content = renderChildren(props.value, context, legacyContext); 1781 const { 1782 value, 1783 ...restProps 1784 } = props; 1785 props = restProps; 1786 } else if (props.dangerouslySetInnerHTML && typeof props.dangerouslySetInnerHTML.__html === 'string') { 1787 // Dangerous content is left unescaped. 1788 content = props.dangerouslySetInnerHTML.__html; 1789 } else if (typeof props.children !== 'undefined') { 1790 content = renderChildren(props.children, context, legacyContext); 1791 } 1792 if (!type) { 1793 return content; 1794 } 1795 const attributes = renderAttributes(props); 1796 if (SELF_CLOSING_TAGS.has(type)) { 1797 return '<' + type + attributes + '/>'; 1798 } 1799 return '<' + type + attributes + '>' + content + '</' + type + '>'; 1800 } 1801 1802 /** @typedef {import('react').ComponentType} ComponentType */ 1803 1804 /** 1805 * Serializes a non-native component type to string. 1806 * 1807 * @param {ComponentType} Component Component type to serialize. 1808 * @param {Object} props Props object. 1809 * @param {Object} [context] Context object. 1810 * @param {Object} [legacyContext] Legacy context object. 1811 * 1812 * @return {string} Serialized element 1813 */ 1814 function renderComponent(Component, props, context, legacyContext = {}) { 1815 const instance = new (/** @type {import('react').ComponentClass} */ 1816 Component)(props, legacyContext); 1817 if (typeof 1818 // Ignore reason: Current prettier reformats parens and mangles type assertion 1819 // prettier-ignore 1820 /** @type {{getChildContext?: () => unknown}} */ 1821 instance.getChildContext === 'function') { 1822 Object.assign(legacyContext, /** @type {{getChildContext?: () => unknown}} */instance.getChildContext()); 1823 } 1824 const html = renderElement(instance.render(), context, legacyContext); 1825 return html; 1826 } 1827 1828 /** 1829 * Serializes an array of children to string. 1830 * 1831 * @param {import('react').ReactNodeArray} children Children to serialize. 1832 * @param {Object} [context] Context object. 1833 * @param {Object} [legacyContext] Legacy context object. 1834 * 1835 * @return {string} Serialized children. 1836 */ 1837 function renderChildren(children, context, legacyContext = {}) { 1838 let result = ''; 1839 children = Array.isArray(children) ? children : [children]; 1840 for (let i = 0; i < children.length; i++) { 1841 const child = children[i]; 1842 result += renderElement(child, context, legacyContext); 1843 } 1844 return result; 1845 } 1846 1847 /** 1848 * Renders a props object as a string of HTML attributes. 1849 * 1850 * @param {Object} props Props object. 1851 * 1852 * @return {string} Attributes string. 1853 */ 1854 function renderAttributes(props) { 1855 let result = ''; 1856 for (const key in props) { 1857 const attribute = getNormalAttributeName(key); 1858 if (!(0,external_wp_escapeHtml_namespaceObject.isValidAttributeName)(attribute)) { 1859 continue; 1860 } 1861 let value = getNormalAttributeValue(key, props[key]); 1862 1863 // If value is not of serializable type, skip. 1864 if (!ATTRIBUTES_TYPES.has(typeof value)) { 1865 continue; 1866 } 1867 1868 // Don't render internal attribute names. 1869 if (isInternalAttribute(key)) { 1870 continue; 1871 } 1872 const isBooleanAttribute = BOOLEAN_ATTRIBUTES.has(attribute); 1873 1874 // Boolean attribute should be omitted outright if its value is false. 1875 if (isBooleanAttribute && value === false) { 1876 continue; 1877 } 1878 const isMeaningfulAttribute = isBooleanAttribute || hasPrefix(key, ['data-', 'aria-']) || ENUMERATED_ATTRIBUTES.has(attribute); 1879 1880 // Only write boolean value as attribute if meaningful. 1881 if (typeof value === 'boolean' && !isMeaningfulAttribute) { 1882 continue; 1883 } 1884 result += ' ' + attribute; 1885 1886 // Boolean attributes should write attribute name, but without value. 1887 // Mere presence of attribute name is effective truthiness. 1888 if (isBooleanAttribute) { 1889 continue; 1890 } 1891 if (typeof value === 'string') { 1892 value = (0,external_wp_escapeHtml_namespaceObject.escapeAttribute)(value); 1893 } 1894 result += '="' + value + '"'; 1895 } 1896 return result; 1897 } 1898 1899 /** 1900 * Renders a style object as a string attribute value. 1901 * 1902 * @param {Object} style Style object. 1903 * 1904 * @return {string} Style attribute value. 1905 */ 1906 function renderStyle(style) { 1907 // Only generate from object, e.g. tolerate string value. 1908 if (!isPlainObject(style)) { 1909 return style; 1910 } 1911 let result; 1912 for (const property in style) { 1913 const value = style[property]; 1914 if (null === value || undefined === value) { 1915 continue; 1916 } 1917 if (result) { 1918 result += ';'; 1919 } else { 1920 result = ''; 1921 } 1922 const normalName = getNormalStylePropertyName(property); 1923 const normalValue = getNormalStylePropertyValue(property, value); 1924 result += normalName + ':' + normalValue; 1925 } 1926 return result; 1927 } 1928 /* harmony default export */ const serialize = (renderElement); 1929 1930 ;// ./node_modules/@wordpress/element/build-module/index.js 1931 1932 1933 1934 1935 1936 1937 1938 1939 (window.wp = window.wp || {}).element = __webpack_exports__; 1940 /******/ })() 1941 ;
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Tue Feb 18 08:20:02 2025 | Cross-referenced by PHPXref |