PageSourceSearch

https://www.vaielettrico.it/wp-content/cache/minify/6f1ef13e44d3f065d5679a.js

js vaielettrico.it collected 2026-10-02 05:17:41 UTC 2,424 bytes, 16 lines download raw bytes

1(function(){'use strict';const config=window.ZeroSpamDavidWalsh||{};const INPUT_NAME='zerospam_david_walsh_key';const DATA_ATTR='data-zerospam-davidwalsh';const REFRESH_THRESHOLD=43200;let currentKey=config.key||'';let keyRefreshAttempted=false;function initForm(form){if(form.getAttribute(DATA_ATTR)==='protected'){return;}
2if(!currentKey){return;}
3form.setAttribute(DATA_ATTR,'protected');let input=form.querySelector(`input[name="${INPUT_NAME}"]`);if(input){input.value=currentKey;}else{input=document.createElement('input');input.type='hidden';input.name=INPUT_NAME;input.value=currentKey;form.appendChild(input);}}
4function initAllForms(){if(!config.selectors){return;}
5try{const forms=document.querySelectorAll(config.selectors);forms.forEach(initForm);}catch(e){if(console&&console.warn){console.warn('Zero Spam: Invalid selector in davidwalsh.js',e);}}}
6async function maybeRefreshKey(){if(keyRefreshAttempted){return;}
7if(!config.restUrl||!config.generated){return;}
8const now=Math.floor(Date.now()/1000);const keyAge=now-config.generated;if(keyAge<REFRESH_THRESHOLD){return;}
9keyRefreshAttempted=true;try{const response=await fetch(config.restUrl,{method:'GET',headers:{'Content-Type':'application/json','X-WP-Nonce':config.restNonce||'',},credentials:'same-origin',});if(!response.ok){return;}
10const data=await response.json();if(data&&data.key){currentKey=data.key;config.generated=data.generated;updateExistingForms();}}catch(e){if(console&&console.warn){console.warn('Zero Spam: Failed to refresh David Walsh key',e);}}}
11function updateExistingForms(){const protectedForms=document.querySelectorAll(`form[${DATA_ATTR}="protected"]`);protectedForms.forEach(function(form){const input=form.querySelector(`input[name="${INPUT_NAME}"]`);if(input){input.value=currentKey;}});}
12function setupMutationObserver(){if(typeof MutationObserver==='undefined'){return;}
13const observer=new MutationObserver(function(mutations){let shouldInit=false;mutations.forEach(function(mutation){if(mutation.addedNodes.length>0){shouldInit=true;}});if(shouldInit){clearTimeout(observer.timeout);observer.timeout=setTimeout(initAllForms,100);}});observer.observe(document.body,{childList:true,subtree:true,});}
14function init(){if(typeof config.key==='undefined'){return;}
15initAllForms();setupMutationObserver();maybeRefreshKey();}
16if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',init);}else{init();}})();

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.