2023-09-21 09:26:32 -04:00
|
|
|
/******/ (function() { // webpackBootstrap
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ "use strict";
|
|
|
|
/******/ // The require scope
|
|
|
|
/******/ var __webpack_require__ = {};
|
|
|
|
/******/
|
|
|
|
/************************************************************************/
|
|
|
|
/******/ /* webpack/runtime/define property getters */
|
2023-09-21 09:26:32 -04:00
|
|
|
/******/ !function() {
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ // define getter functions for harmony exports
|
2023-09-21 09:26:32 -04:00
|
|
|
/******/ __webpack_require__.d = function(exports, definition) {
|
2022-04-11 08:04:30 -04: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-13 23:41:57 -05:00
|
|
|
/******/ };
|
2023-09-21 09:26:32 -04:00
|
|
|
/******/ }();
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/
|
|
|
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
2023-09-21 09:26:32 -04:00
|
|
|
/******/ !function() {
|
|
|
|
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
|
|
/******/ }();
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/
|
2018-12-13 23:41:57 -05:00
|
|
|
/************************************************************************/
|
2022-04-11 08:04:30 -04:00
|
|
|
var __webpack_exports__ = {};
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
2023-09-21 09:26:32 -04:00
|
|
|
/* harmony export */ "default": function() { return /* binding */ domReady; }
|
2022-04-11 08:04:30 -04:00
|
|
|
/* harmony export */ });
|
2020-01-22 17:06:21 -05: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-13 23:41:57 -05:00
|
|
|
/**
|
|
|
|
* Specify a function to execute when the DOM is fully loaded.
|
|
|
|
*
|
2020-01-22 17:06:21 -05:00
|
|
|
* @param {Callback} callback A function to execute after the DOM is ready.
|
2018-12-13 23:41:57 -05:00
|
|
|
*
|
2019-03-21 08:48:00 -04:00
|
|
|
* @example
|
|
|
|
* ```js
|
|
|
|
* import domReady from '@wordpress/dom-ready';
|
|
|
|
*
|
|
|
|
* domReady( function() {
|
|
|
|
* //do something after DOM loads.
|
|
|
|
* } );
|
|
|
|
* ```
|
|
|
|
*
|
2018-12-13 23:41:57 -05:00
|
|
|
* @return {void}
|
|
|
|
*/
|
2020-01-22 17:06:21 -05:00
|
|
|
function domReady(callback) {
|
2021-04-15 11:19:43 -04:00
|
|
|
if (typeof document === 'undefined') {
|
|
|
|
return;
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
if (document.readyState === 'complete' ||
|
|
|
|
// DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
|
2018-12-13 23:41:57 -05:00
|
|
|
document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
|
|
|
|
) {
|
2021-11-15 07:50:17 -05:00
|
|
|
return void callback();
|
2023-09-26 10:23:26 -04:00
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
// DOMContentLoaded has not fired yet, delay callback until then.
|
2018-12-13 23:41:57 -05:00
|
|
|
document.addEventListener('DOMContentLoaded', callback);
|
2020-01-22 17:06:21 -05:00
|
|
|
}
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
(window.wp = window.wp || {}).domReady = __webpack_exports__["default"];
|
|
|
|
/******/ })()
|
|
|
|
;
|