2024-01-31 13:59:56 +01:00
|
|
|
/******/ (() => { // webpackBootstrap
|
2022-04-11 14:04:30 +02:00
|
|
|
/******/ "use strict";
|
|
|
|
/******/ // The require scope
|
|
|
|
/******/ var __webpack_require__ = {};
|
|
|
|
/******/
|
|
|
|
/************************************************************************/
|
|
|
|
/******/ /* webpack/runtime/define property getters */
|
2024-01-31 13:59:56 +01:00
|
|
|
/******/ (() => {
|
2022-04-11 14:04:30 +02:00
|
|
|
/******/ // define getter functions for harmony exports
|
2024-01-31 13:59:56 +01:00
|
|
|
/******/ __webpack_require__.d = (exports, definition) => {
|
2022-04-11 14:04:30 +02:00
|
|
|
/******/ for(var key in definition) {
|
|
|
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
|
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
|
|
/******/ }
|
|
|
|
/******/ }
|
2018-12-14 05:41:57 +01:00
|
|
|
/******/ };
|
2024-01-31 13:59:56 +01:00
|
|
|
/******/ })();
|
2022-04-11 14:04:30 +02:00
|
|
|
/******/
|
|
|
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
2024-01-31 13:59:56 +01:00
|
|
|
/******/ (() => {
|
|
|
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
|
|
/******/ })();
|
2022-04-11 14:04:30 +02:00
|
|
|
/******/
|
2018-12-14 05:41:57 +01:00
|
|
|
/************************************************************************/
|
2022-04-11 14:04:30 +02:00
|
|
|
var __webpack_exports__ = {};
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
2024-01-31 13:59:56 +01:00
|
|
|
/* harmony export */ "default": () => (/* binding */ domReady)
|
2022-04-11 14:04:30 +02:00
|
|
|
/* harmony export */ });
|
2020-01-22 23:06:21 +01:00
|
|
|
/**
|
|
|
|
* @typedef {() => void} Callback
|
|
|
|
*
|
|
|
|
* TODO: Remove this typedef and inline `() => void` type.
|
|
|
|
*
|
|
|
|
* This typedef is used so that a descriptive type is provided in our
|
|
|
|
* automatically generated documentation.
|
|
|
|
*
|
|
|
|
* An in-line type `() => void` would be preferable, but the generated
|
|
|
|
* documentation is `null` in that case.
|
|
|
|
*
|
|
|
|
* @see https://github.com/WordPress/gutenberg/issues/18045
|
|
|
|
*/
|
|
|
|
|
2018-12-14 05:41:57 +01:00
|
|
|
/**
|
|
|
|
* Specify a function to execute when the DOM is fully loaded.
|
|
|
|
*
|
2020-01-22 23:06:21 +01:00
|
|
|
* @param {Callback} callback A function to execute after the DOM is ready.
|
2018-12-14 05:41:57 +01:00
|
|
|
*
|
2019-03-21 13:48:00 +01:00
|
|
|
* @example
|
|
|
|
* ```js
|
|
|
|
* import domReady from '@wordpress/dom-ready';
|
|
|
|
*
|
|
|
|
* domReady( function() {
|
|
|
|
* //do something after DOM loads.
|
|
|
|
* } );
|
|
|
|
* ```
|
|
|
|
*
|
2018-12-14 05:41:57 +01:00
|
|
|
* @return {void}
|
|
|
|
*/
|
2020-01-22 23:06:21 +01:00
|
|
|
function domReady(callback) {
|
2021-04-15 17:19:43 +02:00
|
|
|
if (typeof document === 'undefined') {
|
|
|
|
return;
|
|
|
|
}
|
2023-09-26 16:23:26 +02:00
|
|
|
if (document.readyState === 'complete' ||
|
|
|
|
// DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
|
2018-12-14 05:41:57 +01:00
|
|
|
document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
|
|
|
|
) {
|
2021-11-15 13:50:17 +01:00
|
|
|
return void callback();
|
2023-09-26 16:23:26 +02:00
|
|
|
}
|
2018-12-14 05:41:57 +01:00
|
|
|
|
2023-09-26 16:23:26 +02:00
|
|
|
// DOMContentLoaded has not fired yet, delay callback until then.
|
2018-12-14 05:41:57 +01:00
|
|
|
document.addEventListener('DOMContentLoaded', callback);
|
2020-01-22 23:06:21 +01:00
|
|
|
}
|
2018-12-14 05:41:57 +01:00
|
|
|
|
2022-04-11 14:04:30 +02:00
|
|
|
(window.wp = window.wp || {}).domReady = __webpack_exports__["default"];
|
|
|
|
/******/ })()
|
|
|
|
;
|