PageSourceSearch

https://www.instituteforgovernment.org.uk/sites/default/files/js/j…KVMFcncw0IA3WrlucXJRZUFKsk52TWJSvDyYBu2kkEQ

js instituteforgovernment.org.uk collected 2026-09-24 08:32:20 UTC 9,879 bytes, 3 lines download raw bytes

1/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
2(function($,Drupal){'use strict';Drupal.behaviors.svg4everybody={attach:function(context,settings){svg4everybody();}};})(jQuery,Drupal);;
3(function(Drupal,drupalSettings){'use strict';Drupal.behaviors.klaro={config:false,manager:false,observing:false,needCallBehaviors:false,ready:false,attach:function(context,settings){if(!settings.klaro)return;if(typeof klaro==='undefined')document.querySelector('#klaro-js').addEventListener("load",()=>{Drupal.behaviors.klaro.proceed(context,settings);});else Drupal.behaviors.klaro.proceed(context,settings);},proceed:function(context,settings){if(!Drupal.behaviors.klaro.config){settings.klaro.config.services.forEach(function(service,a_index){settings.klaro.config.services[a_index].callback=Drupal.behaviors.klaro.serviceCallback;['onInit','onAccept','onDecline'].forEach(function(hook){const code=service[hook];if(code&&code.length>0)settings.klaro.config.services[a_index][hook]=function(opts){try{Function('opts',code)(opts);}catch(error){console.error('Error executing '+hook+' code for service "'+service.name+'":',error);}};});service.cookies.forEach(function(cookie,c_index){settings.klaro.config.services[a_index]['cookies'][c_index]=[new RegExp(cookie[0],'i'),cookie[1]||'/',cookie[2]||location.host];});});Drupal.behaviors.klaro.config=settings.klaro.config;}Drupal.behaviors.klaro.klaroDecorateWrapper(context,settings);context.querySelectorAll('a[data-name]')?.forEach((item)=>{item.removeAttribute('data-href');});if(!Drupal.behaviors.klaro.manager)Drupal.behaviors.klaro.manager=klaro.getManager(Drupal.behaviors.klaro.config);if(settings.klaro.dialog_mode==='silent')Drupal.behaviors.klaro.manager.confirmed=true;klaro.setup(Drupal.behaviors.klaro.config);Drupal.behaviors.klaro.klaroElementObserver();let learn_more_link=document.querySelector('a.cm-link.cn-learn-more');if(learn_more_link){let label_open_consent_dialog=Drupal.t("Open consent dialog",{},{context:'klaro'});learn_more_link.setAttribute('title',label_open_consent_dialog);learn_more_link.setAttribute('role','button');learn_more_link.setAttribute('aria-haspopup','dialog');}if(!Drupal.behaviors.klaro.manager)Drupal.behaviors.klaro.manager=klaro.getManager(Drupal.behaviors.klaro.config);if(context===document){var elements=once('klaro','body',context);Array.prototype.forEach.call(elements,function(){if(settings.klaro.show_toggle_button&&!document.getElementById('klaro_toggle_dialog')){var button_label=Drupal.t("Manage consents",{},{context:'klaro'});var button_html='<button id="klaro_toggle_dialog" aria-label="'+button_label+'" aria-haspopup="dialog" title="'+button_label+'" type="button" class="klaro_toggle_dialog klaro_toggle_dialog_override" rel="open-consent-manager"></button>';document.body.insertAdjacentHTML('afterbegin',button_html);}});}else{for(var app in Drupal.behaviors.klaro.manager.executedOnce)if(Drupal.behaviors.klaro.manager.executedOnce[app])if(document.querySelectorAll('[data-name="'+app+'"][data-src]:not([src])').length>0)Drupal.behaviors.klaro.manager.applyConsents();}var elements=once('klaro-thumbnail','.klaro.cm-as-context-notice',context);Array.prototype.forEach.call(elements,function(el){let klaro_elem=(el.closest('.field'))?.querySelector('[data-modified-by-klaro]');let thumbnail=klaro_elem?.getAttribute('data-thumbnail');let title=klaro_elem?.getAttribute('title');if(thumbnail){el.parentElement.style.backgroundImage='url('+thumbnail+')';el.parentElement.style.backgroundSize='cover';el.parentElement.style.backgroundPosition='center';el.firstChild.style.backgroundColor='rgba(250, 250, 250, 0.75)';}if(title){let title_elem=document.createElement('p');title_elem.textContent=title;el.firstChild.prepend(title_elem);}});Drupal.behaviors.klaro.config.services.forEach(function(service,a_index){if(service.contextualConsentText){var elements=once('klaro-text','[data-type="placeholder"][data-name="'+service.name+'"] div.context-notice > p:first-child',context);if(elements.length>0){let title_elem=document.createElement('p');title_elem.innerHTML=service.contextualConsentText;Array.prototype.forEach.call(elements,function(el){el.parentNode.replaceChild(title_elem.cloneNode(true),el);});}}});var elements=once('klaro-consent-link','[data-type="placeholder"] div.context-notice');
3var title=Drupal.t("Open the Consent Management Dialog",{},{context:'klaro'});var linktext=Drupal.t("Manage privacy settings",{},{context:'klaro'});Array.prototype.forEach.call(elements,function(el){el.insertAdjacentHTML('beforeend',`<p class="cm-dialog-link"><a href="#" title="${title}" rel="open-consent-manager">${linktext}</a></p>`);});if(Drupal.behaviors.klaro.needCallBehaviors&&context===document){Drupal.behaviors.klaro.needCallBehaviors=false;Drupal.attachBehaviors(document,drupalSettings);}Drupal.behaviors.klaro.ready=true;},serviceCallback:function(consent,service){if(Drupal.behaviors.klaro.manager&&service.onlyOnce&&Drupal.behaviors.klaro.manager.executedOnce[service.name])return;if(service.callbackCode.length>0)try{Function('consent','service',service.callbackCode)(consent,service);}catch(error){console.error('Error executing callback code for service "'+service.name+'":',error);}if(!consent)return;var elements=document.querySelectorAll('[data-name="'+service.name+'"][data-id]');if(elements.length>0){Array.prototype.forEach.call(elements,function(element){element.setAttribute('id',element.getAttribute('data-id'));});if(Drupal.behaviors.klaro.ready)Drupal.attachBehaviors(document,drupalSettings);else Drupal.behaviors.klaro.needCallBehaviors=true;}let knownBehaviors=Object.keys(Drupal.behaviors);var elements=document.querySelectorAll('[data-name="'+service.name+'"][src]');if(!elements)return;var source_tags=document.querySelectorAll('source[data-name="'+service.name+'"]');if(source_tags.length>0){var loading_state;for(var i=0;i<source_tags.length;i++){loading_state=source_tags[i].parentElement.readyState;if(loading_state==0||loading_state==1)source_tags[i].parentElement.load();}}function processBehaviors(){for(let name in Drupal.behaviors)if(knownBehaviors.indexOf(name)===-1){Drupal.behaviors[name].attach(document,drupalSettings);knownBehaviors.push(name);}}Array.prototype.forEach.call(elements,function(element){if(element.complete)processBehaviors();else element.addEventListener('load',processBehaviors);});},klaroDecorateWrapper:function(context,settings){settings.klaro.config.services.forEach(function(service,a_index){service.wrapperIdentifier.forEach(function(wrapperIdentifier){var elements=once('klaro-wrap',wrapperIdentifier,context);Array.prototype.forEach.call(elements,function(el){if(el){var wrapper=document.createElement('div');wrapper.setAttribute('data-name',service.name);wrapper.setAttribute('data-original-display',getComputedStyle(el).display);el.parentNode.insertBefore(wrapper,el);wrapper.appendChild(el);}});});});},klaroElementObserver:function(){var targetNode=document.getElementById("klaro");if(Drupal.behaviors.klaro.observing||!targetNode)return;Drupal.behaviors.klaro.observing=true;const config={childList:true,subtree:true};const callback=(mutationList,observer)=>{for(const mutation of mutationList)if(mutation.type==="childList")Drupal.behaviors.klaro.klaroElementMutator();};const observer=new MutationObserver(callback);observer.observe(targetNode,config);Drupal.behaviors.klaro.klaroElementMutator();},klaroElementMutator:function(){var labels=document.querySelectorAll('#klaro label');if(labels.length>0){for(var i=0;i<labels.length;i++){labels[i].setAttribute('onkeydown','Drupal.behaviors.klaro.KlaroToggleService(event)');labels[i].setAttribute('aria-labelledby',labels[i].getAttribute('for')+'-title');labels[i].setAttribute('aria-describedby',labels[i].getAttribute('for')+'-description');if(labels[i].previousElementSibling&&labels[i].previousElementSibling.tagName=='INPUT'){labels[i].previousElementSibling.setAttribute('tabindex','0');labels[i].removeAttribute('tabindex');}}document.querySelector('#klaro input:not(:disabled)+label')?.focus();}if(document.querySelector('.cm-modal.cm-klaro')){var elem=document.querySelector('.cm-modal.cm-klaro');elem.setAttribute('role','dialog');elem.setAttribute('aria-modal','true');elem.querySelector('.cm-header .title').setAttribute('id','cm-modal-title');elem.setAttribute('aria-labelledby','cm-modal-title');}if(drupalSettings.klaro.show_close_button){if(document.querySelector('#klaro-cookie-notice'))var elem=document.querySelector('#klaro-cookie-notice');else{if(document.querySelector('.cm-modal.cm-klaro')){var elem=document.querySelector('.cm-modal.cm-klaro');if((Drupal.behaviors.klaro.manager.confirmed)&&(!Drupal.behaviors.klaro.config.mustConsent))elem=false;}}if(elem&&!document.querySelector('.klaro-close')){var close_label=Drupal.t("Close dialog and decline all",{},{context:'klaro'});var close_html='<button title="'+close_label+'" type="button" class="cn-decline klaro-close" tabindex="0" aria-label="'+close_label+'"></button>';elem.insertAdjacentHTML('beforeend',close_html);;document.querySelector('.klaro-close')?.addEventListener('click',(e)=>{Drupal.behaviors.klaro.manager.changeAll(false);Drupal.behaviors.klaro.manager.saveAndApplyConsents();},false);document.querySelector('.klaro').classList.add('klaro-close-enabled');document.querySelector('.klaro .cookie-modal .cm-modal .hide')?.remove();}}},KlaroToggleService:function(event){if(event.key==="Enter"){event.target.click();
3event.target.focus();}}};Drupal.behaviors.klaroLink={attach:function(context,settings){var elements=once('klaroLink','[rel*="open-consent-manager"], [href*="#klaro"], .open-consent-manager',context);Array.prototype.forEach.call(elements,function(element){element.addEventListener('click',function(event){klaro.show(Drupal.behaviors.klaro.config);event.preventDefault();return false;});});}};})(Drupal,drupalSettings);;

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.