: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const BorderBoxControl = contextConnect(UnconnectedBorderBoxControl, 'BorderBoxControl');
/* harmony default export */ const border_box_control_component = (BorderBoxControl);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-icon-styles.js
function box_control_icon_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)."; }
const box_control_icon_styles_Root = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
styles: "box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"
const Viewbox = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
styles: "box-sizing:border-box;display:block;position:relative;width:100%;height:100%"
return /*#__PURE__*/emotion_react_browser_esm_css({
backgroundColor: 'currentColor',
opacity: isFocused ? 1 : 0.3
}, true ? "" : 0, true ? "" : 0);
const Stroke = /*#__PURE__*/emotion_styled_base_browser_esm("span", true ? {
} : 0)("box-sizing:border-box;display:block;pointer-events:none;position:absolute;", strokeFocus, ";" + ( true ? "" : 0));
const VerticalStroke = /*#__PURE__*/emotion_styled_base_browser_esm(Stroke, true ? {
styles: "bottom:3px;top:3px;width:2px"
const HorizontalStroke = /*#__PURE__*/emotion_styled_base_browser_esm(Stroke, true ? {
styles: "height:2px;left:3px;right:3px"
const TopStroke = /*#__PURE__*/emotion_styled_base_browser_esm(HorizontalStroke, true ? {
const RightStroke = /*#__PURE__*/emotion_styled_base_browser_esm(VerticalStroke, true ? {
const BottomStroke = /*#__PURE__*/emotion_styled_base_browser_esm(HorizontalStroke, true ? {
const LeftStroke = /*#__PURE__*/emotion_styled_base_browser_esm(VerticalStroke, true ? {
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/icon.js
const BASE_ICON_SIZE = 24;
function BoxControlIcon({
const isSideDisabled = value => sides?.length && !sides.includes(value);
const hasSide = value => {
if (isSideDisabled(value)) {
return side === 'all' || side === value;
const top = hasSide('top') || hasSide('vertical');
const right = hasSide('right') || hasSide('horizontal');
const bottom = hasSide('bottom') || hasSide('vertical');
const left = hasSide('left') || hasSide('horizontal');
// Simulates SVG Icon scaling.
const scale = size / BASE_ICON_SIZE;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(box_control_icon_styles_Root, {
transform: `scale(${scale})`
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Viewbox, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TopStroke, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RightStroke, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BottomStroke, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LeftStroke, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/styles/box-control-styles.js
function box_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)."; }
const StyledUnitControl = /*#__PURE__*/emotion_styled_base_browser_esm(unit_control, true ? {
const InputWrapper = /*#__PURE__*/emotion_styled_base_browser_esm(h_stack_component, true ? {
styles: "grid-column:1/span 3"
const ResetButton = /*#__PURE__*/emotion_styled_base_browser_esm(build_module_button, true ? {
styles: "grid-area:1/2;justify-self:end"
const LinkedButtonWrapper = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? {
styles: "grid-area:1/3;justify-self:end"
const FlexedBoxControlIcon = /*#__PURE__*/emotion_styled_base_browser_esm(BoxControlIcon, true ? {
const FlexedRangeControl = /*#__PURE__*/emotion_styled_base_browser_esm(range_control, true ? {
} : 0)("width:100%;margin-inline-end:", space(2), ";" + ( true ? "" : 0));
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/utils.js
const CUSTOM_VALUE_SETTINGS = {
all: (0,external_wp_i18n_namespaceObject.__)('All sides'),
top: (0,external_wp_i18n_namespaceObject.__)('Top side'),
bottom: (0,external_wp_i18n_namespaceObject.__)('Bottom side'),
left: (0,external_wp_i18n_namespaceObject.__)('Left side'),
right: (0,external_wp_i18n_namespaceObject.__)('Right side'),
mixed: (0,external_wp_i18n_namespaceObject.__)('Mixed'),
vertical: (0,external_wp_i18n_namespaceObject.__)('Top and bottom sides'),
horizontal: (0,external_wp_i18n_namespaceObject.__)('Left and right sides')
const ALL_SIDES = ['top', 'right', 'bottom', 'left'];
* Gets an items with the most occurrence within an array
* https://stackoverflow.com/a/20762713
* @param arr Array of items to check.
* @return The item with the most occurrences.
function utils_mode(arr) {
return arr.sort((a, b) => arr.filter(v => v === a).length - arr.filter(v => v === b).length).pop();
* Gets the 'all' input value and unit from values data.
* @param values Box values.
* @param selectedUnits Box units.
* @param availableSides Available box sides to evaluate.
* @return A value + unit for the 'all' input.
function getAllValue(values = {}, selectedUnits, availableSides = ALL_SIDES) {
const sides = normalizeSides(availableSides);
const parsedQuantitiesAndUnits = sides.map(side => parseQuantityAndUnitFromRawValue(values[side]));
const allParsedQuantities = parsedQuantitiesAndUnits.map(value => {
return (_value$ = value[0]) !== null && _value$ !== void 0 ? _value$ : '';
const allParsedUnits = parsedQuantitiesAndUnits.map(value => value[1]);
const commonQuantity = allParsedQuantities.every(v => v === allParsedQuantities[0]) ? allParsedQuantities[0] : '';
* The typeof === 'number' check is important. On reset actions, the incoming value
* may be null or an empty string.
* Also, the value may also be zero (0), which is considered a valid unit value.
* typeof === 'number' is more specific for these cases, rather than relying on a
if (typeof commonQuantity === 'number') {
commonUnit = utils_mode(allParsedUnits);
// Set meaningful unit selection if no commonQuantity and user has previously
// selected units without assigning values while controls were unlinked.
commonUnit = (_getAllUnitFallback = getAllUnitFallback(selectedUnits)) !== null && _getAllUnitFallback !== void 0 ? _getAllUnitFallback : utils_mode(allParsedUnits);
return [commonQuantity, commonUnit].join('');
* Determine the most common unit selection to use as a fallback option.
* @param selectedUnits Current unit selections for individual sides.
* @return Most common unit selection.
function getAllUnitFallback(selectedUnits) {
if (!selectedUnits || typeof selectedUnits !== 'object') {
const filteredUnits = Object.values(selectedUnits).filter(Boolean);
return utils_mode(filteredUnits);
* Checks to determine if values are mixed.
* @param values Box values.
* @param selectedUnits Box units.
* @param sides Available box sides to evaluate.
* @return Whether values are mixed.
function isValuesMixed(values = {}, selectedUnits, sides = ALL_SIDES) {
const allValue = getAllValue(values, selectedUnits, sides);
const isMixed = isNaN(parseFloat(allValue));
* Checks to determine if values are defined.
* @param values Box values.
* @return Whether values are mixed.
function isValuesDefined(values) {
return values !== undefined && Object.values(values).filter(
// Switching units when input is empty causes values only
// containing units. This gives false positive on mixed values
value => !!value && /\d/.test(value)).length > 0;
* Get initial selected side, factoring in whether the sides are linked,
* and whether the vertical / horizontal directions are grouped via splitOnAxis.
* @param isLinked Whether the box control's fields are linked.
* @param splitOnAxis Whether splitting by horizontal or vertical axis.
* @return The initial side.
function getInitialSide(isLinked, splitOnAxis) {
initialSide = splitOnAxis ? 'vertical' : 'top';
* Normalizes provided sides configuration to an array containing only top,
* right, bottom and left. This essentially just maps `horizontal` or `vertical`
* to their appropriate sides to facilitate correctly determining value for
* @param sides Available sides for box control.
* @return Normalized sides configuration.
function normalizeSides(sides) {
const filteredSides = [];
if (sides.includes('vertical')) {
filteredSides.push(...['top', 'bottom']);
} else if (sides.includes('horizontal')) {
filteredSides.push(...['left', 'right']);
const newSides = ALL_SIDES.filter(side => sides.includes(side));
filteredSides.push(...newSides);
* Applies a value to an object representing top, right, bottom and left sides
* while taking into account any custom side configuration.
* @param currentValues The current values for each side.
* @param newValue The value to apply to the sides object.
* @param sides Array defining valid sides.
* @return Object containing the updated values for each side.
function applyValueToSides(currentValues, newValue, sides) {
if (side === 'vertical') {
newValues.top = newValue;
newValues.bottom = newValue;
} else if (side === 'horizontal') {
newValues.left = newValue;
newValues.right = newValue;
newValues[side] = newValue;
ALL_SIDES.forEach(side => newValues[side] = newValue);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/box-control/all-input-control.js
const all_input_control_noop = () => {};