/**
 * 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_settings = require("../../../settings.js");
let react = require("react");
//#region src/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js
/**
* Copyright IBM Corp. 2022, 2022
*
* 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 useResetSpreadsheetFocus = ({ blockClass = `${require_settings.pkg.prefix}--data-spreadsheet`, focusedElement, removeActiveCell, setContainerHasFocus }) => {
	(0, react.useEffect)(() => {
		if (!focusedElement.classList.contains(`${blockClass}--interactive-cell-element`)) {
			setContainerHasFocus(false);
			removeActiveCell();
		}
		if (focusedElement.classList.contains(blockClass) || focusedElement.classList.contains(`${blockClass}--interactive-cell-element`)) setContainerHasFocus(true);
	}, [
		focusedElement,
		removeActiveCell,
		blockClass,
		setContainerHasFocus
	]);
};
//#endregion
exports.useResetSpreadsheetFocus = useResetSpreadsheetFocus;
