import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2021-2026 GoodData Corporation
import { HubspotProvider } from "@aaronhayes/react-use-hubspot-form";
import { useId } from "../utils/useId.js";
import { Dialog } from "./Dialog.js";
import { HubspotConversionTouchPointDialogBase, } from "./HubspotConversionTouchPointDialogBase.js";
/**
 * @public
 */
export function HubspotConversionTouchPointDialog(props) {
    const submitButtonClasses = `hs-button primary large ${props.submitButtonClass || "s-hs-submit"}`;
    const onDialogSubmit = () => {
        const submitBtn = document.getElementsByClassName(submitButtonClasses)[0];
        submitBtn?.click();
    };
    const titleElementId = useId();
    return (_jsx(Dialog, { displayCloseButton: true, onCancel: props.onClose, submitOnEnterKey: true, onSubmit: onDialogSubmit, className: "conversion-touch-point-dialog s-conversion-touch-point-dialog", accessibilityConfig: { titleElementId }, children: _jsx(HubspotProvider, { children: _jsx(HubspotConversionTouchPointDialogBase, { ...props, submitButtonClass: submitButtonClasses, accessibilityConfig: { titleElementId } }) }) }));
}
