/* Minification failed. Returning unminified contents.
(545,68-69): run-time error JS1100: Expected ',': =
(698,63-64): run-time error JS1004: Expected ';': ]
(713,25-26): run-time error JS1195: Expected expression: >
(713,42-43): run-time error JS1004: Expected ';': )
(721,10-11): run-time error JS1195: Expected expression: )
(1003,40-41): run-time error JS1100: Expected ',': =
(698,32-63): run-time error JS5017: Syntax error in regular expression: /[!@#$%^&*()_+{}\[\]:;<>,.?~\\/
 */
var login = null;

function Toastr() {
    "use strict";
    toastr.options = {
        "closeButton": true,
        "debug": false,
        "newestOnTop": true,
        "progressBar": false,
        "positionClass": "toast-top-right",
        "preventDuplicates": false,
        "showDuration": 300,
        "hideDuration": 1000,
        "timeOut": 10000,
        "extendedTimeOut": 1000,
        "showEasing": "swing",
        "hideEasing": "linear",
        "showMethod": "fadeIn",
        "hideMethod": "fadeOut"
    };
}
$(document).ready(function () {
    setMobileNavBar();
    $('.products-menu').on('click', function (event) {
        event.stopPropagation();
    });
    $('.learning-and-support-menu').on('click', function (event) {
        event.stopPropagation();
    });
    $(".menu-close-button").click(function () {
        $(".products").removeClass("open");
        document.body.style.overflow = 'auto';
    });
    $(".menu-back-button, .menu-close-button").click(function () {
        // Find the closest ancestor with the class "content" and add a class to it
        $(this).closest('.content').addClass('hidden');
        document.body.style.overflow = 'auto';
    });
    document.querySelector('.products-items').addEventListener('click', function (clickEvent) {
        const dropdowns = document.querySelectorAll('.products-items .mobile-dropdown');
        dropdowns.forEach(function (dropdown) {
            const dropdownMenu = dropdown.querySelector('.dropdown-menu');

            // Check if the clicked element is inside the dropdown
            if (!dropdown.contains(clickEvent.target)|| dropdownMenu.contains(clickEvent.target)) {
                dropdownMenu.classList.remove('show');
                const chevronIcon = dropdown.querySelector('.sf-icon-chevron-down-small');
                if (chevronIcon) {
                    chevronIcon.style.transform = 'rotate(0deg)';
                }
            }
        });
    });
    if (window.innerWidth <= 1260) {
        var allSidebarLinks = document.querySelectorAll('.products-menu .navbar a.active, .learning-and-support-menu .navbar a.active');
        allSidebarLinks.forEach(function (sidebarLink) {
            var contentId = sidebarLink.getAttribute('data-content-id');
            if (contentId) {
                var contentElement = document.getElementById(contentId);
                if (contentElement) {
                    contentElement.classList.add('hidden');
                }
            }
            sidebarLink.classList.remove('active');
        });
    }
    // To allow the Return URL except for Home page
    if (window.location.pathname != "/") {
        $("#login-btn-menu").attr({ "href": "/account/login?ReturnUrl=" + window.location.pathname });
    }
    if ($("#unlimited-license .request-pricing").length > 0) {
        loggeduserFlatBanner();
    }
    if (window.location.href.indexOf("#") != -1 && history.pushState && window.location.href.toLowerCase().indexOf("c#") == -1 && (window.location.href.toLowerCase().indexOf("f#") == -1 || window.location.href.toLowerCase().indexOf("pdf#") >= -1)) {
        var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname.split('#')[0] + (window.location.href.split('?').length > 1 ? "?" + window.location.href.split('?')[1].split('#')[0] : "");
        window.history.pushState({ path: newurl }, '', newurl);
    }
    $(".sub-menu-container .essentialstudio-section").on("click", function () {
        var width = $(window).width();
        if (width < 1260) {
            window.location = $(this).find("a")[0].href;
        }
    });
    $(".sub-menu-container .community-link").on("click", function () {
        window.location = $(this).find("a")[0].href;
    });


    $(document).on("click", "#menu-signin .logout-icon", function () {
       // $('#logout-section').css("top", $("#menu-signin").outerHeight());
        $("#logout-section").slideToggle("fast");
        if (($(window).width() >= 768) && ($(window).width() < 1260)) {
            if ($(".menu-list").css("display") == "block") {
                $(".menu-list").css("display", "none");
            }
        }
        if ($('#menu-signin').hasClass("bghover")) {
            $('#menu-signin').removeClass("bghover");
        }
        else {
            $('#menu-signin').addClass("bghover");
        }
        //var top = 73;
        //if ($(window).width() < 1260) {
        //    top = 50;
        //}
        //var offset = $("#menu-wrapper").offset();
        //var offsetTop = offset.top + top;
        //$("#logout-section").css("top", offsetTop);
        
    });



    $("#boldbi-start-free").on("click", function () {
        // Google Analytics Bold BI goal event
        gtag('event', 'Launch Homepage', {
            'event_category': 'Bold BI',
            'event_label': 'Bold BI Start Free'
        });
    });

});

$(".navbar-toggle").click(function (event) {
    event.stopPropagation();
    setTimeout(function () {
        if ($(".navbar-toggle").is(":visible") && $(".menu-list").css("display") == "none") {
            $(".menu-list").css("display", "block");
        } else {
            $(".menu-list").css("display", "none");
        }
    }, 100);
});

$(".products").click(function () {

    if (document.querySelector('#mobile .side-navbar a.active') == null) {
        $.ajax({
            url: "/Home/GetProducts",
            type: "GET",
            dataType: "json",
            success: function (data) {
                $(".products-items").append(data.platforms);
                $("#web-footer").before(data.products);
                CustomizeMenu();
                defaultNavTab(true);

            },
            error: function (error) {
                console.log(error);
            }
        });

    }

    defaultNavTab();
    if($(window).width() > 1260 )
    {
    var contentId =  document.querySelector('.navbar a.active').getAttribute('data-content-id');
    if (contentId === 'web' || contentId === 'desktop' || contentId === 'mobile') {
        var sidebarLink = document.querySelector('.products-menu #' + contentId + ' .side-navbar a.active');
        var sideContentId = getContentIdFromElement(sidebarLink);
        if (sideContentId !== null) {
            triggerInputEvent(sideContentId);
        }
    }
    }

    if ($(window).width() > 1256 && !$(".navbar-toggle").is(":visible")) {
        var productElement = document.getElementById('product-nav');
        var offsetFromLeft = productElement.offsetLeft;
        $(".sub-menu-container").css({ "margin-left": -(offsetFromLeft) });
        var customerDashboardWidth = $("#menu-wrapper .container-fluid .sub-menu-container");
        if (customerDashboardWidth.length > 0) {
            customerDashboardWidth.css({ "width": $(window).width() });
        }
    } 
});

