'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-ceff47a0.js');

const bpSdkSendToExchangeCss = "";
const BpSdkSendToExchangeStyle0 = bpSdkSendToExchangeCss;

const BpSdkSendToExchange = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.sendToExchangeHandler = undefined;
        this.buttonDisabled = false;
        this.text = 'Send to Exchange';
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-send-to-exchange');
        customElements.whenDefined('bp-sdk-external-send-to-exchange').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (index.h("bp-sdk-external-send-to-exchange", { buttonDisabled: this.buttonDisabled, sendToExchangeHandler: this.sendToExchangeHandler, text: this.text }));
    }
    renderInternal() {
        return (index.h("div", { class: "bp-sdk-send-to-exchange__container" }, index.h("bp-sdk-send-to-exchange-button", { text: this.text, buttonDisabled: this.buttonDisabled, onClick: this.sendToExchangeHandler })));
    }
};
BpSdkSendToExchange.style = BpSdkSendToExchangeStyle0;

const bpSdkSendToExchangeButtonCss = "";
const BpSdkSendToExchangeButtonStyle0 = bpSdkSendToExchangeButtonCss;

const BpSdkSendToExchangeButton = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.text = '';
        this.buttonDisabled = false;
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-send-to-exchange-button');
        customElements.whenDefined('bp-sdk-external-send-to-exchange-button').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return index.h("bp-sdk-external-send-to-exchange-button", { buttonDisabled: this.buttonDisabled, text: this.text });
    }
    renderInternal() {
        return index.h("bp-sdk-button", { buttonDisabled: this.buttonDisabled, text: this.text });
    }
};
BpSdkSendToExchangeButton.style = BpSdkSendToExchangeButtonStyle0;

exports.bp_sdk_send_to_exchange = BpSdkSendToExchange;
exports.bp_sdk_send_to_exchange_button = BpSdkSendToExchangeButton;
