import EdenModal from "../common/eden-modal.js";
import t from "../../i18n/index.js";
export function openPluginModal(options) {
    const modal = new EdenModal(options);
    document.body.append(modal);
    return modal;
}
export function buildConfirmCancelButtons({ confirmLabel, onConfirm, cancelLabel = t("common.cancel"), confirmCssClass = "confirm", autofocus, keepOpened, }) {
    return [
        { value: cancelLabel, cssClass: "cancel" },
        {
            value: confirmLabel,
            onClick: onConfirm,
            cssClass: confirmCssClass,
            autofocus,
            keepOpened,
        },
    ];
}
export function getModalInputValue(modal, name) {
    const input = modal.shadowRoot.querySelector(`[name=\"${name}\"]`);
    return input?.value || "";
}
export function getModalInputAttributeValue(modal, name) {
    const input = modal.shadowRoot.querySelector(`[name=\"${name}\"]`);
    return input?.getAttribute("value") || "";
}
export function isModalCheckboxChecked(modal, name) {
    const checkbox = modal.shadowRoot.querySelector(`[name=\"${name}\"]`);
    return checkbox?.checked === true;
}
