/**
 * 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_settings = require("../../settings.js");
const require_devtools = require("../../global/js/utils/devtools.js");
const require_Error403SVG = require("./assets/Error403SVG.js");
const require_Error404SVG = require("./assets/Error404SVG.js");
const require_ErrorGenericSVG = require("./assets/ErrorGenericSVG.js");
let react = require("react");
react = require_runtime.__toESM(react);
let prop_types = require("prop-types");
prop_types = require_runtime.__toESM(prop_types);
let _carbon_react = require("@carbon/react");
//#region src/components/FullPageError/FullPageError.tsx
/**
* Copyright IBM Corp. 2024, 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.
*/
var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const blockClass = `${require_settings.pkg.prefix}--full-page-error`;
const componentName = "FullPageError";
const defaults = { kind: "custom" };
/**
* Display a full-page error when the requested page is unavailable to the user.
* This is typically caused by issues with the requested URL or access permissions.
*/
const FullPageError = react.default.forwardRef(({ children, className, description, label, kind = defaults.kind, title, ...rest }, ref) => {
	const errorData = {
		403: { svg: /* @__PURE__ */ react.default.createElement(require_Error403SVG.Error403SVG, { className: `${blockClass}__svg ${blockClass}__403` }) },
		404: { svg: /* @__PURE__ */ react.default.createElement(require_Error404SVG.Error404SVG, { className: `${blockClass}__svg ${blockClass}__404` }) },
		custom: { svg: /* @__PURE__ */ react.default.createElement(require_ErrorGenericSVG.ErrorGenericSVG, { className: `${blockClass}__svg ${blockClass}__custom` }) }
	};
	return /* @__PURE__ */ react.default.createElement("div", {
		...rest,
		className: (0, import_classnames.default)(blockClass, className),
		ref,
		role: "main",
		...require_devtools.getDevtoolsProps(componentName)
	}, /* @__PURE__ */ react.default.createElement("div", { className: `${blockClass}__container` }, /* @__PURE__ */ react.default.createElement(_carbon_react.Grid, { className: `${blockClass}__grid` }, /* @__PURE__ */ react.default.createElement(_carbon_react.Column, {
		sm: 4,
		md: 3,
		lg: 6,
		className: `${blockClass}__column`
	}, /* @__PURE__ */ react.default.createElement("h1", { className: `${blockClass}__title` }, /* @__PURE__ */ react.default.createElement("span", { className: `${blockClass}__label` }, /* @__PURE__ */ react.default.createElement("span", { "aria-hidden": "true" }, "↳ "), label), /* @__PURE__ */ react.default.createElement("span", null, title)), /* @__PURE__ */ react.default.createElement("p", { className: `${blockClass}__description` }, description), /* @__PURE__ */ react.default.createElement("div", { className: `${blockClass}__body` }, children)), /* @__PURE__ */ react.default.createElement(_carbon_react.Column, {
		sm: 4,
		md: 5,
		lg: 10
	}, /* @__PURE__ */ react.default.createElement("div", { className: `${blockClass}__svg-container` }, errorData[kind].svg)))));
});
FullPageError.displayName = componentName;
FullPageError.propTypes = {
	/**
	* Provide the contents of the FullPageError.
	*/
	children: prop_types.default.node,
	/**
	* Provide an optional class to be applied to the containing node.
	*/
	className: prop_types.default.string,
	/**
	* String that will provide the description for the error code. <br/>
	* This is optional for 403 and 404 kinds, and passing this would override their default descriptions.
	*/
	description: prop_types.default.string.isRequired,
	/**
	* The kind of error page to be displayed, default is custom
	*/
	kind: prop_types.default.oneOf([
		"custom",
		"403",
		"404"
	]),
	/**
	* String that will describe the error that occurred
	*/
	label: prop_types.default.string.isRequired,
	/**
	* This will be for the main title of the FullPageError component
	*/
	title: prop_types.default.string.isRequired
};
//#endregion
exports.FullPageError = FullPageError;
