/**
 * 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.
 */

require("../../../_virtual/_rolldown/runtime.js");
const require_ConditionBuilderProvider = require("../ConditionBuilderContext/ConditionBuilderProvider.js");
const require_translationObject = require("../ConditionBuilderContext/translationObject.js");
let react = require("react");
//#region src/components/ConditionBuilder/utils/useTranslations.js
/**
* Copyright IBM Corp. 2021, 2023
*
* 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 useTranslations = (translationKeys, alterTranslationKeyMap) => {
	const { translateWithId } = (0, react.useContext)(require_ConditionBuilderProvider.ConditionBuilderContext);
	return translationKeys.map((translationKey) => {
		if (alterTranslationKeyMap?.[translationKey]) translationKey = alterTranslationKeyMap[translationKey];
		if (translateWithId?.(translationKey) && translateWithId?.(translationKey) !== translationKey) return translateWithId(translationKey);
		else if (require_translationObject.translationsObject[translationKey]) return require_translationObject.translationsObject[translationKey];
		else return translationKey;
	});
};
//#endregion
exports.useTranslations = useTranslations;
