1(function () { 2 const DEFAULTS = { 3 trackUrl: "https://track-mono.com/allmono", 4 // network: "stake", 5 // brand: "lucky-block", 6 "keyword-group": "National Casino", 7 // project: "Bizzo casino", 8 rootClass: "promo", 9 }; 10 11 const CFG = Object.assign({}, DEFAULTS, window.KT_CONFIG || {}); 12 const ROOT_CLASS = CFG.rootClass || "promo"; 13 14 const kebab = (v) => 15 String(v || "") 16 .trim() 17 .toLowerCase() 18 .replace(/[_\s]+/g, "-") 19 .replace(/[^a-z0-9-]+/g, "-") 20 .replace(/-+/g, "-") 21 .replace(/^-|-$/g, ""); 22 23 const getSite = () => location.hostname; 24 25 const getPage = () => 26 location.hostname + 27 (location.pathname.replace(/\/+$/, "") || "/") + 28 (location.search || ""); 29 30 const findPromoRoot = (el) => 31 el.closest ? el.closest("." + ROOT_CLASS) : null; 32 33 const getBlockFromPromo = (el) => { 34 let node = el; 35 while (node) { 36 const cls = [...(node.classList || [])].filter((c) => c !== ROOT_CLASS); 37 if (cls.length) return kebab(cls[0]); 38 node = node.parentElement; 39 } 40 return "unknown"; 41 }; 42 43 const getBlockWithLocation = (el, block) => { 44 if (el.closest('header,.header,[role="banner"],[data-section="header"]')) 45 return "header-" + block; 46 if ( 47 el.closest('footer,.footer,[role="contentinfo"],[data-section="footer"]') 48 ) 49 return "footer-" + block; 50 return "body-" + block; 51 }; 52 53 const buildUrl = (href, params) => { 54 const base = (href || "").trim() || CFG.trackUrl; 55 let u; 56 try { 57 u = new URL( 58 base.startsWith("http") ? base : "https://" + base.replace(/^\/+/, "") 59 ); 60 } catch (_) { 61 u = new URL(CFG.trackUrl); 62 } 63 64 // u.searchParams.set("net", kebab(params.network)); 65 // u.searchParams.set("br", kebab(params.brand)); 66 u.searchParams.set("kg", kebab(params["keyword-group"])); 67 // u.searchParams.set("pr", kebab(params.project)); 68 u.searchParams.set("s", params.site); 69 u.searchParams.set("bl", kebab(params.block)); 70 71 const raw = u.searchParams.toString(); 72 return `${u.origin}${u.pathname}?${raw}&pg=${params.page}`; 73 }; 74 75 document.addEventListener( 76 "click", 77 function (e) { 78 const promo = findPromoRoot(e.target); 79 if (!promo) return; 80 81 const a = promo.matches("a") ? promo : promo.querySelector("a"); 82 const baseHref = a ? a.getAttribute("href") || "" : CFG.trackUrl; 83 84 const block = getBlockFromPromo(promo); 85 const fullBlock = getBlockWithLocation(promo, block); 86 87 const params = { 88 network: CFG.network, 89 brand: CFG.brand, 90 "keyword-group": 91 CFG["keyword-group"] || CFG.keywordGroup || DEFAULTS["keyword-group"], 92 project: CFG.project, 93 site: getSite(), 94 page: getPage(), 95 block: fullBlock, 96 }; 97 98 const url = buildUrl(baseHref, params); 99 100 e.preventDefault(); 101 e.stopPropagation(); 102 window.open(url, "_blank", "noopener"); 103 }, 104 { capture: true } 105 ); 106})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.