class Paddle {
    init() {
        if (!jQuery('#use_paddle_gateway')[0]) {
            return;
        }
        this._handleEvents();
        this._handlePaddleActivation();
    }

    _handleEvents() {
        console.log('handle paddle events')
        const _this = this;
        jQuery('#use_paddle_gateway').on('change', function(event) {
            _this._handlePaddleActivation();
        })
    }

    _handlePaddleActivation() {
        const isChecked = jQuery('#use_paddle_gateway').is(':checked');
        console.log('Checkbox changed. Checked:', isChecked);
        if (isChecked) {
            jQuery('.paddle_options').show();
        } else {
            jQuery('.paddle_options').hide();
        }
    }
}
export default Paddle;