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

//#region ../../node_modules/@carbon/icon-helpers/es/index.js
/**
* Copyright IBM Corp. 2018, 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 defaultAttributes = {
	focusable: "false",
	preserveAspectRatio: "xMidYMid meet"
};
/**
* Get supplementary HTML attributes for a given <svg> element based on existing
* attributes.
*/
function getAttributes({ width, height, viewBox = `0 0 ${width} ${height}`, ...attributes } = {}) {
	const { tabindex, ...rest } = attributes;
	const iconAttributes = {
		...defaultAttributes,
		...rest,
		width,
		height,
		viewBox
	};
	if (iconAttributes["aria-label"] || iconAttributes["aria-labelledby"]) {
		iconAttributes.role = "img";
		if (tabindex !== void 0 && tabindex !== null) {
			iconAttributes.focusable = "true";
			iconAttributes.tabindex = tabindex;
		}
	} else iconAttributes["aria-hidden"] = true;
	return iconAttributes;
}

//#endregion
export { getAttributes };