require("./Disclosure.css");
var $6e265ff388155b91$exports = require("./ActionButton.cjs");
var $e991cbcdf82ced71$exports = require("./CenterBaseline.cjs");
var $1df9f1c9262ce5df$exports = require("./Chevron.cjs");
var $150382364eecc4bc$exports = require("./useDOMRef.cjs");
var $ac757a4c2bd72aee$exports = require("../../icons/useSpectrumContextProps.cjs");
var $5FRIp$reactjsxruntime = require("react/jsx-runtime");
var $5FRIp$reactariacomponentsButton = require("react-aria-components/Button");
var $5FRIp$reactariacomponentsslots = require("react-aria-components/slots");
var $5FRIp$reactariacomponentsDisclosure = require("react-aria-components/Disclosure");
var $5FRIp$reactariafilterDOMProps = require("react-aria/filterDOMProps");
var $5FRIp$reactariacomponentsHeading = require("react-aria-components/Heading");
var $5FRIp$react = require("react");
var $5FRIp$reactariaI18nProvider = require("react-aria/I18nProvider");


function $parcel$export(e, n, v, s) {
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}

$parcel$export(module.exports, "DisclosureContext", () => $4e301a98f0cc4e4f$export$d665dd135a51b28a);
$parcel$export(module.exports, "Disclosure", () => $4e301a98f0cc4e4f$export$74a362b31437ec83);
$parcel$export(module.exports, "DisclosureHeader", () => $4e301a98f0cc4e4f$export$1e037ddd32f5b8ac);
$parcel$export(module.exports, "DisclosureTitle", () => $4e301a98f0cc4e4f$export$7843c6a5b3e340a2);
$parcel$export(module.exports, "DisclosurePanel", () => $4e301a98f0cc4e4f$export$feabaa331e1d464c);
/*
 * Copyright 2024 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */ 












