'use strict';

var index = require('./index-p7cvUYAE.js');
var Analytics = require('./Analytics-C6KBHEIP.js');
var checkPkgVersion = require('./check-pkg-version-B9EoYyZR.js');
var configState = require('./config-state-BIgGhhe9.js');
var styledHost = require('./styled-host-Ch0-dxF-.js');
require('./event-types-YOY5TKUN.js');
require('./package-YyJzVqrh.js');
require('./Api-D9vOcUw4.js');
require('./utils-CYONRFR6.js');
require('./dinero-BwNN_k7x.js');
require('./Plaid-CPESyiiV.js');
require('./Pagination-Dediz133.js');
require('./Business-oBifyXkW.js');
require('./index-W-zoNiyM.js');

const JustifiCardForm = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    async componentWillLoad() {
        await configState.waitForConfig();
        checkPkgVersion.checkPkgVersion();
        this.analytics = new Analytics.JustifiAnalytics(this);
    }
    disconnectedCallback() {
        var _a;
        (_a = this.analytics) === null || _a === void 0 ? void 0 : _a.cleanup();
    }
    async validate() {
        return this.cardFormElement.validate();
    }
    async tokenize({ clientId, paymentMethodMetadata, account, }) {
        return this.cardFormElement.tokenize({ clientId, paymentMethodMetadata, account });
    }
    render() {
        return (index.h(styledHost.StyledHost, { key: 'e8591312a00d22c68812fda0b56a125ffd763e01' }, index.h("card-form", { key: 'e987ea9f3bcd2bf0aa8b2c6749bff3b902f20519', ref: (el) => (this.cardFormElement = el) })));
    }
};

exports.justifi_card_form = JustifiCardForm;
