import ProductGallery from './Components/ProductGallery.js';
import VariantSelector from './Components/VariantSelector.js';
import PriceDisplay from './Components/PriceDisplay.js';
import CartHandler from './Components/CartHandler.js';
import EventBus from './Events/EventBus.js';
import Events from './Events/Events.js';

jQuery(document).ready(() => {

    try {
        // Initialize global event bus
        window.ShopyPressEventBus = EventBus.getInstance();
        window.ShopyPressEvents = Events;

        if (jQuery('#shopypress-single-product-gallery')[0] && window.shopyPressProductData) {
            // Initialize product gallery
            const gallery = new ProductGallery('#shopypress-single-product-gallery', window.shopyPressProductData.images);
            gallery.init();
        }

    } catch (error) {
        console.error('ShopyPress: Initialization error', error);
    }
});