const $4e301a98f0cc4e4f$export$d665dd135a51b28a = /*#__PURE__*/ (0, $5FRIp$react.createContext)(null);
const $4e301a98f0cc4e4f$var$disclosure = function anonymous(props, overrides) {
    let rules = " ";
    let minWidth = false;
    let matches = String(overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L)[^\s]+/g);
    for (let p of matches){
        if (p[1] === "N") minWidth = true;
        rules += p[0];
    }
    rules += ' po12';
    if (props.isQuiet) rules += ' _ka12';
    else rules += ' _kb12';
    if (props.isInGroup) {
        rules += ' ha12';
        if (props.isQuiet) rules += ' hka12';
        else rules += ' hkb12';
    } else if (props.isQuiet) rules += ' ha12';
    else rules += ' hb12';
    rules += ' ma12';
    rules += ' la12';
    rules += ' _jf12';
    rules += ' ir12';
    if (!minWidth) rules += ' Ng12';
    return rules;
};
const $4e301a98f0cc4e4f$export$74a362b31437ec83 = /*#__PURE__*/ (0, $5FRIp$react.forwardRef)(function Disclosure(props, ref) {
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $4e301a98f0cc4e4f$export$d665dd135a51b28a);
    let { size: size = 'M', density: density = 'regular', isQuiet: isQuiet, UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '' } = props;
    let domRef = (0, $150382364eecc4bc$exports.useDOMRef)(ref);
    let isInGroup = (0, $5FRIp$react.useContext)($4e301a98f0cc4e4f$export$d665dd135a51b28a) !== null;
    return /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)((0, $5FRIp$reactariacomponentsslots.Provider), {
        values: [
            [
                $4e301a98f0cc4e4f$export$d665dd135a51b28a,
                {
                    size: size,
                    isQuiet: isQuiet,
                    density: density
                }
            ]
        ],
        children: /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)((0, $5FRIp$reactariacomponentsDisclosure.Disclosure), {
            ...props,
            ref: domRef,
            style: UNSAFE_style,
            className: (UNSAFE_className ?? '') + $4e301a98f0cc4e4f$var$disclosure({
                isQuiet: isQuiet,
                isInGroup: isInGroup
            }, props.styles),
            children: props.children
        })
    });
});
const $4e301a98f0cc4e4f$var$headingStyle = " Jy12 Gy12 Iy12 Hy12 _ub12 sd12 _vb12 Na12";
const $4e301a98f0cc4e4f$var$buttonStyles = function anonymous(props) {
    let rules = " ";
    if (props.isFocusVisible) rules += ' _Lf12';
    else rules += ' _Le12';
    rules += ' Oh12';
    rules += ' Olc12';
    rules += ' _Mc12';
    rules += ' _Kb12';
    rules += ' uk12';
    rules += ' ucJ9TBTb12';
    rules += ' ud3Euai12';
    rules += ' uea12';
    rules += ' ugb12';
    rules += ' uhd12';
    rules += ' uje12';
    rules += ' u2NhKxcl12';
    rules += ' uic12';
    if (props.size === "XL") {
        rules += ' -_6BNtrc-f12';
        rules += ' vx12';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-e12';
        rules += ' vx12';
    } else if (props.size === "M") {
        rules += ' -_6BNtrc-d12';
        rules += ' vx12';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-c12';
        rules += ' vx12';
    }
    rules += ' xd12';
    rules += ' _xa12';
    rules += ' xX0cczbc12';
    rules += ' _xX0cczba12';
    rules += ' _Fd12';
    rules += ' _FnuYUweb12';
    if (props.isDisabled) {
        rules += ' pp12';
        rules += ' plc12';
    } else {
        if (props.isPressed) rules += ' po12';
        else if (props.isFocusVisible) rules += ' po12';
        else if (props.isHovered) rules += ' po12';
        else rules += ' pt12';
        rules += ' plb12';
    }
    rules += ' sd12';
    rules += ' _ub12';
    rules += ' ea12';
    rules += ' S6FcKR12';
    rules += ' R6FcKR12';
    rules += ' Tu7Fubd12';
    rules += ' Qu7Fubd12';
    rules += ' U6FcKR12';
    rules += ' q6FcKR12';
    rules += ' MAyFGYc12';
    rules += ' Za12';
    if (props.isPressed) rules += ' gnSjEFb12';
    else if (props.isHovered) rules += ' gabY4te12';
    else if (props.isFocusVisible) rules += ' gabY4te12';
    else rules += ' g912';
    rules += ' Yd12';
    rules += ' Xb12';
    rules += ' _2b12';
    rules += ' _kJ8iPYd12';
    rules += ' hXMFGYc12';
    rules += ' ma12';
    rules += ' la12';
    if (props.isQuiet) rules += ' ob12';
    else if (props.isFocusVisible) rules += ' ob12';
    else rules += ' od12';
    if (props.isQuiet) rules += ' nb12';
    else if (props.isFocusVisible) rules += ' nb12';
    else rules += ' nd12';
    if (props.isQuiet) rules += ' kb12';
    else if (props.isFocusVisible) rules += ' kb12';
    else rules += ' kd12';
    if (props.isQuiet) rules += ' jb12';
    else if (props.isFocusVisible) rules += ' jb12';
    else rules += ' jd12';
    rules += ' _Wd12';
    rules += ' __ca12';
    if (props.size === "XL") {
        if (props.density === "spacious") rules += ' -M_-Mj12';
        else if (props.density === "regular") rules += ' -M_-Mk12';
        else if (props.density === "compact") rules += ' -M_-Mh12';
    } else if (props.size === "L") {
        if (props.density === "spacious") rules += ' -M_-Mk12';
        else if (props.density === "regular") rules += ' -M_-Mh12';
        else if (props.density === "compact") rules += ' -M_-Mi12';
    } else if (props.size === "M") {
        if (props.density === "spacious") rules += ' -M_-Mh12';
        else if (props.density === "regular") rules += ' -M_-Mi12';
        else if (props.density === "compact") rules += ' -M_-Mg12';
    } else if (props.size === "S") {
        if (props.density === "spacious") rules += ' -M_-Mi12';
        else if (props.density === "regular") rules += ' -M_-Mg12';
        else if (props.density === "compact") rules += ' -M_-Me12';
    }
    rules += ' -_k_-_ka12';
    rules += ' -h_-ha12';
    return rules;
};
const $4e301a98f0cc4e4f$var$chevronStyles = function anonymous(props) {
    let rules = " ";
    if (props.isExpanded) rules += ' _Sd12';
    else if (props.isRTL) rules += ' _Sc12';
    rules += ' Yd12';
    rules += ' Xb12';
    rules += ' _2b12';
    rules += ' -_8sjo0b-t5ZbAob12';
    rules += ' _va12';
    return rules;
};
const $4e301a98f0cc4e4f$var$InternalDisclosureHeader = /*#__PURE__*/ (0, $5FRIp$react.createContext)(null);
function $4e301a98f0cc4e4f$var$DisclosureHeaderWithForwardRef(props, ref) {
    let { UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style, children: children } = props;
    let domRef = (0, $150382364eecc4bc$exports.useDOMRef)(ref);
    let { size: size, isQuiet: isQuiet, density: density } = (0, $5FRIp$reactariacomponentsslots.useSlottedContext)($4e301a98f0cc4e4f$export$d665dd135a51b28a);
    // Shift button size down by 2 for compact density, 1 for regular/spacious to ensure there is space between the top and bottom of the action button and container
    let newSize = size;
    const sizes = [
        'XS',
        'S',
        'M',
        'L',
        'XL'
    ];
    const currentIndex = sizes.indexOf(size ?? 'M');
    const shift = density === 'compact' ? 2 : 1;
    newSize = sizes[Math.max(0, currentIndex - shift)];
    return /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)((0, $5FRIp$reactariacomponentsslots.Provider), {
        values: [
            [
                (0, $6e265ff388155b91$exports.ActionButtonContext),
                {
                    size: newSize,
                    isQuiet: isQuiet
                }
            ],
            [
                $4e301a98f0cc4e4f$var$InternalDisclosureHeader,
                {}
            ]
        ],
        children: /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)("div", {
            style: UNSAFE_style,
            className: (UNSAFE_className ?? '') + " sd12 eb12 Ub12 qb12",
            ref: domRef,
            children: children
        })
    });
}
const $4e301a98f0cc4e4f$export$1e037ddd32f5b8ac = /*#__PURE__*/ (0, $5FRIp$react.forwardRef)($4e301a98f0cc4e4f$var$DisclosureHeaderWithForwardRef);
const $4e301a98f0cc4e4f$export$7843c6a5b3e340a2 = /*#__PURE__*/ (0, $5FRIp$react.forwardRef)(function DisclosureTitle(props, ref) {
    let { level: level = 3, UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '', ...otherProps } = props;
    let domRef = (0, $150382364eecc4bc$exports.useDOMRef)(ref);
    const domProps = (0, $5FRIp$reactariafilterDOMProps.filterDOMProps)(otherProps);
    let { direction: direction } = (0, $5FRIp$reactariaI18nProvider.useLocale)();
    let { isExpanded: isExpanded } = (0, $5FRIp$react.useContext)((0, $5FRIp$reactariacomponentsDisclosure.DisclosureStateContext));
    let { size: size, density: density, isQuiet: isQuiet } = (0, $5FRIp$reactariacomponentsslots.useSlottedContext)($4e301a98f0cc4e4f$export$d665dd135a51b28a);
    let isRTL = direction === 'rtl';
    let buttonTrigger = /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)((0, $5FRIp$reactariacomponentsHeading.Heading), {
        ...domProps,
        level: level,
        ref: domRef,
        style: UNSAFE_style,
        className: (UNSAFE_className ?? '') + $4e301a98f0cc4e4f$var$headingStyle,
        children: /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsxs)((0, $5FRIp$reactariacomponentsButton.Button), {
            className: (renderProps)=>$4e301a98f0cc4e4f$var$buttonStyles({
                    ...renderProps,
                    size: size,
                    density: density,
                    isQuiet: isQuiet
                }),
            slot: "trigger",
            children: [
                /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)((0, $e991cbcdf82ced71$exports.CenterBaseline), {
                    children: /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)((0, $1df9f1c9262ce5df$exports.default), {
                        size: size,
                        className: $4e301a98f0cc4e4f$var$chevronStyles({
                            isExpanded: isExpanded,
                            isRTL: isRTL
                        }),
                        "aria-hidden": "true"
                    })
                }),
                props.children
            ]
        })
    });
    let ctx = (0, $5FRIp$react.useContext)($4e301a98f0cc4e4f$var$InternalDisclosureHeader);
    if (ctx) return buttonTrigger;
    return /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)($4e301a98f0cc4e4f$export$1e037ddd32f5b8ac, {
        children: buttonTrigger
    });
});
const $4e301a98f0cc4e4f$var$panelStyles = " uk12 ucJ9TBTb12 ud3Euai12 uea12 ugb12 uhd12 uje12 u2NhKxcl12 uic12 -_6BNtrc-d12 vx12 xb12 _xa12 _Fb12 _FnuYUwec12 pt12 FfwmW1d12 _Nb12 Pb12 Ysgyfc12 Ydklsgce12 Xb12 Xdklsgcb12 _2b12 _2dklsgcb12";
const $4e301a98f0cc4e4f$var$panelInner = function anonymous(props) {
    let rules = " ";
    rules += ' Tt12';
    rules += ' Qf12';
    if (props.size === "XL") rules += ' Sz5EUbe12';
    else if (props.size === "L") rules += ' Se12';
    else if (props.size === "M") rules += ' SLabwmd12';
    else if (props.size === "S") rules += ' St12';
    if (props.size === "XL") rules += ' Rz5EUbe12';
    else if (props.size === "L") rules += ' Re12';
    else if (props.size === "M") rules += ' RLabwmd12';
    else if (props.size === "S") rules += ' Rt12';
    return rules;
};
const $4e301a98f0cc4e4f$export$feabaa331e1d464c = /*#__PURE__*/ (0, $5FRIp$react.forwardRef)(function DisclosurePanel(props, ref) {
    let { UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '', ...otherProps } = props;
    const domProps = (0, $5FRIp$reactariafilterDOMProps.filterDOMProps)(otherProps);
    let { size: size } = (0, $5FRIp$reactariacomponentsslots.useSlottedContext)($4e301a98f0cc4e4f$export$d665dd135a51b28a);
    let panelRef = (0, $150382364eecc4bc$exports.useDOMRef)(ref);
    return /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)((0, $5FRIp$reactariacomponentsDisclosure.DisclosurePanel), {
        ...domProps,
        ref: panelRef,
        style: UNSAFE_style,
        className: (UNSAFE_className ?? '') + $4e301a98f0cc4e4f$var$panelStyles,
        children: /*#__PURE__*/ (0, $5FRIp$reactjsxruntime.jsx)("div", {
            className: $4e301a98f0cc4e4f$var$panelInner({
                size: size
            }),
            children: props.children
        })
    });
});


//# sourceMappingURL=Disclosure.cjs.map
