"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = (module)=>{
        var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __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__, {
    ApAccordion: ()=>ApAccordion
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const Accordion_namespaceObject = require("@mui/material/Accordion");
var Accordion_default = /*#__PURE__*/ __webpack_require__.n(Accordion_namespaceObject);
const AccordionDetails_namespaceObject = require("@mui/material/AccordionDetails");
var AccordionDetails_default = /*#__PURE__*/ __webpack_require__.n(AccordionDetails_namespaceObject);
const AccordionSummary_namespaceObject = require("@mui/material/AccordionSummary");
var AccordionSummary_default = /*#__PURE__*/ __webpack_require__.n(AccordionSummary_namespaceObject);
const styles_namespaceObject = require("@mui/material/styles");
const apollo_core_namespaceObject = require("@uipath/apollo-core");
var apollo_core_default = /*#__PURE__*/ __webpack_require__.n(apollo_core_namespaceObject);
const index_cjs_namespaceObject = require("../../../icons/index.cjs");
const external_ap_typography_index_cjs_namespaceObject = require("../ap-typography/index.cjs");
const StyledAccordion = (0, styles_namespaceObject.styled)(Accordion_default(), {
    shouldForwardProp: (prop)=>'accordionPadding' !== prop
})(()=>({
        '&.MuiPaper-root': {
            boxShadow: 'unset'
        },
        position: 'relative',
        '&.Mui-expanded': {
            margin: 0
        },
        '&::before': {
            display: 'none'
        },
        '&:first-of-type .MuiAccordionSummary-root::before': {
            display: 'none'
        }
    }));
const StyledAccordionSummary = (0, styles_namespaceObject.styled)(AccordionSummary_default(), {
    shouldForwardProp: (prop)=>'disableDivider' !== prop && 'accordionPadding' !== prop && 'dividerLeftPosition' !== prop && 'dividerRightPosition' !== prop && 'expandIconPosition' !== prop
})(({ disableDivider, dividerLeftPosition, dividerRightPosition, expandIconPosition })=>({
        '&:hover, &:focus': {
            backgroundColor: 'transparent'
        },
        '&:focus-visible': {
            zIndex: 1
        },
        flexDirection: 'end' !== expandIconPosition ? 'row-reverse' : 'row',
        padding: `${apollo_core_default().Padding.PadXl} ${apollo_core_default().Padding.PadXxxl}`,
        minHeight: apollo_core_default().Spacing.SpacingXxl,
        position: 'relative',
        '&::before': {
            content: '""',
            position: 'absolute',
            top: 0,
            left: dividerLeftPosition || apollo_core_default().Padding.PadXxxl,
            right: dividerRightPosition || apollo_core_default().Padding.PadXxxl,
            height: 1,
            backgroundColor: 'var(--color-border-de-emp)',
            display: disableDivider ? 'none' : 'block',
            pointerEvents: 'none'
        },
        '&.Mui-expanded': {
            minHeight: apollo_core_default().Spacing.SpacingXxl
        },
        '& .MuiAccordionSummary-content': {
            margin: '0px',
            '&.Mui-expanded': {
                margin: '0px'
            }
        }
    }));
function ApAccordion(props) {
    const { startIcon, label, defaultExpanded, children, expandIconPosition = 'end', labelFontSize, labelFontWeight, labelColor, disableDivider, summarySx, summaryProps, dividerLeftPosition, dividerRightPosition, detailsSx, detailsProps, ...accordionProps } = props;
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(StyledAccordion, {
        defaultExpanded: defaultExpanded,
        ...accordionProps,
        children: [
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(StyledAccordionSummary, {
                sx: summarySx,
                dividerLeftPosition: dividerLeftPosition,
                dividerRightPosition: dividerRightPosition,
                expandIcon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ChevronDown, {
                    size: "20px",
                    style: {
                        marginTop: '-2px'
                    },
                    "aria-hidden": "true"
                }),
                expandIconPosition: expandIconPosition,
                disableDivider: disableDivider,
                ...summaryProps,
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_ap_typography_index_cjs_namespaceObject.ApTypography, {
                    variant: apollo_core_namespaceObject.FontVariantToken.fontSizeM,
                    color: labelColor || 'var(--color-foreground-de-emp)',
                    style: {
                        ...labelFontSize && {
                            fontSize: labelFontSize
                        },
                        ...labelFontWeight && {
                            fontWeight: labelFontWeight
                        },
                        display: 'flex',
                        alignItems: 'center'
                    },
                    children: [
                        startIcon ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                            style: {
                                display: 'flex',
                                marginRight: apollo_core_namespaceObject.PadL
                            },
                            children: startIcon
                        }) : null,
                        label
                    ]
                })
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(AccordionDetails_default(), {
                sx: {
                    padding: 'unset',
                    ...detailsSx
                },
                ...detailsProps,
                children: children
            })
        ]
    });
}
ApAccordion.displayName = 'ApAccordion';
exports.ApAccordion = __webpack_exports__.ApAccordion;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "ApAccordion"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