$(document).click(function (evt) {
    setTimeout(function () {
        if (window.innerWidth < 1261 || $(".navbar-toggle").is(":visible")) {
            var target = evt.currentTarget;
            var inside = $(".menu-list");
            if (target != inside) {
                var collapse = $(".navbar-toggle").hasClass("collapsed");
                if (($(".menu-list").css("display") == "none") == true) {
                    if (collapse == false) {
                        $(".navbar-toggle").addClass("collapsed");
                    }
                }
                else {
                    if (collapse == true) {
                        $(".navbar-toggle").removeClass("collapsed");
                    }
                }
            }
        }
    }, 100);
});
$(window).resize(function () {
    var deviceWidth = $(window).width();
    setMobileNavBar();
    handleResize();
    supportMenuQueries();
    //if ((deviceWidth > 1260)) {
    //    if ($(".menu-list").css("display") == "none") {
    //        $(".menu-list").css("display", "block");
    //    }
    //}
    //else {
    //    var collapse = $(".navbar-toggle").hasClass("collapsed");
    //    if (collapse == false) {
    //        $(".menu-list").css("display", "block");
    //    }
    //    else {
    //        $(".menu-list").css("display", "none");
    //    }
    //}
    if ($(window).width() < 1261) {
        $(".sub-menu-container").css({ "margin-left": 0 });
    }
    if (deviceWidth >= 1261) {
        $(".menu-list").css("display", "block");
        if ($(".products").hasClass("open") == true) {
            var productElement = document.getElementById('product-nav');
            var offsetFromLeft = productElement.offsetLeft;
            $(".sub-menu-container").css({ "margin-left": -(offsetFromLeft) });
            var customerDashboardWidth = $("#menu-wrapper .container-fluid .sub-menu-container");
            if (customerDashboardWidth.length > 0) {
                customerDashboardWidth.css({ "width": $(window).width() });
            }
        }
    }
    else {
        if (($(window).width() > 767) || ($(window).width() < 1245)) {
            $(".sub-menu-container").css("width", "100%");
        }
        else {
            $(".sub-menu-container").css("width", "100%");
        }

    }

    MenuIconOffset(deviceWidth);
    $('#logout-section').slideUp("fast");
    $('#menu-signin').removeClass("bghover");

});

function viewport() {
    if (typeof $.browser.safari != 'undefined' && $.browser.safari) {
        return { width: $(window).width(), height: $(window).height() };
    }
    else {
        var e = window, a = 'inner';
        if (!('innerWidth' in window)) {
            a = 'client';
            e = document.documentElement || document.body;
        }
        return { width: e[a + 'Width'], height: e[a + 'Height'] };
    }
}

//Search click 
$('.search-icon').on('click', function (event) {
    event.preventDefault();
    // close product , support and company dropdowns if its in open state 
    if ($("#bs-example-navbar-collapse-1  .products").hasClass("open"))
    {
        $("#bs-example-navbar-collapse-1  .products").removeClass("open");
    }

    if ($("#bs-example-navbar-collapse-1  .support-menu").hasClass("open")) {
        $("#bs-example-navbar-collapse-1  .support-menu").removeClass("open");
    }

    if ($("#bs-example-navbar-collapse-1  .company-menu").hasClass("open")) {
        $("#bs-example-navbar-collapse-1  .company-menu").removeClass("open");
    }

    if ($("#logout-section").is(":visible") && !$(event.target).closest("#logout-section .column").length && !$(event.target).closest("#menu-signin").length) {
        $("#logout-section").slideUp("fast");
        $("#menu-signin").removeClass("bghover");
    }

    if ($(window).width() < 768) {
        if ($(".navbar-collapse").hasClass("in")) {
            $(".navbar-collapse").removeClass("in");
        }
    } else if (($(window).width() >= 768) && ($(window).width() < 1260)) {
        if ($(".menu-list").css("display") == "block") {
            $(".menu-list").css("display", "none");
        }
    }
    $('#search-container').slideToggle("fast");
    if ($(this).parent().hasClass("bghover")) {
        $(this).parent().removeClass("bghover");
    }
    else {
        $(this).parent().addClass("bghover");
        $("#search").focus();

    }
    
    if (document.getElementById("search-popular-results").innerHTML == "null" || document.getElementById("search-popular-results").innerHTML == "") {
        $("#search-container").css("top", ($("#menu-wrapper").height() + $("#menu-wrapper").offset().top));
        $("#search-popular-results").showWaitingPopUp();
        $.ajax({
            type: "GET",
            url: "/search/getmetadetails",

            success: function (result) {
                if (result != null && result != "") {
                    $("#search-popular-results").html(result.success);
                    $("#search-popular-results").removeWaitingPopUp();
                }
                else {
                    $("#search-popular-results").removeWaitingPopUp();
                }
            },
            error: function (result) {
                $("#search-popular-results").removeWaitingPopUp();
            }
        });
    }
});
$(".search-btn").click(function () {
    if ($('#search').val() == "") {
        return false;
    }
    return true;
});

//script for hide the menu list when cick outside of the menu list
$("div, html").on("click", function (event) {
    setTimeout(function () {
        if ($(window).width() < 1261 || $('.navbar-toggle').is(':visible')) {
            if (event.target.className != "menu-item dropdown-toggle" && event.target.className != "navbar-toggle" && event.target.className != "caret") {
                var collapse = $(".navbar-toggle").hasClass("collapsed");
                if (collapse == false) {
                    $(".menu-list").css("display", "none");
                }

            }
        }
    }, 100);
});

//Menu click 
$(".sub-menu-list").on('click', function () {
    if ($("#search-container").is(":visible")) {
        $("#search-container").slideUp("fast");
        $('.search-bar').removeClass("bghover");
    }
    if ($("#logout-section").is(":visible")) {
        $("#logout-section").slideUp("fast");
        $("#menu-signin").removeClass("bghover");
    }
});
//Document on click
$(document).on("click", function (event) {

    if ($("#logout-section").is(":visible") && !$(event.target).closest("#logout-section .column").length && !$(event.target).closest("#menu-signin").length) {
        $("#logout-section").slideUp("fast");
        $("#menu-signin").removeClass("bghover");

    }

    if ($("#search-container").is(":visible") && !$(event.target).closest("#search-container").length && !$(event.target).closest(".search-bar").length && !$(event.target).closest("#search_suggestion").length && event.target.id != "search-icon") {
        $("#search-container").slideUp("fast");
        $('.search-bar').removeClass("bghover");
    }
});

function MenuIconOffset(deviceWidth) {
    var windowWidth = $(window).width();
    var offsetMinus = 20;
    if (deviceWidth > 767) {
        offsetMinus = 25;
    }
    var containerWithLeftPadding = $('.container').outerWidth() + $(".container").offset().left - offsetMinus;
    var menuLeftPadding = containerWithLeftPadding - ($(".syncfusion-menu .syncfusion-menu-items .menu-list").outerWidth());
    $(".syncfusion-menu .syncfusion-menu-items .menu-list").css("left", menuLeftPadding);
}
$(window).load(function () {
    var deviceWidth = $(window).width();;
    MenuIconOffset(deviceWidth);

});

function getCookieUserConfirmedValue(cookieVariable)
{
    var name = cookieVariable;
    var allCookies = document.cookie.split(';');
    for (var i = 0; i < allCookies.length; i++) {
        var c = allCookies[i];
        while (c.charAt(0) == ' ') {
            c = c.substring(1);
        }
        if (c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
        }
    }
    return "";
}
$(".activation-unconfirmed-notification-close").on('click', function () {
    var cookieName = deleteCookie("UserAccountNotActivated = UserType", "", -1);
    $(".unconfirmed-notification").slideUp('slow');
});

