case external_wp_keycodes_["UP"]:
case external_wp_keycodes_["DOWN"]:
case external_wp_keycodes_["ENTER"]:
if (isPressEnterToChange) {
var dragGestureProps = useDrag(function (dragProps) {
var distance = dragProps.distance,
dragging = dragProps.dragging,
* Quick return if no longer dragging.
* This prevents unnecessary value calculations.
threshold: dragThreshold,
var dragProps = isDragEnabled ? dragGestureProps() : {};
return Object(external_wp_element_["createElement"])(input_control_styles_Input, Object(esm_extends["a" /* default */])({}, props, dragProps, {
className: "components-input-control__input",
onChange: handleOnChange,
onKeyDown: handleOnKeyDown,
var ForwardedComponent = Object(external_wp_element_["forwardRef"])(InputField);
/* harmony default export */ var input_field = (ForwardedComponent);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/index.js
function input_control_useUniqueId(idProp) {
var instanceId = Object(external_wp_compose_["useInstanceId"])(InputControl);
var id = "inspector-input-control-".concat(instanceId);
function InputControl(_ref, ref) {
var _ref$__unstableStateR = _ref.__unstableStateReducer,
stateReducer = _ref$__unstableStateR === void 0 ? function (state) {
} : _ref$__unstableStateR,
__unstableInputWidth = _ref.__unstableInputWidth,
className = _ref.className,
_ref$disabled = _ref.disabled,
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
_ref$hideLabelFromVis = _ref.hideLabelFromVision,
hideLabelFromVision = _ref$hideLabelFromVis === void 0 ? false : _ref$hideLabelFromVis,
_ref$isPressEnterToCh = _ref.isPressEnterToChange,
isPressEnterToChange = _ref$isPressEnterToCh === void 0 ? false : _ref$isPressEnterToCh,
_ref$labelPosition = _ref.labelPosition,
labelPosition = _ref$labelPosition === void 0 ? 'top' : _ref$labelPosition,
_ref$onChange = _ref.onChange,
onChange = _ref$onChange === void 0 ? external_lodash_["noop"] : _ref$onChange,
_ref$onValidate = _ref.onValidate,
onValidate = _ref$onValidate === void 0 ? external_lodash_["noop"] : _ref$onValidate,
_ref$onKeyDown = _ref.onKeyDown,
onKeyDown = _ref$onKeyDown === void 0 ? external_lodash_["noop"] : _ref$onKeyDown,
size = _ref$size === void 0 ? 'default' : _ref$size,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["__unstableStateReducer", "__unstableInputWidth", "className", "disabled", "hideLabelFromVision", "id", "isPressEnterToChange", "label", "labelPosition", "onChange", "onValidate", "onKeyDown", "prefix", "size", "suffix", "value"]);
var _useState = Object(external_wp_element_["useState"])(false),
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
isFocused = _useState2[0],
setIsFocused = _useState2[1];
var id = input_control_useUniqueId(idProp);
var classes = classnames_default()('components-input-control', className);
return Object(external_wp_element_["createElement"])(input_base, {
__unstableInputWidth: __unstableInputWidth,
hideLabelFromVision: hideLabelFromVision,
labelPosition: labelPosition,
}, Object(external_wp_element_["createElement"])(input_field, Object(esm_extends["a" /* default */])({}, props, {
className: "components-input-control__input",
isPressEnterToChange: isPressEnterToChange,
setIsFocused: setIsFocused,
stateReducer: stateReducer,
var input_control_ForwardedComponent = Object(external_wp_element_["forwardRef"])(InputControl);
/* harmony default export */ var input_control = (input_control_ForwardedComponent);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/styles/number-control-styles.js
function number_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
var number_control_styles_ref = true ? {
styles: "&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none !important;margin:0 !important;}"
var htmlArrowStyles = function htmlArrowStyles(_ref2) {
var hideHTMLArrows = _ref2.hideHTMLArrows;
if (!hideHTMLArrows) return "";
return number_control_styles_ref;
var number_control_styles_Input = /*#__PURE__*/styled_base_browser_esm(input_control, {
})(htmlArrowStyles, ";" + ( true ? "" : undefined));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/math.js
* Parses and retrieves a number value.
* @param {unknown} value The incoming value.
* @return {number} The parsed number value.
function getNumber(value) {
var number = Number(value);
return isNaN(number) ? 0 : number;
* @param {Array<number|string>} args Values to add together.
* @return {number} The sum of values.
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
/** @type {(sum:number, arg: number|string) => number} */
return sum + getNumber(arg);
* Safely subtracts 2 values.
* @param {Array<number|string>} args Values to subtract together.
* @return {number} The difference of the values.
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
/** @type {(diff:number, arg: number|string, index:number) => number} */
function (diff, arg, index) {
var value = getNumber(arg);
return index === 0 ? value : diff - value;
* Determines the decimal position of a number value.
* @param {number} value The number to evaluate.
* @return {number} The number of decimal places.
function getPrecision(value) {
var split = (value + '').split('.');
return split[1] !== undefined ? split[1].length : 0;
* Clamps a value based on a min/max range with rounding
* @param {number} value The value.
* @param {number} min The minimum range.
* @param {number} max The maximum range.
* @param {number} step A multiplier for the value.
* @return {number} The rounded and clamped value.
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity;
var step = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
var baseValue = getNumber(value);
var stepValue = getNumber(step);
var precision = getPrecision(step);
var rounded = Math.round(baseValue / stepValue) * stepValue;
var clampedValue = Object(external_lodash_["clamp"])(rounded, min, max);
return precision ? getNumber(clampedValue.toFixed(precision)) : clampedValue;
* Clamps a value based on a min/max range with rounding.
* @param {Parameters<typeof roundClamp>} args Arguments for roundClamp().
* @return {string} The rounded and clamped value.
function roundClampString() {
return roundClamp.apply(void 0, arguments).toString();
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-jump-step.js
* A custom hook that calculates a step value (used by elements like input
* [type="number"]). This value can be modified based on whether the Shift
* key is being held down.
* For example, a shiftStep of 10, and a step of 1...
* Starting from 10, the next incremented value will be 11.
* Starting from 10, the next incremented value will be 20.
* @param {Object} props Properties for the hook.
* @param {boolean} [props.isShiftStepEnabled=true] Determines if jumping values with shift is enabled
* @param {number} [props.shiftStep=10] Multiplier to jump by, when holding shift key.
* @param {number} [props.step=1] Multiplier to jump by, when not-holding shift key.
* @return {number} The jump step value.
function useJumpStep(_ref) {
var _ref$isShiftStepEnabl = _ref.isShiftStepEnabled,
isShiftStepEnabled = _ref$isShiftStepEnabl === void 0 ? true : _ref$isShiftStepEnabl,
_ref$shiftStep = _ref.shiftStep,
shiftStep = _ref$shiftStep === void 0 ? 10 : _ref$shiftStep,
step = _ref$step === void 0 ? 1 : _ref$step;
var _useState = Object(external_wp_element_["useState"])(false),
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
isShiftKey = _useState2[0],
setIsShiftKey = _useState2[1];
Object(external_wp_element_["useEffect"])(function () {
/** @type {(event: KeyboardEvent)=>void} */
var handleShiftKeyToggle = function handleShiftKeyToggle(event) {
setIsShiftKey(event.shiftKey);
window.addEventListener('keydown', handleShiftKeyToggle);
window.addEventListener('keyup', handleShiftKeyToggle);
window.removeEventListener('keydown', handleShiftKeyToggle);
window.removeEventListener('keyup', handleShiftKeyToggle);
var isEnabled = isShiftStepEnabled && isShiftKey;
return isEnabled ? shiftStep * step : step;
/* harmony default export */ var use_jump_step = (useJumpStep);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/index.js
function NumberControl(_ref, ref) {
var _ref$__unstableStateR = _ref.__unstableStateReducer,
stateReducer = _ref$__unstableStateR === void 0 ? function (state) {
} : _ref$__unstableStateR,
className = _ref.className,
_ref$dragDirection = _ref.dragDirection,
dragDirection = _ref$dragDirection === void 0 ? 'n' : _ref$dragDirection,
_ref$hideHTMLArrows = _ref.hideHTMLArrows,
hideHTMLArrows = _ref$hideHTMLArrows === void 0 ? false : _ref$hideHTMLArrows,
_ref$isDragEnabled = _ref.isDragEnabled,
isDragEnabled = _ref$isDragEnabled === void 0 ? true : _ref$isDragEnabled,
_ref$isShiftStepEnabl = _ref.isShiftStepEnabled,
isShiftStepEnabled = _ref$isShiftStepEnabl === void 0 ? true : _ref$isShiftStepEnabl,
max = _ref$max === void 0 ? Infinity : _ref$max,
min = _ref$min === void 0 ? -Infinity : _ref$min,
_ref$shiftStep = _ref.shiftStep,
shiftStep = _ref$shiftStep === void 0 ? 10 : _ref$shiftStep,
step = _ref$step === void 0 ? 1 : _ref$step,
typeProp = _ref$type === void 0 ? 'number' : _ref$type,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["__unstableStateReducer", "className", "dragDirection", "hideHTMLArrows", "isDragEnabled", "isShiftStepEnabled", "label", "max", "min", "shiftStep", "step", "type", "value"]);
var baseValue = roundClamp(0, min, max, step);
var jumpStep = use_jump_step({
isShiftStepEnabled: isShiftStepEnabled
var autoComplete = typeProp === 'number' ? 'off' : null;
var classes = classnames_default()('components-number-control', className);
* "Middleware" function that intercepts updates from InputControl.
* This allows us to tap into actions to transform the (next) state for
* @param {Object} state State from InputControl
* @param {Object} action Action triggering state change
* @return {Object} The updated state to apply to InputControl
var numberControlStateReducer = function numberControlStateReducer(state, action) {
payload = action.payload;
var event = payload === null || payload === void 0 ? void 0 : payload.event;
var currentValue = state.value;
* Handles custom UP and DOWN Keyboard events
if (type === inputControlActionTypes.PRESS_UP || type === inputControlActionTypes.PRESS_DOWN) {
var enableShift = event.shiftKey && isShiftStepEnabled;
var incrementalValue = enableShift ? parseFloat(shiftStep) * parseFloat(step) : parseFloat(step);
var nextValue = isValueEmpty(currentValue) ? baseValue : currentValue;
if (event !== null && event !== void 0 && event.preventDefault) {
if (type === inputControlActionTypes.PRESS_UP) {
nextValue = add(nextValue, incrementalValue);
if (type === inputControlActionTypes.PRESS_DOWN) {
nextValue = subtract(nextValue, incrementalValue);
nextValue = roundClamp(nextValue, min, max, incrementalValue);
* Handles drag to update events
if (type === inputControlActionTypes.DRAG && isDragEnabled) {
var delta = payload.delta,
shiftKey = payload.shiftKey;
var _delta = Object(slicedToArray["a" /* default */])(delta, 2),
var modifier = shiftKey ? parseFloat(shiftStep) * parseFloat(step) : parseFloat(step);
directionModifier = Object(external_wp_i18n_["isRTL"])() ? -1 : 1;
directionModifier = Object(external_wp_i18n_["isRTL"])() ? 1 : -1;