Menu

Testes educativos

Conteúdo editorial sobre testes educativos, questionários e avaliações de saúde.

(function () { 'use strict'; var INTERNAL_HOSTS = new Set([ 'cleoloiolatp.com', 'www.cleoloiolatp.com', 'tools.cleoloiolatp.com' ]); var EXACT_KEYS = new Set(['gclid','gbraid','wbraid','fbclid','msclkid']); var EXCLUDED_SELECTOR = 'nav,header,footer,.menu,.menu-item,.main-navigation,.site-navigation,.site-header,.site-footer,#wpadminbar'; function isAttributionKey(key) { key = String(key || '').toLowerCase(); return key.indexOf('utm_') === 0 || EXACT_KEYS.has(key); } function currentAttribution() { var params = new URLSearchParams(window.location.search); var kept = []; params.forEach(function (value, key) { if (isAttributionKey(key) && value && value !== 'undefined') { kept.push([key, value]); } }); return kept; } function eligible(anchor) { if (!anchor || !anchor.href || anchor.closest(EXCLUDED_SELECTOR)) return false; var raw = (anchor.getAttribute('href') || '').trim(); if (!raw || raw.charAt(0) === '#' || /^(mailto:|tel:|javascript:)/i.test(raw)) return false; try { var url = new URL(raw, window.location.href); if (!/^https?:$/.test(url.protocol) || !INTERNAL_HOSTS.has(url.hostname.toLowerCase())) return false; if (url.pathname.indexOf('/wp-admin/') === 0 || url.pathname.indexOf('/wp-login.php') === 0) return false; return true; } catch (error) { return false; } } function protect(anchor) { if (!eligible(anchor)) return; var source = currentAttribution(); if (!source.length) return; try { var url = new URL(anchor.getAttribute('href'), window.location.href); source.forEach(function (pair) { var key = pair[0], value = pair[1]; if (!url.searchParams.has(key)) url.searchParams.set(key, value); }); anchor.setAttribute('href', url.toString()); } catch (error) {} } function scan(root) { if (root && root.nodeType === 1 && root.matches && root.matches('a[href]')) protect(root); var scope = root && root.querySelectorAll ? root : document; scope.querySelectorAll('a[href]').forEach(protect); } function start() { scan(document); new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { if (mutation.type === 'attributes') protect(mutation.target); mutation.addedNodes.forEach(function (node) { if (node.nodeType === 1) scan(node); }); }); }).observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeFilter: ['href'] }); document.addEventListener('click', function (event) { var anchor = event.target.closest && event.target.closest('a[href]'); if (anchor) protect(anchor); }, true); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', start, { once: true }); } else { start(); } })();