/* Minification failed. Returning unminified contents.
(1,1): run-time error CSS1019: Unexpected token, found '$'
(1,2): run-time error CSS1019: Unexpected token, found '('
(1,11): run-time error CSS1031: Expected selector, found ')'
(1,11): run-time error CSS1025: Expected comma or open brace, found ')'
(29,2): run-time error CSS1019: Unexpected token, found ')'
(33,10): run-time error CSS1031: Expected selector, found 'ShowMsg('
(33,10): run-time error CSS1025: Expected comma or open brace, found 'ShowMsg('
 */
$(document).ready(function () {

    var toggle = document.querySelector(".username-login");
    if (toggle != null) {
        var menu_info = document.querySelector(".from-info");
        toggle.addEventListener("click", () => {
            menu_info.classList.toggle("open-form-infor");
        });
    }

    $(document).click(function (event) {
        var $target = $(event.target);
        if (!$target.closest('.username-login').length && $('.username-login').is(":visible")) {
            document.querySelector(".from-info").classList.remove("open-form-infor");
        }
    });



    // -------- img lazyload
    let myLazyLoad = new LazyLoad({
        use_native: true,
        threshold: 20,
    });
    myLazyLoad.update();



});



function ShowMsg(TieuDe, NoiDung) {
    var modalHTML = `
    <div class="modal scale-up" tabindex="-1">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">${TieuDe}</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    ${NoiDung}
                </div>

                <div class="modal-footer" style="border-top: none">
                    <button type="button" class="btn btn-sm btn-primary" data-bs-dismiss="modal" aria-label="Close"><i class="bi bi-send"></i> OK </button>
                </div>

            </div>
        </div>
    </div>`;

    $(modalHTML).modal("show");
}
