this["wp"] = this["wp"] || {}; this["wp"]["dom"] = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 453); /******/ }) /************************************************************************/ /******/ ({ /***/ 15: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js var arrayLikeToArray = __webpack_require__(24); // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr); } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js var iterableToArray = __webpack_require__(39); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js var unsupportedIterableToArray = __webpack_require__(28); // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread(); } /***/ }), /***/ 2: /***/ (function(module, exports) { (function() { module.exports = window["lodash"]; }()); /***/ }), /***/ 24: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; }); function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /***/ }), /***/ 28: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; }); /* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24); function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Object(_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); } /***/ }), /***/ 39: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } /***/ }), /***/ 453: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "focus", function() { return /* binding */ build_module_focus; }); __webpack_require__.d(__webpack_exports__, "computeCaretRect", function() { return /* reexport */ computeCaretRect; }); __webpack_require__.d(__webpack_exports__, "documentHasTextSelection", function() { return /* reexport */ documentHasTextSelection; }); __webpack_require__.d(__webpack_exports__, "documentHasUncollapsedSelection", function() { return /* reexport */ documentHasUncollapsedSelection; }); __webpack_require__.d(__webpack_exports__, "documentHasSelection", function() { return /* reexport */ documentHasSelection; }); __webpack_require__.d(__webpack_exports__, "getRectangleFromRange", function() { return /* reexport */ getRectangleFromRange; }); __webpack_require__.d(__webpack_exports__, "getScrollContainer", function() { return /* reexport */ getScrollContainer; }); __webpack_require__.d(__webpack_exports__, "getOffsetParent", function() { return /* reexport */ getOffsetParent; }); __webpack_require__.d(__webpack_exports__, "isEntirelySelected", function() { return /* reexport */ isEntirelySelected; }); __webpack_require__.d(__webpack_exports__, "isHorizontalEdge", function() { return /* reexport */ isHorizontalEdge; }); __webpack_require__.d(__webpack_exports__, "isNumberInput", function() { return /* reexport */ isNumberInput; }); __webpack_require__.d(__webpack_exports__, "isTextField", function() { return /* reexport */ isTextField; }); __webpack_require__.d(__webpack_exports__, "isVerticalEdge", function() { return /* reexport */ isVerticalEdge; }); __webpack_require__.d(__webpack_exports__, "placeCaretAtHorizontalEdge", function() { return /* reexport */ placeCaretAtHorizontalEdge; }); __webpack_require__.d(__webpack_exports__, "placeCaretAtVerticalEdge", function() { return /* reexport */ placeCaretAtVerticalEdge; }); __webpack_require__.d(__webpack_exports__, "replace", function() { return /* reexport */ replace; }); __webpack_require__.d(__webpack_exports__, "remove", function() { return /* reexport */ remove; }); __webpack_require__.d(__webpack_exports__, "insertAfter", function() { return /* reexport */ insertAfter; }); __webpack_require__.d(__webpack_exports__, "unwrap", function() { return /* reexport */ unwrap; }); __webpack_require__.d(__webpack_exports__, "replaceTag", function() { return /* reexport */ replaceTag; }); __webpack_require__.d(__webpack_exports__, "wrap", function() { return /* reexport */ wrap; }); __webpack_require__.d(__webpack_exports__, "__unstableStripHTML", function() { return /* reexport */ stripHTML; }); __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return /* reexport */ isEmpty; }); __webpack_require__.d(__webpack_exports__, "removeInvalidHTML", function() { return /* reexport */ removeInvalidHTML; }); __webpack_require__.d(__webpack_exports__, "getPhrasingContentSchema", function() { return /* reexport */ getPhrasingContentSchema; }); __webpack_require__.d(__webpack_exports__, "isPhrasingContent", function() { return /* reexport */ isPhrasingContent; }); __webpack_require__.d(__webpack_exports__, "isTextContent", function() { return /* reexport */ isTextContent; }); __webpack_require__.d(__webpack_exports__, "getFilesFromDataTransfer", function() { return /* reexport */ getFilesFromDataTransfer; }); // NAMESPACE OBJECT: ./node_modules/@wordpress/dom/build-module/focusable.js var focusable_namespaceObject = {}; __webpack_require__.r(focusable_namespaceObject); __webpack_require__.d(focusable_namespaceObject, "find", function() { return find; }); // NAMESPACE OBJECT: ./node_modules/@wordpress/dom/build-module/tabbable.js var tabbable_namespaceObject = {}; __webpack_require__.r(tabbable_namespaceObject); __webpack_require__.d(tabbable_namespaceObject, "isTabbableIndex", function() { return isTabbableIndex; }); __webpack_require__.d(tabbable_namespaceObject, "find", function() { return tabbable_find; }); __webpack_require__.d(tabbable_namespaceObject, "findPrevious", function() { return findPrevious; }); __webpack_require__.d(tabbable_namespaceObject, "findNext", function() { return findNext; }); // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/focusable.js /** * References: * * Focusable: * - https://www.w3.org/TR/html5/editing.html#focus-management * * Sequential focus navigation: * - https://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute * * Disabled elements: * - https://www.w3.org/TR/html5/disabled-elements.html#disabled-elements * * getClientRects algorithm (requiring layout box): * - https://www.w3.org/TR/cssom-view-1/#extension-to-the-element-interface * * AREA elements associated with an IMG: * - https://w3c.github.io/html/editing.html#data-model */ var SELECTOR = ['[tabindex]', 'a[href]', 'button:not([disabled])', 'input:not([type="hidden"]):not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'iframe', 'object', 'embed', 'area[href]', '[contenteditable]:not([contenteditable=false])'].join(','); /** * Returns true if the specified element is visible (i.e. neither display: none * nor visibility: hidden). * * @param {HTMLElement} element DOM element to test. * * @return {boolean} Whether element is visible. */ function isVisible(element) { return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0; } /** * Returns true if the specified element should be skipped from focusable elements. * For now it rather specific for `iframes` and if tabindex attribute is set to -1. * * @param {Element} element DOM element to test. * * @return {boolean} Whether element should be skipped from focusable elements. */ function skipFocus(element) { return element.nodeName.toLowerCase() === 'iframe' && element.getAttribute('tabindex') === '-1'; } /** * Returns true if the specified area element is a valid focusable element, or * false otherwise. Area is only focusable if within a map where a named map * referenced by an image somewhere in the document. * * @param {HTMLAreaElement} element DOM area element to test. * * @return {boolean} Whether area element is valid for focus. */ function isValidFocusableArea(element) { /** @type {HTMLMapElement | null} */ var map = element.closest('map[name]'); if (!map) { return false; } /** @type {HTMLImageElement | null} */ var img = element.ownerDocument.querySelector('img[usemap="#' + map.name + '"]'); return !!img && isVisible(img); } /** * Returns all focusable elements within a given context. * * @param {Element} context Element in which to search. * * @return {Element[]} Focusable elements. */ function find(context) { /* eslint-disable jsdoc/no-undefined-types */ /** @type {NodeListOf} */ /* eslint-enable jsdoc/no-undefined-types */ var elements = context.querySelectorAll(SELECTOR); return Array.from(elements).filter(function (element) { if (!isVisible(element) || skipFocus(element)) { return false; } var nodeName = element.nodeName; if ('AREA' === nodeName) { return isValidFocusableArea( /** @type {HTMLAreaElement} */ element); } return true; }); } // EXTERNAL MODULE: external "lodash" var external_lodash_ = __webpack_require__(2); // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/tabbable.js /** * External dependencies */ /** * Internal dependencies */ /** * Returns the tab index of the given element. In contrast with the tabIndex * property, this normalizes the default (0) to avoid browser inconsistencies, * operating under the assumption that this function is only ever called with a * focusable node. * * @see https://bugzilla.mozilla.org/show_bug.cgi?id=1190261 * * @param {Element} element Element from which to retrieve. * * @return {number} Tab index of element (default 0). */ function getTabIndex(element) { var tabIndex = element.getAttribute('tabindex'); return tabIndex === null ? 0 : parseInt(tabIndex, 10); } /** * Returns true if the specified element is tabbable, or false otherwise. * * @param {Element} element Element to test. * * @return {boolean} Whether element is tabbable. */ function isTabbableIndex(element) { return getTabIndex(element) !== -1; } /** @typedef {Element & { type?: string, checked?: boolean, name?: string }} MaybeHTMLInputElement */ /** * Returns a stateful reducer function which constructs a filtered array of * tabbable elements, where at most one radio input is selected for a given * name, giving priority to checked input, falling back to the first * encountered. * * @return {(acc: MaybeHTMLInputElement[], el: MaybeHTMLInputElement) => MaybeHTMLInputElement[]} Radio group collapse reducer. */ function createStatefulCollapseRadioGroup() { /** @type {Record} */ var CHOSEN_RADIO_BY_NAME = {}; return function collapseRadioGroup( /** @type {MaybeHTMLInputElement[]} */ result, /** @type {MaybeHTMLInputElement} */ element) { var nodeName = element.nodeName, type = element.type, checked = element.checked, name = element.name; // For all non-radio tabbables, construct to array by concatenating. if (nodeName !== 'INPUT' || type !== 'radio' || !name) { return result.concat(element); } var hasChosen = CHOSEN_RADIO_BY_NAME.hasOwnProperty(name); // Omit by skipping concatenation if the radio element is not chosen. var isChosen = checked || !hasChosen; if (!isChosen) { return result; } // At this point, if there had been a chosen element, the current // element is checked and should take priority. Retroactively remove // the element which had previously been considered the chosen one. if (hasChosen) { var hadChosenElement = CHOSEN_RADIO_BY_NAME[name]; result = Object(external_lodash_["without"])(result, hadChosenElement); } CHOSEN_RADIO_BY_NAME[name] = element; return result.concat(element); }; } /** * An array map callback, returning an object with the element value and its * array index location as properties. This is used to emulate a proper stable * sort where equal tabIndex should be left in order of their occurrence in the * document. * * @param {Element} element Element. * @param {number} index Array index of element. * * @return {{ element: Element, index: number }} Mapped object with element, index. */ function mapElementToObjectTabbable(element, index) { return { element: element, index: index }; } /** * An array map callback, returning an element of the given mapped object's * element value. * * @param {{ element: Element }} object Mapped object with element. * * @return {Element} Mapped object element. */ function mapObjectTabbableToElement(object) { return object.element; } /** * A sort comparator function used in comparing two objects of mapped elements. * * @see mapElementToObjectTabbable * * @param {{ element: Element, index: number }} a First object to compare. * @param {{ element: Element, index: number }} b Second object to compare. * * @return {number} Comparator result. */ function compareObjectTabbables(a, b) { var aTabIndex = getTabIndex(a.element); var bTabIndex = getTabIndex(b.element); if (aTabIndex === bTabIndex) { return a.index - b.index; } return aTabIndex - bTabIndex; } /** * Givin focusable elements, filters out tabbable element. * * @param {Element[]} focusables Focusable elements to filter. * * @return {Element[]} Tabbable elements. */ function filterTabbable(focusables) { return focusables.filter(isTabbableIndex).map(mapElementToObjectTabbable).sort(compareObjectTabbables).map(mapObjectTabbableToElement).reduce(createStatefulCollapseRadioGroup(), []); } /** * @param {Element} context * @return {Element[]} Tabbable elements within the context. */ function tabbable_find(context) { return filterTabbable(find(context)); } /** * Given a focusable element, find the preceding tabbable element. * * @param {Element} element The focusable element before which to look. Defaults * to the active element. */ function findPrevious(element) { var focusables = find(element.ownerDocument.body); var index = focusables.indexOf(element); // Remove all focusables after and including `element`. focusables.length = index; return Object(external_lodash_["last"])(filterTabbable(focusables)); } /** * Given a focusable element, find the next tabbable element. * * @param {Element} element The focusable element after which to look. Defaults * to the active element. */ function findNext(element) { var focusables = find(element.ownerDocument.body); var index = focusables.indexOf(element); // Remove all focusables before and inside `element`. var remaining = focusables.slice(index + 1).filter(function (node) { return !element.contains(node); }); return Object(external_lodash_["first"])(filterTabbable(remaining)); } // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/utils/assert-is-defined.js function assertIsDefined(val, name) { if (val === undefined || val === null) { throw new Error("Expected '".concat(name, "' to be defined, but received ").concat(val)); } } // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/get-rectangle-from-range.js /** * Internal dependencies */ /** * Get the rectangle of a given Range. * * @param {Range} range The range. * * @return {DOMRect} The rectangle. */ function getRectangleFromRange(range) { // For uncollapsed ranges, get the rectangle that bounds the contents of the // range; this a rectangle enclosing the union of the bounding rectangles // for all the elements in the range. if (!range.collapsed) { return range.getBoundingClientRect(); } var _range = range, startContainer = _range.startContainer; var ownerDocument = startContainer.ownerDocument; // Correct invalid "BR" ranges. The cannot contain any children. if (startContainer.nodeName === 'BR') { var parentNode = startContainer.parentNode; assertIsDefined(parentNode, 'parentNode'); var index = /** @type {Node[]} */ Array.from(parentNode.childNodes).indexOf(startContainer); assertIsDefined(ownerDocument, 'ownerDocument'); range = ownerDocument.createRange(); range.setStart(parentNode, index); range.setEnd(parentNode, index); } var rect = range.getClientRects()[0]; // If the collapsed range starts (and therefore ends) at an element node, // `getClientRects` can be empty in some browsers. This can be resolved // by adding a temporary text node with zero-width space to the range. // // See: https://stackoverflow.com/a/6847328/995445 if (!rect) { assertIsDefined(ownerDocument, 'ownerDocument'); var padNode = ownerDocument.createTextNode("\u200B"); // Do not modify the live range. range = range.cloneRange(); range.insertNode(padNode); rect = range.getClientRects()[0]; assertIsDefined(padNode.parentNode, 'padNode.parentNode'); padNode.parentNode.removeChild(padNode); } return rect; } // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/compute-caret-rect.js /** * Internal dependencies */ /** * Get the rectangle for the selection in a container. * * @param {Window} win The window of the selection. * * @return {DOMRect | null} The rectangle. */ function computeCaretRect(win) { var selection = win.getSelection(); assertIsDefined(selection, 'selection'); var range = selection.rangeCount ? selection.getRangeAt(0) : null; if (!range) { return null; } return getRectangleFromRange(range); } // CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/document-has-text-selection.js /** * Check whether the current document has selected text. This applies to ranges * of text in the document, and not selection inside and