import "./ContextualHelp.css";
import {ActionButton as $da878a05ab4a403e$export$cfc7921d29ef7b80} from "./ActionButton.mjs";
import {ContentContext as $8e847109a6ab556d$export$1cbdd774077931b4, FooterContext as $8e847109a6ab556d$export$5630640b68817ed6, HeadingContext as $8e847109a6ab556d$export$d688439359537581} from "./Content.mjs";
import {dialogInner as $9bbc115952dac5a6$export$6af31f836f9aa6f2} from "./Dialog.mjs";
import {DialogTrigger as $66262086fa190fcb$export$2e1e1122cf0cba88} from "./DialogTrigger.mjs";
import $410bd93c9b5189d7$export$2e2bcd8739ae039 from "../icons/HelpCircle.mjs";
import $4c8f17dac3ecefd9$export$2e2bcd8739ae039 from "../icons/InfoCircle.mjs";
import $bcd4U$intlStringsmjs from "./intlStrings.mjs";
import {mergeStyles as $feb886035e0d4633$export$e618dc39ac9ad607} from "../icons/runtime.mjs";
import {Popover as $88b746eba92c8d0d$export$5b6b19405a83ff9d} from "./Popover.mjs";
import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "../icons/useSpectrumContextProps.mjs";
import {jsxs as $bcd4U$jsxs, jsx as $bcd4U$jsx} from "react/jsx-runtime";
import {Dialog as $bcd4U$Dialog, Provider as $bcd4U$Provider, TextContext as $bcd4U$TextContext, DEFAULT_SLOT as $bcd4U$DEFAULT_SLOT} from "react-aria-components";
import {createContext as $bcd4U$createContext, forwardRef as $bcd4U$forwardRef} from "react";
import {useLabels as $bcd4U$useLabels, filterDOMProps as $bcd4U$filterDOMProps, mergeProps as $bcd4U$mergeProps} from "@react-aria/utils";
import {useLocalizedStringFormatter as $bcd4U$useLocalizedStringFormatter} from "@react-aria/i18n";


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}















