1(function() { 2 function reloadPaQueries() { 3 if(!window.partnerAdsWooCommerce.update_url_with_variable || window.partnerAdsWooCommerce.update_url_with_variable != 'yes') { 4 return; 5 } 6 7 let paQueries; 8 var name = "partner-ads-query="; 9 var decodedCookie = decodeURIComponent(document.cookie); 10 var ca = decodedCookie.split(';'); 11 ca.forEach(function(c) { 12 while (c.charAt(0) == ' ') { 13 c = c.substring(1); 14 } 15 if (c.indexOf(name) == 0) { 16 paQueries = JSON.parse(atob(c.substring(name.length, c.length))); 17 } 18 }); 19 20 if (paQueries) { 21 let url = window.location.href; 22 let queries = []; 23 for (const key in paQueries) { 24 if (paQueries.hasOwnProperty(key)) { 25 const value = paQueries[key]; 26 queries.push(key +'='+ value); 27 } 28 } 29 30 if (queries.length > 0) { 31 url += '?'+ queries.join('&'); 32 window.history.replaceState({}, document.title, url); 33 } 34 } 35 } 36 37 if (window.location.search) { 38 const queries = location.search.replace('?','').split('&'); 39 const paQueries = {}; 40 41 for (let index = 0; index < queries.length; index++) { 42 const query = queries[index]; 43 44 if ( 45 query.match(/pa-/) 46 || 47 query.match(/pacid/) 48 ) { 49 [key, value] = query.split('='); 50 51 paQueries[key] = value; 52 } 53 } 54 55 if (Object.keys(paQueries).length > 0) { 56 var d = new Date(); 57 d.setTime(d.getTime() + (60 * 60 * 24 * 40*1000)); 58 var expires = "expires="+ d.toUTCString(); 59 60 document.cookie = "partner-ads-query="+ btoa(JSON.stringify(paQueries)) +"; expires="+ expires +"; path=/"; 61 } else { 62 reloadPaQueries(); 63 } 64 } else { 65 reloadPaQueries(); 66 } 67})();
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.