(function ($) {
    'use strict';

    const SifencySocialFeed = function ($scope, $) {
        const $wrapper = $scope.find('.sifency-social-feed-wrapper');
        const $masonry = $wrapper.find('.sifency-sf-masonry');

        if ($masonry.length) {
            $masonry.imagesLoaded(function() {
                $masonry.masonry({
                    itemSelector: '.sifency-sf-col',
                    percentPosition: true,
                    columnWidth: '.sifency-sf-col'
                });
            });
        }
    };

    $(window).on('elementor/frontend/init', function () {
        elementorFrontend.hooks.addAction('frontend/element_ready/sifency-social-feed.default', SifencySocialFeed);
    });

})(jQuery);