const $8e176595bc49ca3f$var$wrappingDiv = " NOBje7c11 ZOBje7c11 Th11 Qh11 Sh11 Rh11 _oa11 Fb11";
const $8e176595bc49ca3f$export$41b9afaaba473494 = /*#__PURE__*/ (0, $bcd4U$createContext)(null);
const $8e176595bc49ca3f$export$7d3cdb256c2ba320 = /*#__PURE__*/ (0, $bcd4U$forwardRef)(function ContextualHelp(props, ref) {
    let stringFormatter = (0, $bcd4U$useLocalizedStringFormatter)((0, ($parcel$interopDefault($bcd4U$intlStringsmjs))), '@react-spectrum/s2');
    [props, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props, ref, $8e176595bc49ca3f$export$41b9afaaba473494);
    let { children: children, defaultOpen: defaultOpen, containerPadding: containerPadding = 8, size: size = 'XS', crossOffset: crossOffset, isOpen: isOpen, onOpenChange: onOpenChange, placement: placement = 'bottom start', shouldFlip: shouldFlip, UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style, styles: styles, variant: variant = 'help' } = props;
    // In a FieldLabel we're getting the context's aria-labeledby, so we need to
    // manually set the aria-label after useLabels() to keep the order of label
    // then ContextualHelp variant
    let labelProps = (0, $bcd4U$useLabels)(props);
    let label = stringFormatter.format(`contextualhelp.${variant}`);
    labelProps['aria-label'] = labelProps['aria-label'] ? labelProps['aria-label'] + ' ' + label : label;
    let buttonProps = (0, $bcd4U$filterDOMProps)(props, {
        labelable: true
    });
    return /*#__PURE__*/ (0, $bcd4U$jsxs)((0, $66262086fa190fcb$export$2e1e1122cf0cba88), {
        isOpen: isOpen,
        defaultOpen: defaultOpen,
        onOpenChange: onOpenChange,
        children: [
            /*#__PURE__*/ (0, $bcd4U$jsx)((0, $da878a05ab4a403e$export$cfc7921d29ef7b80), {
                slot: null,
                ref: ref,
                size: size,
                ...(0, $bcd4U$mergeProps)(buttonProps, labelProps),
                UNSAFE_style: UNSAFE_style,
                UNSAFE_className: UNSAFE_className,
                styles: styles,
                isQuiet: true,
                children: variant === 'info' ? /*#__PURE__*/ (0, $bcd4U$jsx)((0, $4c8f17dac3ecefd9$export$2e2bcd8739ae039), {}) : /*#__PURE__*/ (0, $bcd4U$jsx)((0, $410bd93c9b5189d7$export$2e2bcd8739ae039), {})
            }),
            /*#__PURE__*/ (0, $bcd4U$jsx)((0, $88b746eba92c8d0d$export$5b6b19405a83ff9d), {
                padding: "none",
                placement: placement,
                shouldFlip: shouldFlip,
                containerPadding: containerPadding,
                offset: 8,
                crossOffset: crossOffset,
                hideArrow: true,
                children: /*#__PURE__*/ (0, $bcd4U$jsx)("div", {
                    className: $8e176595bc49ca3f$var$wrappingDiv,
                    children: /*#__PURE__*/ (0, $bcd4U$jsx)((0, $bcd4U$Dialog), {
                        className: (0, $feb886035e0d4633$export$e618dc39ac9ad607)((0, $9bbc115952dac5a6$export$6af31f836f9aa6f2), " od11 nd11 kd11 jd11 Jnqb3Ob11 Gnqb3Ob11 Inqb3Ob11 Hnqb3Ob11 TjCFGYc11 Qh11 Sh11 Rh11 -T_-Th11"),
                        children: /*#__PURE__*/ (0, $bcd4U$jsx)((0, $bcd4U$Provider), {
                            values: [
                                [
                                    (0, $bcd4U$TextContext),
                                    {
                                        slots: {
                                            [(0, $bcd4U$DEFAULT_SLOT)]: {}
                                        }
                                    }
                                ],
                                [
                                    (0, $8e847109a6ab556d$export$d688439359537581),
                                    {
                                        styles: " uk11 ucJ9TBTb11 ud3Euai11 uea11 ugb11 uhd11 uje11 u2NhKxcl11 uic11 -_6BNtrc-e11 vx11 xe11 _xa11 xX0cczbd11 _xX0cczba11 xfe11 _xfa11 xfX0cczbd11 _xfX0cczba11 _Fd11 _FnuYUweb11 po11 Jy11 Gv11 Iy11 Hy11"
                                    }
                                ],
                                [
                                    (0, $8e847109a6ab556d$export$1cbdd774077931b4),
                                    {
                                        styles: " uk11 ucJ9TBTb11 ud3Euai11 uea11 ugb11 uhd11 uje11 u2NhKxcl11 uic11 -_6BNtrc-c11 vx11 xb11 _xa11 _Fb11 _FnuYUwec11 pt11"
                                    }
                                ],
                                [
                                    (0, $8e847109a6ab556d$export$5630640b68817ed6),
                                    {
                                        styles: " uk11 ucJ9TBTb11 ud3Euai11 uea11 ugb11 uhd11 uje11 u2NhKxcl11 uic11 -_6BNtrc-c11 vx11 xb11 _xa11 _Fb11 _FnuYUwec11 pt11 JC11"
                                    }
                                ]
                            ],
                            children: children
                        })
                    })
                })
            })
        ]
    });
});


export {$8e176595bc49ca3f$export$41b9afaaba473494 as ContextualHelpContext, $8e176595bc49ca3f$export$7d3cdb256c2ba320 as ContextualHelp};
//# sourceMappingURL=ContextualHelp.mjs.map
