×
source: 'html', // Force the widget to use default browser language
},
};
if (w.chaport) return;
v3 = w.chaport = {};
v3._q = [];
v3._l = {};
v3.q = function() {
v3._q.push(arguments);
};
v3.on = function(e, fn) {
if (!v3._l[e]) v3._l[e] = [];
v3._l[e].push(fn);
};
var s = d.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'https://app.chaport.com/javascripts/insert.js';
var ss = d.getElementsByTagName('script')[0];
ss.parentNode.insertBefore(s, ss);
// Custom launcher setup
s.onload = function() {
const excludedPages = [
"/index.php/landing-page-menu/landing-page",
"/index.php/landing-page-menu/landing-page-2"
];
const currentPath = window.location.pathname;
if (excludedPages.includes(currentPath)) {
const launcherContainer = document.getElementById('launcher-container');
if (launcherContainer) {
launcherContainer.style.display = 'none'; // Hide the launcher on excluded pages
}
return;
}
const customLauncher = document.getElementById('custom-launcher');
if (customLauncher) {
customLauncher.addEventListener('click', function() {
if (w.chaport && w.chaport.open) {
w.chaport.open(); // Open chat widget
} else {
console.error('Chaport script not loaded yet.');
}
});
} else {
console.error('Custom launcher element not found.');
}
};
})(window, document);
-->