* isButton(document.querySelector("button")); // true
* isButton(document.querySelector("input[type='button']")); // true
* isButton(document.querySelector("div")); // false
* isButton(document.querySelector("input[type='text']")); // false
* isButton(document.querySelector("div[role='button']")); // false
function isButton(element) {
if (element.tagName === "BUTTON") return true;
if (element.tagName === "INPUT") {
return buttonInputTypes.indexOf(input.type) !== -1;
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
exports['default'] = isBeforeDay;
var _moment = __webpack_require__("wy2R");
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function isBeforeDay(a, b) {
if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
var isSameYear = aYear === bYear;
var isSameMonth = aMonth === bMonth;
if (isSameYear && isSameMonth) return a.date() < b.date();
if (isSameYear) return aMonth < bMonth;
/***/ (function(module, exports, __webpack_require__) {
var bind = __webpack_require__("D3zA");
var GetIntrinsic = __webpack_require__("AM7I");
var $apply = GetIntrinsic('%Function.prototype.apply%');
var $call = GetIntrinsic('%Function.prototype.call%');
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
var $max = GetIntrinsic('%Math.max%');
$defineProperty({}, 'a', { value: 1 });
// IE 8 has a broken defineProperty
module.exports = function callBind(originalFunction) {
var func = $reflectApply(bind, $call, arguments);
if ($gOPD && $defineProperty) {
var desc = $gOPD(func, 'length');
// original length, plus the receiver, minus any additional arguments (after the receiver)
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
var applyBind = function applyBind() {
return $reflectApply(bind, $apply, arguments);
$defineProperty(module.exports, 'apply', { value: applyBind });
module.exports.apply = applyBind;
/***/ (function(module, exports, __webpack_require__) {
// https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey
module.exports = function IsPropertyKey(argument) {
return typeof argument === 'string' || typeof argument === 'symbol';
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("YLtl");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("TSYQ");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("gdqT");
/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("l3Sj");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("Z23Y");
/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("kA6J");
var NOTICE_TIMEOUT = 10000;
/** @typedef {import('@wordpress/element').WPElement} WPElement */
* Custom hook which announces the message with the given politeness, if a
* valid message is provided.
* @param {string|WPElement} [message] Message to announce.
* @param {'polite'|'assertive'} politeness Politeness to announce.
function useSpokenMessage(message, politeness) {
var spokenMessage = typeof message === 'string' ? message : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["renderToString"])(message);
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__["speak"])(spokenMessage, politeness);
}, [spokenMessage, politeness]);
function Snackbar(_ref, ref) {
var className = _ref.className,
children = _ref.children,
_ref$spokenMessage = _ref.spokenMessage,
spokenMessage = _ref$spokenMessage === void 0 ? children : _ref$spokenMessage,
_ref$politeness = _ref.politeness,
politeness = _ref$politeness === void 0 ? 'polite' : _ref$politeness,
_ref$actions = _ref.actions,
actions = _ref$actions === void 0 ? [] : _ref$actions,
_ref$onRemove = _ref.onRemove,
onRemove = _ref$onRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref$onRemove,
icon = _ref$icon === void 0 ? null : _ref$icon,
_ref$explicitDismiss = _ref.explicitDismiss,
explicitDismiss = _ref$explicitDismiss === void 0 ? false : _ref$explicitDismiss,
_ref$onDismiss = _ref.onDismiss,
onDismiss = _ref$onDismiss === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref$onDismiss;
onDismiss = onDismiss || lodash__WEBPACK_IMPORTED_MODULE_1__["noop"];
function dismissMe(event) {
if (event && event.preventDefault) {
function onActionClick(event, onClick) {
useSpokenMessage(spokenMessage, politeness); // Only set up the timeout dismiss if we're not explicitly dismissing.
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
var timeoutHandle = setTimeout(function () {
return clearTimeout(timeoutHandle);
}, [onDismiss, onRemove]);
var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-snackbar', {
'components-snackbar-explicit-dismiss': !!explicitDismiss
if (actions && actions.length > 1) {
// we need to inform developers that snackbar only accepts 1 action
typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default()('Snackbar can only have 1 action, use Notice if your message require many messages') : void 0; // return first element only while keeping it inside an array
var snackbarContentClassnames = classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-snackbar__content', {
'components-snackbar__content-with-icon': !!icon
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
onClick: !explicitDismiss ? dismissMe : lodash__WEBPACK_IMPORTED_MODULE_1__["noop"],
role: !explicitDismiss ? 'button' : '',
onKeyPress: !explicitDismiss ? dismissMe : lodash__WEBPACK_IMPORTED_MODULE_1__["noop"],
"aria-label": !explicitDismiss ? Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Dismiss this notice') : ''
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: snackbarContentClassnames
}, icon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
className: "components-snackbar__icon"
}, icon), children, actions.map(function (_ref2, index) {
_onClick = _ref2.onClick,
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
onClick: function onClick(event) {
return onActionClick(event, _onClick);
className: "components-snackbar__action"
}), explicitDismiss && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
"aria-label": "Dismiss this notice",
className: "components-snackbar__dismiss-button",
/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(Snackbar));
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("rePB");
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Ff2n");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("GRId");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
* @param {IconProps} props icon is the SVG component to render
* size is a number specifiying the icon size in pixels
* Other props will be passed to wrapped SVG component
* @return {JSX.Element} Icon component
size = _ref$size === void 0 ? 24 : _ref$size,
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]);
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({
/* harmony default export */ __webpack_exports__["a"] = (Icon);
/***/ (function(module, exports) {
invalidPredicate: '`predicate` must be a function',
invalidPropValidator: '`propValidator` must be a function',
requiredCore: 'is marked as required',
invalidTypeCore: 'Invalid input type',
predicateFailureCore: 'Failed to succeed with predicate',
anonymousMessage: '<<anonymous>>',
baseInvalidMessage: 'Invalid ',
function constructPropValidatorVariations(propValidator) {
if (typeof propValidator !== 'function') {
throw new Error(messages.invalidPropValidator);
var requiredPropValidator = propValidator.bind(null, false, null);
requiredPropValidator.isRequired = propValidator.bind(null, true, null);
requiredPropValidator.withPredicate = function predicateApplication(predicate) {
if (typeof predicate !== 'function') {
throw new Error(messages.invalidPredicate);
var basePropValidator = propValidator.bind(null, false, predicate);
basePropValidator.isRequired = propValidator.bind(null, true, predicate);
return basePropValidator;
return requiredPropValidator;
function createInvalidRequiredErrorMessage(propName, componentName, value) {
'The prop `' + propName + '` ' + messages.requiredCore +
' in `' + componentName + '`, but its value is `' + value + '`.'
var independentGuardianValue = -1;
function preValidationRequireCheck(isRequired, componentName, propFullName, propValue) {
var isPropValueUndefined = typeof propValue === 'undefined';
var isPropValueNull = propValue === null;
if (isPropValueUndefined) {
return createInvalidRequiredErrorMessage(propFullName, componentName, 'undefined');
} else if (isPropValueNull) {
return createInvalidRequiredErrorMessage(propFullName, componentName, 'null');
if (isPropValueUndefined || isPropValueNull) {
return independentGuardianValue;
function createMomentChecker(type, typeValidator, validator, momentType) {
isRequired, // Bound parameter to indicate with the propType is required
predicate, // Bound parameter to allow user to add dynamic validation
var propValue = props[ propName ];
var propType = typeof propValue;
componentName = componentName || messages.anonymousMessage;
propFullName = propFullName || propName;
var preValidationRequireCheckValue = preValidationRequireCheck(
isRequired, componentName, propFullName, propValue
if (preValidationRequireCheckValue !== independentGuardianValue) {
return preValidationRequireCheckValue;
if (typeValidator && !typeValidator(propValue)) {
messages.invalidTypeCore + ': `' + propName + '` of type `' + propType + '` ' +
'supplied to `' + componentName + '`, expected `' + type + '`.'
if (!validator(propValue)) {
messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' +
'supplied to `' + componentName + '`, expected `' + momentType + '`.'
if (predicate && !predicate(propValue)) {
var predicateName = predicate.name || messages.anonymousMessage;
messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' +
'supplied to `' + componentName + '`. ' + messages.predicateFailureCore + ' `' +
return constructPropValidatorVariations(propValidator);
constructPropValidatorVariations: constructPropValidatorVariations,
createMomentChecker: createMomentChecker,
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return contains; });
* Similar to `Element.prototype.contains`, but a little bit faster when
* `element` is the same as `child`.
* import { contains } from "reakit-utils";
* contains(document.getElementById("parent"), document.getElementById("child"));
function contains(parent, child) {
return parent === child || parent.contains(child);
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return findFirstEnabledItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCurrentId; });
function findFirstEnabledItem(items, excludeId) {
return items.find(function (item) {
return !item.disabled && item.id !== excludeId;