: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// eslint-disable-next-line no-restricted-imports
function UnforwardedToggleGroupControlAsRadioGroup({
const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsRadioGroup, 'toggle-group-control-as-radio-group');
const baseId = idProp || generatedId;
// Use a heuristic to understand if the component is being used in controlled
// or uncontrolled mode, and consequently:
// - when controlled, convert `undefined` values to `''` (ie. "no value")
// - use the `value` prop as the `defaultValue` when uncontrolled
} = useComputeControlledOrUncontrolledValue(valueProp);
// `useRadioStore`'s `setValue` prop can be called with `null`, while
// the component's `onChange` prop only expects `undefined`
const wrappedOnChangeProp = onChangeProp ? v => {
onChangeProp(v !== null && v !== void 0 ? v : undefined);
const radio = useRadioStore({
setValue: wrappedOnChangeProp
const selectedValue = radio.useState('value');
const setValue = radio.setValue;
const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
isBlock: !isAdaptiveWidth,
}), [baseId, isAdaptiveWidth, size, selectedValue, setValue]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_context.Provider, {
value: groupContextValue,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RadioGroup, {
render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, {}),
const ToggleGroupControlAsRadioGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsRadioGroup);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-value.js
* Simplified and improved implementation of useControlledState.
* @param props.defaultValue
* @return The controlled value and the value setter.
function useControlledValue({
const hasValue = typeof valueProp !== 'undefined';
const initialValue = hasValue ? valueProp : defaultValue;
const [state, setState] = (0,external_wp_element_namespaceObject.useState)(initialValue);
const value = hasValue ? valueProp : state;
if (hasValue && typeof onChange === 'function') {
} else if (!hasValue && typeof onChange === 'function') {
setValue = nextValue => {
return [value, setValue];
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/as-button-group.js
function UnforwardedToggleGroupControlAsButtonGroup({
const generatedId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControlAsButtonGroup, 'toggle-group-control-as-button-group');
const baseId = idProp || generatedId;
// Use a heuristic to understand if the component is being used in controlled
// or uncontrolled mode, and consequently:
// - when controlled, convert `undefined` values to `''` (ie. "no value")
// - use the `value` prop as the `defaultValue` when uncontrolled
} = useComputeControlledOrUncontrolledValue(valueProp);
const [selectedValue, setSelectedValue] = useControlledValue({
const groupContextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
setValue: setSelectedValue,
isBlock: !isAdaptiveWidth,
}), [baseId, selectedValue, setSelectedValue, isAdaptiveWidth, size]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(toggle_group_control_context.Provider, {
value: groupContextValue,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(component, {
const ToggleGroupControlAsButtonGroup = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedToggleGroupControlAsButtonGroup);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control/component.js
// eslint-disable-next-line no-restricted-imports
function UnconnectedToggleGroupControl(props, forwardedRef) {
__nextHasNoMarginBottom = false,
__next40pxDefaultSize = false,
hideLabelFromVision = false,
} = useContextSystem(props, 'ToggleGroupControl');
const baseId = (0,external_wp_compose_namespaceObject.useInstanceId)(ToggleGroupControl, 'toggle-group-control');
const normalizedSize = __next40pxDefaultSize && size === 'default' ? '__unstable-large' : size;
const classes = (0,external_wp_element_namespaceObject.useMemo)(() => cx(toggleGroupControl({
}), isBlock && toggle_group_control_styles_block, className), [className, cx, isBlock, isDeselectable, normalizedSize]);
const MainControl = isDeselectable ? ToggleGroupControlAsButtonGroup : ToggleGroupControlAsRadioGroup;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(base_control, {
__nextHasNoMarginBottom: __nextHasNoMarginBottom,
children: [!hideLabelFromVision && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(VisualLabelWrapper, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(base_control.VisualLabel, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MainControl, {
isAdaptiveWidth: isAdaptiveWidth,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutGroup, {
* `ToggleGroupControl` is a form component that lets users choose options
* represented in horizontal segments. To render options for this control use
* `ToggleGroupControlOption` component.
* This component is intended for selecting a single persistent value from a set of options,
* similar to a how a radio button group would work. If you simply want a toggle to switch between views,
* use a `TabPanel` instead.
* Only use this control when you know for sure the labels of items inside won't
* wrap. For items with longer labels, you can consider a `SelectControl` or a
* `CustomSelectControl` component instead.
* __experimentalToggleGroupControl as ToggleGroupControl,
* __experimentalToggleGroupControlOption as ToggleGroupControlOption,
* } from '@wordpress/components';
* <ToggleGroupControl label="my label" value="vertical" isBlock>
* <ToggleGroupControlOption value="horizontal" label="Horizontal" />
* <ToggleGroupControlOption value="vertical" label="Vertical" />
const ToggleGroupControl = contextConnect(UnconnectedToggleGroupControl, 'ToggleGroupControl');
/* harmony default export */ const toggle_group_control_component = (ToggleGroupControl);
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/JL6IRDFK.js
function getIsChecked(value, storeValue) {
if (storeValue === void 0)
if (value != null && storeValue != null) {
return storeValue === value;
function isNativeRadio(tagName, type) {
return tagName === "input" && (!type || type === "radio");
var useRadio = createHook(
var _b = _a, { store, name, value, checked } = _b, props = __objRest(_b, ["store", "name", "value", "checked"]);
const context = useRadioContext();
store = store || context;
const id = useId(props.id);
const ref = (0,external_React_.useRef)(null);
const isChecked = useStoreState(
(state) => checked != null ? checked : getIsChecked(value, state == null ? void 0 : state.value)
(0,external_React_.useEffect)(() => {
const isActiveItem = (store == null ? void 0 : store.getState().activeId) === id;
store == null ? void 0 : store.setActiveId(id);
}, [store, isChecked, id]);
const onChangeProp = props.onChange;
const tagName = useTagName(ref, props.as || "input");
const nativeRadio = isNativeRadio(tagName, props.type);
const disabled = disabledFromProps(props);
const [propertyUpdated, schedulePropertyUpdate] = useForceUpdate();
(0,external_React_.useEffect)(() => {
const element = ref.current;
if (isChecked !== void 0) {
element.checked = isChecked;
element.value = `${value}`;
}, [propertyUpdated, nativeRadio, isChecked, name, value]);
const onChange = useEvent((event) => {
event.currentTarget.checked = true;
schedulePropertyUpdate();
onChangeProp == null ? void 0 : onChangeProp(event);
if (event.defaultPrevented)
store == null ? void 0 : store.setValue(value);
const onClickProp = props.onClick;
const onClick = useEvent((event) => {
onClickProp == null ? void 0 : onClickProp(event);
if (event.defaultPrevented)
const onFocusProp = props.onFocus;
const onFocus = useEvent((event) => {
onFocusProp == null ? void 0 : onFocusProp(event);
if (event.defaultPrevented)
const { moves, activeId } = store.getState();
if (id && activeId !== id)
props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({
role: !nativeRadio ? "radio" : void 0,
type: nativeRadio ? "radio" : void 0,
"aria-checked": isChecked
ref: useMergeRefs(ref, props.ref),
props = useCompositeItem(_4R3V3JGP_spreadValues({ store, clickOnEnter: !nativeRadio }, props));
return _4R3V3JGP_spreadValues({
name: nativeRadio ? name : void 0,
value: nativeRadio ? value : void 0,
var Radio = createMemoComponent((props) => {
const htmlProps = useRadio(props);
return _3ORBWXWF_createElement("input", htmlProps);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js
function toggle_group_control_option_base_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 LabelView = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? {
styles: "display:inline-flex;max-width:100%;min-width:0;position:relative"
const labelBlock = true ? {
}) => /*#__PURE__*/emotion_react_browser_esm_css("align-items:center;appearance:none;background:transparent;border:none;border-radius:", config_values.controlBorderRadius, ";color:", COLORS.gray[700], ";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;@media not ( prefers-reduced-motion ){transition:background ", config_values.transitionDurationFast, " linear,color ", config_values.transitionDurationFast, " linear,font-weight 60ms linear;}user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:", config_values.toggleGroupControlBackgroundColor, ";}", isDeselectable && deselectable, " ", isIcon && isIconStyles({
}), " ", isPressed && pressed, ";" + ( true ? "" : 0), true ? "" : 0);
const pressed = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.white, ";&:active{background:transparent;}" + ( true ? "" : 0), true ? "" : 0);
const deselectable = /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.gray[900], ";&:focus{box-shadow:inset 0 0 0 1px ", COLORS.white, ",0 0 0 ", config_values.borderWidthFocus, " ", COLORS.theme.accent, ";outline:2px solid transparent;}" + ( true ? "" : 0), true ? "" : 0);
const ButtonContentView = /*#__PURE__*/emotion_styled_base_browser_esm("div", true ? {
} : 0)("display:flex;font-size:", config_values.fontSize, ";line-height:1;" + ( true ? "" : 0));
const iconButtonSizes = {
'__unstable-large': '32px'
return /*#__PURE__*/emotion_react_browser_esm_css("color:", COLORS.gray[900], ";height:", iconButtonSizes[size], ";aspect-ratio:1;padding-left:0;padding-right:0;" + ( true ? "" : 0), true ? "" : 0);
const backdropView = /*#__PURE__*/emotion_react_browser_esm_css("background:", COLORS.gray[900], ";border-radius:", config_values.controlBorderRadius, ";position:absolute;inset:0;z-index:1;outline:2px solid transparent;outline-offset:-3px;" + ( true ? "" : 0), true ? "" : 0);
;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/component.js
// eslint-disable-next-line no-restricted-imports
// eslint-disable-next-line no-restricted-imports
ButtonContentView: component_ButtonContentView,
LabelView: component_LabelView
} = toggle_group_control_option_base_styles_namespaceObject;
const REDUCED_MOTION_TRANSITION_CONFIG = {
const LAYOUT_ID = 'toggle-group-backdrop-shared-layout-id';