1;(function () { 2 var GAMESIGHT_SDK_KEY = 'GS-101461' 3 var GAMESIGHT_IAB_VENDOR_ID = 1055 4 var initialized = false 5 6 // By default the SDK is initialized and gsid generated regardless of cookie 7 // consent. Set window.UFL_GSID.preConsent to false to restore consent-gated init. 8 function preConsentEnabled() { 9 return !(window.UFL_GSID && window.UFL_GSID.preConsent === false) 10 } 11 12 function initGamesight() { 13 if (initialized) return 14 if (!window.gsght) return 15 initialized = true 16 window.gsght('set', 'cookies_enabled', true) 17 window.gsght('init', GAMESIGHT_SDK_KEY) 18 } 19 20 function sendAnalyticsEvent(eventName) { 21 if (!window.gsght) return 22 var cookiesEnabled = window.gsght('get', 'cookies_enabled') 23 if (!cookiesEnabled) return 24 25 return new Promise(function (resolve) { 26 window.gsght('send', eventName, resolve) 27 }) 28 } 29 30 // Consent-gated init â used only on the rollback path (preConsent disabled). 31 function consentAccepted() { 32 if (!window.Cookiebot || !window.Cookiebot.consent) return 33 if (initialized) return 34 if (!window.__tcfapi) return 35 36 var marketing = window.Cookiebot.consent.marketing 37 38 window.__tcfapi('addEventListener', 2, function (tcData, success) { 39 if (!success) return 40 if (['tcloaded', 'useractioncomplete'].indexOf(tcData.eventStatus) === -1) return 41 42 if (!window.iabbundle || !window.CookieConsent) return 43 44 var decodedTCModel = window.iabbundle.TCString.decode(window.CookieConsent.IABConsentString) 45 var gamesightConsent = decodedTCModel.vendorConsents.has(GAMESIGHT_IAB_VENDOR_ID) || false 46 47 if (marketing && gamesightConsent) { 48 initGamesight() 49 sendAnalyticsEvent('landing_consent_accept') 50 } 51 }) 52 } 53 54 function consentDeclined() { 55 // Pre-consent mode: consent (accept or decline) must not affect the SDK or 56 // the gsid cookie â do nothing on decline. 57 if (preConsentEnabled()) return 58 if (!initialized) return 59 initialized = false 60 sendAnalyticsEvent('disable_gamesight') 61 if (window.gsght) window.gsght('set', 'cookies_enabled', false) 62 } 63 64 // Emit the consent-accept signal when the user accepts (pre-consent mode). 65 function onMarketingAccept() { 66 if (window.Cookiebot && window.Cookiebot.consent && window.Cookiebot.consent.marketing) { 67 sendAnalyticsEvent('landing_consent_accept') 68 } 69 } 70 71 function loadSdk() { 72 ;(function (G, m, s, g, h, t) { 73 G.gsght = G.gsght || function () { (G.gsght.q = G.gsght.q || []).push(arguments) } 74 G.gsght.q = [] 75 h = m.createElement(s) 76 t = m.getElementsByTagName(s)[0] 77 h.async = 1 78 h.src = g 79 t.parentNode.insertBefore(h, t) 80 })(window, document, 'script', 'https://cdn.gsght.com/sdk.js') 81 } 82 83 // Shared entry point for other theme scripts (e.g. download-screen.js) that 84 // need to report a Gamesight event. Consent handling stays here. 85 window.UFL_ANALYTICS = window.UFL_ANALYTICS || {} 86 window.UFL_ANALYTICS.send = sendAnalyticsEvent 87 88 function initAnalytics() { 89 loadSdk() 90 91 if (preConsentEnabled()) { 92 // Initialize immediately so gsid is generated before any consent choice. 93 initGamesight() 94 window.addEventListener('CookiebotOnAccept', onMarketingAccept) 95 } else { 96 // Rollback: original consent-gated initialization. 97 window.addEventListener('CookiebotOnAccept', consentAccepted) 98 window.addEventListener('CookiebotOnConsentReady', consentDeclined) 99 } 100 } 101 102 document.addEventListener('DOMContentLoaded', initAnalytics) 103})()
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.