import { r as registerInstance, c as createEvent, h, H as Host } from './index-CV0Pyo1O.js';
import { C as CardBrandLabels } from './payment-method-option-utils-lUHAQVFl.js';
import { r as radioListItem } from './parts-CPKMvyV_.js';
import './dinero-HXpYMWUU.js';

const JustifiSavedPaymentMethod = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.paymentMethodOptionSelected = createEvent(this, "paymentMethodOptionSelected", 7);
        this.onPaymentMethodOptionClick = (e) => {
            e.preventDefault();
            this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
        };
    }
    async resolvePaymentMethod(insuranceValidation) {
        var _a;
        if (!insuranceValidation.isValid) {
            return { validationError: true };
        }
        return { token: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id };
    }
    ;
    render() {
        var _a, _b, _c;
        return (h(Host, { key: '66b8725a684241fc105d182ee5982167b2007506', class: "payment-method" }, h("div", { key: 'd0370f70b880f6a83b18eaeeefce7b8fde342ce9', class: "radio-list-item p-3", part: radioListItem, onClick: this.onPaymentMethodOptionClick }, h("form-control-radio", { key: '76ed425815f77082ba1145aa2df04beef6044e07', name: "paymentMethodType", value: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, checked: this.isSelected, label: `${CardBrandLabels[(_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.brand] || ''} *${(_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.acct_last_four}` }))));
    }
};

export { JustifiSavedPaymentMethod as justifi_saved_payment_method };
