jQuery(document).ready(function() {
    var stacy_aboutpage = stacyLiteWelcomeScreenCustomizerObject.aboutpage;
    var stacy_nr_actions_required = stacyLiteWelcomeScreenCustomizerObject.nr_actions_required;

    /* Number of required actions */
    if ((typeof stacy_aboutpage !== 'undefined') && (typeof stacy_nr_actions_required !== 'undefined') && (stacy_nr_actions_required != '0')) {
        jQuery('#accordion-section-themes .accordion-section-title').append('<a href="' + stacy_aboutpage + '"><span class="stacy-actions-count">' + stacy_nr_actions_required + '</span></a>');
    }

    /* Upsell in Customizer (Link to Welcome page) */
    if ( !jQuery( ".stacy-upsells" ).length ) {
        jQuery('#customize-theme-controls > ul').prepend('<li class="accordion-section stacy-upsells">');
    }
    if (typeof stacy_aboutpage !== 'undefined') {
        jQuery('.stacy-upsells').append('<a style="width: 80%; margin: 5px auto 15px auto; display: block; text-align: center;" href="' + stacy_aboutpage + '" class="button" target="_blank">{themeinfo}</a>'.replace('{themeinfo}', stacyLiteWelcomeScreenCustomizerObject.themeinfo));
    }
    if ( !jQuery( ".stacy-upsells" ).length ) {
        jQuery('#customize-theme-controls > ul').prepend('</li>');
    }
});