/**
 * 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_index = require('../../../node_modules/classnames/index.js');
const require_PageHeaderUtils = require('../PageHeaderUtils.js');
const require_context = require('./context.js');
let react = require("react");
react = require_runtime.__toESM(react);
let _carbon_react = require("@carbon/react");

//#region src/components/PageHeader/next/PageHeaderBreadcrumbBar.tsx
/**
* Copyright IBM Corp. 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.
*/
var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const PageHeaderBreadcrumbBar = react.default.forwardRef(function PageHeaderBreadcrumbBar({ border = true, className, children, renderIcon: IconElement, contentActions, contentActionsFlush, pageActions, pageActionsFlush, ...other }, ref) {
	const context = require_context.usePageHeader();
	const { pageActionsInstance: globalActions, observerState } = context;
	const classNames = (0, import_classnames.default)({
		[`${require_PageHeaderUtils.blockClass}__breadcrumb-bar`]: true,
		[`${require_PageHeaderUtils.blockClass}__breadcrumb-bar-border`]: border,
		[`${require_PageHeaderUtils.blockClass}__breadcrumb__actions-flush`]: pageActionsFlush
	}, className);
	const resolvedContentActions = typeof contentActions === "function" ? contentActions(observerState) : contentActions;
	const isFunctionalContentActions = typeof contentActions === "function";
	const contentActionsClasses = (0, import_classnames.default)({
		[`${require_PageHeaderUtils.blockClass}__breadcrumb__content-actions`]: !contentActionsFlush,
		[`${require_PageHeaderUtils.blockClass}__breadcrumb__content-actions-with-global-actions`]: !!globalActions,
		[`${require_PageHeaderUtils.blockClass}__breadcrumb__content-actions-with-global-actions--show`]: observerState.contentActionsClipped || isFunctionalContentActions
	});
	const resolvedPageActions = typeof pageActions === "function" ? pageActions(observerState) : pageActions;
	return /* @__PURE__ */ react.default.createElement(require_context.PageHeaderContext.Provider, { value: {
		...context,
		isContentActionsInBreadcrumbBar: true,
		isFunctionalContentActions
	} }, /* @__PURE__ */ react.default.createElement("div", {
		className: classNames,
		ref,
		...other
	}, /* @__PURE__ */ react.default.createElement(_carbon_react.Grid, null, /* @__PURE__ */ react.default.createElement(_carbon_react.Column, {
		lg: 16,
		md: 8,
		sm: 4
	}, /* @__PURE__ */ react.default.createElement("div", { className: `${require_PageHeaderUtils.blockClass}__breadcrumb-container` }, /* @__PURE__ */ react.default.createElement("div", { className: `${require_PageHeaderUtils.blockClass}__breadcrumb-wrapper` }, IconElement && /* @__PURE__ */ react.default.createElement("div", { className: `${require_PageHeaderUtils.blockClass}__breadcrumb__icon` }, /* @__PURE__ */ react.default.createElement(IconElement, null)), children), /* @__PURE__ */ react.default.createElement("div", { className: `${require_PageHeaderUtils.blockClass}__breadcrumb__actions` }, /* @__PURE__ */ react.default.createElement("div", { className: contentActionsClasses }, resolvedContentActions), resolvedPageActions))))));
});
PageHeaderBreadcrumbBar.displayName = "PageHeaderBreadcrumbBar";

//#endregion
exports.PageHeaderBreadcrumbBar = PageHeaderBreadcrumbBar;