element.js 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102
  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 = 359);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 10:
  90. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91. "use strict";
  92. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
  93. function _defineProperty(obj, key, value) {
  94. if (key in obj) {
  95. Object.defineProperty(obj, key, {
  96. value: value,
  97. enumerable: true,
  98. configurable: true,
  99. writable: true
  100. });
  101. } else {
  102. obj[key] = value;
  103. }
  104. return obj;
  105. }
  106. /***/ }),
  107. /***/ 2:
  108. /***/ (function(module, exports) {
  109. (function() { module.exports = this["lodash"]; }());
  110. /***/ }),
  111. /***/ 21:
  112. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113. "use strict";
  114. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
  115. function _objectWithoutPropertiesLoose(source, excluded) {
  116. if (source == null) return {};
  117. var target = {};
  118. var sourceKeys = Object.keys(source);
  119. var key, i;
  120. for (i = 0; i < sourceKeys.length; i++) {
  121. key = sourceKeys[i];
  122. if (excluded.indexOf(key) >= 0) continue;
  123. target[key] = source[key];
  124. }
  125. return target;
  126. }
  127. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
  128. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
  129. function _objectWithoutProperties(source, excluded) {
  130. if (source == null) return {};
  131. var target = _objectWithoutPropertiesLoose(source, excluded);
  132. var key, i;
  133. if (Object.getOwnPropertySymbols) {
  134. var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
  135. for (i = 0; i < sourceSymbolKeys.length; i++) {
  136. key = sourceSymbolKeys[i];
  137. if (excluded.indexOf(key) >= 0) continue;
  138. if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
  139. target[key] = source[key];
  140. }
  141. }
  142. return target;
  143. }
  144. /***/ }),
  145. /***/ 28:
  146. /***/ (function(module, exports) {
  147. (function() { module.exports = this["React"]; }());
  148. /***/ }),
  149. /***/ 31:
  150. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  151. "use strict";
  152. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
  153. function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
  154. function _typeof(obj) {
  155. if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
  156. _typeof = function _typeof(obj) {
  157. return _typeof2(obj);
  158. };
  159. } else {
  160. _typeof = function _typeof(obj) {
  161. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
  162. };
  163. }
  164. return _typeof(obj);
  165. }
  166. /***/ }),
  167. /***/ 359:
  168. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  169. "use strict";
  170. __webpack_require__.r(__webpack_exports__);
  171. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
  172. var objectSpread = __webpack_require__(7);
  173. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
  174. var objectWithoutProperties = __webpack_require__(21);
  175. // EXTERNAL MODULE: external "React"
  176. var external_React_ = __webpack_require__(28);
  177. // EXTERNAL MODULE: external "lodash"
  178. var external_lodash_ = __webpack_require__(2);
  179. // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/react.js
  180. /**
  181. * External dependencies
  182. */
  183. /**
  184. * Object that provides utilities for dealing with React children.
  185. */
  186. /**
  187. * Creates a copy of an element with extended props.
  188. *
  189. * @param {WPElement} element Element
  190. * @param {?Object} props Props to apply to cloned element
  191. *
  192. * @return {WPElement} Cloned element.
  193. */
  194. /**
  195. * A base class to create WordPress Components (Refs, state and lifecycle hooks)
  196. */
  197. /**
  198. * Creates a context object containing two components: a provider and consumer.
  199. *
  200. * @param {Object} defaultValue A default data stored in the context.
  201. *
  202. * @return {Object} Context object.
  203. */
  204. /**
  205. * Returns a new element of given type. Type can be either a string tag name or
  206. * another function which itself returns an element.
  207. *
  208. * @param {?(string|Function)} type Tag name or element creator
  209. * @param {Object} props Element properties, either attribute
  210. * set to apply to DOM node or values to
  211. * pass through to element creator
  212. * @param {...WPElement} children Descendant elements
  213. *
  214. * @return {WPElement} Element.
  215. */
  216. /**
  217. * Returns an object tracking a reference to a rendered element via its
  218. * `current` property as either a DOMElement or Element, dependent upon the
  219. * type of element rendered with the ref attribute.
  220. *
  221. * @return {Object} Ref object.
  222. */
  223. /**
  224. * Component enhancer used to enable passing a ref to its wrapped component.
  225. * Pass a function argument which receives `props` and `ref` as its arguments,
  226. * returning an element using the forwarded ref. The return value is a new
  227. * component which forwards its ref.
  228. *
  229. * @param {Function} forwarder Function passed `props` and `ref`, expected to
  230. * return an element.
  231. *
  232. * @return {WPComponent} Enhanced component.
  233. */
  234. /**
  235. * A component which renders its children without any wrapping element.
  236. */
  237. /**
  238. * Checks if an object is a valid WPElement
  239. *
  240. * @param {Object} objectToCheck The object to be checked.
  241. *
  242. * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.
  243. */
  244. /**
  245. * @see https://reactjs.org/docs/react-api.html#reactmemo
  246. */
  247. /**
  248. * Component that activates additional checks and warnings for its descendants.
  249. */
  250. /**
  251. * @see https://reactjs.org/docs/hooks-reference.html#usecallback
  252. */
  253. /**
  254. * @see https://reactjs.org/docs/hooks-reference.html#usecontext
  255. */
  256. /**
  257. * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue
  258. */
  259. /**
  260. * @see https://reactjs.org/docs/hooks-reference.html#useeffect
  261. */
  262. /**
  263. * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
  264. */
  265. /**
  266. * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
  267. */
  268. /**
  269. * @see https://reactjs.org/docs/hooks-reference.html#usememo
  270. */
  271. /**
  272. * @see https://reactjs.org/docs/hooks-reference.html#usereducer
  273. */
  274. /**
  275. * @see https://reactjs.org/docs/hooks-reference.html#useref
  276. */
  277. /**
  278. * @see https://reactjs.org/docs/hooks-reference.html#usestate
  279. */
  280. /**
  281. * @see https://reactjs.org/docs/react-api.html#reactlazy
  282. */
  283. /**
  284. * @see https://reactjs.org/docs/react-api.html#reactsuspense
  285. */
  286. /**
  287. * Concatenate two or more React children objects.
  288. *
  289. * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.
  290. *
  291. * @return {Array} The concatenated value.
  292. */
  293. function concatChildren() {
  294. for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
  295. childrenArguments[_key] = arguments[_key];
  296. }
  297. return childrenArguments.reduce(function (result, children, i) {
  298. external_React_["Children"].forEach(children, function (child, j) {
  299. if (child && 'string' !== typeof child) {
  300. child = Object(external_React_["cloneElement"])(child, {
  301. key: [i, j].join()
  302. });
  303. }
  304. result.push(child);
  305. });
  306. return result;
  307. }, []);
  308. }
  309. /**
  310. * Switches the nodeName of all the elements in the children object.
  311. *
  312. * @param {?Object} children Children object.
  313. * @param {string} nodeName Node name.
  314. *
  315. * @return {?Object} The updated children object.
  316. */
  317. function switchChildrenNodeName(children, nodeName) {
  318. return children && external_React_["Children"].map(children, function (elt, index) {
  319. if (Object(external_lodash_["isString"])(elt)) {
  320. return Object(external_React_["createElement"])(nodeName, {
  321. key: index
  322. }, elt);
  323. }
  324. var _elt$props = elt.props,
  325. childrenProp = _elt$props.children,
  326. props = Object(objectWithoutProperties["a" /* default */])(_elt$props, ["children"]);
  327. return Object(external_React_["createElement"])(nodeName, Object(objectSpread["a" /* default */])({
  328. key: index
  329. }, props), childrenProp);
  330. });
  331. }
  332. // EXTERNAL MODULE: external "ReactDOM"
  333. var external_ReactDOM_ = __webpack_require__(57);
  334. // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/react-platform.js
  335. /**
  336. * External dependencies
  337. */
  338. /**
  339. * Creates a portal into which a component can be rendered.
  340. *
  341. * @see https://github.com/facebook/react/issues/10309#issuecomment-318433235
  342. *
  343. * @param {Component} component Component
  344. * @param {Element} target DOM node into which element should be rendered
  345. */
  346. /**
  347. * Finds the dom node of a React component
  348. *
  349. * @param {Component} component component's instance
  350. * @param {Element} target DOM node into which element should be rendered
  351. */
  352. /**
  353. * Renders a given element into the target DOM node.
  354. *
  355. * @param {WPElement} element Element to render
  356. * @param {Element} target DOM node into which element should be rendered
  357. */
  358. /**
  359. * Removes any mounted element from the target DOM node.
  360. *
  361. * @param {Element} target DOM node in which element is to be removed
  362. */
  363. // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/utils.js
  364. /**
  365. * External dependencies
  366. */
  367. /**
  368. * Checks if the provided WP element is empty.
  369. *
  370. * @param {*} element WP element to check.
  371. * @return {boolean} True when an element is considered empty.
  372. */
  373. var utils_isEmptyElement = function isEmptyElement(element) {
  374. if (Object(external_lodash_["isNumber"])(element)) {
  375. return false;
  376. }
  377. if (Object(external_lodash_["isString"])(element) || Object(external_lodash_["isArray"])(element)) {
  378. return !element.length;
  379. }
  380. return !element;
  381. };
  382. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
  383. var esm_typeof = __webpack_require__(31);
  384. // EXTERNAL MODULE: external {"this":["wp","escapeHtml"]}
  385. var external_this_wp_escapeHtml_ = __webpack_require__(71);
  386. // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/raw-html.js
  387. /**
  388. * Internal dependencies
  389. */
  390. /**
  391. * Component used as equivalent of Fragment with unescaped HTML, in cases where
  392. * it is desirable to render dangerous HTML without needing a wrapper element.
  393. * To preserve additional props, a `div` wrapper _will_ be created if any props
  394. * aside from `children` are passed.
  395. *
  396. * @param {Object} props
  397. * @param {string} props.children HTML to render.
  398. * @param {Object} props.props Any additonal props to be set on the containing div.
  399. *
  400. * @return {WPElement} Dangerously-rendering element.
  401. */
  402. function RawHTML(_ref) {
  403. var children = _ref.children,
  404. props = Object(objectWithoutProperties["a" /* default */])(_ref, ["children"]);
  405. // The DIV wrapper will be stripped by serializer, unless there are
  406. // non-children props present.
  407. return Object(external_React_["createElement"])('div', Object(objectSpread["a" /* default */])({
  408. dangerouslySetInnerHTML: {
  409. __html: children
  410. }
  411. }, props));
  412. }
  413. // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/serialize.js
  414. /**
  415. * Parts of this source were derived and modified from fast-react-render,
  416. * released under the MIT license.
  417. *
  418. * https://github.com/alt-j/fast-react-render
  419. *
  420. * Copyright (c) 2016 Andrey Morozov
  421. *
  422. * Permission is hereby granted, free of charge, to any person obtaining a copy
  423. * of this software and associated documentation files (the "Software"), to deal
  424. * in the Software without restriction, including without limitation the rights
  425. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  426. * copies of the Software, and to permit persons to whom the Software is
  427. * furnished to do so, subject to the following conditions:
  428. *
  429. * The above copyright notice and this permission notice shall be included in
  430. * all copies or substantial portions of the Software.
  431. *
  432. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  433. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  434. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  435. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  436. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  437. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  438. * THE SOFTWARE.
  439. */
  440. /**
  441. * External dependencies
  442. */
  443. /**
  444. * WordPress dependencies
  445. */
  446. /**
  447. * Internal dependencies
  448. */
  449. var _createContext = Object(external_React_["createContext"])(),
  450. Provider = _createContext.Provider,
  451. Consumer = _createContext.Consumer;
  452. var ForwardRef = Object(external_React_["forwardRef"])(function () {
  453. return null;
  454. });
  455. /**
  456. * Valid attribute types.
  457. *
  458. * @type {Set}
  459. */
  460. var ATTRIBUTES_TYPES = new Set(['string', 'boolean', 'number']);
  461. /**
  462. * Element tags which can be self-closing.
  463. *
  464. * @type {Set}
  465. */
  466. var SELF_CLOSING_TAGS = new Set(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']);
  467. /**
  468. * Boolean attributes are attributes whose presence as being assigned is
  469. * meaningful, even if only empty.
  470. *
  471. * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes
  472. * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3
  473. *
  474. * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]
  475. * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )
  476. * .reduce( ( result, tr ) => Object.assign( result, {
  477. * [ tr.firstChild.textContent.trim() ]: true
  478. * } ), {} ) ).sort();
  479. *
  480. * @type {Set}
  481. */
  482. 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']);
  483. /**
  484. * Enumerated attributes are attributes which must be of a specific value form.
  485. * Like boolean attributes, these are meaningful if specified, even if not of a
  486. * valid enumerated value.
  487. *
  488. * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute
  489. * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3
  490. *
  491. * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]
  492. * .filter( ( tr ) => /^("(.+?)";?\s*)+/.test( tr.lastChild.textContent.trim() ) )
  493. * .reduce( ( result, tr ) => Object.assign( result, {
  494. * [ tr.firstChild.textContent.trim() ]: true
  495. * } ), {} ) ).sort();
  496. *
  497. * Some notable omissions:
  498. *
  499. * - `alt`: https://blog.whatwg.org/omit-alt
  500. *
  501. * @type {Set}
  502. */
  503. 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']);
  504. /**
  505. * Set of CSS style properties which support assignment of unitless numbers.
  506. * Used in rendering of style properties, where `px` unit is assumed unless
  507. * property is included in this set or value is zero.
  508. *
  509. * Generated via:
  510. *
  511. * Object.entries( document.createElement( 'div' ).style )
  512. * .filter( ( [ key ] ) => (
  513. * ! /^(webkit|ms|moz)/.test( key ) &&
  514. * ( e.style[ key ] = 10 ) &&
  515. * e.style[ key ] === '10'
  516. * ) )
  517. * .map( ( [ key ] ) => key )
  518. * .sort();
  519. *
  520. * @type {Set}
  521. */
  522. 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']);
  523. /**
  524. * Returns true if the specified string is prefixed by one of an array of
  525. * possible prefixes.
  526. *
  527. * @param {string} string String to check.
  528. * @param {string[]} prefixes Possible prefixes.
  529. *
  530. * @return {boolean} Whether string has prefix.
  531. */
  532. function hasPrefix(string, prefixes) {
  533. return prefixes.some(function (prefix) {
  534. return string.indexOf(prefix) === 0;
  535. });
  536. }
  537. /**
  538. * Returns true if the given prop name should be ignored in attributes
  539. * serialization, or false otherwise.
  540. *
  541. * @param {string} attribute Attribute to check.
  542. *
  543. * @return {boolean} Whether attribute should be ignored.
  544. */
  545. function isInternalAttribute(attribute) {
  546. return 'key' === attribute || 'children' === attribute;
  547. }
  548. /**
  549. * Returns the normal form of the element's attribute value for HTML.
  550. *
  551. * @param {string} attribute Attribute name.
  552. * @param {*} value Non-normalized attribute value.
  553. *
  554. * @return {string} Normalized attribute value.
  555. */
  556. function getNormalAttributeValue(attribute, value) {
  557. switch (attribute) {
  558. case 'style':
  559. return renderStyle(value);
  560. }
  561. return value;
  562. }
  563. /**
  564. * Returns the normal form of the element's attribute name for HTML.
  565. *
  566. * @param {string} attribute Non-normalized attribute name.
  567. *
  568. * @return {string} Normalized attribute name.
  569. */
  570. function getNormalAttributeName(attribute) {
  571. switch (attribute) {
  572. case 'htmlFor':
  573. return 'for';
  574. case 'className':
  575. return 'class';
  576. }
  577. return attribute.toLowerCase();
  578. }
  579. /**
  580. * Returns the normal form of the style property name for HTML.
  581. *
  582. * - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color'
  583. * - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor'
  584. * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform'
  585. *
  586. * @param {string} property Property name.
  587. *
  588. * @return {string} Normalized property name.
  589. */
  590. function getNormalStylePropertyName(property) {
  591. if (Object(external_lodash_["startsWith"])(property, '--')) {
  592. return property;
  593. }
  594. if (hasPrefix(property, ['ms', 'O', 'Moz', 'Webkit'])) {
  595. return '-' + Object(external_lodash_["kebabCase"])(property);
  596. }
  597. return Object(external_lodash_["kebabCase"])(property);
  598. }
  599. /**
  600. * Returns the normal form of the style property value for HTML. Appends a
  601. * default pixel unit if numeric, not a unitless property, and not zero.
  602. *
  603. * @param {string} property Property name.
  604. * @param {*} value Non-normalized property value.
  605. *
  606. * @return {*} Normalized property value.
  607. */
  608. function getNormalStylePropertyValue(property, value) {
  609. if (typeof value === 'number' && 0 !== value && !CSS_PROPERTIES_SUPPORTS_UNITLESS.has(property)) {
  610. return value + 'px';
  611. }
  612. return value;
  613. }
  614. /**
  615. * Serializes a React element to string.
  616. *
  617. * @param {WPElement} element Element to serialize.
  618. * @param {?Object} context Context object.
  619. * @param {?Object} legacyContext Legacy context object.
  620. *
  621. * @return {string} Serialized element.
  622. */
  623. function renderElement(element, context) {
  624. var legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  625. if (null === element || undefined === element || false === element) {
  626. return '';
  627. }
  628. if (Array.isArray(element)) {
  629. return renderChildren(element, context, legacyContext);
  630. }
  631. switch (Object(esm_typeof["a" /* default */])(element)) {
  632. case 'string':
  633. return Object(external_this_wp_escapeHtml_["escapeHTML"])(element);
  634. case 'number':
  635. return element.toString();
  636. }
  637. var type = element.type,
  638. props = element.props;
  639. switch (type) {
  640. case external_React_["StrictMode"]:
  641. case external_React_["Fragment"]:
  642. return renderChildren(props.children, context, legacyContext);
  643. case RawHTML:
  644. var children = props.children,
  645. wrapperProps = Object(objectWithoutProperties["a" /* default */])(props, ["children"]);
  646. return renderNativeComponent(Object(external_lodash_["isEmpty"])(wrapperProps) ? null : 'div', Object(objectSpread["a" /* default */])({}, wrapperProps, {
  647. dangerouslySetInnerHTML: {
  648. __html: children
  649. }
  650. }), context, legacyContext);
  651. }
  652. switch (Object(esm_typeof["a" /* default */])(type)) {
  653. case 'string':
  654. return renderNativeComponent(type, props, context, legacyContext);
  655. case 'function':
  656. if (type.prototype && typeof type.prototype.render === 'function') {
  657. return renderComponent(type, props, context, legacyContext);
  658. }
  659. return renderElement(type(props, legacyContext), context, legacyContext);
  660. }
  661. switch (type && type.$$typeof) {
  662. case Provider.$$typeof:
  663. return renderChildren(props.children, props.value, legacyContext);
  664. case Consumer.$$typeof:
  665. return renderElement(props.children(context || type._currentValue), context, legacyContext);
  666. case ForwardRef.$$typeof:
  667. return renderElement(type.render(props), context, legacyContext);
  668. }
  669. return '';
  670. }
  671. /**
  672. * Serializes a native component type to string.
  673. *
  674. * @param {?string} type Native component type to serialize, or null if
  675. * rendering as fragment of children content.
  676. * @param {Object} props Props object.
  677. * @param {?Object} context Context object.
  678. * @param {?Object} legacyContext Legacy context object.
  679. *
  680. * @return {string} Serialized element.
  681. */
  682. function renderNativeComponent(type, props, context) {
  683. var legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  684. var content = '';
  685. if (type === 'textarea' && props.hasOwnProperty('value')) {
  686. // Textarea children can be assigned as value prop. If it is, render in
  687. // place of children. Ensure to omit so it is not assigned as attribute
  688. // as well.
  689. content = renderChildren(props.value, context, legacyContext);
  690. props = Object(external_lodash_["omit"])(props, 'value');
  691. } else if (props.dangerouslySetInnerHTML && typeof props.dangerouslySetInnerHTML.__html === 'string') {
  692. // Dangerous content is left unescaped.
  693. content = props.dangerouslySetInnerHTML.__html;
  694. } else if (typeof props.children !== 'undefined') {
  695. content = renderChildren(props.children, context, legacyContext);
  696. }
  697. if (!type) {
  698. return content;
  699. }
  700. var attributes = renderAttributes(props);
  701. if (SELF_CLOSING_TAGS.has(type)) {
  702. return '<' + type + attributes + '/>';
  703. }
  704. return '<' + type + attributes + '>' + content + '</' + type + '>';
  705. }
  706. /**
  707. * Serializes a non-native component type to string.
  708. *
  709. * @param {Function} Component Component type to serialize.
  710. * @param {Object} props Props object.
  711. * @param {?Object} context Context object.
  712. * @param {?Object} legacyContext Legacy context object.
  713. *
  714. * @return {string} Serialized element
  715. */
  716. function renderComponent(Component, props, context) {
  717. var legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  718. var instance = new Component(props, legacyContext);
  719. if (typeof instance.getChildContext === 'function') {
  720. Object.assign(legacyContext, instance.getChildContext());
  721. }
  722. var html = renderElement(instance.render(), context, legacyContext);
  723. return html;
  724. }
  725. /**
  726. * Serializes an array of children to string.
  727. *
  728. * @param {Array} children Children to serialize.
  729. * @param {?Object} context Context object.
  730. * @param {?Object} legacyContext Legacy context object.
  731. *
  732. * @return {string} Serialized children.
  733. */
  734. function renderChildren(children, context) {
  735. var legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  736. var result = '';
  737. children = Object(external_lodash_["castArray"])(children);
  738. for (var i = 0; i < children.length; i++) {
  739. var child = children[i];
  740. result += renderElement(child, context, legacyContext);
  741. }
  742. return result;
  743. }
  744. /**
  745. * Renders a props object as a string of HTML attributes.
  746. *
  747. * @param {Object} props Props object.
  748. *
  749. * @return {string} Attributes string.
  750. */
  751. function renderAttributes(props) {
  752. var result = '';
  753. for (var key in props) {
  754. var attribute = getNormalAttributeName(key);
  755. if (!Object(external_this_wp_escapeHtml_["isValidAttributeName"])(attribute)) {
  756. continue;
  757. }
  758. var value = getNormalAttributeValue(key, props[key]); // If value is not of serializeable type, skip.
  759. if (!ATTRIBUTES_TYPES.has(Object(esm_typeof["a" /* default */])(value))) {
  760. continue;
  761. } // Don't render internal attribute names.
  762. if (isInternalAttribute(key)) {
  763. continue;
  764. }
  765. var isBooleanAttribute = BOOLEAN_ATTRIBUTES.has(attribute); // Boolean attribute should be omitted outright if its value is false.
  766. if (isBooleanAttribute && value === false) {
  767. continue;
  768. }
  769. var isMeaningfulAttribute = isBooleanAttribute || hasPrefix(key, ['data-', 'aria-']) || ENUMERATED_ATTRIBUTES.has(attribute); // Only write boolean value as attribute if meaningful.
  770. if (typeof value === 'boolean' && !isMeaningfulAttribute) {
  771. continue;
  772. }
  773. result += ' ' + attribute; // Boolean attributes should write attribute name, but without value.
  774. // Mere presence of attribute name is effective truthiness.
  775. if (isBooleanAttribute) {
  776. continue;
  777. }
  778. if (typeof value === 'string') {
  779. value = Object(external_this_wp_escapeHtml_["escapeAttribute"])(value);
  780. }
  781. result += '="' + value + '"';
  782. }
  783. return result;
  784. }
  785. /**
  786. * Renders a style object as a string attribute value.
  787. *
  788. * @param {Object} style Style object.
  789. *
  790. * @return {string} Style attribute value.
  791. */
  792. function renderStyle(style) {
  793. // Only generate from object, e.g. tolerate string value.
  794. if (!Object(external_lodash_["isPlainObject"])(style)) {
  795. return style;
  796. }
  797. var result;
  798. for (var property in style) {
  799. var value = style[property];
  800. if (null === value || undefined === value) {
  801. continue;
  802. }
  803. if (result) {
  804. result += ';';
  805. } else {
  806. result = '';
  807. }
  808. var normalName = getNormalStylePropertyName(property);
  809. var normalValue = getNormalStylePropertyValue(property, value);
  810. result += normalName + ':' + normalValue;
  811. }
  812. return result;
  813. }
  814. /* harmony default export */ var serialize = (renderElement);
  815. // CONCATENATED MODULE: ./node_modules/@wordpress/element/build-module/index.js
  816. /* concated harmony reexport Children */__webpack_require__.d(__webpack_exports__, "Children", function() { return external_React_["Children"]; });
  817. /* concated harmony reexport cloneElement */__webpack_require__.d(__webpack_exports__, "cloneElement", function() { return external_React_["cloneElement"]; });
  818. /* concated harmony reexport Component */__webpack_require__.d(__webpack_exports__, "Component", function() { return external_React_["Component"]; });
  819. /* concated harmony reexport createContext */__webpack_require__.d(__webpack_exports__, "createContext", function() { return external_React_["createContext"]; });
  820. /* concated harmony reexport createElement */__webpack_require__.d(__webpack_exports__, "createElement", function() { return external_React_["createElement"]; });
  821. /* concated harmony reexport createRef */__webpack_require__.d(__webpack_exports__, "createRef", function() { return external_React_["createRef"]; });
  822. /* concated harmony reexport forwardRef */__webpack_require__.d(__webpack_exports__, "forwardRef", function() { return external_React_["forwardRef"]; });
  823. /* concated harmony reexport Fragment */__webpack_require__.d(__webpack_exports__, "Fragment", function() { return external_React_["Fragment"]; });
  824. /* concated harmony reexport isValidElement */__webpack_require__.d(__webpack_exports__, "isValidElement", function() { return external_React_["isValidElement"]; });
  825. /* concated harmony reexport memo */__webpack_require__.d(__webpack_exports__, "memo", function() { return external_React_["memo"]; });
  826. /* concated harmony reexport StrictMode */__webpack_require__.d(__webpack_exports__, "StrictMode", function() { return external_React_["StrictMode"]; });
  827. /* concated harmony reexport useCallback */__webpack_require__.d(__webpack_exports__, "useCallback", function() { return external_React_["useCallback"]; });
  828. /* concated harmony reexport useContext */__webpack_require__.d(__webpack_exports__, "useContext", function() { return external_React_["useContext"]; });
  829. /* concated harmony reexport useDebugValue */__webpack_require__.d(__webpack_exports__, "useDebugValue", function() { return external_React_["useDebugValue"]; });
  830. /* concated harmony reexport useEffect */__webpack_require__.d(__webpack_exports__, "useEffect", function() { return external_React_["useEffect"]; });
  831. /* concated harmony reexport useImperativeHandle */__webpack_require__.d(__webpack_exports__, "useImperativeHandle", function() { return external_React_["useImperativeHandle"]; });
  832. /* concated harmony reexport useLayoutEffect */__webpack_require__.d(__webpack_exports__, "useLayoutEffect", function() { return external_React_["useLayoutEffect"]; });
  833. /* concated harmony reexport useMemo */__webpack_require__.d(__webpack_exports__, "useMemo", function() { return external_React_["useMemo"]; });
  834. /* concated harmony reexport useReducer */__webpack_require__.d(__webpack_exports__, "useReducer", function() { return external_React_["useReducer"]; });
  835. /* concated harmony reexport useRef */__webpack_require__.d(__webpack_exports__, "useRef", function() { return external_React_["useRef"]; });
  836. /* concated harmony reexport useState */__webpack_require__.d(__webpack_exports__, "useState", function() { return external_React_["useState"]; });
  837. /* concated harmony reexport lazy */__webpack_require__.d(__webpack_exports__, "lazy", function() { return external_React_["lazy"]; });
  838. /* concated harmony reexport Suspense */__webpack_require__.d(__webpack_exports__, "Suspense", function() { return external_React_["Suspense"]; });
  839. /* concated harmony reexport concatChildren */__webpack_require__.d(__webpack_exports__, "concatChildren", function() { return concatChildren; });
  840. /* concated harmony reexport switchChildrenNodeName */__webpack_require__.d(__webpack_exports__, "switchChildrenNodeName", function() { return switchChildrenNodeName; });
  841. /* concated harmony reexport createPortal */__webpack_require__.d(__webpack_exports__, "createPortal", function() { return external_ReactDOM_["createPortal"]; });
  842. /* concated harmony reexport findDOMNode */__webpack_require__.d(__webpack_exports__, "findDOMNode", function() { return external_ReactDOM_["findDOMNode"]; });
  843. /* concated harmony reexport render */__webpack_require__.d(__webpack_exports__, "render", function() { return external_ReactDOM_["render"]; });
  844. /* concated harmony reexport unmountComponentAtNode */__webpack_require__.d(__webpack_exports__, "unmountComponentAtNode", function() { return external_ReactDOM_["unmountComponentAtNode"]; });
  845. /* concated harmony reexport isEmptyElement */__webpack_require__.d(__webpack_exports__, "isEmptyElement", function() { return utils_isEmptyElement; });
  846. /* concated harmony reexport renderToString */__webpack_require__.d(__webpack_exports__, "renderToString", function() { return serialize; });
  847. /* concated harmony reexport RawHTML */__webpack_require__.d(__webpack_exports__, "RawHTML", function() { return RawHTML; });
  848. /***/ }),
  849. /***/ 57:
  850. /***/ (function(module, exports) {
  851. (function() { module.exports = this["ReactDOM"]; }());
  852. /***/ }),
  853. /***/ 7:
  854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  855. "use strict";
  856. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; });
  857. /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
  858. function _objectSpread(target) {
  859. for (var i = 1; i < arguments.length; i++) {
  860. var source = arguments[i] != null ? arguments[i] : {};
  861. var ownKeys = Object.keys(source);
  862. if (typeof Object.getOwnPropertySymbols === 'function') {
  863. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  864. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  865. }));
  866. }
  867. ownKeys.forEach(function (key) {
  868. Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]);
  869. });
  870. }
  871. return target;
  872. }
  873. /***/ }),
  874. /***/ 71:
  875. /***/ (function(module, exports) {
  876. (function() { module.exports = this["wp"]["escapeHtml"]; }());
  877. /***/ })
  878. /******/ });