1window.addEventListener('load', function () {
2    let namespace = "-bs"
3    let version = 5;
4    if (typeof jQuery != 'undefined' && typeof jQuery.fn.tooltip.constructor.VERSION !== 'undefined') {
5        version = parseInt(jQuery.fn.tooltip.Constructor.VERSION.substr(0, 1), 10);
6        if (version < 5) {
7            namespace = "";
8        }
9        jQuery(`[data${namespace}-toggle="tooltip"]`).tooltip();
10    } else if (typeof bootstrap.Tooltip.VERSION !== 'undefined') {
11        version = parseInt(bootstrap.Tooltip.VERSION.substr(0, 1), 10);
12        if (version < 5) {
13            namespace = "";
14        }
15        document.querySelectorAll(`[data${namespace}-toggle="tooltip"]`).forEach(el => new bootstrap.Tooltip(el));
16    }
17});
18