/**
 * Copyright IBM Corp. 2020, 2026
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */

const require_runtime = require('../../../_virtual/_rolldown/runtime.js');
const require_util = require('../utils/util.js');
const require_ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
const require_useTranslations = require('../utils/useTranslations.js');
const require_ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
const require_ItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js');
const require_useDataConfigs = require('../utils/useDataConfigs.js');
let react = require("react");
react = require_runtime.__toESM(react);

//#region src/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.jsx
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const GroupConnector = () => {
	const { rootState, setRootState } = (0, react.useContext)(require_ConditionBuilderProvider.ConditionBuilderContext);
	const [conditionText] = require_useTranslations.useTranslations(["conditionText"]);
	const { connectorConfig } = require_useDataConfigs.useDataConfigs();
	const onStatementChangeHandler = (updatedStatement) => {
		setRootState({
			...rootState,
			operator: updatedStatement
		});
	};
	return /* @__PURE__ */ react.default.createElement("div", {
		className: `${require_util.blockClass}__group-separator ${require_util.blockClass}__group-separator-row`,
		role: "row",
		tabIndex: -1,
		"aria-level": 1
	}, /* @__PURE__ */ react.default.createElement(require_ConditionBuilderItem.ConditionBuilderItem, {
		label: rootState.operator,
		title: conditionText,
		"data-name": "connectorField",
		popOverClassName: `${require_util.blockClass}__gap ${require_util.blockClass}__groupConnector`,
		className: `${require_util.blockClass}__statement-button`
	}, /* @__PURE__ */ react.default.createElement(require_ItemOption.ItemOption, {
		conditionState: {
			value: rootState.operator,
			label: conditionText
		},
		onChange: onStatementChangeHandler,
		config: { options: connectorConfig }
	})));
};

//#endregion
exports.default = GroupConnector;