onHover: function onHover() {},
onSelect: function onSelect() {},
suggestions: Object.freeze([])
/* harmony default export */ var suggestions_list = (Object(external_wp_compose_["withSafeTimeout"])(suggestions_list_SuggestionsList));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js
/* harmony default export */ var with_focus_outside = (Object(external_wp_compose_["createHigherOrderComponent"])(function (WrappedComponent) {
return function (props) {
var _useState = Object(external_wp_element_["useState"])(),
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
handleFocusOutside = _useState2[0],
setHandleFocusOutside = _useState2[1];
var bindFocusOutsideHandler = Object(external_wp_element_["useCallback"])(function (node) {
return setHandleFocusOutside(function () {
return node !== null && node !== void 0 && node.handleFocusOutside ? node.handleFocusOutside.bind(node) : undefined;
return Object(external_wp_element_["createElement"])("div", Object(external_wp_compose_["__experimentalUseFocusOutside"])(handleFocusOutside), Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({
ref: bindFocusOutsideHandler
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/combobox-control/index.js
function combobox_control_createSuper(Derived) { var hasNativeReflectConstruct = combobox_control_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function combobox_control_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var DetectOutside = with_focus_outside( /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(_class, _Component);
var _super = combobox_control_createSuper(_class);
Object(classCallCheck["a" /* default */])(this, _class);
return _super.apply(this, arguments);
Object(createClass["a" /* default */])(_class, [{
key: "handleFocusOutside",
value: function handleFocusOutside(event) {
this.props.onFocusOutside(event);
value: function render() {
return this.props.children;
}(external_wp_element_["Component"]));
function ComboboxControl(_ref) {
var _currentOption$label;
onChange = _ref.onChange,
onFilterValueChange = _ref.onFilterValueChange,
hideLabelFromVision = _ref.hideLabelFromVision,
_ref$allowReset = _ref.allowReset,
allowReset = _ref$allowReset === void 0 ? true : _ref$allowReset,
className = _ref.className,
_ref$messages = _ref.messages,
messages = _ref$messages === void 0 ? {
selected: Object(external_wp_i18n_["__"])('Item selected.')
var instanceId = Object(external_wp_compose_["useInstanceId"])(ComboboxControl);
var _useState = Object(external_wp_element_["useState"])(null),
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
selectedSuggestion = _useState2[0],
setSelectedSuggestion = _useState2[1];
var _useState3 = Object(external_wp_element_["useState"])(false),
_useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2),
isExpanded = _useState4[0],
setIsExpanded = _useState4[1];
var _useState5 = Object(external_wp_element_["useState"])(''),
_useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2),
inputValue = _useState6[0],
setInputValue = _useState6[1];
var inputContainer = Object(external_wp_element_["useRef"])();
var currentOption = options.find(function (option) {
return option.value === value;
var currentLabel = (_currentOption$label = currentOption === null || currentOption === void 0 ? void 0 : currentOption.label) !== null && _currentOption$label !== void 0 ? _currentOption$label : '';
var matchingSuggestions = Object(external_wp_element_["useMemo"])(function () {
var startsWithMatch = [];
var match = Object(external_lodash_["deburr"])(inputValue.toLocaleLowerCase());
options.forEach(function (option) {
var index = Object(external_lodash_["deburr"])(option.label).toLocaleLowerCase().indexOf(match);
startsWithMatch.push(option);
containsMatch.push(option);
return startsWithMatch.concat(containsMatch);
}, [inputValue, options, value]);
var onSuggestionSelected = function onSuggestionSelected(newSelectedSuggestion) {
onChange(newSelectedSuggestion.value);
Object(external_wp_a11y_["speak"])(messages.selected, 'assertive');
setSelectedSuggestion(newSelectedSuggestion);
var handleArrowNavigation = function handleArrowNavigation() {
var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
var index = matchingSuggestions.indexOf(selectedSuggestion);
var nextIndex = index + offset;
nextIndex = matchingSuggestions.length - 1;
} else if (nextIndex >= matchingSuggestions.length) {
setSelectedSuggestion(matchingSuggestions[nextIndex]);
var onKeyDown = function onKeyDown(event) {
var preventDefault = false;
case external_wp_keycodes_["ENTER"]:
if (selectedSuggestion) {
onSuggestionSelected(selectedSuggestion);
case external_wp_keycodes_["UP"]:
handleArrowNavigation(-1);
case external_wp_keycodes_["DOWN"]:
handleArrowNavigation(1);
case external_wp_keycodes_["ESCAPE"]:
setSelectedSuggestion(null);
var onFocus = function onFocus() {
var onFocusOutside = function onFocusOutside() {
var onInputChange = function onInputChange(event) {
onFilterValueChange(text);
var handleOnReset = function handleOnReset() {
inputContainer.current.input.focus();
Object(external_wp_element_["useEffect"])(function () {
var hasMatchingSuggestions = matchingSuggestions.length > 0;
var message = hasMatchingSuggestions ? Object(external_wp_i18n_["sprintf"])(
/* translators: %d: number of results. */
Object(external_wp_i18n_["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length) : Object(external_wp_i18n_["__"])('No results.');
Object(external_wp_a11y_["speak"])(message, 'polite');
}, [matchingSuggestions, isExpanded]); // Disable reason: There is no appropriate role which describes the
// input container intended accessible usability.
// TODO: Refactor click detection to use blur to stop propagation.
/* eslint-disable jsx-a11y/no-static-element-interactions */
return Object(external_wp_element_["createElement"])(DetectOutside, {
onFocusOutside: onFocusOutside
}, Object(external_wp_element_["createElement"])(base_control, {
className: classnames_default()(className, 'components-combobox-control'),
id: "components-form-token-input-".concat(instanceId),
hideLabelFromVision: hideLabelFromVision,
}, Object(external_wp_element_["createElement"])("div", {
className: "components-combobox-control__suggestions-container",
}, Object(external_wp_element_["createElement"])(flex_Flex, null, Object(external_wp_element_["createElement"])(block, null, Object(external_wp_element_["createElement"])(token_input, {
className: "components-combobox-control__input",
value: isExpanded ? inputValue : currentLabel,
"aria-label": currentLabel ? "".concat(currentLabel, ", ").concat(label) : null,
selectedSuggestionIndex: matchingSuggestions.indexOf(selectedSuggestion),
})), allowReset && Object(external_wp_element_["createElement"])(flex_item, null, Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
className: "components-combobox-control__reset",
icon: close_small["a" /* default */],
label: Object(external_wp_i18n_["__"])('Reset')
}))), isExpanded && Object(external_wp_element_["createElement"])(suggestions_list, {
displayTransform: function displayTransform(suggestion) {
suggestions: matchingSuggestions,
selectedIndex: matchingSuggestions.indexOf(selectedSuggestion),
onHover: setSelectedSuggestion,
onSelect: onSuggestionSelected,
/* eslint-enable jsx-a11y/no-static-element-interactions */
/* harmony default export */ var combobox_control = (ComboboxControl);
// CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
function objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var sourceKeys = Object.keys(source);
for (i = 0; i < sourceKeys.length; i++) {
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
// CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/extends.js
function extends_extends() {
extends_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
return extends_extends.apply(this, arguments);
// CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
function assertThisInitialized_assertThisInitialized(self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
// CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
return _setPrototypeOf(o, p);
// CONCATENATED MODULE: ./node_modules/downshift/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
function inheritsLoose_inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf(subClass, superClass);
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
var prop_types = __webpack_require__("17x9");
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
// EXTERNAL MODULE: ./node_modules/downshift/node_modules/react-is/index.js
var react_is = __webpack_require__("cD2C");
// CONCATENATED MODULE: ./node_modules/compute-scroll-into-view/dist/index.module.js
function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function index_module_e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return index_module_e(r.overflowY,n)||index_module_e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function index_module_r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}/* harmony default export */ var index_module = (function(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentElement)===f){s.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,a)&&s.push(p)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E:V,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,X=B.right,Y=B.bottom,L=B.left;if("if-needed"===l&&y>=0&&V>=0&&M<=g&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?index_module_r(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:index_module_r(w,w+m,m,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?index_module_r(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:index_module_r(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)))}C.push({el:k,top:F,left:G})}return C});
// CONCATENATED MODULE: ./node_modules/downshift/node_modules/tslib/tslib.es6.js
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
return __assign.apply(this, arguments);
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
if (f) throw new TypeError("Generator is already executing.");
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (o && typeof o.length === "number") return {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");