1(function(){ 2 var golmdIsAppleWebKit=(function(){try{var ua=navigator.userAgent||'';var p=navigator.platform||'';var touch=(navigator.maxTouchPoints||0)>1;return /iP(hone|od|ad)/.test(ua)||(p==='MacIntel'&&touch);}catch(e){return false;}})(); 3 function qs(s){return document.querySelector(s)} 4 5 function golmdVisibleAdminBarHeight(){ 6 try{ 7 var bar=document.getElementById('wpadminbar'); 8 if(!bar) return 0; 9 var cs=getComputedStyle(bar); 10 if(cs.display==='none'||cs.visibility==='hidden'||cs.opacity==='0') return 0; 11 var r=bar.getBoundingClientRect(); 12 if(!r||r.width<40||r.height<8||r.bottom<=0||r.top>80) return 0; 13 return Math.max(0,Math.ceil(r.bottom)); 14 }catch(e){return 0;} 15 } 16 function golmdSyncAdminBarState(){ 17 try{ 18 var h=golmdVisibleAdminBarHeight(); 19 var html=document.documentElement, body=document.body; 20 [html,body].forEach(function(el){ 21 if(!el||!el.classList) return; 22 el.classList.toggle('golmd-adminbar-visible',h>0); 23 el.classList.toggle('golmd-adminbar-hidden',h<=0); 24 el.classList.toggle('golmdm-adminbar-visible',h>0); 25 el.classList.toggle('golmdm-adminbar-hidden',h<=0); 26 }); 27 if(html){ 28 html.style.setProperty('--golmd-visible-adminbar-h',(h||0)+'px'); 29 html.style.setProperty('--golmdm-visible-adminbar-h',(h||0)+'px'); 30 if(h<=0 && body && body.classList && body.classList.contains('admin-bar')) html.style.setProperty('margin-top','0','important'); 31 else html.style.removeProperty('margin-top'); 32 } 33 if(body){ 34 body.style.setProperty('--golmd-visible-adminbar-h',(h||0)+'px'); 35 body.style.setProperty('--golmdm-visible-adminbar-h',(h||0)+'px'); 36 if(h<=0 && body.classList && body.classList.contains('admin-bar')) body.style.setProperty('margin-top','0','important'); 37 else body.style.removeProperty('margin-top'); 38 } 39 try{ window.dispatchEvent(new CustomEvent('golmd:adminbar-sync',{detail:{height:h}})); }catch(_evt){} 40 }catch(e){} 41 } 42 try{ window.__golmdSyncAdminBarState = golmdSyncAdminBarState; golmdSyncAdminBarState(); }catch(_adminbarEarly){} 43 function fitGolmdMainNav(){ 44 var nav=qs('.golmd-nav'); 45 if(!nav) return; 46 nav.classList.remove('golmd-nav-wrap-needed'); 47 48 requestAnimationFrame(function(){ 49 if(!nav) return; 50 51 var links=[].slice.call(nav.querySelectorAll('a')); 52 var overflowing = nav.scrollWidth > nav.clientWidth + 2; 53 54 links.forEach(function(a){ 55 var span=a.querySelector('span'); 56 if(!span) return; 57 58 var oldWhite=span.style.whiteSpace; 59 var oldOverflow=span.style.overflow; 60 var oldDisplay=span.style.display; 61 62 span.style.whiteSpace='nowrap'; 63 span.style.overflow='visible'; 64 span.style.display='inline-block'; 65 66 if(span.scrollWidth > span.clientWidth + 2 || span.scrollWidth > a.clientWidth - 24){ 67 overflowing = true; 68 } 69 70 span.style.whiteSpace=oldWhite; 71 span.style.overflow=oldOverflow; 72 span.style.display=oldDisplay; 73 }); 74 75 nav.classList.toggle('golmd-nav-wrap-needed', overflowing); 76 }); 77 } 78 function syncGolmdTopNoTagline(){ 79 var shell=qs('.golmd-top .golmd-shell'); 80 var tag=qs('.golmd-tagline'); 81 if(!shell || !tag) return; 82 var hidden = tag.classList.contains('golmd-tagline-hidden') || getComputedStyle(tag).display === 'none'; 83 shell.classList.toggle('golmd-no-tagline', hidden); 84 } 85 function fitGolmdTagline(){ 86 var shell=qs('.golmd-top .golmd-shell'); 87 var tag=qs('.golmd-tagline'); 88 if(!shell || !tag) return; 89 90 tag.classList.remove('golmd-tagline-hidden'); 91 shell.classList.remove('golmd-no-tagline'); 92 93 requestAnimationFrame(function(){ 94 if(!shell || !tag) return; 95 var overflow = shell.scrollWidth > shell.clientWidth + 2 || tag.scrollWidth > tag.clientWidth + 2; 96 if(overflow){ 97 tag.classList.add('golmd-tagline-hidden'); 98 shell.classList.add('golmd-no-tagline'); 99 }else{ 100 tag.classList.remove('golmd-tagline-hidden'); 101 shell.classList.remove('golmd-no-tagline'); 102 } 103 }); 104 } 105 function searchHeaderClass(on){var h=qs('.golmd-header'); if(h){h.classList.toggle('is-mobile-search-open',!!on);}} 106 function closeGolmdSearch(clearValue){ 107 var forms=document.querySelectorAll('.golmd-search'); 108 var wraps=document.querySelectorAll('.golmd-search-wrap');
109 forms.forEach(function(sf){ 110 sf.classList.remove('is-open'); 111 var inp=sf.querySelector('input'); 112 if(inp && clearValue) inp.value=''; 113 if(inp) inp.blur(); 114 }); 115 document.querySelectorAll('.golmd-mobile-search-form input').forEach(function(inp){ 116 if(clearValue) inp.value=''; 117 inp.blur(); 118 }); 119 wraps.forEach(function(sw){sw.classList.remove('is-open');}); 120 searchHeaderClass(false); 121 } 122 function golmdIsHomeNodeForBackground(el){ 123 try{ 124 if(!el||!el.closest)return false; 125 return !!el.closest('.golmdm-homepage-v1549'); 126 }catch(e){return false;} 127 } 128 function golmdClearHomeForcedBackgrounds(){ 129 try{ 130 var sel=[ 131 '.golmdm-homepage-v1549', 132 '.golmdm-homepage-v1549 .gol-home-stage-inner-v1593', 133 '.golmdm-homepage-v1549 .gol-home-main-v1593', 134 '.golmdm-homepage-v1549 .gol-home-hero-grid-v1593', 135 '.golmdm-homepage-v1549 .gol-home-editorial-stack-v1593', 136 '.golmdm-homepage-v1549 .gol-home-lower-v1593', 137 '.golmdm-homepage-v1549 .golmdm-home-full-v1525', 138 '.golmdm-homepage-v1549 .golmdm-home-matches-v1523', 139 '.golmdm-homepage-v1549 .golmdm-home-tabs', 140 '.golmdm-homepage-v1549 .golmdm-home-matches-head-v1523', 141 '.golmdm-homepage-v1549 .golmdm-home-tab-panel', 142 '.golmdm-homepage-v1549 .golmdm-home-group-v1523', 143 '.golmdm-homepage-v1549 .golmdm-home-group-v1523>summary', 144 '.golmdm-homepage-v1549 .golmdm-home-match', 145 '.golmdm-homepage-v1549 .golmdm-home-match-summary', 146 '.golmdm-homepage-v1549 .gol-home-top-story-v1593', 147 '.golmdm-homepage-v1549 .gol-home-hero-small-card-v1593', 148 '.golmdm-homepage-v1549 .gol-home-latest-panel-v1593', 149 '.golmdm-homepage-v1549 .gol-home-latest-feed-v1593', 150 '.golmdm-homepage-v1549 .gol-home-latest-row-v1593', 151 '.golmdm-homepage-v1549 .gol-home-latest-all-v1593', 152 '.golmdm-homepage-v1549 .golmdm-home-media-v1523', 153 '.golmdm-homepage-v1549 .golmdm-home-media-carousel-v1585', 154 '.golmdm-homepage-v1549 .golmdm-home-media-row-v1523', 155 '.golmdm-homepage-v1549 .golmdm-home-partners-v1594', 156 '.golmdm-homepage-v1549 .golmdm-home-partner-strip-v1594' 157 ].join(','); 158 document.querySelectorAll(sel).forEach(function(el){ 159 el.style.removeProperty('background'); 160 el.style.removeProperty('background-color'); 161 el.style.removeProperty('background-image'); 162 }); 163 }catch(e){} 164 } 165 function golmdCurrentThemeFromDom(){ 166 try{ 167 var h=document.documentElement,b=document.body; 168 var vals=[ 169 h&&h.getAttribute('data-golmdm-real-theme'), b&&b.getAttribute('data-golmdm-real-theme'), 170 h&&h.getAttribute('data-golmdm-live-theme'), b&&b.getAttribute('data-golmdm-live-theme'), 171 h&&h.getAttribute('data-theme'), b&&b.getAttribute('data-theme'), 172 h&&h.getAttribute('data-golmdm-theme-boot'), b&&b.getAttribute('data-golmdm-theme-boot') 173 ]; 174 for(var i=0;i<vals.length;i++){if(vals[i]==='dark'||vals[i]==='light')return vals[i];} 175 if(h&&h.classList&&h.classList.contains('golmd-theme-dark'))return 'dark'; 176 if(b&&b.classList&&b.classList.contains('golmd-theme-dark'))return 'dark'; 177 if(h&&h.classList&&h.classList.contains('golmd-theme-light'))return 'light'; 178 if(b&&b.classList&&b.classList.contains('golmd-theme-light'))return 'light'; 179 }catch(e){} 180 return 'light'; 181 } 182 function golmdApplySiteBackground(t){ 183 t = (t === 'dark') ? 'dark' : 'light'; 184 var html=document.documentElement, body=document.body; 185 var htmlBg=t === 'dark' ? '#0e1a26' : '#fff'; 186 var generated=!!(body&&body.classList&&body.classList.contains('golmdm-has-league-page')&&!body.classList.contains('single-post')); 187 var bodyBg=generated?(t === 'dark' ? '#23344b' : '#eef1f4'):htmlBg; 188 [[html,htmlBg],[body,bodyBg]].forEach(function(pair){ 189 var el=pair[0],bg=pair[1]; 190 if(!el || !el.style) return; 191 if(el.style.getPropertyValue('background') !== bg || el.style.getPropertyPriority('background') !== 'important'){ 192 el.style.setProperty('background', bg, 'important'); 193 } 194 if(el.style.getPropertyValue('background-color') !== bg || el.style.getPropertyPriority('background-color') !== 'important'){ 195 el.style.setProperty('background-color', bg, 'important'); 196 } 197 }); 198 } 199 200 var golmdThemeScopeSelector3143 = [ 201 '.golmdm-leagues-page-v57','#golmdm-virtual-page', 202 '.golmdm-liga-shell-v78','.golmdm-liga-main-v78','.golmdm-league-detail-v78', 203 '.golmdm-generated-shell-v5','.golmdm-generated-main-v5','.golmdm-generated-detail-v5', 204 '.golmdm-liga-left-rail','.golmdm-liga-right-rail', 205 '.golmdm-leagues-layout','.golmdm-leagues-sidebar','.golmdm-liga-anchor-nav', 206 '.golmdm-homepage-v1549','.golmdm-home-matches-v1523' 207 ].join(','); 208 var golmdNewsThemeScopeSelector3143 = '.golmdm-leagues-news,.golmdm-leagues-news-catalog-v2594,[data-golmdm-leagues-news="1"]'; 209 function golmdStampThemeScopes3143(t,switching){ 210 t = (t === 'dark') ? 'dark' : 'light'; 211 function attr(el,name,value){ if(el && el.getAttribute(name)!==value) el.setAttribute(name,value); } 212 try{ 213 document.querySelectorAll(golmdThemeScopeSelector3143).forEach(function(el){ 214 attr(el,'data-golmdm-theme',t); 215 }); 216 }catch(scopeError){} 217 try{ 218 document.querySelectorAll(golmdNewsThemeScopeSelector3143).forEach(function(el){ 219 attr(el,'data-golmdm-news-theme',t); 220 if(switching) attr(el,'data-golmdm-news-theme-switching','1'); 221 else el.removeAttribute('data-golmdm-news-theme-switching'); 222 }); 223 }catch(newsScopeError){} 224 } 225 function golmdFlushThemeScopes3143(){ 226 try{ 227 var probe=document.querySelector('.golmdm-leagues-news-catalog-v2594,section#scorers .golmdm-scorer-row,section#standings table tbody tr,section#matches .golmdm-match-row,.golmdm-club-card-logo-only,#golmdm-virtual-page,.golmdm-liga-shell-v78'); 228 if(probe){ 229 try{window.getComputedStyle(probe).backgroundColor;}catch(styleError){} 230 void probe.offsetWidth; 231 }else if(document.documentElement){ 232 void document.documentElement.offsetWidth; 233 } 234 }catch(e){} 235 } 236 237 function golmdBroadcastThemeBridge(t,switching){ 238 t = (t === 'dark') ? 'dark' : 'light'; 239 function attr(el,name,value){ if(el && el.getAttribute(name)!==value) el.setAttribute(name,value); } 240 function variable(el,name,value){ 241 if(!el || !el.style) return; 242 if(el.style.getPropertyValue(name)!==value) el.style.setProperty(name,value); 243 } 244 try { 245 window.__golmdmCurrentTheme = t; 246 var html = document.documentElement; 247 var body = document.body;
248 [html, body].forEach(function(el){ 249 if(!el) return; 250 attr(el,'data-golmdm-real-theme',t); 251 attr(el,'data-golmdm-live-theme',t); 252 attr(el,'data-golmdm-theme',t); 253 attr(el,'data-golmdm-news-theme',t); 254 if(el.classList){ 255 el.classList.toggle('golmdm-dark-live', t === 'dark'); 256 el.classList.toggle('golmdm-light-live', t !== 'dark'); 257 el.classList.toggle('golmd-dark-live', t === 'dark'); 258 el.classList.toggle('golmd-light-live', t !== 'dark'); 259 el.classList.toggle('golmdm-theme-dark', t === 'dark'); 260 el.classList.toggle('golmdm-theme-light', t !== 'dark'); 261 el.classList.remove('golmdm-theme-syncing'); 262 } 263 }); 264 if(html){ 265 attr(html,'data-golmdm-theme-boot',t); 266 variable(html,'--golmdm-page-bg',t === 'dark' ? '#0e1a26' : '#fff'); 267 variable(html,'--golmdm-rail-bg',t === 'dark' ? '#23344b' : '#eef1f4'); 268 variable(html,'--golmdm-ad-surface-bg',t === 'dark' ? '#23344b' : '#eef1f4'); 269 variable(html,'--golmdm-league-gap-bg',t === 'dark' ? '#23344b' : '#eef1f4'); 270 variable(html,'--golmdm-generated-page-bg',t === 'dark' ? '#0e1a26' : '#fff'); 271 variable(html,'--golmdm-generated-head-bg',t === 'dark' ? '#101a26' : '#fbfcfd'); 272 variable(html,'--golmdm-generated-soft-bg',t === 'dark' ? '#121f2a' : '#f7f9fb'); 273 variable(html,'--golmdm-generated-alt-bg',t === 'dark' ? '#111d28' : '#f8fafb'); 274 variable(html,'--golmdm-generated-card-bg',t === 'dark' ? '#101a26' : '#f6f8fa'); 275 variable(html,'--golmdm-generated-table-head-soft-bg',t === 'dark' ? '#121f2a' : '#f5f7fa'); 276 variable(html,'--golmdm-generated-alt-soft-bg',t === 'dark' ? '#111d28' : '#fafbfc'); 277 variable(html,'--golmdm-generated-table-head-bg',t === 'dark' ? '#111b25' : '#f4f7fa'); 278 variable(html,'--golmdm-generated-table-logo-bg',t === 'dark' ? '#101b25' : '#f5f8fa'); 279 variable(html,'--golmdm-generated-table-soft-bg',t === 'dark' ? '#0d1721' : '#f8fafc'); 280 variable(html,'--golmdm-generated-table-alt-bg',t === 'dark' ? '#09131d' : '#fbfcfe'); 281 variable(html,'--golmdm-generated-table-green-head-bg',t === 'dark' ? '#121f2a' : '#f6faf7'); 282 variable(html,'--golmdm-generated-table-alt-green-bg',t === 'dark' ? '#111d28' : '#fcfdfc'); 283 variable(html,'--golmdm-generated-table-gradient-start',t === 'dark' ? '#121f2a' : '#f8fafc'); 284 variable(html,'--golmdm-generated-table-gradient-end',t === 'dark' ? '#101a26' : '#f3f6f9'); 285 variable(html,'--golmdm-generated-rail-bg',t === 'dark' ? '#23344b' : '#eef1f4'); 286 variable(html,'--golmdm-generated-text',t === 'dark' ? '#e8f0f5' : '#071523'); 287 variable(html,'--golmdm-generated-line',t === 'dark' ? '#2a3b4c' : '#e5e7eb'); 288 variable(html,'--golmdm-u-subnav-bg',t === 'dark' ? '#0e1a26' : '#fff'); 289 variable(html,'--golmdm-u-subnav-fg',t === 'dark' ? '#e8f0f5' : '#071523'); 290 variable(html,'--golmdm-u-subnav-muted',t === 'dark' ? '#aebcc7' : '#64748b'); 291 variable(html,'--golmdm-u-subnav-border',t === 'dark' ? 'rgba(255,255,255,.12)' : 'rgba(8,16,24,.10)'); 292 variable(html,'--golmdm-u-subnav-hover',t === 'dark' ? '#182231' : '#eef7e9'); 293 variable(html,'--golmdm-prepaint-bg',t === 'dark' ? '#23344b' : '#eef1f4'); 294 variable(html,'--golmdm-prepaint-page-bg',t === 'dark' ? '#0e1a26' : '#fff'); 295 variable(html,'--golmd-top-ad-bg',t === 'dark' ? '#23344b' : '#eef1f4'); 296 variable(html,'--golmdm-page-subnav-bg-v3071',t === 'dark' ? '#0e1a26' : '#fff'); 297 variable(html,'--golmdm-page-subnav-fg-v3071',t === 'dark' ? '#dbe7ee' : '#071523'); 298 variable(html,'--golmdm-page-subnav-line-v3071',t === 'dark' ? 'rgba(255,255,255,.12)' : 'rgba(8,16,24,.10)'); 299 variable(html,'--golmdm-page-subnav-hover-v3071',t === 'dark' ? '#182231' : '#eef7e9'); 300 variable(html,'--golmdm-page-subnav-active-v3071',t === 'dark' ? 'var(--golmd-brand-active,#81dd4b)' : 'var(--golmd-brand-active,#55b545)'); 301 } 302 303 /* 3143: component-owned theme attributes are written by the same helper 304 used before the root flip. Repeating the stamp here also covers nodes 305 inserted by another synchronous renderer during this task. */ 306 golmdStampThemeScopes3143(t,switching!==false);
307 [html,body].forEach(function(el){ 308 if(!el || !el.classList) return; 309 el.classList.toggle('golmd-v116-dark-active',t==='dark'); 310 el.classList.toggle('golmd-dark-active-v117',t==='dark'); 311 }); 312 } catch(e) {} 313 /* One synchronous bridge event is the only component update path. Calling 314 __golmdmApplyTheme here as well made generated pages process every switch twice. */ 315 try { 316 window.dispatchEvent(new CustomEvent('golmdm:themechange', {detail:{theme:t}})); 317 } catch(e2) { 318 try { 319 if (typeof window.__golmdmApplyTheme === 'function') window.__golmdmApplyTheme(t); 320 else if (typeof window.__golmdmThemeSync === 'function') window.__golmdmThemeSync(true); 321 } catch(e3) {} 322 } 323 } 324 function golmdResetPostDarkInlineStyles(){ 325 if(!document.body || !document.body.classList.contains('single-post')) return; 326 var selectors = [ 327 '.entry-meta','.entry-meta *', 328 '.golmd-v19-meta','.golmd-v19-meta *', 329 '.golmd-post-v9-meta-line','.golmd-post-v9-meta-line *', 330 '.golmd-v19-terms','.golmd-v19-terms *', 331 '.golmd-v19-cat','.golmd-v19-tag', 332 '.cat-links a','.tags-links a','.post-categories a', 333 'a[rel="tag"]','a[rel="category tag"]' 334 ]; 335 var props = [ 336 'display','flex-wrap','align-items','gap','margin','margin-bottom', 337 'padding','color','font-size','line-height','font-weight','opacity', 338 'background','background-color','border','border-color','border-radius', 339 'box-shadow','text-decoration' 340 ]; 341 document.querySelectorAll(selectors.join(',')).forEach(function(el){ 342 props.forEach(function(prop){ el.style.removeProperty(prop); }); 343 }); 344 } 345 function golmdStorageGet(k){ 346 try { return localStorage.getItem(k) || sessionStorage.getItem(k) || ''; } catch(e) { try { return sessionStorage.getItem(k) || ''; } catch(e2) { return ''; } } 347 } 348 function golmdStorageSet(k,v){ 349 try { localStorage.setItem(k,v); } catch(e) {} 350 try { sessionStorage.setItem(k,v); } catch(e2) {} 351 } 352 function golmdStorageRemove(k){ 353 try { localStorage.removeItem(k); } catch(e) {} 354 try { sessionStorage.removeItem(k); } catch(e2) {} 355 } 356 function golmdCleanupOldPersistentTheme(){ 357 try { ['golmdm-theme-preferred','golmdm_theme_preferred'].forEach(function(k){ localStorage.removeItem(k); }); } catch(e) {} 358 } 359 function golmdClearManualTheme(){ 360 golmdStorageRemove('golmd-theme'); 361 golmdStorageRemove('golmd-theme-manual'); 362 } 363 function golmdHasManualTheme(){ 364 return golmdStorageGet('golmd-theme-manual') === '1'; 365 } 366 function golmdSystemTheme(){ 367 var fallback = 'light'; 368 try { 369 if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) return 'dark'; 370 if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) return 'light'; 371 } catch(e) {} 372 return fallback === 'dark' ? 'dark' : 'light'; 373 } 374 function golmdResolvedTheme(){ 375 var saved = golmdHasManualTheme() ? golmdStorageGet('golmd-theme') : ''; 376 if (saved === 'dark' || saved === 'light') return saved; 377 return golmdSystemTheme(); 378 } 379 var golmdThemeSwitchToken3408 = 0; 380 function golmdThemeFreezeGate3408(){ 381 /* beta.3408: an !important declaration with even one ID selector outranks 382 any number of classes/attributes. The previous freeze gate repeated only 383 [data-golmdm-theme-freeze], so component owners such as #clubs, 384 #matches, #standings and #golmdm-virtual-page could still animate for 385 120â170 ms. Always-true :not(#...) clauses contribute ID specificity 386 without depending on a real page ID and make this one global gate win 387 over every current plugin transition/animation owner. */ 388 var gate='html[data-golmdm-theme-freeze="1"]'; 389 for(var i=0;i<16;i++) gate+=':not(#golmdm-theme-freeze-specificity-v3408-'+i+')'; 390 return gate; 391 } 392 function golmdEnsureInstantThemeStyle3408(){ 393 try{ 394 var id='golmd-instant-theme-style-v3408',st=document.getElementById(id); 395 if(st)return; 396 st=document.createElement('style');st.id=id; 397 var gate=golmdThemeFreezeGate3408(); 398 st.textContent=gate+','+gate+' body,'+gate+' body *,'+gate+' body *::before,'+gate+' body *::after{transition:none!important;transition-property:none!important;transition-duration:0s!important;transition-delay:0s!important;animation:none!important;animation-name:none!important;animation-duration:0s!important;animation-delay:0s!important;animation-iteration-count:1!important;scroll-behavior:auto!important;}'; 399 (document.head||document.documentElement).appendChild(st); 400 }catch(e){} 401 } 402 function golmdCancelRunningThemeTransitions3408(){ 403 /* A third-party/direct listener may have started a CSS transition before 404 the delegated header click handler runs. Cancel CSS transitions only; 405 unrelated keyframe animations are still merely paused by the freeze gate 406 and resume normally after it is released. */ 407 try{ 408 if(typeof document.getAnimations!=='function')return;
409 document.getAnimations().forEach(function(animation){ 410 var isTransition=false; 411 try{ 412 isTransition=(typeof window.CSSTransition==='function' && animation instanceof window.CSSTransition) || typeof animation.transitionProperty==='string'; 413 }catch(e){} 414 if(isTransition){try{animation.cancel();}catch(cancelError){}} 415 }); 416 }catch(e){} 417 } 418 function golmdBeginInstantThemeSwitch3408(){ 419 var token = ++golmdThemeSwitchToken3408; 420 try{ 421 golmdEnsureInstantThemeStyle3408(); 422 var html=document.documentElement,body=document.body; 423 if(html){html.setAttribute('data-golmdm-theme-freeze','1');if(html.classList)html.classList.add('golmdm-theme-switching');} 424 if(body&&body.classList) body.classList.add('golmdm-theme-switching'); 425 /* Establish the winning no-transition cascade before writing any palette 426 state, then cancel a transition that another listener may already have 427 created in the same input task. */ 428 if(html) void html.offsetWidth; 429 golmdCancelRunningThemeTransitions3408(); 430 }catch(e){} 431 return token; 432 } 433 function golmdEndInstantThemeSwitch3408(token,t){ 434 t = (t === 'dark') ? 'dark' : 'light'; 435 var sync=function(){ 436 if(token!==golmdThemeSwitchToken3408)return false; 437 golmdStampThemeScopes3143(t,true); 438 golmdFlushThemeScopes3143(); 439 golmdCancelRunningThemeTransitions3408(); 440 return true; 441 }; 442 var done=function(){ 443 if(token!==golmdThemeSwitchToken3408)return; 444 try{ 445 /* Restore normal hover/keyframe behavior only after the browser has 446 committed the complete target palette. No timed 560 ms dead window: 447 the gate survives only through the two paint boundaries needed to 448 absorb synchronous/microtask component writes. */ 449 golmdStampThemeScopes3143(t,false); 450 golmdFlushThemeScopes3143(); 451 golmdCancelRunningThemeTransitions3408(); 452 [document.documentElement,document.body].forEach(function(el){ 453 if(el&&el.classList)el.classList.remove('golmdm-theme-switching'); 454 }); 455 if(document.documentElement)document.documentElement.removeAttribute('data-golmdm-theme-freeze'); 456 }catch(e){} 457 }; 458 try{ 459 if(typeof queueMicrotask==='function')queueMicrotask(sync); 460 else Promise.resolve().then(sync).catch(function(){}); 461 }catch(microtaskError){} 462 try{ 463 requestAnimationFrame(function(){ 464 if(!sync())return; 465 requestAnimationFrame(function(){if(sync())done();}); 466 }); 467 }catch(e){ 468 try{setTimeout(function(){if(sync())done();},0);}catch(e2){done();} 469 } 470 } 471 472 /* beta.3074: inline style duplicates are suppressed before output; no CSSOM-wide scan. */ 473 474 function setTheme(t, persist){ 475 t = (t === 'dark') ? 'dark' : 'light'; 476 var instantToken3408=golmdBeginInstantThemeSwitch3408(); 477 try { 478 window.__GOLMD_AD_REFIT_PAUSED_UNTIL = Date.now() + 420; 479 if (window.__GOLMD_AD_REFIT_PAUSED_TIMER) clearTimeout(window.__GOLMD_AD_REFIT_PAUSED_TIMER); 480 window.__GOLMD_AD_REFIT_PAUSED_TIMER = setTimeout(function(){ 481 try { window.__GOLMD_AD_REFIT_PAUSED_UNTIL = 0; } catch(e) {} 482 }, 520); 483 } catch(e) {} 484 var html=document.documentElement, body=document.body; 485 /* beta.3404: root palette and component scope markers must be committed in 486 one synchronous state. The previous pre-root scope stamp was followed by 487 a forced style flush; on rapid switches that created a real hybrid 488 computed state (new component theme + old root theme). In league match 489 rows the score placeholder could therefore turn white before the team 490 names, looking like a stray divider. Do not force any style resolution 491 until the complete target palette has been written. */ 492 try{if(html&&html.style)html.style.setProperty('color-scheme',t);}catch(e){} 493 function attr(el,name,value){ if(el && el.getAttribute(name)!==value) el.setAttribute(name,value); } 494 [html,body].forEach(function(el){ 495 if(!el) return; 496 attr(el,'data-theme',t); 497 attr(el,'data-golmdm-theme-boot',t); 498 attr(el,'data-golmdm-theme',t); 499 attr(el,'data-golmdm-news-theme',t); 500 if(el.classList){ 501 el.classList.toggle('golmd-theme-dark',t==='dark'); 502 el.classList.toggle('golmd-theme-light',t!=='dark'); 503 el.classList.toggle('golmdm-theme-dark',t==='dark'); 504 el.classList.toggle('golmdm-theme-light',t!=='dark'); 505 el.classList.toggle('golmd-dark-live',t==='dark'); 506 el.classList.toggle('golmd-light-live',t!=='dark'); 507 } 508 }); 509 if(t === 'light'){ 510 if(body) body.classList.remove('golmd-v116-dark-active','golmd-dark-active-v117'); 511 if(html) html.classList.remove('golmd-v116-dark-active','golmd-dark-active-v117'); 512 golmdResetPostDarkInlineStyles(); 513 } 514 if (persist !== false) { 515 golmdStorageSet('golmd-theme',t); 516 golmdStorageSet('golmd-theme-manual','1'); 517 } 518 /* All theme owners update in the same task. There is no 50/180/300 ms 519 transition window in which the page and Match Centre disagree. */
520 golmdApplySiteBackground(t); 521 golmdBroadcastThemeBridge(t,true); 522 golmdFlushThemeScopes3143(); 523 golmdEndInstantThemeSwitch3408(instantToken3408,t); 524 } 525 function golmdWatchSystemTheme(){ 526 try { 527 if (golmdIsAppleWebKit) return; 528 if (!window.matchMedia) return; 529 var mq = window.matchMedia('(prefers-color-scheme: dark)'); 530 var handler = function(){ 531 golmdClearManualTheme(); 532 setTheme(golmdSystemTheme(), false); 533 }; 534 if (mq.addEventListener) mq.addEventListener('change', handler); 535 else if (mq.addListener) mq.addListener(handler); 536 } catch(e) {} 537 } 538 document.addEventListener('DOMContentLoaded',function(){ 539 golmdSyncAdminBarState(); 540 [60,250,900,1800].forEach(function(ms){setTimeout(function(){golmdSyncAdminBarState();},ms);}); 541 window.addEventListener('resize',function(){golmdSyncAdminBarState();},{passive:true}); 542 window.addEventListener('pageshow',function(){golmdSyncAdminBarState();},{passive:true}); 543 golmdCleanupOldPersistentTheme(); 544 var current = golmdResolvedTheme(); 545 var bootTheme = (window.__golmdmBootTheme === 'dark' || window.__golmdmBootTheme === 'light') 546 ? window.__golmdmBootTheme 547 : golmdCurrentThemeFromDom(); 548 if(bootTheme === current){ 549 /* beta.3399: the head/body boot already committed the correct palette. 550 Initialising component bridges must not impersonate a user theme switch, 551 add a 240 ms freeze, or repaint the same colours a second time. */ 552 golmdStampThemeScopes3143(current,false); 553 golmdApplySiteBackground(current); 554 golmdBroadcastThemeBridge(current,false); 555 golmdFlushThemeScopes3143(); 556 }else{ 557 setTheme(current, false); 558 } 559 golmdWatchSystemTheme(); 560 window.addEventListener('storage',function(e){ 561 if(!e || e.key === 'golmd-theme' || e.key === 'golmd-theme-manual'){ 562 var next = golmdResolvedTheme(); 563 setTheme(next,false); 564 } 565 },{passive:true}); 566 fitGolmdTagline(); syncGolmdTopNoTagline(); fitGolmdMainNav(); window.addEventListener('resize',function(){fitGolmdTagline(); syncGolmdTopNoTagline(); fitGolmdMainNav();}); window.addEventListener('orientationchange',function(){setTimeout(function(){fitGolmdTagline(); syncGolmdTopNoTagline(); fitGolmdMainNav();},150);}); 567 document.addEventListener('submit',function(e){ 568 var form=e.target.closest('.golmd-search,.golmd-mobile-search-form'); 569 if(!form) return; 570 var input=form.querySelector('input[name="s"]'); 571 if(!input || !input.value.trim()){ 572 e.preventDefault(); 573 return false; 574 } 575 },true); 576 document.addEventListener('click',function(e){ 577 var b=e.target.closest('.golmd-burger'); if(b){b.blur();var m=qs('.golmd-mobile'); if(m)m.classList.toggle('is-open'); return;} 578 var close=e.target.closest('.golmd-search-close'); if(close){closeGolmdSearch(true); return;} 579 var s=e.target.closest('.golmd-search-toggle'); if(s){s.blur(); var isMobile=window.matchMedia&&window.matchMedia('(max-width:560px)').matches; if(isMobile){var mf=qs('.golmd-mobile-search-form'); var mi=mf?mf.querySelector('input'):null; var h=qs('.golmd-header'); var isOpen=h&&h.classList.contains('is-mobile-search-open'); if(!isOpen){searchHeaderClass(true); setTimeout(function(){if(mi)mi.focus();},60);} else {if(mi&&mi.value.trim()){mf.submit();} else {closeGolmdSearch(true);}} return;} var wrap=s.closest('.golmd-search-wrap'); var f=wrap?wrap.querySelector('.golmd-search'):qs('.golmd-search'); if(f){var inp=f.querySelector('input'); if(!f.classList.contains('is-open')){f.classList.add('is-open'); if(wrap)wrap.classList.add('is-open'); searchHeaderClass(true); if(inp){setTimeout(function(){inp.focus();},60);}} else {if(inp && inp.value.trim()){f.submit();} else {closeGolmdSearch(true);}}} return;} 580 var th=e.target.closest('.golmd-theme-toggle'); if(th){th.blur(); setTheme(document.body.classList.contains('golmd-theme-dark')?'light':'dark'); return;} 581 if(!e.target.closest('.golmd-search-wrap') && !e.target.closest('.golmd-mobile-search-form')){closeGolmdSearch(false);} 582 }); 583 document.addEventListener('pointerdown',function(e){ 584 if(e.target.closest('.golmd-search-wrap') || e.target.closest('.golmd-mobile-search-form') || e.target.closest('.golmd-search-toggle')) return; 585 closeGolmdSearch(false); 586 },{passive:true}); 587 document.addEventListener('touchend',function(e){
588 var btn=e.target.closest('.golmd-mobile-controls button,.golmd-action'); 589 if(btn){ setTimeout(function(){btn.blur();},0); } 590 },{passive:true}); 591 document.addEventListener('touchstart',function(e){ 592 if(e.target.closest('.golmd-search-wrap') || e.target.closest('.golmd-mobile-search-form') || e.target.closest('.golmd-search-toggle')) return; 593 closeGolmdSearch(false); 594 },{passive:true}); 595 setTimeout(fitGolmdMainNav,100); setTimeout(fitGolmdMainNav,400); setTimeout(fitGolmdMainNav,1000); 596 }); 597 /* beta.3074: removed retired mobile bottom-nav JS generations. 598 The current bottom navigation is CSS-owned; iOS viewport variables remain below. */ 599 600 /* beta.3072: removed the body class/style MutationObserver. Its callback wrote 601 inline backgrounds to the same observed style attributes, creating an 602 unbounded observer -> style write -> observer feedback loop in Chromium. */ 603 604 /* beta.3074: site background CSS is part of header-v2505.css; no runtime style node. */ 605 606 /* 3.7.136: iOS-only viewport variables for browser chrome. 607 This is intentionally tiny: no body MutationObserver, no background repaint loop. */ 608 (function(){ 609 if(!golmdIsAppleWebKit) return; 610 var raf=0; 611 var timers=[]; 612 function isMobilePortrait(){ 613 try{return !!(window.matchMedia && window.matchMedia('(max-width:560px) and (orientation:portrait)').matches);}catch(e){return false;} 614 } 615 function isFormFocused(){ 616 var a=document.activeElement; 617 return !!(a && /^(INPUT|TEXTAREA|SELECT)$/.test(a.tagName||'')); 618 } 619 function setPx(name,val){document.documentElement.style.setProperty(name, Math.max(0,Math.round(val||0))+'px');} 620 function updateIOSViewportVars(){ 621 raf=0; 622 var root=document.documentElement; 623 if(!root) return; 624 root.classList.add('golmd-ios-webkit-v136'); 625 var layoutH=window.innerHeight || root.clientHeight || 0; 626 var vv=window.visualViewport; 627 var vvTop=0, vvH=layoutH; 628 if(vv){ 629 vvTop=Math.max(0,Math.round(vv.offsetTop||0)); 630 vvH=Math.max(0,Math.round(vv.height||layoutH)); 631 } 632 var bottomGap=0; 633 if(vv){ 634 bottomGap=Math.max(0,Math.round(layoutH - vvH - vvTop)); 635 } 636 // When the keyboard opens iOS reports a huge bottom gap. Do not push the menu into it. 637 if(isFormFocused()) bottomGap=0; 638 // Browser chrome is normally much smaller; this clamp prevents one bad measurement from throwing the nav away. 639 bottomGap=Math.min(bottomGap, 140); 640 setPx('--golmd-ios-vv-top', vvTop); 641 setPx('--golmd-ios-browser-bottom-gap', bottomGap); 642 643 /* v1875: CSS owns .golmd-bottom-nav geometry. Keep only viewport vars; 644 do not write inline nav styles on every iOS viewport tick. */ 645 } 646 function scheduleIOSViewportVars(){ 647 if(raf) cancelAnimationFrame(raf); 648 raf=requestAnimationFrame(updateIOSViewportVars); 649 } 650 function burstIOSViewportVars(){ 651 scheduleIOSViewportVars(); 652 [60,180,420,900].forEach(function(ms){timers.push(setTimeout(scheduleIOSViewportVars,ms));}); 653 } 654 burstIOSViewportVars(); 655 document.addEventListener('DOMContentLoaded', burstIOSViewportVars, {passive:true}); 656 window.addEventListener('load', burstIOSViewportVars, {passive:true}); 657 window.addEventListener('resize', scheduleIOSViewportVars, {passive:true}); 658 window.addEventListener('orientationchange', burstIOSViewportVars, {passive:true}); 659 window.addEventListener('pageshow', burstIOSViewportVars, {passive:true}); 660 document.addEventListener('visibilitychange', burstIOSViewportVars, {passive:true}); 661 document.addEventListener('focusin', scheduleIOSViewportVars, true); 662 document.addEventListener('focusout', function(){setTimeout(burstIOSViewportVars,80);}, true); 663 if(window.visualViewport){ 664 window.visualViewport.addEventListener('resize', scheduleIOSViewportVars, {passive:true}); 665 window.visualViewport.addEventListener('scroll', scheduleIOSViewportVars, {passive:true}); 666 } 667 })(); 668 669})();
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.