import { setCookie } from "./utils";

; (function ($) {
    $('.guide-modal').each(function () {
        var targetElem = $(this).attr('data-attach');
        var modalId = $(this).attr('id');
        $(targetElem).click(function (e) {
            setCookie(modalId, '1', 365);
            MicroModal.show(modalId, {
                onClose: modal => {
                    $(modal).remove();
                    $(targetElem).off('click')
                }
            });
        })
    })
})(jQuery);

