(function ($) {
    'use strict';

    const SifencyLoginForm = function ($scope, $) {
        const $toggle = $scope.find('.sifency-pass-toggle');
        const $input = $scope.find('input[name="pwd"]');

        if (!$toggle.length) return;

        $toggle.on('click', function() {
            const type = $input.attr('type') === 'password' ? 'text' : 'password';
            $input.attr('type', type);
            $(this).find('i').toggleClass('eicon-preview-medium eicon-preview-hide');
        });
    };

    $(window).on('elementor/frontend/init', function () {
        elementorFrontend.hooks.addAction('frontend/element_ready/sifency-login-form.default', SifencyLoginForm);
    });

})(jQuery);