$(".unconfirmed-message .resend").on('click', function () {
    $(".unconfirmed-notification").showWaitingPopUp();
    $.ajax({
        type: "POST",
        url: "/account/activationresend",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (result) {
            $(".unconfirmed-notification").removeWaitingPopUp();
            if (result == true) {
                var cookieName = deleteCookie("UserAccountNotActivated = UserType", "", -1);
                $(".unconfirmed-notification").slideUp('slow');
                new Toastr();
                toastr.success("An account verification email has been sent to your registered email address.");
            }
            else {
                $(".unconfirmed-notification").addClass("hide");
                $(".unconfirmed-error-notification").removeClass("hide");
            }
        }
    });
});
function deleteCookie(name, value, days) {
    var date = new Date();
    date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
    var expires = "; expires=" + date.toGMTString();
    document.cookie = name + "=" + value + expires + "; path=/";
}
$(".activation-unconfirmed-error-notification-close").on('click', function () {
    var cookieName = deleteCookie("UserAccountNotActivated = UserType", "", -1);
    $(".unconfirmed-error-notification").slideUp('slow');
});

$(".unconfirmed-error-message .resend").on('click', function () {
    $(".unconfirmed-error-notification").showWaitingPopUp();
    $.ajax({
        type: "POST",
        url: "/account/activationresend",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (result) {
            $(".unconfirmed-error-notification").removeWaitingPopUp();
            if (result == true) {
                var cookieName = deleteCookie("UserAccountNotActivated = UserType", "", -1);
                $(".unconfirmed-error-notification").slideUp('slow');
            }
        }
    });
});

//Get cookie value by passing cookie name
function getCookie(cname) {
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') {
            c = c.substring(1);
        }
        if (c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
        }
    }
    return "";
}

//Set cookie value by passing cookie name, value and expiry days
function setCookie(cname, cvalue, exdays) {
    var d = new Date();
    d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
    var expires = "expires=" + d.toUTCString();
    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}


// support section 

$(".support-menu").click(function () {

    if (document.querySelector("#resources-section") == null) {
        $.ajax({
            url: "/Home/GetSupportMenu",
            type: "GET",
            dataType: "html",
            success: function (data) {

                $(".learning-and-support-items").append(data);
                CustomizeMenu();

            },
            error: function (error) {
                console.log(error);
            }
        });
    }
   supportMenuQueries();
   if ($(window).width() > 1260) {
   document.querySelector('.support-menu .navbar a[data-content-id="learning-section"]').click();
   var customerDashboardWidth = $("#menu-wrapper .container-fluid .support-menu-container");
   if (customerDashboardWidth.length > 0) {
       customerDashboardWidth.css({ "width": $(window).width() });
   }
   }
});
function supportMenuQueries()
{
    if ($(window).width() > 1256) {
        var supportMenuElement = document.querySelector('.support-menu');
        var offsetFromLeft = supportMenuElement.offsetLeft;
        $(".support-menu-container").css({ "margin-left": -(offsetFromLeft) });
    }
    else
    {
        $(".support-menu-container").css({ "margin-left": '0px' });
    }
}

document.addEventListener('DOMContentLoaded', function () {
    var links = document.querySelectorAll('a[target="_blank"]');

    links.forEach(function (link) {
        var domain = link.hostname;
        if (domain !== null && domain.trim() !== "" && domain !== undefined) {
            if (!domain.includes('syncfusion.com') && !domain.includes('boldbi.com') && !domain.includes('bolddesk.com') && !domain.includes('boldreports.com') && !domain.includes('boldsign.com') && !domain.includes('boldpdftools.com')) {
                link.setAttribute('rel', 'nofollow noopener noreferrer');
            }
        }
    });
});

//Menu Scripts

function showContent(contentId, event, isLearningAndSupportSection = false) {

    event.preventDefault();
    var menuSelector = isLearningAndSupportSection ? '.learning-and-support-menu' : '.products-menu';

    var selectedContent = document.querySelector(menuSelector + ' #' + contentId);
    if (selectedContent == null) {
        document.getElementById('menu-search-loader').style.display = 'block';
        var allContent = document.querySelectorAll(menuSelector + ' .content');
        allContent.forEach(function (element) {

            if (!element.classList.contains('hidden')) {
                element.style.pointerEvents = "none";
            }

        });
        setTimeout(function () {
            showContent(contentId, event, isLearningAndSupportSection)
        }, 1000);
    }
    else {
        document.getElementById('menu-search-loader').style.display = 'none';
        document.body.style.overflow = (window.innerWidth <= 1260) ? 'hidden' : 'auto';
        event.preventDefault();
        var menuSelector = isLearningAndSupportSection ? '.learning-and-support-menu' : '.products-menu';
        if (contentId === 'web' || contentId === 'desktop' || contentId === 'mobile') {
            var sidebarLink = document.querySelector('.products-menu #' + contentId + ' .side-navbar a.active');
            var sideContentId = getContentIdFromElement(sidebarLink);
            if (sideContentId !== null) {
                triggerInputEvent(sideContentId);
            }
        }

        // Hide all content divs
        var allContent = document.querySelectorAll(menuSelector + ' .content');
        allContent.forEach(function (element) {
            element.classList.add('hidden');
            if (element.style.pointerEvents == "none") {
                element.style.pointerEvents = "auto";
            }
        });

        // Show the selected content div
        var selectedContent = document.getElementById(contentId);
        selectedContent.classList.remove('hidden');

        // Remove 'active' class from all links
        var allLinks = document.querySelectorAll(menuSelector + ' .navbar a');
        allLinks.forEach(function (element) {
            element.classList.remove('active');
        });

        // Add 'active' class to the clicked link
        var clickedLink = document.querySelector(menuSelector + ' .navbar a[data-content-id="' + contentId + '"]');
        clickedLink.classList.add('active');
    }
}

function getContentIdFromElement(element) {
    if (element && element.dataset && element.dataset.contentId) {
        return element.dataset.contentId;
    }
    return null;
}

function showSideContent(sideContentId, event) {

    // Find the parent div of the clicked link
    var parentDiv = event.target.closest('.content');

    var selectedSideContent = parentDiv.querySelector('#' + sideContentId);
    if (event) {
        event.preventDefault();
    }

        var isNoSearchTabSelected = document.querySelector('.platform-headers a.active');
        if (!isNoSearchTabSelected) {
            triggerInputEvent(sideContentId);
        }

        // Remove 'active' class from all sidebar links within the parent div
        var allSidebarLinks = parentDiv.querySelectorAll('.products-menu .side-navbar a');
        allSidebarLinks.forEach(function (element) {
            element.classList.remove('active');
        });

        // Add 'active' class to the clicked sidebar link
        event.target.classList.add('active');

        // Hide all side content divs within the parent div
        var allSideContent = parentDiv.querySelectorAll('.products-menu .side-content');
        allSideContent.forEach(function (element) {
            element.classList.add('hidden');
        });

    if (selectedSideContent != null) {
        document.getElementById('menu-search-loader').style.display = 'none';
    
        selectedSideContent.classList.remove('hidden');

    }
    else {
        document.getElementById('menu-search-loader').style.display = 'block';
        setTimeout(function () {
            showSideContent(sideContentId, event)
        }, 1000);
    }
    setActiveContentLink();
}

