1(function(){'use strict';var STORAGE_KEY='msa_state';var LEGACY_KEY='acc_state';var DEFAULTS={zoom:1,spacing:0,lineHeight:0,gray:!1,contrast:!1,line:!1,cursor:!1,links:!1,font:!1,noAnim:!1};var LIMITS={zoom:{min:0.7,max:2,step:0.1},spacing:{min:0,max:5,step:1},lineHeight:{min:1.5,max:3,step:0.1}};var TOGGLES={gray:{cls:'accessibility-gray',btn:'btn-grayscale'},contrast:{cls:'accessibility-contrast',btn:'btn-contrast'},links:{cls:'accessibility-links',btn:'btn-links'},font:{cls:'accessibility-font',btn:'btn-font'},noAnim:{cls:'accessibility-no-anim',btn:'btn-anim'},line:{cls:null,btn:'btn-line'},cursor:{cls:'accessibility-cursor',btn:'btn-cursor'}};var TEXT_SELECTOR='p, li, h1, h2, h3, h4, h5, h6, a, span, td, th, blockquote, label, dt, dd';var KEEPS_BACKGROUND='msa-keeps-background';var markedFor=null;var html=document.documentElement;var state=Object.assign({},DEFAULTS);var pausedVideos=new WeakSet();var btn,panel,line,announcer,labels,container;function ready(fn){if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',fn)}else{fn()}} 2function clamp(value,limit,fallback){var num=parseFloat(value);if(isNaN(num))return fallback;return Math.min(limit.max,Math.max(limit.min,num))} 3function loadState(){var saved;var migrated=!1;try{saved=JSON.parse(localStorage.getItem(STORAGE_KEY));if(!saved){saved=JSON.parse(localStorage.getItem(LEGACY_KEY));migrated=!!saved}}catch(e){saved=null} 4if(!saved||typeof saved!=='object')return;Object.keys(DEFAULTS).forEach(function(key){if(typeof DEFAULTS[key]==='boolean'){state[key]=saved[key]===!0}});state.zoom=clamp(saved.zoom,LIMITS.zoom,DEFAULTS.zoom);state.spacing=Math.round(clamp(saved.spacing,LIMITS.spacing,DEFAULTS.spacing));state.lineHeight=(!saved.lineHeight||saved.lineHeight===1.5)?0:clamp(saved.lineHeight,LIMITS.lineHeight,DEFAULTS.lineHeight);if(migrated){saveState();try{localStorage.removeItem(LEGACY_KEY)}catch(e){}}} 5function saveState(){try{localStorage.setItem(STORAGE_KEY,JSON.stringify(state))}catch(e){}} 6function insideWidget(el){return!!container&&(container===el||container.contains(el))} 7function textElementsIn(root){var found=[];if(root.nodeType===1&&root.matches(TEXT_SELECTOR)&&!insideWidget(root)){found.push(root)} 8root.querySelectorAll(TEXT_SELECTOR).forEach(function(el){if(!insideWidget(el))found.push(el)});return found} 9function textElements(){return textElementsIn(document.body)} 10function textSettingsActive(){return state.zoom!==1||state.spacing!==0||state.lineHeight!==0} 11function forgetSizes(){textElements().forEach(function(el){el.style.fontSize='';el.removeAttribute('data-orig-size')})} 12function styleElement(el){if(state.zoom===1){el.style.fontSize=''}else{if(!el.hasAttribute('data-orig-size')){var size=parseFloat(window.getComputedStyle(el).fontSize);if(size>0)el.setAttribute('data-orig-size',size)} 13var orig=parseFloat(el.getAttribute('data-orig-size'));if(orig>0)el.style.fontSize=(orig*state.zoom)+'px'} 14el.style.letterSpacing=state.spacing?state.spacing+'px':'';el.style.lineHeight=state.lineHeight?state.lineHeight:''} 15function applyTextSettings(root){textElementsIn(root||document.body).forEach(styleElement)} 16function applyVideoState(){document.querySelectorAll('video').forEach(function(video){if(state.noAnim){if(!video.paused){pausedVideos.add(video);video.pause()} 17return} 18if(pausedVideos.has(video)){pausedVideos.delete(video);var resumed=video.play();if(resumed&&typeof resumed.catch==='function')resumed.catch(function(){})}})} 19function markBackgrounds(root){var scope=root||document.body;if(!root){if(markedFor===state.contrast)return;markedFor=state.contrast;document.querySelectorAll('.'+KEEPS_BACKGROUND).forEach(function(el){el.classList.remove(KEEPS_BACKGROUND)})} 20if(!state.contrast)return;var applied=html.classList.contains(TOGGLES.contrast.cls);if(applied)html.classList.remove(TOGGLES.contrast.cls);var candidates=Array.prototype.slice.call(scope.querySelectorAll('*'));if(root&&root.nodeType===1)candidates.unshift(root);candidates.forEach(function(el){if(insideWidget(el))return;var image=window.getComputedStyle(el).backgroundImage;if(!image||image==='none')return;if(el.textContent.trim())return;el.classList.add(KEEPS_BACKGROUND)});if(applied)html.classList.add(TOGGLES.contrast.cls)} 21function applyPanelScale(){if(!container)return;container.style.setProperty('--msa-scale',String(Math.min(Math.max(state.zoom,1),1.75)))}
22function applyToggles(){Object.keys(TOGGLES).forEach(function(key){if(TOGGLES[key].cls)html.classList.toggle(TOGGLES[key].cls,state[key])});if(line)line.style.display=state.line?'block':'none'} 23function applyAll(withText){markBackgrounds();applyToggles();applyPanelScale();if(withText!==!1)applyTextSettings();applyVideoState();updateDisplay()} 24function formatted(key){if(key==='zoom')return Math.round(state.zoom*100)+'%';if(key==='spacing')return state.spacing+'px';return state.lineHeight?'x'+state.lineHeight.toFixed(1):(labels.auto||'Auto')} 25function updateDisplay(){var values={'zoom-value-text':'zoom','spacing-value-text':'spacing','line-height-value-text':'lineHeight'};Object.keys(values).forEach(function(id){var el=document.getElementById(id);if(el)el.textContent=formatted(values[id])});Object.keys(TOGGLES).forEach(function(key){var el=document.getElementById(TOGGLES[key].btn);if(!el)return;el.classList.toggle('active',state[key]);el.setAttribute('aria-pressed',state[key]?'true':'false')})} 26function announceValue(labelKey,stateKey){var name=labels[labelKey];announce(name?name+': '+formatted(stateKey):formatted(stateKey))} 27function announce(message){if(!announcer)return;announcer.textContent='';window.setTimeout(function(){announcer.textContent=message},50)} 28function isOpen(){return panel&&!panel.classList.contains('msa-hidden')} 29function openPanel(){if(!panel)return;if(btn){var onTheRight=btn.getBoundingClientRect().left>window.innerWidth/2;panel.classList.toggle('msa-anchor-right',onTheRight);panel.classList.toggle('msa-anchor-left',!onTheRight);btn.setAttribute('aria-expanded','true')} 30panel.classList.remove('msa-hidden');panel.focus()} 31function closePanel(returnFocus){if(!panel||!isOpen())return;panel.classList.add('msa-hidden');if(btn){btn.setAttribute('aria-expanded','false');if(returnFocus)btn.focus()}} 32function step(key,direction){var limit=LIMITS[key];var current=state[key];if(key==='lineHeight'&¤t===0){if(direction<0)return!1;state.lineHeight=limit.min;return!0} 33var next=parseFloat((current+direction*limit.step).toFixed(2));if(key==='lineHeight'&&next<limit.min){state.lineHeight=0;return!0} 34if(next<limit.min||next>limit.max)return!1;state[key]=next;return!0} 35function accessibilityAction(action){var changed=!0;var textAction=/^(zoom|spacing|lineHeight)/.test(action)||action==='reset';switch(action){case 'zoomIn':changed=step('zoom',1);break;case 'zoomOut':changed=step('zoom',-1);break;case 'spacingIn':changed=step('spacing',1);break;case 'spacingOut':changed=step('spacing',-1);break;case 'lineHeightIn':changed=step('lineHeight',1);break;case 'lineHeightOut':changed=step('lineHeight',-1);break;case 'grayscale':state.gray=!state.gray;if(state.gray)state.contrast=!1;break;case 'contrast':state.contrast=!state.contrast;if(state.contrast)state.gray=!1;break;case 'highlightLinks':state.links=!state.links;break;case 'readableFont':state.font=!state.font;break;case 'stopAnimations':state.noAnim=!state.noAnim;break;case 'readingLine':state.line=!state.line;break;case 'cursor':state.cursor=!state.cursor;break;case 'reset':state=Object.assign({},DEFAULTS);if(labels.reset_done)announce(labels.reset_done);break;case 'close':closePanel(!0);return} 36if(!changed)return;applyAll(textAction);saveState();if(action.indexOf('zoom')===0)announceValue('text_size','zoom');if(action.indexOf('spacing')===0)announceValue('letter_spacing','spacing');if(action.indexOf('lineHeight')===0)announceValue('line_height','lineHeight')} 37ready(function(){btn=document.getElementById('accessibility-toggle-btn');panel=document.getElementById('accessibility-panel');line=document.getElementById('accessibility-reading-line');announcer=document.getElementById('accessibility-announcer');container=document.getElementById('accessibility-widget-container');if(!container)return;try{labels=JSON.parse(container.getAttribute('data-msa-labels'))||{}}catch(e){labels={}} 38if(btn&&panel){btn.addEventListener('click',function(e){e.stopPropagation();if(isOpen())closePanel(!1);else openPanel()});document.addEventListener('click',function(e){if(!isOpen())return;if(panel.contains(e.target)||e.target===btn||btn.contains(e.target))return;closePanel(!1)});document.addEventListener('keydown',function(e){if(e.key==='Escape'&&isOpen())closePanel(!0)});document.addEventListener('focusin',function(e){if(!isOpen())return;if(panel.contains(e.target)||e.target===btn)return;closePanel(!1)})} 39if(panel){panel.addEventListener('click',function(e){var target=e.target.closest('[data-msa-action]');if(target)accessibilityAction(target.getAttribute('data-msa-action'))})} 40loadState();applyAll();var resizeTimer;window.addEventListener('resize',function(){if(state.zoom===1)return;window.clearTimeout(resizeTimer);resizeTimer=window.setTimeout(function(){forgetSizes();applyTextSettings()},250)});followTheReader();watchNewContent()});function followTheReader(){var pending=!1;function moveTo(y){if(!state.line||!line||pending)return;pending=!0;window.requestAnimationFrame(function(){var top=Math.max(0,Math.min(y,window.innerHeight));line.style.top=top+'px';pending=!1})} 41document.addEventListener('mousemove',function(e){moveTo(e.clientY-10)});document.addEventListener('touchmove',function(e){if(e.touches&&e.touches.length)moveTo(e.touches[0].clientY-10)},{passive:!0});document.addEventListener('focusin',function(e){if(!state.line||insideWidget(e.target))return;var box=e.target.getBoundingClientRect();if(!box.height)return;moveTo(box.top+box.height/2-20)})} 42function watchNewContent(){if(!window.MutationObserver)return;var fresh=[];var timer;new MutationObserver(function(records){if(!textSettingsActive()&&!state.contrast)return;records.forEach(function(record){Array.prototype.forEach.call(record.addedNodes,function(node){if(node.nodeType===1&&!insideWidget(node))fresh.push(node)})});if(!fresh.length)return;window.clearTimeout(timer);timer=window.setTimeout(function(){var nodes=fresh;fresh=[];
42nodes.forEach(function(node){if(!node.isConnected)return;if(textSettingsActive())applyTextSettings(node);if(state.contrast)markBackgrounds(node)})},100)}).observe(document.body,{childList:!0,subtree:!0})} 43window.accessibilityAction=accessibilityAction})()
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.