!function(){"use strict";window.GOVUK=window.GOVUK||{};var t={essential:!0,settings:!1,usage:!1,campaigns:!1},e={cookies_policy:"essential",seen_cookie_message:"essential",cookie_preferences_set:"essential",cookies_preferences_set:"essential","_email-alert-frontend_session":"essential",intervention_campaign:"essential",licensing_session:"essential",govuk_contact_referrer:"essential",multivariatetest_cohort_coronavirus_extremely_vulnerable_rate_limit:"essential",dgu_beta_banner_dismissed:"settings",global_bar_seen:"settings",user_nation:"settings","JS-Detection":"usage",TLSversion:"usage",_ga_VBLT2V3FZR:"usage",_ga_P1DGM6TVYF:"usage",_ga_S5RQ7FTGVR:"usage"};window.GOVUK.cookie=function(t,e,o){return void 0!==e?!1===e||null===e?window.GOVUK.setCookie(t,"",{days:-1}):(void 0===o&&(o={days:30}),window.GOVUK.setCookie(t,e,o)):window.GOVUK.getCookie(t)},window.GOVUK.setDefaultConsentCookie=function(){window.GOVUK.setConsentCookie(t)},window.GOVUK.approveAllCookieTypes=function(){var t={essential:!0,settings:!0,usage:!0,campaigns:!0};window.GOVUK.setCookie("cookies_policy",JSON.stringify(t),{days:365})},window.GOVUK.getConsentCookie=function(){var t,e=window.GOVUK.cookie("cookies_policy");if(!e)return null;try{t=JSON.parse(e)}catch(t){return null}return"object"!=typeof t&&null!==t&&(t=JSON.parse(t)),t},window.GOVUK.setConsentCookie=function(o){var i=window.GOVUK.getConsentCookie();for(var n in i||(i=JSON.parse(JSON.stringify(t))),o)if(i[n]=o[n],!o[n])for(var s in e)e[s]===n&&window.GOVUK.deleteCookie(s);window.GOVUK.setCookie("cookies_policy",JSON.stringify(i),{days:365})},window.GOVUK.checkConsentCookieCategory=function(t,o){var i=window.GOVUK.getConsentCookie();if(!i&&e[t])return!0;i=window.GOVUK.getConsentCookie();try{return i[o]}catch(t){return console.error(t),!1}},window.GOVUK.checkConsentCookie=function(t,o){if("cookies_policy"===t||null===o||!1===o)return!0;if(t.match("^govuk_surveySeen")||t.match("^govuk_taken"))return window.GOVUK.checkConsentCookieCategory(t,"settings");if(e[t]){var i=e[t];return window.GOVUK.checkConsentCookieCategory(t,i)}return!1},window.GOVUK.setCookie=function(t,e,o){if(window.GOVUK.checkConsentCookie(t,e)){void 0===o&&(o={});var i=t+"="+e+"; path=/";if(o.days){var n=new Date;n.setTime(n.getTime()+24*o.days*60*60*1e3),i=i+"; expires="+n.toGMTString()}"https:"===document.location.protocol&&(i+="; Secure"),document.cookie=i}},window.GOVUK.getCookie=function(t){for(var e=t+"=",o=document.cookie.split(";"),i=0,n=o.length;i2;if(this.options.multiple=!this.options.stacked&&(this.$table.classList.contains("mc-multiple")||t),this.options.autoOutdent=this.options.autoOutdent||this.$table.classList.contains("mc-auto-outdent"),this.options.outdentAll=this.options.outdentAll||this.$table.classList.contains("mc-outdented"),this.options.multiple&&this.$graph.classList.add("mc-multiple"),this.options.hasCaption=!!this.$table.querySelectorAll("caption").length,this.ENABLED&&(this.apply(),this.options.applyOnInit||this.toggleLink.click()),this.options.returnReference)return this},e.prototype.detectIEVersion=function(){this.ie=function(){var t,e=3,o=document.createElement("div"),i=o.getElementsByTagName("i");do{o.innerHTML=""}while(e<10&&i[0]);return e>4?e:t}()},e.prototype.apply=function(){if(this.ENABLED)try{this.constructChart(),this.addClassesToHeader(),this.applyWidths(),this.insert(),this.$table.classList.add("mc-hidden"),this.applyOutdent()}catch(t){console.error("MagnaCharta error:",t)}},e.prototype.construct={},e.prototype.construct.thead=function(){var t=document.createElement("div");t.classList.add("mc-thead");var e=document.createElement("div");e.classList.add("mc-tr");for(var o="",i=this.$table.querySelectorAll("thead th"),n=0;n',o+=i[n].innerHTML,o+="";return e.innerHTML=o,t.appendChild(e),t},e.prototype.construct.tbody=function(){var t=document.createElement("div");t.classList.add("mc-tbody");for(var e=this.$table.querySelectorAll("tbody tr"),o=0;o',n+=s[r].innerHTML,n+="";i.innerHTML=n,t.appendChild(i)}return t},e.prototype.construct.caption=function(){return this.$table.querySelector("caption").cloneNode(!0)},e.prototype.construct.toggleLink=function(t){var e=document.createElement("button"),o=document.createElement("span"),i=document.createElement("span");return o.classList.add("mc-toggle-text"),o.innerHTML=t,i.classList.add("govuk-visually-hidden","mc-toggle-status"),i.setAttribute("role","alert"),e.classList.add("govuk-body-s","mc-toggle-button"),e.appendChild(o),e.appendChild(i),e},e.prototype.addToggleClick=function(t,e,o,i){var n=this;this.toggleLink.addEventListener("click",(function(s){s.preventDefault();var r=n.toggleLink.querySelector(".mc-toggle-text"),a=n.toggleLink.querySelector(".mc-toggle-status");n.$graphContainer.classList.toggle("mc-hidden"),n.$table.classList.toggle("mc-hidden"),r.innerHTML=r.innerHTML===e?t:e,a.innerHTML=a.innerHTML===i?o:i}))},e.prototype.constructChart=function(){var t=this.construct.thead.call(this),e=this.construct.tbody.call(this);if(this.toggleLink=this.construct.toggleLink(this.options.chartVisibleText),this.addToggleClick(this.options.chartVisibleText,this.options.tableVisibleText,this.options.chartAlertText,this.options.tableAlertText),this.options.hasCaption){var o=this.construct.caption.call(this);this.$graph.appendChild(o)}this.options.toggleAfter?this.$table.insertAdjacentElement("afterend",this.toggleLink):this.$table.insertAdjacentElement("beforebegin",this.toggleLink),this.$graph.appendChild(t),this.$graph.appendChild(e)},e.prototype.utils={isFloat:function(t){return!isNaN(parseFloat(t))},stripValue:function(t){return t.replace(/,|\xa3|%|[a-z]/gi,"")},returnMax:function(t){for(var e=0,o=0;oe&&(e=t[o]);return e},isNegative:function(t){return t<0}},e.prototype.addClassesToHeader=function(){var t=this.$graph.querySelectorAll(".mc-th"),e=t.length;this.options.stacked&&(t[e-1].classList.add("mc-stacked-header","mc-header-total"),e-=1);for(var o=1;oe&&(e=g)):h.classList.add("mc-bar-positive")),m=g,this.options.stacked?d+=m:(d=m,t.push(m))}}}this.options.stacked&&t.push(d)}var f={};return f.max=parseFloat(this.utils.returnMax(t),10),f.single=parseFloat(this.options.outOf/f.max,10),this.options.negative&&(f.marginLeft=parseFloat(e,10)*f.single,f.maxNegative=parseFloat(e,10)),f},e.prototype.applyWidths=function(){this.dimensions=this.calculateMaxWidth();for(var t=this.$graph.querySelectorAll(".mc-tr"),e=0;e"+n.innerHTML+"",n.style.width=l+"%"}},e.prototype.insert=function(){var t=document.createElement("span"),e="mc-chart-not-accessible-"+this.chartId;t.innerHTML="This content is not accessible - switch to table",t.className="mc-hidden",t.id=e,this.$graphContainer.setAttribute("aria-labelledby",e),this.$graphContainer.appendChild(this.$graph),this.$graphContainer.appendChild(t),this.$table.insertAdjacentElement("afterend",this.$graphContainer)},e.prototype.applyOutdent=function(){for(var t=this.$graph.querySelectorAll(".mc-bar-cell"),e=0;er&&i>0||i<1)&&o.classList.add("mc-value-overflow"):(0===i&&o.classList.add("mc-bar-outdented"),this.options.autoOutdent&&s>=r||this.options.outdentAll?(o.classList.add("mc-bar-outdented"),n.style.marginLeft="100%",n.style.display="inline-block"):o.classList.add("mc-bar-indented"))}},e.prototype.getChartId=function(){for(var t=document.querySelectorAll("table.js-barchart-table"),e=null,o=0;o0&&e.insertApiScript();for(var o=0;o',t.title=i.textContent,r.replaceChild(a,s),this.insertVideo(o,t)},e.prototype.insertVideo=function(t,o){var i="",n="";o.channel?(i=o.channel,n="live_stream"):n=o.videoId;var s=function(){new window.YT.Player(t,{videoId:n,host:"https://www.youtube-nocookie.com",playerVars:{enablejsapi:1,origin:window.location.origin,rel:0,disablekb:1,modestbranding:1,channel:i},events:{onReady:function(t){var e=o.title;t.target.getIframe().title=e+" (video)",window.GOVUK.analyticsGa4.analyticsModules&&window.GOVUK.analyticsGa4.analyticsModules.VideoTracker&&window.GOVUK.analyticsGa4.analyticsModules.VideoTracker.configureVideo(t)},onStateChange:function(t){var e=t.data,o={"-1":"VideoUnstarted",0:"VideoEnded",1:"VideoPlaying",2:"VideoPaused",3:"VideoBuffering",5:"VideoCued"};window.GOVUK.analyticsGa4.analyticsModules.VideoTracker&&window.GOVUK.analyticsGa4.analyticsModules.VideoTracker.trackVideo(t,o[e])}}})};s=s.bind(this),e.playerApiReady?s.call():e.queuedInserts.push(s)},e.prototype.campaignCookiesAllowed=function(){var t=window.GOVUK.getConsentCookie();return null!==t&&t.campaigns},e.nextId=function(){return this.embedCount=this.embedCount||0,this.embedCount+=1,"youtube-"+this.embedCount},e.insertApiScript=function(){if(!this.apiScriptInserted){var t=document.createElement("script");t.src="https://www.youtube.com/player_api";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),this.apiScriptInserted=!0}},e.parseLivestream=function(t){var e=t.match(/channel=([^&]*)/);if(e)return e[1]},e.parseVideoId=function(t){var e;try{e=new URL(t)}catch(t){return}return"www.youtube.com"===e.host||"youtube.com"===e.host?e.searchParams.get("v")||void 0:"youtu.be"===e.host?e.pathname.slice(1):void 0},e.apiScriptInserted=!1,e.playerApiReady=!1,e.queuedInserts=[],window.onYouTubePlayerAPIReady=function(){e.playerApiReady=!0;for(var t=0;t0&&isFinite(Number(o))&&(n="number")),n){case"boolean":i="true"===o;break;case"number":i=Number(o);break;default:i=t}return i}function o(...t){const e={};for(const i of t)for(const t of Object.keys(i)){const n=e[t],s=i[t];r(n)&&r(s)?e[t]=o(n,s):e[t]=s}return e}function i(t,o,i){const n=t.schema.properties[i];if("object"!==(null==n?void 0:n.type))return;const s={[i]:{}};for(const[t,n]of Object.entries(o)){let o=s;const a=t.split(".");for(const[s,l]of a.entries())"object"==typeof o&&(s` from template `