function debounce(func, wait, immediate) {
    var timeout;
    return function () {
        var context = this, args = arguments;
        var later = function () {
            timeout = null;
            if (!immediate) func.apply(context, args);
        };
        var callNow = immediate && !timeout;
        clearTimeout(timeout);
        timeout = setTimeout(later, wait);
        if (callNow) func.apply(context, args);
    };
}
var handleInputDebounced = debounce(handleInput, 300); // Debounce for 300 milliseconds

function handleInput(sectionId, event) {
    document.getElementById('menu-search-loader').style.display = 'block';
    document.getElementById(sectionId).style.opacity = 0.6;
    var suggestionsContainer = document.querySelector('#' + sectionId + ' .suggestions-container');
    suggestionsContainer.style.display = 'block';
    var productDropdown = document.querySelector('.products-menu');
    productDropdown.addEventListener('click',function(clickEvent)
    {
      const inputElement = document.querySelector('#' + sectionId + ' .search-container .search-input');
      if(!inputElement.contains(clickEvent.target)&& !suggestionsContainer.contains(clickEvent.target))
      {
        suggestionsContainer.style.display = 'none';
      }
    });
    var userInput = event.target.value.toLowerCase();

    var closeButton = document.querySelector('#' + sectionId + ' .search-container .search-close');
    if (event.target.value !== '') {
        closeButton.style.display = 'block';
        closeButton.addEventListener('click', function() {
            event.target.value = '';
            handleInput(sectionId,event);
            closeButton.style.display = 'none';
        });
    } else {
        closeButton.style.display = 'none';
    }
    const nonAlphabeticRegex = /[!@#$%^&*()_+{}\[\]:;<>,.?~\\/]/;
    if (nonAlphabeticRegex.test(userInput)) {
        var suggestionsContainer = document.querySelector('#' + sectionId + ' .suggestions-container');
        suggestionsContainer.innerHTML = '';
        var suggestionDiv = document.createElement('div');
        suggestionDiv.className = "noResultFound";
        suggestionDiv.innerHTML = "No search results found.";
        suggestionsContainer.appendChild(suggestionDiv);
        document.querySelector('#' + sectionId + ' .suggestions-container .noResultFound').style.display = 'block';
        document.getElementById(sectionId).style.opacity = 'unset';
        document.getElementById('menu-search-loader').style.display = 'none';
        return;
    }

    fetch('https://cdn.syncfusion.com/content/images/common/menu/master/search-details.xml?v1')
        .then(response => response.text())
        .then(data => {
            var parser = new DOMParser();
            var xmlDoc = parser.parseFromString(data, 'text/xml');
            var matches = findMatches(xmlDoc, userInput, sectionId);
            displayMatches(matches, sectionId);
            document.getElementById(sectionId).style.opacity = 'unset';
            document.getElementById('menu-search-loader').style.display = 'none';
        })
}


function findMatches(xmlDoc, userInput, sectionId) {
    var matches = [];
    var noResultFound = false;
    var sectionElement = xmlDoc.querySelector('#' + sectionId);
    if (sectionElement) {
        var contentElements = sectionElement.querySelectorAll('content');
        contentElements.forEach(function (contentElement) {
            var heading = contentElement.querySelector('heading').textContent.toLowerCase();
            var description = contentElement.querySelector('description').textContent.toLowerCase();

            if ((userInput === '' && contentElement.classList.contains('default')) ||
                (userInput !== '' && (heading.includes(userInput) || (userInput.length > 3 && description.includes(userInput))))) {
                matches.push({
                    heading: contentElement.querySelector('heading').textContent,
                    description: contentElement.querySelector('description').textContent,
                    link: contentElement.querySelector('link').textContent,
                    imageUrl: contentElement.querySelector('image').getAttribute('class')
                });
            }
        });
        if (userInput !== '' && matches.length === 0) {
            // If there are no matches with startsWith, return content with class 'default'
            contentElements.forEach(function (contentElement) {
                if (contentElement.classList.contains('default')) {
                    matches.push({
                        heading: contentElement.querySelector('heading').textContent,
                        description: contentElement.querySelector('description').textContent,
                        link: contentElement.querySelector('link').textContent,
                        imageUrl: contentElement.querySelector('image').getAttribute('class')
                    });
                }
            });
            noResultFound = true;
        }
        var suggestionsContainer = document.querySelector('#' + sectionId + ' .suggestions-container');
        suggestionsContainer.innerHTML = '';

        if (userInput !== '' && !noResultFound && matches.length > 0) {
            matches.forEach(function (match) {
                var suggestionDiv = document.createElement('div');
                suggestionDiv.className = "suggestion-item"
                var highlightedText = getHighlightedText(match.heading, userInput);
                suggestionDiv.innerHTML = highlightedText;
                suggestionDiv.addEventListener('click', function () {
                    // Take the value and add it to the input box
                    document.querySelector('#' + sectionId + ' .search-input').value = match.heading;
                    handleInput(sectionId, { target: { value: match.heading } });
                    suggestionsContainer.style.display = 'none';
                    // Clear existing user input
                    suggestionsContainer.innerHTML = '';
                });
                suggestionsContainer.appendChild(suggestionDiv);
            });
        }
        else {
            suggestionsContainer.innerHTML = '';
            if(userInput !== '')
            {
            var suggestionDiv = document.createElement('div');
            suggestionDiv.className = "noResultFound";
            suggestionDiv.innerHTML = "No search results found.";
            suggestionsContainer.appendChild(suggestionDiv);
            document.querySelector('#' + sectionId + ' .suggestions-container .noResultFound').style.display = 'block';
            }

        }
    }

    return matches;
}

function getHighlightedText(text, highlight) {
    var startIndex = text.toLowerCase().indexOf(highlight.toLowerCase());
    if (startIndex !== -1) {
        var endIndex = startIndex + highlight.length;
        return text.substring(0, startIndex) + '<span class="highlight">' + text.substring(startIndex, endIndex) + '</span>' + text.substring(endIndex);
    } else {
        return text;
    }
}
// Function to display matching items
function displayMatches(matches, sectionId) {
    var platformList = document.querySelector('#' + sectionId + ' .control-platforms-list');
    platformList.innerHTML = ''; // Clear existing content
    if (matches.length > 0) {
        matches.forEach(function (match) {
            // Create platform item
            var platformItem = document.createElement('a');
            platformItem.href = match.link;
            platformItem.className = 'platform-item';
            platformItem.style.display = 'flex';

            // Create platform image
            var platformImage = document.createElement('div');
            platformImage.className = 'platform-image '+ match.imageUrl;


            // Create platform details
            var platformDetails = document.createElement('div');
            platformDetails.className = 'platform-details';

            var controlHeader = document.createElement('span');
            controlHeader.className = 'control-header';
            controlHeader.textContent = match.heading;

            var controlDescription = document.createElement('span');
            controlDescription.className = 'control-description';
            controlDescription.textContent = match.description;

            // Append elements to platform item
            platformDetails.appendChild(controlHeader);
            platformDetails.appendChild(controlDescription);

            platformItem.appendChild(platformImage);
            platformItem.appendChild(platformDetails);

            // Append platform item to the list
            platformList.appendChild(platformItem);
        });
    }
}

function triggerInputEvent(sideContentId) {
    if(!sideContentId.includes('library'))
    {
        var searchInput = document.querySelector('#' + sideContentId + ' .search-input');
        if (searchInput != null) {
            var searchInputContent = searchInput.value.trim();
            searchInput.value = '';
            if (searchInputContent.length > 0) {
            var searchEvent = new Event('input', { bubbles: true, cancelable: true });

            Object.defineProperty(searchEvent, 'target', {
                value: searchInput,
                writable: false
            });

            handleInput(sideContentId, searchEvent);
            }
        }
    }
}

function toggleDropdown(segmentId) {
 
    var dropdownMenu = document.querySelector('#' + segmentId + ' .dropdown-menu');
    dropdownMenu.classList.toggle('show');
    var existingOption =  document.querySelector('#' + segmentId + ' .selected-option .option-text').textContent;
    document.querySelector('#' + segmentId + ' li[data-value="' + existingOption + '"]').classList.add('hidden');
    document.querySelector('#' + segmentId + ' .selected-option .sf-icon-chevron-down-small').style.transform = document.querySelector('#' + segmentId + ' .dropdown-menu.show') ? 'rotate(180deg)' : 'rotate(0deg)';

}

function selectOption(segmentID, text, platform) {
    var dropDown = document.querySelectorAll('.selected-option .sf-icon-chevron-down-small');
    dropDown.forEach(function (element) {
        element.style.transform = 'none';
    });

    if (document.querySelector('#' + platform + ' .selected-option .option-text') != null) {
        var existingOption =  document.querySelector('#' + platform + ' .selected-option .option-text').textContent;
    }
    if (document.querySelector('#' + platform + ' li[data-value="' + existingOption + '"]') != null){
        document.querySelector('#' + platform + ' li[data-value="' + existingOption + '"]').classList.remove('hidden');
    }
        
    var selectedOption = document.querySelector('#' + platform + ' .selected-option .option-text');
    if (selectedOption != null) {
        selectedOption.textContent = text;
    }
    var correspondingAnchor = document.querySelector('[data-content-id="' + segmentID + '"]');
    if (correspondingAnchor) {
        correspondingAnchor.click();
    }
    
}

function setMobileNavBar()
{
    if (window.innerWidth <= 1260) {

        document.querySelectorAll('.products-menu .control-platforms-list').forEach(function(controlPlatformsList) {
            controlPlatformsList.style.maxHeight = window.innerHeight - 439 + 'px';
        });
        document.querySelectorAll('.products-menu .library-platforms-list').forEach(function(libraryPlatformsList) {
            libraryPlatformsList.style.maxHeight = window.innerHeight - 392 + 'px';
        });
        if (document.querySelector('#free-products .platform-grid') != null) {
            document.querySelector('#free-products .platform-grid').style.maxHeight = window.innerHeight - 319 + 'px';
        }
    var libraryPlatformsLists = document.querySelectorAll('.library-platforms-list h4');

    libraryPlatformsLists.forEach(function (list) {
        if (!list.hasAttribute('data-click-bound')) {
            list.addEventListener('click', function (event) {
                event.stopPropagation(); 
                if(window.innerWidth <= 1260)
                {
                var nextDiv = this.nextElementSibling;
                nextDiv.classList.toggle('hidden'); 
                if (nextDiv.classList.contains('hidden')) {
                    this.querySelector('.sf-icon-chevron-down-small').style.transform = 'rotate(180deg)';
                    
                } else {
                    this.querySelector('.sf-icon-chevron-down-small').style.transform = 'rotate(0deg)';
                }
                }
            });
            list.setAttribute('data-click-bound', true);
        }
    });

}
    var activeWebTag = document.querySelector('#web .side-navbar a.active').innerText;
    document.querySelector('#web .selected-option .option-text').textContent = activeWebTag;

    if (document.querySelector('#mobile .side-navbar a.active') != null) {
        var activeMobileTag = document.querySelector('#mobile .side-navbar a.active').innerText;
        var activeDesktopTag = document.querySelector('#desktop .side-navbar a.active').innerText;
        var activeDocumentProcessingTag = document.querySelector('#document-processing .side-navbar a.active').innerText;
        
        document.querySelector('#mobile .selected-option .option-text').textContent = activeMobileTag;
        document.querySelector('#desktop .selected-option .option-text').textContent = activeDesktopTag;
        document.querySelector('#document-processing .selected-option .option-text').textContent = activeDocumentProcessingTag;
    }
}


function handleResize() {

    if (window.innerWidth > 1260) 
    {
        var productsElement = document.querySelector('.products');
        if (productsElement && productsElement.classList.contains('open')) {
          productsElement.classList.remove('open');
        }
        if (document.querySelector('.support-menu') && document.querySelector('.support-menu').classList.contains('open')) {
            document.querySelector('.support-menu').classList.remove('open');
        }
        defaultNavTab();
        var libraryPlatformsLists = document.querySelectorAll('.library-platforms-list');
        libraryPlatformsLists.forEach(function(libraryPlatformsList) {
            if (libraryPlatformsList) {
                var elementsToCheck = libraryPlatformsList.querySelectorAll('.single-column, .split-column');
                elementsToCheck.forEach(function(element) {
                    element.classList.remove('hidden');
                });
            }
        });
        var chevronElements = document.querySelectorAll('.library-platforms-list .sf-icon-chevron-down-small');
        chevronElements.forEach(function(chevronElement) {
            chevronElement.style.transform = 'rotate(0deg)';
        });
    }
    else if(window.innerWidth >=  912 && window.innerWidth <= 1260 )
    {
        var allSidebarLinks = document.querySelectorAll('.products-menu .navbar a.active');
        allSidebarLinks.forEach(function (sidebarLink) {
            var contentId = sidebarLink.getAttribute('data-content-id');
            if (contentId) {
                var contentElement = document.getElementById(contentId);
                if (contentElement) {
                    contentElement.classList.add('hidden');
                }
            }
            sidebarLink.classList.remove('active');
        });
    }
var navbarLinks = document.querySelectorAll('.navbar a');
var hasActiveClass = Array.from(navbarLinks).some(function(link) {
  return link.classList.contains('active');
});

if (!hasActiveClass) {
  document.body.style.overflow = 'unset';
}

}
function defaultNavTab(exceptBlazorWeb = false)
{
    var sideNavbars = $(".products-items .side-navbar");
    sideNavbars.each(function() {
        var firstAnchor = $(this).find("a").first();
        
        var isBlazorWeb = firstAnchor.attr("data-content-id");
        if (isBlazorWeb != "blazor-web" && exceptBlazorWeb) {
            firstAnchor.click();
        }
        else if (!exceptBlazorWeb) {
            firstAnchor.click();
        }
    });

    if (!exceptBlazorWeb) {
        if (window.innerWidth > 1260) 
        {
            document.querySelector('.products-menu .navbar a[data-content-id="web"]').click();
        }
    
        selectOption('blazor-web', 'Blazor', 'web');
    }
            
    selectOption('maui-mobile', '.NET MAUI' , 'mobile');
    selectOption('winforms-desktop', 'WinForms' , 'desktop');
    selectOption('pdf-library', 'PDF' , 'document-processing');
    var getdropdownhide = document.querySelectorAll(".products-items .content .side-navbar .mobile-dropdown ul");
    getdropdownhide.forEach(function(event){
    event.classList.remove('show');
    });
}
function setActiveContentLink() {
    var sideNavbarLinks = document.querySelectorAll('.side-navbar a.active');
    sideNavbarLinks.forEach(function (link) {
        if (link.classList.contains('active')) {
            var dataContentId = link.getAttribute('data-content-id');
            var contentElement = document.getElementById(dataContentId);
            if (contentElement) {
                var viewDemoValue = contentElement.getAttribute('data-content-link') || '/demos'; 
                var platformName = contentElement.getAttribute('data-platform-name') || ''; 
                var freeTrailValue = contentElement.getAttribute('data-download-link') || ''; 
                
                var parentDiv = contentElement.parentElement;
                if (parentDiv) {
                    var productItemsFooter = parentDiv.querySelector('.product-items-footer');
                    if (productItemsFooter) {
                        var viewDemoLink = productItemsFooter.querySelector('.view-demo-link');
                        var whatsNewLink = productItemsFooter.querySelector('.whats-new-link');
                        var tryItFreeLink = productItemsFooter.querySelector('.try-it-free-link');                      
                            viewDemoLink.setAttribute('href', viewDemoValue);
                            whatsNewLink.setAttribute('href','/products/whatsnew/' + platformName);
                            tryItFreeLink.setAttribute('href', '/downloads/' + freeTrailValue);
                    }
                }
            }
        }
    });
}
setActiveContentLink();

function CustomizeMenu() {
    $(".menu-close-button").click(function () {
        $(".products").removeClass("open");
        document.body.style.overflow = 'auto';
    });
    $(".menu-back-button, .menu-close-button").click(function () {
        // Find the closest ancestor with the class "content" and add a class to it
        $(this).closest('.content').addClass('hidden');
        document.body.style.overflow = 'auto';
    });

};
function showWaitingPopupForElement(elementId) {
    $("#" + elementId).showWaitingPopUp();
}
function removeWaitingPopupFromElement(elementId) {
    $("#" + elementId).removeWaitingPopUp();
}
(function ($) {
    jQuery.fn.showWaitingPopUp = function (defaultValue) {
        var defaults = {
            opacityRange: 0.4,
            loadingImage: "//cdn.syncfusion.com/content/images/Support/images/spinner.gif",
            color: "#F8F8F8",
            center: 'false',
            isGridsection:'false'
        };

        var options = $.extend(defaults, defaultValue);
        if (options.isGridsection == 'false') {
            var tag = '<div id="_waiting-popup_" style="display: none; height: 100%; position: absolute; top: 0; width: 100%; left: 0">' +
                              '<div style="background-color:' + options.color + '; height: 100%; opacity:' + options.opacityRange + '; width: 100%; filter: alpha(opacity= ' + (0 * 100) + ');"> </div>' +
                              '<img src="' + options.loadingImage + '" alt="loading" style="position: absolute;"/>' +
                              '</div>';
        }
        else {
            var tag = '<div id="_waiting-popup_" style="display: none; height: 100%; position: absolute; top: 0; width: 100%; left: 0">' +
                              '<div style="background-color:' + options.color + '; height: 100%;opacity:' + options.opacityRange + '; width: 100%; filter: alpha(opacity= ' + (options.opacityRange * 100) + ');"> </div>' +
                              '<img src="' + options.loadingImage + '" alt="loading" style="position: absolute;"/>' +
                              '</div>';
        }
        $(this).append(tag);
        $(this).css('position', 'relative');
        $(this).find('#_waiting-popup_').css('display', 'block');
        var width = $(this).outerWidth();
        var height = $(this).outerHeight();
        var _top;
        var _left;
        try {
            if (width != null && height != null) {

                if (options.isGridsection == 'true') {
                    if (height < 350) {
                        _top = (height / 2) - ($('#_waiting-popup_').find('img').height() / 2);
                    }
                    else {
                        _top = 200;
                    }
                }
                else if (options.center == "false") {
                    _top = (height / 2) - ($('#_waiting-popup_').find('img').height() / 2);
                    $(this).find('#_waiting-popup_').find('img').css("position", "absolute");
                }
               
                else {
                    _top = $(window).height() / 2;
                    $(this).find('#_waiting-popup_').find('img').css("position", "fixed");
                    $(this).find('#_waiting-popup_').css("z-index", '999')
                }
                _left = (width / 2) - ($('#_waiting-popup_').find('img').width() / 2);
                $(this).find('#_waiting-popup_').find('img').css('top', _top).css('left', _left);
                
                
            }
        } catch (e) {
        }
    };

    jQuery.fn.removeWaitingPopUp = function () {
        $(this).find('#_waiting-popup_').remove();
        $(this).css('position', '');
        return true;
    };
})(jQuery);;
var userInfo = '';
var generalData = '';
var documentCookies = [];
// Create a client
var today = new Date();
var errorCount = 0;
var tempModel = {};
var downloadLogError = false;

//returns the domain name based on the protocol
function apiUrl() {
    return "//analytics.syncfusion.com/log/";
}

//Reading all the cookie in the format of key value pair
$(document).ready(function () {
    readCookie();
});

function readCookie() {
    if (document.cookie != '' && document.cookie != null) {
        var cookie = document.cookie.split(';');
        for (var i = 0; i < cookie.length; i++) {
            var _cookie = cookie[i].split('=');
            if (_cookie.length == 2) {

                documentCookies[_cookie[0].trim()] = _cookie[1];
            }

        }
    }
}

function LogSearch(searchModel) {
    $.ajax({
        type: "post",
        url: "/analytics/searchlog",
        data: searchModel,
        error: function (jqXHR, textStatus) {
            errorCount++;
            if (errorCount <= 3) {
                LogSearch(searchModel);
            }
            else {
                getErrorMessage(jqXHR, textStatus, searchModel, "Search");
            }
        }

    });
}

function LogAnalyticsForFaq(faqThreadModel) {
    $.ajax({
        type: "post",
        url: "/analytics/faqlog",
        data: faqThreadModel,
        async: false,
        error: function (jqXHR, textStatus) {
            errorCount++;
            if (errorCount <= 3) {
                LogAnalyticsForFaq(faqThreadModel);
            }
            else {
                getErrorMessage(jqXHR, textStatus, faqThreadModel, "FAQ");
            }
        }
    });
}

//email the ajax failed notifications
function getErrorMessage(jqXHR, textStatus, analyticsModel, queue) {

    var id = '';
    var exceptionMessage = '';

    if (jqXHR.status == 0)
        exceptionMessage = 'Not connect, verify network';
    else if (jqXHR.status == 404)
        exceptionMessage = 'Requested page not found [404]';
    else if (jqXHR.status == 500)
        exceptionMessage = 'Internal Server Error [500]';
    else if (textStatus == 'parsererror')
        exceptionMessage = 'Requested JSON parse failed';
    else if (textStatus == 'timeout')
        exceptionMessage = 'Time out error';
    else if (textStatus == 'abort')
        exceptionMessage = 'Ajax request aborted';
    else
        exceptionMessage = 'Uncaught Error ' + jqXHR.responseText;


    $.ajax({
        type: "post",
        url: "/analytics/errornotification",
        data: { Action: analyticsModel.Action, Id: id, Exception: exceptionMessage, QueueName: queue },
    });
}

function getServerDateTime() {
    var dateTime = null;
    $.ajax({
        type: "GET",
        url: "/downloads/getdownloadservertime",
        async: false,
        success: function (result) {
            dateTime = result;
        }
    });
    return dateTime;
};
/*
 * Note that this is toastr v2.1.3, the "latest" version in url has no more maintenance,
 * please go to https://cdnjs.com/libraries/toastr.js and pick a certain version you want to use,
 * make sure you copy the url from the website since the url may change between versions.
 * */
!function(e){e(["jquery"],function(e){return function(){function t(e,t,n){return g({type:O.error,iconClass:m().iconClasses.error,message:e,optionsOverride:n,title:t})}function n(t,n){return t||(t=m()),v=e("#"+t.containerId),v.length?v:(n&&(v=d(t)),v)}function o(e,t,n){return g({type:O.info,iconClass:m().iconClasses.info,message:e,optionsOverride:n,title:t})}function s(e){C=e}function i(e,t,n){return g({type:O.success,iconClass:m().iconClasses.success,message:e,optionsOverride:n,title:t})}function a(e,t,n){return g({type:O.warning,iconClass:m().iconClasses.warning,message:e,optionsOverride:n,title:t})}function r(e,t){var o=m();v||n(o),u(e,o,t)||l(o)}function c(t){var o=m();return v||n(o),t&&0===e(":focus",t).length?void h(t):void(v.children().length&&v.remove())}function l(t){for(var n=v.children(),o=n.length-1;o>=0;o--)u(e(n[o]),t)}function u(t,n,o){var s=!(!o||!o.force)&&o.force;return!(!t||!s&&0!==e(":focus",t).length)&&(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){h(t)}}),!0)}function d(t){return v=e("<div/>").attr("id",t.containerId).addClass(t.positionClass),v.appendTo(e(t.target)),v}function p(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">&times;</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function f(e){C&&C(e)}function g(t){function o(e){return null==e&&(e=""),e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function s(){c(),u(),d(),p(),g(),C(),l(),i()}function i(){var e="";switch(t.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}I.attr("aria-live",e)}function a(){E.closeOnHover&&I.hover(H,D),!E.onclick&&E.tapToDismiss&&I.click(b),E.closeButton&&j&&j.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0),E.onCloseClick&&E.onCloseClick(e),b(!0)}),E.onclick&&I.click(function(e){E.onclick(e),b()})}function r(){I.hide(),I[E.showMethod]({duration:E.showDuration,easing:E.showEasing,complete:E.onShown}),E.timeOut>0&&(k=setTimeout(b,E.timeOut),F.maxHideTime=parseFloat(E.timeOut),F.hideEta=(new Date).getTime()+F.maxHideTime,E.progressBar&&(F.intervalId=setInterval(x,10)))}function c(){t.iconClass&&I.addClass(E.toastClass).addClass(y)}function l(){E.newestOnTop?v.prepend(I):v.append(I)}function u(){if(t.title){var e=t.title;E.escapeHtml&&(e=o(t.title)),M.append(e).addClass(E.titleClass),I.append(M)}}function d(){if(t.message){var e=t.message;E.escapeHtml&&(e=o(t.message)),B.append(e).addClass(E.messageClass),I.append(B)}}function p(){E.closeButton&&(j.addClass(E.closeClass).attr("role","button"),I.prepend(j))}function g(){E.progressBar&&(q.addClass(E.progressClass),I.prepend(q))}function C(){E.rtl&&I.addClass("rtl")}function O(e,t){if(e.preventDuplicates){if(t.message===w)return!0;w=t.message}return!1}function b(t){var n=t&&E.closeMethod!==!1?E.closeMethod:E.hideMethod,o=t&&E.closeDuration!==!1?E.closeDuration:E.hideDuration,s=t&&E.closeEasing!==!1?E.closeEasing:E.hideEasing;if(!e(":focus",I).length||t)return clearTimeout(F.intervalId),I[n]({duration:o,easing:s,complete:function(){h(I),clearTimeout(k),E.onHidden&&"hidden"!==P.state&&E.onHidden(),P.state="hidden",P.endTime=new Date,f(P)}})}function D(){(E.timeOut>0||E.extendedTimeOut>0)&&(k=setTimeout(b,E.extendedTimeOut),F.maxHideTime=parseFloat(E.extendedTimeOut),F.hideEta=(new Date).getTime()+F.maxHideTime)}function H(){clearTimeout(k),F.hideEta=0,I.stop(!0,!0)[E.showMethod]({duration:E.showDuration,easing:E.showEasing})}function x(){var e=(F.hideEta-(new Date).getTime())/F.maxHideTime*100;q.width(e+"%")}var E=m(),y=t.iconClass||E.iconClass;if("undefined"!=typeof t.optionsOverride&&(E=e.extend(E,t.optionsOverride),y=t.optionsOverride.iconClass||y),!O(E,t)){T++,v=n(E,!0);var k=null,I=e("<div/>"),M=e("<div/>"),B=e("<div/>"),q=e("<div/>"),j=e(E.closeHtml),F={intervalId:null,hideEta:null,maxHideTime:null},P={toastId:T,state:"visible",startTime:new Date,options:E,map:t};return s(),r(),a(),f(P),E.debug&&console&&console.log(P),I}}function m(){return e.extend({},p(),b.options)}function h(e){v||(v=n()),e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),w=void 0))}var v,C,w,T=0,O={error:"error",info:"info",success:"success",warning:"warning"},b={clear:r,remove:c,error:t,getContainer:n,info:o,options:{},subscribe:s,success:i,version:"2.1.3",warning:a};return b}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)});
//# sourceMappingURL=toastr.js.map
;
$(document).ready(function () {

    var url = window.location.href;

    if ($("#button-BoldBIEmbedded").hasClass("xamarin") && url.indexOf("xamarin") >= 0) {
        $(".bold-popup-button-section").css("margin-top", "15px");
        $(".bold-popup-button-section").css("margin-right", "15px");
    }

    if ($("#button-BoldBIEmbedded").hasClass("blazorgrid") && url.indexOf("blazor-components") >= 0 || url.indexOf("forums/blazor-components") >= 0 || url.indexOf("/kb/blazor-components") >= 0 || url.indexOf("javascript") >= 0) {
        $(".bold-popup-button-section").css("margin-top", "15px");
        $(".bold-popup-button-section").css("margin-right", "15px");
    }

    if ($("#popup-section").length > 0 || $("#bold_banner_popup").length > 0) {
        var customerHaveActiveLicense = $("#customerHaveActiveLicense").val();
        if ($("#bold_banner_popup").length > 0) {
            document.cookie = "ValidLicensedCustomer=" + customerHaveActiveLicense + "; max-age=864000; path=/";
        }
        if ($("#popup-section").length > 0) {
            document.cookie = "ValidLicensedCustomerForPopup=" + customerHaveActiveLicense + "; expires=Sun, 05 September 2021 11:59:00 UTC; path=/";
        }
        if ($("#CookieNotification").css("display") == "block") {
            $("#popup-section").css("bottom", "60px");
            ResponsivePopupwithCookieNotification();
        }
        else {
            $("#popup-section").css("bottom", "0");
        }
    }

    $("#close-BoldBIEmbedded").mouseover(function () {
        $("#close-BoldBIEmbedded").attr("src", "https://cdn.syncfusion.com/content/images/General/Maximize-Development-Productivity-Hover.svg");
    });

    $("#close-BoldBIEmbedded").mouseleave(function () {
        $("#close-BoldBIEmbedded").attr("src", "https://cdn.syncfusion.com/content/images/General/Maximize-Development-Productivity.svg");
    });

    $("#close-BoldDesktoastPopup").mouseover(function () {
        $("#close-BoldDesktoastPopup").attr("src", "https://cdn.syncfusion.com/content/images/common/popup/bolddesk-toaster-close-icon.png");
    });

    $("#close-BoldDesktoastPopup").mouseleave(function () {
        $("#close-BoldDesktoastPopup").attr("src", "https://cdn.syncfusion.com/content/images/common/popup/bolddesk-toaster-close-icon.png");
    });

   
    $(".popup-button-section").click(function () {
        $("#popup-section").hide();
    });
    
    setTimeout(function () {
        $("#popup-button").click(function () {
            closeToaster();
        });
    }, 3000);

    setTimeout(function () {
        $("#popup-button-flutter").click(function () {
            closeFlutterEbookPopup();
        });
    }, 3000);

    setTimeout(function () {
        $("#button-blazor").click(function () {
            closeBlazorPopup();
        });
    }, 3000);

    setTimeout(function () {
        $("#button-flutter").click(function () {
            closeFlutterPopup();
        });
    }, 3000);

    setTimeout(function () {
    $("#button-BoldBIEmbedded").click(function () {
        closeBoldBIEmbeddedDemoPopup();
    });
    }, 3000);

    setTimeout(function () {
        $("#button-BoldDesktoastPopup").click(function () {
            closeBoldDeskEmbeddedDemoPopup();
        });
    }, 3000);
    $("#close-BoldDeskEmbedded").click(function () {
        closeBoldDeskEmbeddedDemoPopup();
    });
    $("#button-BoldDeskEmbedded").click(function () {
        closeBoldDeskEmbeddedDemoPopup();
    });
    function closeFlutterEbookPopup() {
        var value = $(".popup-close-button").attr("value");
        document.cookie = "FlutterEbookPopup=false; expires=Tue, 30 Jun 2020 11:59:00 UTC; path=/";
        var myDiv = $("#popup-section");
        myDiv.clearQueue();
        $("#popup-section").slideUp(600);
    }
    
    function closeToaster() {
        var value = $(".popup-close-button").attr("value");
        document.cookie = "2021ToasterPopup=false; expires=Sun, 25 Apr 2021 23:59:00 UTC; path=/";
        var myDiv = $("#popup-section");
        myDiv.clearQueue();
        $("#popup-section").slideUp(600);
    }

    function closeBlazorPopup() {
        var value = $(".popup-close-button").attr("value");
        document.cookie = "BlazorTour=false; expires=Tue, 30 Jun 2020 11:59:00 UTC; path=/";
        var myDiv = $("#popup-section");
        myDiv.clearQueue();
        $("#popup-section").slideUp(600);
    }

    function closeFlutterPopup() {
        var value = $(".popup-close-button").attr("value");
        document.cookie = "FlutterTour=false; expires=Tue, 30 Jun 2020 11:59:00 UTC; path=/";
        var myDiv = $("#popup-section");
        myDiv.clearQueue();
        $("#popup-section").slideUp(600);
    }

    function closeBoldBIEmbeddedDemoPopup() {
        var value = $(".popup-close-button").attr("value");
        document.cookie = "BoldBIEmbeddedPopup=false; expires=Tue, 24 May 2022 4:00:00 UTC; path=/";
        var myDiv = $("#popup-section");
        myDiv.clearQueue();
        $("#popup-section").slideUp(600);
    }

    function closeBoldDeskEmbeddedDemoPopup() {
        var value = $(".popup-close-button").attr("value");
        document.cookie = "SuccinctlyAwardsPopup=false; expires=Thu, 08 Feb 2024 17:00:00 UTC; path=/";
        var myDiv = $("#popup-section");
        myDiv.clearQueue();
        $("#popup-section").slideUp(600);
    }

    if ($(this).width() <= 768) {
        setTimeout(function () {
            if ($("#popup-section").length > 0) {
                $("#popup-section").slideDown(600);
            }
        }, 10000);
    }
    else {
        setTimeout(function () {
            if ($("#popup-section").length > 0) {
                $("#popup-section").slideDown(600);
            }
        }, 30000);
    }
    setTimeout(function () {
        $("#popup-close-icon").click(function () {
            closeToaster();
        });
    }, 3000);

    setTimeout(function () {
        $("#popup-close-icon-flutter").click(function () {
            closeFlutterEbookPopup();
        });
    }, 3000);

    setTimeout(function () {
        $("#close-blazor").click(function () {
            closeBlazorPopup();
        });
    }, 3000);

    setTimeout(function () {
        $("#close-flutter").click(function () {
            closeFlutterPopup();
        });
    }, 3000);

    $("#close-BoldBIEmbedded").click(function () {
        closeBoldBIEmbeddedDemoPopup();
    });
    $("#close-BoldDesktoastPopup").click(function () {
        closeBoldDeskEmbeddedDemoPopup();
    });
    setTimeout(function () {
        $("#cookiesubs").click(function () {
            if ($("#popup-section").length > 0) {
                $("#popup-section").css("bottom", "0px");
            }
        })
    }, 5000);

    //Responsive BoldBI popup with cookie notification
    $(window).resize(function () {
        if ($("#popup-section").length > 0) {
            if ($("#CookieNotification").css("display") == "block") {
                ResponsivePopupwithCookieNotification();
            }
            else {
                $("#popup-section").css("bottom", "0");
            }
        }
    });
    function ResponsivePopupwithCookieNotification() {
        var cookieNotificationHeight = $("#CookieNotification").outerHeight(true);
        $("#popup-section").css("bottom", cookieNotificationHeight);
    }

    if ($("#CookieNotification").css("display") == "block") {
        $("#toaster-section").css("bottom", "66px");
        ResponsivePopupwithCookieNotification();
    }
    else {
        $("#toaster-section").css("bottom", "0");
    }

    function ResponsivePopupwithCookieNotification() {
        var cookieHeight = $("#CookieNotification")[0].offsetHeight;
        $("#toaster-section").css("bottom", cookieHeight);
    }

    $("#cookiesubs").click(function () {
        $("#toaster-section").css("bottom", "0");
    });

})
;
