"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    ExecutionStatusIcon: ()=>ExecutionStatusIcon,
    getExecutionStatusColor: ()=>getExecutionStatusColor
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
const external_react_namespaceObject = require("react");
const icon_registry_cjs_namespaceObject = require("../../utils/icon-registry.cjs");
function getExecutionStatusColor(status) {
    switch(status){
        case 'NotExecuted':
            return 'var(--color-foreground-de-emp)';
        case 'InProgress':
            return 'var(--color-info-icon)';
        case 'Completed':
            return 'var(--color-success-icon)';
        case 'Paused':
        case 'Warning':
            return 'var(--color-warning-icon)';
        case 'Cancelled':
            return 'var(--color-error-icon)';
        case 'UserCancelled':
            return 'var(--color-info-icon)';
        case 'Failed':
            return 'var(--color-error-icon)';
        case 'Terminated':
            return 'var(--color-error-icon)';
        case 'Canceling':
            return 'var(--color-error-icon)';
        case 'Faulted':
            return 'var(--color-error-icon)';
        case 'Pausing':
            return 'var(--color-warning-icon)';
        case 'Pending':
            return 'var(--color-warning-icon)';
        case 'Resuming':
            return 'var(--color-info-icon)';
        case 'Retrying':
            return 'var(--color-info-icon)';
        case 'Running':
            return 'var(--color-info-icon)';
        case 'Upgrading':
            return 'var(--color-info-icon)';
        default:
            return '';
    }
}
function ExecutionStatusIcon({ status, size = 16 }) {
    return (0, external_react_namespaceObject.useMemo)(()=>{
        const color = getExecutionStatusColor(status);
        switch(status){
            case 'InProgress':
                return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Spinner, {
                    size: "sm",
                    style: {
                        backgroundColor: 'transparent',
                        width: size,
                        height: size
                    }
                });
            case 'Completed':
                return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
                    icon: "circle-check",
                    size: size,
                    color: color
                });
            case 'Paused':
                return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
                    icon: "circle-pause",
                    size: size,
                    color: color
                });
            case 'Warning':
                return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
                    icon: "triangle-alert",
                    size: size,
                    color: color
                });
            case 'Failed':
                return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
                    icon: "circle-alert",
                    size: size,
                    color: color
                });
            case 'Terminated':
                return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
                    icon: "circle-x",
                    size: size,
                    color: color
                });
            case 'Cancelled':
            case 'UserCancelled':
                return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
                    icon: "circle-stop",
                    size: size,
                    color: color
                });
            case 'NotExecuted':
                return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
                    icon: "circle-dashed",
                    size: size,
                    color: color
                });
            default:
                return null;
        }
    }, [
        status,
        size
    ]);
}
exports.ExecutionStatusIcon = __webpack_exports__.ExecutionStatusIcon;
exports.getExecutionStatusColor = __webpack_exports__.getExecutionStatusColor;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "ExecutionStatusIcon",
    "getExecutionStatusColor"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
