Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nhsuk-frontend

Package Overview
Dependencies
Maintainers
0
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nhsuk-frontend - npm Package Compare versions

Comparing version 9.0.1 to 9.1.0

dist/nhsuk-9.1.0.min.css

2

dist/nhsuk.js

@@ -1,1 +0,1 @@

(()=>{var e={621:()=>{NodeList.prototype.forEach||(NodeList.prototype.forEach=Array.prototype.forEach),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{enumerable:!1,value:function(e){return this.filter((function(t){return t===e})).length>0}}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n})}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function i(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(t){var n=function(t){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}var a=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"KEY_SPACE",32),i(this,"DEBOUNCE_TIMEOUT_IN_SECONDS",1),this.$module=t,this.debounceFormSubmitTimer=null},(n=[{key:"handleKeyDown",value:function(e){var t=e.target;"button"===t.getAttribute("role")&&e.keyCode===this.KEY_SPACE&&(e.preventDefault(),t.click())}},{key:"debounce",value:function(e){var t=this;if("true"===e.target.getAttribute("data-prevent-double-click"))return this.debounceFormSubmitTimer?(e.preventDefault(),!1):void(this.debounceFormSubmitTimer=setTimeout((function(){t.debounceFormSubmitTimer=null}),1e3*this.DEBOUNCE_TIMEOUT_IN_SECONDS))}},{key:"init",value:function(){this.$module.addEventListener("keydown",this.handleKeyDown.bind(this)),this.$module.addEventListener("click",this.debounce.bind(this))}}])&&t(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$module=t,this.$textarea=t.querySelector(".nhsuk-js-character-count"),this.$visibleCountMessage=null,this.$screenReaderCountMessage=null,this.lastInputTimestamp=null}return t=e,i=[{key:"getDataset",value:function(e){var t={},n=e.attributes;if(n)for(var i=0;i<n.length;i++){var o=n[i],a=o.name.match(/^data-(.+)/);a&&(t[a[1]]=o.value)}return t}}],(n=[{key:"init",value:function(){if(this.$textarea){var t=this.$module,n=this.$textarea,i=document.getElementById("".concat(n.id,"-info"));n.insertAdjacentElement("afterend",i);var o=document.createElement("div");o.className="nhsuk-character-count__sr-status nhsuk-u-visually-hidden",o.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=o,i.insertAdjacentElement("afterend",o);var a=document.createElement("div");a.className=i.className,a.classList.add("nhsuk-character-count__status"),a.setAttribute("aria-hidden","true"),this.$visibleCountMessage=a,i.insertAdjacentElement("afterend",a),i.classList.add("nhsuk-u-visually-hidden"),this.options=e.getDataset(t);var r=this.defaults.characterCountAttribute;this.options.maxwords&&(r=this.defaults.wordCountAttribute),this.maxLength=t.getAttribute(r),this.maxLength&&(n.removeAttribute("maxlength"),this.bindChangeEvents(),"onpageshow"in window?window.addEventListener("pageshow",this.updateCountMessage.bind(this)):window.addEventListener("DOMContentLoaded",this.updateCountMessage.bind(this)),this.updateCountMessage())}}},{key:"count",value:function(e){return this.options.maxwords?(e.match(/\S+/g)||[]).length:e.length}},{key:"bindChangeEvents",value:function(){var e=this.$textarea;e.addEventListener("keyup",this.handleKeyUp.bind(this)),e.addEventListener("focus",this.handleFocus.bind(this)),e.addEventListener("blur",this.handleBlur.bind(this))}},{key:"checkIfValueChanged",value:function(){this.$textarea.oldValue||(this.$textarea.oldValue=""),this.$textarea.value!==this.$textarea.oldValue&&(this.$textarea.oldValue=this.$textarea.value,this.updateCountMessage())}},{key:"updateCountMessage",value:function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}},{key:"updateVisibleCountMessage",value:function(){var e=this.$textarea,t=this.$visibleCountMessage,n=this.maxLength-this.count(e.value);this.isOverThreshold()?t.classList.remove("nhsuk-character-count__message--disabled"):t.classList.add("nhsuk-character-count__message--disabled"),n<0?(e.classList.add("nhsuk-textarea--error"),t.classList.remove("nhsuk-hint"),t.classList.add("nhsuk-error-message")):(e.classList.remove("nhsuk-textarea--error"),t.classList.remove("nhsuk-error-message"),t.classList.add("nhsuk-hint")),t.innerHTML=this.formattedUpdateMessage()}},{key:"updateScreenReaderCountMessage",value:function(){var e=this.$screenReaderCountMessage;this.isOverThreshold()?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",!0),e.innerHTML=this.formattedUpdateMessage()}},{key:"formattedUpdateMessage",value:function(){var e,t,n=this.$textarea,i=this.options,o=this.maxLength-this.count(n.value),a="character";return i.maxwords&&(a="word"),a+=-1===o||1===o?"":"s",e=o<0?"too many":"remaining",t=Math.abs(o),"You have ".concat(t," ").concat(a," ").concat(e)}},{key:"isOverThreshold",value:function(){var e=this.$textarea,t=this.options,n=this.count(e.value);return this.maxLength*(t.threshold?t.threshold:0)/100<=n}},{key:"handleKeyUp",value:function(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}},{key:"handleFocus",value:function(){var e=this;this.valueChecker=setInterval((function(){(!e.lastInputTimestamp||Date.now()-500>=e.lastInputTimestamp)&&e.checkIfValueChanged()}),1e3)}},{key:"handleBlur",value:function(){clearInterval(this.valueChecker)}}])&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}();c.prototype.defaults={characterCountAttribute:"data-maxlength",wordCountAttribute:"data-maxwords"};var l=function(e,t){if(e&&t){var n="true"===e.getAttribute(t)?"false":"true";e.setAttribute(t,n)}},h=function(e,t){if(e&&t){var n=e.getAttribute("aria-controls");if(n){var i=document.getElementById(n);i&&(e.checked?(i.classList.remove(t),e.setAttribute("aria-expanded",!0)):(i.classList.add(t),e.setAttribute("aria-expanded",!1)))}}},d=function(e){e.form.querySelectorAll('input[type="checkbox"]').forEach((function(e){return h(e,"nhsuk-checkboxes__conditional--hidden")}))};function b(e){(function(e){if("A"!==e.tagName||!1===e.href)return!1;var t=document.querySelector(e.hash);if(!t)return!1;var n=function(e){var t=e.closest("fieldset");if(t){var n=t.getElementsByTagName("legend");if(n.length){var i=n[0];if("checkbox"===e.type||"radio"===e.type)return i;var o=i.getBoundingClientRect().top,a=e.getBoundingClientRect();if(a.height&&window.innerHeight&&a.top+a.height-o<window.innerHeight/2)return i}}return document.querySelector("label[for='".concat(e.getAttribute("id"),"']"))||e.closest("label")}(t);return!!n&&(n.scrollIntoView(),t.focus({preventScroll:!0}),!0)})(e.target)&&e.preventDefault()}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function f(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,m(i.key),i)}}function m(e){var t=function(e){if("object"!=v(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==v(t)?t:t+""}var p=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.menuIsOpen=!1,this.navigation=document.querySelector(".nhsuk-navigation"),this.navigationList=document.querySelector(".nhsuk-header__navigation-list"),this.mobileMenu=document.createElement("ul"),this.mobileMenuToggleButton=document.querySelector(".nhsuk-header__menu-toggle"),this.mobileMenuCloseButton=document.createElement("button"),this.mobileMenuContainer=document.querySelector(".nhsuk-mobile-menu-container"),this.breakpoints=[],this.width=document.body.offsetWidth},t=[{key:"init",value:function(){var e=this;this.navigation&&this.navigationList&&this.mobileMenuToggleButton&&this.mobileMenuContainer&&(this.setupMobileMenu(),this.calculateBreakpoints(),this.updateNavigation(),this.doOnOrientationChange(),this.handleResize=this.debounce((function(){e.calculateBreakpoints(),e.updateNavigation()})),this.mobileMenuToggleButton.addEventListener("click",this.toggleMobileMenu.bind(this)),window.addEventListener("resize",this.handleResize),window.addEventListener("orientationchange",this.doOnOrientationChange()))}},{key:"debounce",value:function(e){var t,n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,a=new Array(o),r=0;r<o;r++)a[r]=arguments[r];clearTimeout(t),t=setTimeout((function(){e.apply(n,a)}),i)}}},{key:"calculateBreakpoints",value:function(){for(var e=0,t=0;t<this.navigationList.children.length;t++)e+=this.navigationList.children[t].offsetWidth,this.breakpoints[t]=e}},{key:"setupMobileMenu",value:function(){this.mobileMenuContainer.appendChild(this.mobileMenu),this.mobileMenu.classList.add("nhsuk-header__drop-down","nhsuk-header__drop-down--hidden")}},{key:"closeMobileMenu",value:function(){this.menuIsOpen=!1,this.mobileMenu.classList.add("nhsuk-header__drop-down--hidden"),this.navigation.style.marginBottom=0,this.mobileMenuToggleButton.setAttribute("aria-expanded","false"),this.mobileMenuToggleButton.focus(),this.mobileMenuCloseButton.removeEventListener("click",this.closeMobileMenu.bind(this)),document.removeEventListener("keydown",this.handleEscapeKey.bind(this))}},{key:"handleEscapeKey",value:function(e){"Escape"===e.key&&this.closeMobileMenu()}},{key:"openMobileMenu",value:function(){this.menuIsOpen=!0,this.mobileMenu.classList.remove("nhsuk-header__drop-down--hidden");var e=this.mobileMenu.offsetHeight;this.navigation.style.marginBottom="".concat(e,"px"),this.mobileMenuToggleButton.setAttribute("aria-expanded","true"),document.addEventListener("keydown",this.handleEscapeKey.bind(this)),this.mobileMenuCloseButton.addEventListener("click",this.closeMobileMenu.bind(this))}},{key:"toggleMobileMenu",value:function(){this.menuIsOpen?this.closeMobileMenu():this.openMobileMenu()}},{key:"updateNavigation",value:function(){var e=this.navigation.offsetWidth,t=this.navigationList.children.length;if(e<this.breakpoints[t-1]){if(this.mobileMenuToggleButton.classList.add("nhsuk-header__menu-toggle--visible"),this.mobileMenuContainer.classList.add("nhsuk-mobile-menu-container--visible"),2===t)return;for(;e<this.breakpoints[t-1];)this.mobileMenu.insertBefore(this.navigationList.children[t-2],this.mobileMenu.firstChild),t-=1}else if(e>this.breakpoints[t])for(;e>this.breakpoints[t];)this.navigationList.insertBefore(this.mobileMenu.removeChild(this.mobileMenu.firstChild),this.mobileMenuContainer),t+=1;this.mobileMenu.children.length||(this.mobileMenuToggleButton.classList.remove("nhsuk-header__menu-toggle--visible"),this.mobileMenuContainer.classList.remove("nhsuk-mobile-menu-container--visible")),document.body.offsetWidth!==this.width&&this.menuIsOpen&&this.closeMobileMenu()}},{key:"doOnOrientationChange",value:function(){var e=this;90===window.orientation&&setTimeout((function(){e.calculateBreakpoints(),e.updateNavigation()}),200)}}],t&&f(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,k(i.key),i)}}function k(e){var t=function(e){if("object"!=y(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==y(t)?t:t+""}var w=function(){function e(t,n,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$module=t,this.namespace=n,this.responsive=i,this.historyEnabled=o,this.$tabs=t.querySelectorAll(".".concat(this.namespace,"__tab")),this.keys={down:40,left:37,right:39,up:38},this.jsHiddenClass="".concat(this.namespace,"__panel--hidden"),this.showEvent=new CustomEvent("tab.show"),this.hideEvent=new CustomEvent("tab.hide")}return t=e,n=[{key:"init",value:function(){"function"==typeof window.matchMedia&&this.responsive?this.setupResponsiveChecks():this.setup()}},{key:"setupResponsiveChecks",value:function(){this.mql=window.matchMedia("(min-width: 641px)"),this.mql.addEventListener("change",this.checkMode.bind(this)),this.checkMode()}},{key:"checkMode",value:function(){this.mql.matches?this.setup():this.teardown()}},{key:"setup",value:function(){var e=this,t=this.$module,n=this.$tabs,i=t.querySelector(".".concat(this.namespace,"__list")),o=t.querySelectorAll(".".concat(this.namespace,"__list-item"));if(n&&i&&o){i.setAttribute("role","tablist"),o.forEach((function(e){e.setAttribute("role","presentation")})),n.forEach((function(t){e.setAttributes(t),t.boundTabClick=e.onTabClick.bind(e),t.boundTabKeydown=e.onTabKeydown.bind(e),t.addEventListener("click",t.boundTabClick,!0),t.addEventListener("keydown",t.boundTabKeydown,!0),e.hideTab(t)}));var a=this.getTab(window.location.hash)||this.$tabs[0];this.showTab(a),this.historyEnabled&&(t.boundOnHashChange=this.onHashChange.bind(this),window.addEventListener("hashchange",t.boundOnHashChange,!0))}}},{key:"teardown",value:function(){var e=this,t=this.$module,n=this.$tabs,i=t.querySelector(".".concat(this.namespace,"__list")),o=t.querySelectorAll(".".concat(this.namespace,"__list-item"));n&&i&&o&&(i.removeAttribute("role"),o.forEach((function(e){e.removeAttribute("role","presentation")})),n.forEach((function(t){t.removeEventListener("click",t.boundTabClick,!0),t.removeEventListener("keydown",t.boundTabKeydown,!0),e.unsetAttributes(t)})),this.historyEnabled&&window.removeEventListener("hashchange",t.boundOnHashChange,!0))}},{key:"onHashChange",value:function(){var e=window.location.hash,t=this.getTab(e);if(t)if(this.changingHash)this.changingHash=!1;else{var n=this.getCurrentTab();this.hideTab(n),this.showTab(t),t.focus()}}},{key:"hideTab",value:function(e){this.unhighlightTab(e),this.hidePanel(e)}},{key:"showTab",value:function(e){this.highlightTab(e),this.showPanel(e)}},{key:"getTab",value:function(e){return this.$module.querySelector(".".concat(this.namespace,'__tab[href="').concat(e,'"]'))}},{key:"setAttributes",value:function(t){var n=e.getHref(t).slice(1);t.setAttribute("id","tab_".concat(n)),t.setAttribute("role","tab"),t.setAttribute("aria-controls",n),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");var i=this.getPanel(t);i.setAttribute("role","tabpanel"),i.setAttribute("aria-labelledby",t.id),i.classList.add(this.jsHiddenClass)}},{key:"unsetAttributes",value:function(e){e.removeAttribute("id"),e.removeAttribute("role"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-selected"),e.removeAttribute("tabindex");var t=this.getPanel(e);t.removeAttribute("role"),t.removeAttribute("aria-labelledby"),t.removeAttribute("tabindex"),t.classList.remove(this.jsHiddenClass)}},{key:"onTabClick",value:function(e){e.target.classList.contains("".concat(this.namespace,"__tab"))||(e.stopPropagation(),e.preventDefault()),e.preventDefault();var t=e.target,n=this.getCurrentTab();this.hideTab(n),this.showTab(t),this.createHistoryEntry(t)}},{key:"createHistoryEntry",value:function(t){if(this.historyEnabled){var n=this.getPanel(t),i=n.id;n.id="",this.changingHash=!0,window.location.hash=e.getHref(t).slice(1),n.id=i}}},{key:"onTabKeydown",value:function(e){switch(e.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),e.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),e.preventDefault()}}},{key:"activateNextTab",value:function(){var e,t=this.getCurrentTab(),n=t.parentNode.nextElementSibling;n&&(e=n.querySelector(".".concat(this.namespace,"__tab"))),e&&(this.hideTab(t),this.showTab(e),e.focus(),this.createHistoryEntry(e))}},{key:"activatePreviousTab",value:function(){var e,t=this.getCurrentTab(),n=t.parentNode.previousElementSibling;n&&(e=n.querySelector(".".concat(this.namespace,"__tab"))),e&&(this.hideTab(t),this.showTab(e),e.focus(),this.createHistoryEntry(e))}},{key:"getPanel",value:function(t){return this.$module.querySelector(e.getHref(t))}},{key:"showPanel",value:function(e){var t=this.getPanel(e);t.classList.remove(this.jsHiddenClass),t.dispatchEvent(this.showEvent)}},{key:"hidePanel",value:function(e){var t=this.getPanel(e);t.classList.add(this.jsHiddenClass),t.dispatchEvent(this.hideEvent)}},{key:"unhighlightTab",value:function(e){e.setAttribute("aria-selected","false"),e.parentNode.classList.remove("".concat(this.namespace,"__list-item--selected")),e.setAttribute("tabindex","-1")}},{key:"highlightTab",value:function(e){e.setAttribute("aria-selected","true"),e.parentNode.classList.add("".concat(this.namespace,"__list-item--selected")),e.setAttribute("tabindex","0")}},{key:"getCurrentTab",value:function(){return this.$module.querySelector(".".concat(this.namespace,"__list-item--selected .").concat(this.namespace,"__tab"))}}],i=[{key:"getHref",value:function(e){var t=e.getAttribute("href");return t.slice(t.indexOf("#"),t.length)}}],n&&g(t.prototype,n),i&&g(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}();function E(e){!function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).scope;(void 0===e?document:e).querySelectorAll('[data-module="nhsuk-button"]').forEach((function(e){new a(e).init()}))}({scope:e}),function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).scope;(void 0===e?document:e).querySelectorAll('[data-module="nhsuk-character-count"]').forEach((function(e){new c(e).init()}))}({scope:e}),function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).scope,t=(void 0===e?document:e).querySelectorAll(".nhsuk-checkboxes .nhsuk-checkboxes__input"),n=function(e){var t;h(e.target,"nhsuk-checkboxes__conditional--hidden"),e.target.checked&&(e.target.hasAttribute("data-checkbox-exclusive")?((t=e.target).form.querySelectorAll('input[type="checkbox"][data-checkbox-exclusive-group="'.concat(t.getAttribute("data-checkbox-exclusive-group"),'"]')).forEach((function(e){t.form===e.form&&e!==t&&(e.checked=!1)})),d(t)):function(e){e.form.querySelectorAll('input[type="checkbox"][data-checkbox-exclusive][data-checkbox-exclusive-group="'.concat(e.getAttribute("data-checkbox-exclusive-group"),'"]')).forEach((function(t){e.form===t.form&&(t.checked=!1)})),d(e)}(e.target))};"onpageshow"in window?window.addEventListener("pageshow",(function(){return t.forEach((function(e){return d(e)}))})):window.addEventListener("DOMContentLoaded",(function(){return t.forEach((function(e){return d(e)}))})),t.forEach((function(e){return d(e)})),t.forEach((function(e){e.addEventListener("change",n)}))}({scope:e}),function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).scope,t=void 0===e?document:e;if("boolean"!=typeof document.createElement("details").open){var n=t.querySelectorAll("details");n.length&&n.forEach((function(e,n){e.hasAttribute("nhsuk-polyfilled")||function(e,n){e.setAttribute("nhsuk-polyfilled","true"),e.id||e.setAttribute("id","nhsuk-details".concat(n));var i=t.querySelector("#".concat(e.id," .nhsuk-details__text"));i.id||i.setAttribute("id","nhsuk-details__text".concat(n));var o=t.querySelector("#".concat(e.id," .nhsuk-details__summary"));o.setAttribute("role","button"),o.setAttribute("aria-controls",i.id),o.setAttribute("tabIndex","0"),1==(null!==e.getAttribute("open"))?(o.setAttribute("aria-expanded","true"),i.setAttribute("aria-hidden","false")):(o.setAttribute("aria-expanded","false"),i.setAttribute("aria-hidden","true"),i.style.display="none"),o.addEventListener("click",(function(){l(o,"aria-expanded"),l(i,"aria-hidden"),i.style.display="true"===i.getAttribute("aria-hidden")?"none":"",e.hasAttribute("open")?e.removeAttribute("open"):e.setAttribute("open","open")})),o.addEventListener("keydown",(function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),o.click())}))}(e,n)}))}}({scope:e}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.focusOnPageLoad,n=void 0===t||t,i=e.scope,o=(void 0===i?document:i).querySelector(".nhsuk-error-summary");o&&(n&&o.focus(),o.addEventListener("click",b))}({scope:e}),function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).scope,t=(void 0===e?document:e).querySelectorAll(".nhsuk-radios--conditional .nhsuk-radios__input"),n=function(){t.forEach((function(e){return h(e,"nhsuk-radios__conditional--hidden")}))};"onpageshow"in window?window.addEventListener("pageshow",n):window.addEventListener("DOMContentLoaded",n),n(),t.forEach((function(e){e.addEventListener("change",n)}))}({scope:e}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.namespace,n=void 0===t?"nhsuk-tabs":t,i=e.responsive,o=void 0===i||i,a=e.historyEnabled,r=void 0===a||a,s=e.scope;(void 0===s?document:s).querySelectorAll('[data-module="'.concat(n,'"]')).forEach((function(e){new w(e,n,o,r).init()}))}({scope:e})}n(621),document.addEventListener("DOMContentLoaded",(function(){var e,t;(new p).init(),e=document.querySelector("h1"),t=document.querySelector(".nhsuk-skip-link"),e&&t&&(t.addEventListener("click",(function(t){t.preventDefault(),e.setAttribute("tabIndex","-1"),e.focus()})),e.addEventListener("blur",(function(t){t.preventDefault(),e.removeAttribute("tabIndex")}))),E(document)}))})()})();
(()=>{var e={621:()=>{NodeList.prototype.forEach||(NodeList.prototype.forEach=Array.prototype.forEach),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{enumerable:!1,value:function(e){return this.filter((function(t){return t===e})).length>0}}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n})}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function i(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(t){var n=function(t){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}var a=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"KEY_SPACE",32),i(this,"DEBOUNCE_TIMEOUT_IN_SECONDS",1),this.$module=t,this.debounceFormSubmitTimer=null},(n=[{key:"handleKeyDown",value:function(e){var t=e.target;"button"===t.getAttribute("role")&&e.keyCode===this.KEY_SPACE&&(e.preventDefault(),t.click())}},{key:"debounce",value:function(e){var t=this;if("true"===e.target.getAttribute("data-prevent-double-click"))return this.debounceFormSubmitTimer?(e.preventDefault(),!1):void(this.debounceFormSubmitTimer=setTimeout((function(){t.debounceFormSubmitTimer=null}),1e3*this.DEBOUNCE_TIMEOUT_IN_SECONDS))}},{key:"init",value:function(){this.$module.addEventListener("keydown",this.handleKeyDown.bind(this)),this.$module.addEventListener("click",this.debounce.bind(this))}}])&&t(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}var c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$module=t,this.$textarea=t.querySelector(".nhsuk-js-character-count"),this.$visibleCountMessage=null,this.$screenReaderCountMessage=null,this.lastInputTimestamp=null}return t=e,i=[{key:"getDataset",value:function(e){var t={},n=e.attributes;if(n)for(var i=0;i<n.length;i++){var o=n[i],a=o.name.match(/^data-(.+)/);a&&(t[a[1]]=o.value)}return t}}],(n=[{key:"init",value:function(){if(this.$textarea){var t=this.$module,n=this.$textarea,i=document.getElementById("".concat(n.id,"-info"));n.insertAdjacentElement("afterend",i);var o=document.createElement("div");o.className="nhsuk-character-count__sr-status nhsuk-u-visually-hidden",o.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=o,i.insertAdjacentElement("afterend",o);var a=document.createElement("div");a.className=i.className,a.classList.add("nhsuk-character-count__status"),a.setAttribute("aria-hidden","true"),this.$visibleCountMessage=a,i.insertAdjacentElement("afterend",a),i.classList.add("nhsuk-u-visually-hidden"),this.options=e.getDataset(t);var r=this.defaults.characterCountAttribute;this.options.maxwords&&(r=this.defaults.wordCountAttribute),this.maxLength=t.getAttribute(r),this.maxLength&&(n.removeAttribute("maxlength"),this.bindChangeEvents(),"onpageshow"in window?window.addEventListener("pageshow",this.updateCountMessage.bind(this)):window.addEventListener("DOMContentLoaded",this.updateCountMessage.bind(this)),this.updateCountMessage())}}},{key:"count",value:function(e){return this.options.maxwords?(e.match(/\S+/g)||[]).length:e.length}},{key:"bindChangeEvents",value:function(){var e=this.$textarea;e.addEventListener("keyup",this.handleKeyUp.bind(this)),e.addEventListener("focus",this.handleFocus.bind(this)),e.addEventListener("blur",this.handleBlur.bind(this))}},{key:"checkIfValueChanged",value:function(){this.$textarea.oldValue||(this.$textarea.oldValue=""),this.$textarea.value!==this.$textarea.oldValue&&(this.$textarea.oldValue=this.$textarea.value,this.updateCountMessage())}},{key:"updateCountMessage",value:function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}},{key:"updateVisibleCountMessage",value:function(){var e=this.$textarea,t=this.$visibleCountMessage,n=this.maxLength-this.count(e.value);this.isOverThreshold()?t.classList.remove("nhsuk-character-count__message--disabled"):t.classList.add("nhsuk-character-count__message--disabled"),n<0?(e.classList.add("nhsuk-textarea--error"),t.classList.remove("nhsuk-hint"),t.classList.add("nhsuk-error-message")):(e.classList.remove("nhsuk-textarea--error"),t.classList.remove("nhsuk-error-message"),t.classList.add("nhsuk-hint")),t.innerHTML=this.formattedUpdateMessage()}},{key:"updateScreenReaderCountMessage",value:function(){var e=this.$screenReaderCountMessage;this.isOverThreshold()?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",!0),e.innerHTML=this.formattedUpdateMessage()}},{key:"formattedUpdateMessage",value:function(){var e,t,n=this.$textarea,i=this.options,o=this.maxLength-this.count(n.value),a="character";return i.maxwords&&(a="word"),a+=-1===o||1===o?"":"s",e=o<0?"too many":"remaining",t=Math.abs(o),"You have ".concat(t," ").concat(a," ").concat(e)}},{key:"isOverThreshold",value:function(){var e=this.$textarea,t=this.options,n=this.count(e.value);return this.maxLength*(t.threshold?t.threshold:0)/100<=n}},{key:"handleKeyUp",value:function(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}},{key:"handleFocus",value:function(){var e=this;this.valueChecker=setInterval((function(){(!e.lastInputTimestamp||Date.now()-500>=e.lastInputTimestamp)&&e.checkIfValueChanged()}),1e3)}},{key:"handleBlur",value:function(){clearInterval(this.valueChecker)}}])&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}();c.prototype.defaults={characterCountAttribute:"data-maxlength",wordCountAttribute:"data-maxwords"};var l=function(e,t){if(e&&t){var n="true"===e.getAttribute(t)?"false":"true";e.setAttribute(t,n)}},h=function(e,t){if(e&&t){var n=e.getAttribute("aria-controls");if(n){var i=document.getElementById(n);i&&(e.checked?(i.classList.remove(t),e.setAttribute("aria-expanded",!0)):(i.classList.add(t),e.setAttribute("aria-expanded",!1)))}}},d=function(e){e.form.querySelectorAll('input[type="checkbox"]').forEach((function(e){return h(e,"nhsuk-checkboxes__conditional--hidden")}))};function b(e){(function(e){if("A"!==e.tagName||!1===e.href)return!1;var t=document.querySelector(e.hash);if(!t)return!1;var n=function(e){var t=e.closest("fieldset");if(t){var n=t.getElementsByTagName("legend");if(n.length){var i=n[0];if("checkbox"===e.type||"radio"===e.type)return i;var o=i.getBoundingClientRect().top,a=e.getBoundingClientRect();if(a.height&&window.innerHeight&&a.top+a.height-o<window.innerHeight/2)return i}}return document.querySelector("label[for='".concat(e.getAttribute("id"),"']"))||e.closest("label")}(t);return!!n&&(n.scrollIntoView(),t.focus({preventScroll:!0}),!0)})(e.target)&&e.preventDefault()}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function f(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,m(i.key),i)}}function m(e){var t=function(e){if("object"!=v(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==v(t)?t:t+""}var p=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.menuIsOpen=!1,this.navigation=document.querySelector(".nhsuk-navigation"),this.navigationList=document.querySelector(".nhsuk-header__navigation-list"),this.mobileMenu=document.createElement("ul"),this.mobileMenuToggleButton=document.querySelector(".nhsuk-header__menu-toggle"),this.mobileMenuCloseButton=document.createElement("button"),this.mobileMenuContainer=document.querySelector(".nhsuk-mobile-menu-container"),this.breakpoints=[],this.width=document.body.offsetWidth},t=[{key:"init",value:function(){var e=this;this.navigation&&this.navigationList&&this.mobileMenuToggleButton&&this.mobileMenuContainer&&(this.setupMobileMenu(),this.calculateBreakpoints(),this.updateNavigation(),this.doOnOrientationChange(),this.handleResize=this.debounce((function(){e.calculateBreakpoints(),e.updateNavigation()})),this.mobileMenuToggleButton.addEventListener("click",this.toggleMobileMenu.bind(this)),window.addEventListener("resize",this.handleResize),window.addEventListener("orientationchange",this.doOnOrientationChange()))}},{key:"debounce",value:function(e){var t,n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,a=new Array(o),r=0;r<o;r++)a[r]=arguments[r];clearTimeout(t),t=setTimeout((function(){e.apply(n,a)}),i)}}},{key:"calculateBreakpoints",value:function(){for(var e=window.getComputedStyle(this.navigationList).getPropertyValue("gap"),t=Number(e.replace("px","")),n=0,i=0;i<this.navigationList.children.length;i++)n+=this.navigationList.children[i].offsetWidth+t,this.breakpoints[i]=n}},{key:"setupMobileMenu",value:function(){this.mobileMenuContainer.appendChild(this.mobileMenu),this.mobileMenu.classList.add("nhsuk-header__drop-down","nhsuk-header__drop-down--hidden")}},{key:"closeMobileMenu",value:function(){this.menuIsOpen=!1,this.mobileMenu.classList.add("nhsuk-header__drop-down--hidden"),this.navigation.style.marginBottom=0,this.mobileMenuToggleButton.setAttribute("aria-expanded","false"),this.mobileMenuToggleButton.focus(),this.mobileMenuCloseButton.removeEventListener("click",this.closeMobileMenu.bind(this)),document.removeEventListener("keydown",this.handleEscapeKey.bind(this))}},{key:"handleEscapeKey",value:function(e){"Escape"===e.key&&this.closeMobileMenu()}},{key:"openMobileMenu",value:function(){this.menuIsOpen=!0,this.mobileMenu.classList.remove("nhsuk-header__drop-down--hidden");var e=this.mobileMenu.offsetHeight;this.navigation.style.marginBottom="".concat(e,"px"),this.mobileMenuToggleButton.setAttribute("aria-expanded","true"),document.addEventListener("keydown",this.handleEscapeKey.bind(this)),this.mobileMenuCloseButton.addEventListener("click",this.closeMobileMenu.bind(this))}},{key:"toggleMobileMenu",value:function(){this.menuIsOpen?this.closeMobileMenu():this.openMobileMenu()}},{key:"updateNavigation",value:function(){var e=this.navigationList.offsetWidth,t=this.navigationList.children.length;if(e<this.breakpoints[t-1]){if(this.mobileMenuToggleButton.classList.add("nhsuk-header__menu-toggle--visible"),this.mobileMenuContainer.classList.add("nhsuk-mobile-menu-container--visible"),2===t)return;for(;e<this.breakpoints[t-1];)this.mobileMenu.insertBefore(this.navigationList.children[t-2],this.mobileMenu.firstChild),t-=1}else if(e>this.breakpoints[t])for(;e>this.breakpoints[t];)this.navigationList.insertBefore(this.mobileMenu.removeChild(this.mobileMenu.firstChild),this.mobileMenuContainer),t+=1;this.mobileMenu.children.length||(this.mobileMenuToggleButton.classList.remove("nhsuk-header__menu-toggle--visible"),this.mobileMenuContainer.classList.remove("nhsuk-mobile-menu-container--visible")),document.body.offsetWidth!==this.width&&this.menuIsOpen&&this.closeMobileMenu()}},{key:"doOnOrientationChange",value:function(){var e=this;90===window.orientation&&setTimeout((function(){e.calculateBreakpoints(),e.updateNavigation()}),200)}}],t&&f(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,k(i.key),i)}}function k(e){var t=function(e){if("object"!=y(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==y(t)?t:t+""}var w=function(){function e(t,n,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$module=t,this.namespace=n,this.responsive=i,this.historyEnabled=o,this.$tabs=t.querySelectorAll(".".concat(this.namespace,"__tab")),this.keys={down:40,left:37,right:39,up:38},this.jsHiddenClass="".concat(this.namespace,"__panel--hidden"),this.showEvent=new CustomEvent("tab.show"),this.hideEvent=new CustomEvent("tab.hide")}return t=e,n=[{key:"init",value:function(){"function"==typeof window.matchMedia&&this.responsive?this.setupResponsiveChecks():this.setup()}},{key:"setupResponsiveChecks",value:function(){this.mql=window.matchMedia("(min-width: 641px)"),this.mql.addEventListener("change",this.checkMode.bind(this)),this.checkMode()}},{key:"checkMode",value:function(){this.mql.matches?this.setup():this.teardown()}},{key:"setup",value:function(){var e=this,t=this.$module,n=this.$tabs,i=t.querySelector(".".concat(this.namespace,"__list")),o=t.querySelectorAll(".".concat(this.namespace,"__list-item"));if(n&&i&&o){i.setAttribute("role","tablist"),o.forEach((function(e){e.setAttribute("role","presentation")})),n.forEach((function(t){e.setAttributes(t),t.boundTabClick=e.onTabClick.bind(e),t.boundTabKeydown=e.onTabKeydown.bind(e),t.addEventListener("click",t.boundTabClick,!0),t.addEventListener("keydown",t.boundTabKeydown,!0),e.hideTab(t)}));var a=this.getTab(window.location.hash)||this.$tabs[0];this.showTab(a),this.historyEnabled&&(t.boundOnHashChange=this.onHashChange.bind(this),window.addEventListener("hashchange",t.boundOnHashChange,!0))}}},{key:"teardown",value:function(){var e=this,t=this.$module,n=this.$tabs,i=t.querySelector(".".concat(this.namespace,"__list")),o=t.querySelectorAll(".".concat(this.namespace,"__list-item"));n&&i&&o&&(i.removeAttribute("role"),o.forEach((function(e){e.removeAttribute("role","presentation")})),n.forEach((function(t){t.removeEventListener("click",t.boundTabClick,!0),t.removeEventListener("keydown",t.boundTabKeydown,!0),e.unsetAttributes(t)})),this.historyEnabled&&window.removeEventListener("hashchange",t.boundOnHashChange,!0))}},{key:"onHashChange",value:function(){var e=window.location.hash,t=this.getTab(e);if(t)if(this.changingHash)this.changingHash=!1;else{var n=this.getCurrentTab();this.hideTab(n),this.showTab(t),t.focus()}}},{key:"hideTab",value:function(e){this.unhighlightTab(e),this.hidePanel(e)}},{key:"showTab",value:function(e){this.highlightTab(e),this.showPanel(e)}},{key:"getTab",value:function(e){return this.$module.querySelector(".".concat(this.namespace,'__tab[href="').concat(e,'"]'))}},{key:"setAttributes",value:function(t){var n=e.getHref(t).slice(1);t.setAttribute("id","tab_".concat(n)),t.setAttribute("role","tab"),t.setAttribute("aria-controls",n),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");var i=this.getPanel(t);i.setAttribute("role","tabpanel"),i.setAttribute("aria-labelledby",t.id),i.classList.add(this.jsHiddenClass)}},{key:"unsetAttributes",value:function(e){e.removeAttribute("id"),e.removeAttribute("role"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-selected"),e.removeAttribute("tabindex");var t=this.getPanel(e);t.removeAttribute("role"),t.removeAttribute("aria-labelledby"),t.removeAttribute("tabindex"),t.classList.remove(this.jsHiddenClass)}},{key:"onTabClick",value:function(e){e.target.classList.contains("".concat(this.namespace,"__tab"))||(e.stopPropagation(),e.preventDefault()),e.preventDefault();var t=e.target,n=this.getCurrentTab();this.hideTab(n),this.showTab(t),this.createHistoryEntry(t)}},{key:"createHistoryEntry",value:function(t){if(this.historyEnabled){var n=this.getPanel(t),i=n.id;n.id="",this.changingHash=!0,window.location.hash=e.getHref(t).slice(1),n.id=i}}},{key:"onTabKeydown",value:function(e){switch(e.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),e.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),e.preventDefault()}}},{key:"activateNextTab",value:function(){var e,t=this.getCurrentTab(),n=t.parentNode.nextElementSibling;n&&(e=n.querySelector(".".concat(this.namespace,"__tab"))),e&&(this.hideTab(t),this.showTab(e),e.focus(),this.createHistoryEntry(e))}},{key:"activatePreviousTab",value:function(){var e,t=this.getCurrentTab(),n=t.parentNode.previousElementSibling;n&&(e=n.querySelector(".".concat(this.namespace,"__tab"))),e&&(this.hideTab(t),this.showTab(e),e.focus(),this.createHistoryEntry(e))}},{key:"getPanel",value:function(t){return this.$module.querySelector(e.getHref(t))}},{key:"showPanel",value:function(e){var t=this.getPanel(e);t.classList.remove(this.jsHiddenClass),t.dispatchEvent(this.showEvent)}},{key:"hidePanel",value:function(e){var t=this.getPanel(e);t.classList.add(this.jsHiddenClass),t.dispatchEvent(this.hideEvent)}},{key:"unhighlightTab",value:function(e){e.setAttribute("aria-selected","false"),e.parentNode.classList.remove("".concat(this.namespace,"__list-item--selected")),e.setAttribute("tabindex","-1")}},{key:"highlightTab",value:function(e){e.setAttribute("aria-selected","true"),e.parentNode.classList.add("".concat(this.namespace,"__list-item--selected")),e.setAttribute("tabindex","0")}},{key:"getCurrentTab",value:function(){return this.$module.querySelector(".".concat(this.namespace,"__list-item--selected .").concat(this.namespace,"__tab"))}}],i=[{key:"getHref",value:function(e){var t=e.getAttribute("href");return t.slice(t.indexOf("#"),t.length)}}],n&&g(t.prototype,n),i&&g(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}();function E(e){!function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).scope;(void 0===e?document:e).querySelectorAll('[data-module="nhsuk-button"]').forEach((function(e){new a(e).init()}))}({scope:e}),function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).scope;(void 0===e?document:e).querySelectorAll('[data-module="nhsuk-character-count"]').forEach((function(e){new c(e).init()}))}({scope:e}),function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).scope,t=(void 0===e?document:e).querySelectorAll(".nhsuk-checkboxes .nhsuk-checkboxes__input"),n=function(e){var t;h(e.target,"nhsuk-checkboxes__conditional--hidden"),e.target.checked&&(e.target.hasAttribute("data-checkbox-exclusive")?((t=e.target).form.querySelectorAll('input[type="checkbox"][data-checkbox-exclusive-group="'.concat(t.getAttribute("data-checkbox-exclusive-group"),'"]')).forEach((function(e){t.form===e.form&&e!==t&&(e.checked=!1)})),d(t)):function(e){e.form.querySelectorAll('input[type="checkbox"][data-checkbox-exclusive][data-checkbox-exclusive-group="'.concat(e.getAttribute("data-checkbox-exclusive-group"),'"]')).forEach((function(t){e.form===t.form&&(t.checked=!1)})),d(e)}(e.target))};"onpageshow"in window?window.addEventListener("pageshow",(function(){return t.forEach((function(e){return d(e)}))})):window.addEventListener("DOMContentLoaded",(function(){return t.forEach((function(e){return d(e)}))})),t.forEach((function(e){return d(e)})),t.forEach((function(e){e.addEventListener("change",n)}))}({scope:e}),function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).scope,t=void 0===e?document:e;if("boolean"!=typeof document.createElement("details").open){var n=t.querySelectorAll("details");n.length&&n.forEach((function(e,n){e.hasAttribute("nhsuk-polyfilled")||function(e,n){e.setAttribute("nhsuk-polyfilled","true"),e.id||e.setAttribute("id","nhsuk-details".concat(n));var i=t.querySelector("#".concat(e.id," .nhsuk-details__text"));i.id||i.setAttribute("id","nhsuk-details__text".concat(n));var o=t.querySelector("#".concat(e.id," .nhsuk-details__summary"));o.setAttribute("role","button"),o.setAttribute("aria-controls",i.id),o.setAttribute("tabIndex","0"),1==(null!==e.getAttribute("open"))?(o.setAttribute("aria-expanded","true"),i.setAttribute("aria-hidden","false")):(o.setAttribute("aria-expanded","false"),i.setAttribute("aria-hidden","true"),i.style.display="none"),o.addEventListener("click",(function(){l(o,"aria-expanded"),l(i,"aria-hidden"),i.style.display="true"===i.getAttribute("aria-hidden")?"none":"",e.hasAttribute("open")?e.removeAttribute("open"):e.setAttribute("open","open")})),o.addEventListener("keydown",(function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),o.click())}))}(e,n)}))}}({scope:e}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.focusOnPageLoad,n=void 0===t||t,i=e.scope,o=(void 0===i?document:i).querySelector(".nhsuk-error-summary");o&&(n&&o.focus(),o.addEventListener("click",b))}({scope:e}),function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).scope,t=(void 0===e?document:e).querySelectorAll(".nhsuk-radios--conditional .nhsuk-radios__input"),n=function(){t.forEach((function(e){return h(e,"nhsuk-radios__conditional--hidden")}))};"onpageshow"in window?window.addEventListener("pageshow",n):window.addEventListener("DOMContentLoaded",n),n(),t.forEach((function(e){e.addEventListener("change",n)}))}({scope:e}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.namespace,n=void 0===t?"nhsuk-tabs":t,i=e.responsive,o=void 0===i||i,a=e.historyEnabled,r=void 0===a||a,s=e.scope;(void 0===s?document:s).querySelectorAll('[data-module="'.concat(n,'"]')).forEach((function(e){new w(e,n,o,r).init()}))}({scope:e})}n(621),document.addEventListener("DOMContentLoaded",(function(){var e,t;(new p).init(),e=document.querySelector("h1"),t=document.querySelector(".nhsuk-skip-link"),e&&t&&(t.addEventListener("click",(function(t){t.preventDefault(),e.setAttribute("tabIndex","-1"),e.focus()})),e.addEventListener("blur",(function(t){t.preventDefault(),e.removeAttribute("tabIndex")}))),E(document)}))})()})();

@@ -1,1 +0,1 @@

(()=>{var n={621:()=>{NodeList.prototype.forEach||(NodeList.prototype.forEach=Array.prototype.forEach),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{enumerable:!1,value:function(t){return 0<this.filter(function(e){return e===t}).length}}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t}while(null!==(t=t.parentElement||t.parentNode)&&1===t.nodeType);return null}),"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n})}},i={};function E(e){var t=i[e];return void 0!==t||(t=i[e]={exports:{}},n[e](t,t.exports,E)),t.exports}(()=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n){(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}function s(e){e=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=n(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e);return"symbol"==n(e)?e:e+""}var t=function(){for(var e,e=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");a(this,"KEY_SPACE",32),a(this,"DEBOUNCE_TIMEOUT_IN_SECONDS",1),this.$module=t,this.debounceFormSubmitTimer=null},t=e.prototype,n=[{key:"handleKeyDown",value:function(e){var t=e.target;"button"===t.getAttribute("role")&&e.keyCode===this.KEY_SPACE&&(e.preventDefault(),t.click())}},{key:"debounce",value:function(e){var t=this;if("true"===e.target.getAttribute("data-prevent-double-click"))return this.debounceFormSubmitTimer?(e.preventDefault(),!1):void(this.debounceFormSubmitTimer=setTimeout(function(){t.debounceFormSubmitTimer=null},1e3*this.DEBOUNCE_TIMEOUT_IN_SECONDS))}},{key:"init",value:function(){this.$module.addEventListener("keydown",this.handleKeyDown.bind(this)),this.$module.addEventListener("click",this.debounce.bind(this))}}],i=0;i<n.length;i++){var o=n[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}return Object.defineProperty(e,"prototype",{writable:!1}),e}();function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){e=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=o(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e);return"symbol"==o(e)?e:e+""}(i.key),i)}}p=[{key:"getDataset",value:function(e){var t={},n=e.attributes;if(n)for(var i=0;i<n.length;i++){var o=n[i],a=o.name.match(/^data-(.+)/);a&&(t[a[1]]=o.value)}return t}}],e((y=r).prototype,[{key:"init",value:function(){var e,t,n,i;this.$textarea&&(e=this.$module,t=this.$textarea,n=document.getElementById("".concat(t.id,"-info")),t.insertAdjacentElement("afterend",n),(i=document.createElement("div")).className="nhsuk-character-count__sr-status nhsuk-u-visually-hidden",i.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=i,n.insertAdjacentElement("afterend",i),(i=document.createElement("div")).className=n.className,i.classList.add("nhsuk-character-count__status"),i.setAttribute("aria-hidden","true"),this.$visibleCountMessage=i,n.insertAdjacentElement("afterend",i),n.classList.add("nhsuk-u-visually-hidden"),this.options=r.getDataset(e),i=this.defaults.characterCountAttribute,this.options.maxwords&&(i=this.defaults.wordCountAttribute),this.maxLength=e.getAttribute(i),this.maxLength)&&(t.removeAttribute("maxlength"),this.bindChangeEvents(),"onpageshow"in window?window.addEventListener("pageshow",this.updateCountMessage.bind(this)):window.addEventListener("DOMContentLoaded",this.updateCountMessage.bind(this)),this.updateCountMessage())}},{key:"count",value:function(e){return(this.options.maxwords?e.match(/\S+/g)||[]:e).length}},{key:"bindChangeEvents",value:function(){var e=this.$textarea;e.addEventListener("keyup",this.handleKeyUp.bind(this)),e.addEventListener("focus",this.handleFocus.bind(this)),e.addEventListener("blur",this.handleBlur.bind(this))}},{key:"checkIfValueChanged",value:function(){this.$textarea.oldValue||(this.$textarea.oldValue=""),this.$textarea.value!==this.$textarea.oldValue&&(this.$textarea.oldValue=this.$textarea.value,this.updateCountMessage())}},{key:"updateCountMessage",value:function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}},{key:"updateVisibleCountMessage",value:function(){var e=this.$textarea,t=this.$visibleCountMessage,n=this.maxLength-this.count(e.value);this.isOverThreshold()?t.classList.remove("nhsuk-character-count__message--disabled"):t.classList.add("nhsuk-character-count__message--disabled"),n<0?(e.classList.add("nhsuk-textarea--error"),t.classList.remove("nhsuk-hint"),t.classList.add("nhsuk-error-message")):(e.classList.remove("nhsuk-textarea--error"),t.classList.remove("nhsuk-error-message"),t.classList.add("nhsuk-hint")),t.innerHTML=this.formattedUpdateMessage()}},{key:"updateScreenReaderCountMessage",value:function(){var e=this.$screenReaderCountMessage;this.isOverThreshold()?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",!0),e.innerHTML=this.formattedUpdateMessage()}},{key:"formattedUpdateMessage",value:function(){var e=this.$textarea,t=this.options,e=this.maxLength-this.count(e.value),n="character";return t.maxwords&&(n="word"),n+=-1==e||1==e?"":"s",t=e<0?"too many":"remaining",e=Math.abs(e),"You have ".concat(e," ").concat(n," ").concat(t)}},{key:"isOverThreshold",value:function(){var e=this.$textarea,t=this.options,e=this.count(e.value);return this.maxLength*(t.threshold||0)/100<=e}},{key:"handleKeyUp",value:function(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}},{key:"handleFocus",value:function(){var e=this;this.valueChecker=setInterval(function(){(!e.lastInputTimestamp||Date.now()-500>=e.lastInputTimestamp)&&e.checkIfValueChanged()},1e3)}},{key:"handleBlur",value:function(){clearInterval(this.valueChecker)}}]),e(y,p),Object.defineProperty(y,"prototype",{writable:!1});var i=y;function r(e){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");this.$module=e,this.$textarea=e.querySelector(".nhsuk-js-character-count"),this.$visibleCountMessage=null,this.$screenReaderCountMessage=null,this.lastInputTimestamp=null}i.prototype.defaults={characterCountAttribute:"data-maxlength",wordCountAttribute:"data-maxwords"};function u(e,t){var n;e&&t&&(n="true"===e.getAttribute(t)?"false":"true",e.setAttribute(t,n))}function c(e){e.form.querySelectorAll('input[type="checkbox"]').forEach(function(e){return l(e,"nhsuk-checkboxes__conditional--hidden")})}var l=function(e,t){var n;e&&t&&(n=e.getAttribute("aria-controls"))&&(n=document.getElementById(n))&&(e.checked?(n.classList.remove(t),e.setAttribute("aria-expanded",!0)):(n.classList.add(t),e.setAttribute("aria-expanded",!1)))};function h(e){!function(e){if("A"===e.tagName&&!1!==e.href){var t,e=document.querySelector(e.hash);if(e)return(t=function(e){var t=e.closest("fieldset");if(t){t=t.getElementsByTagName("legend");if(t.length){t=t[0];if("checkbox"===e.type||"radio"===e.type)return t;var n=t.getBoundingClientRect().top,i=e.getBoundingClientRect();if(i.height&&window.innerHeight&&i.top+i.height-n<window.innerHeight/2)return t}}return document.querySelector("label[for='".concat(e.getAttribute("id"),"']"))||e.closest("label")}(e))&&(t.scrollIntoView(),e.focus({preventScroll:!0}),1)}}(e.target)||e.preventDefault()}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){e=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=d(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e);return"symbol"==d(e)?e:e+""}(i.key),i)}}b((p=function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.menuIsOpen=!1,this.navigation=document.querySelector(".nhsuk-navigation"),this.navigationList=document.querySelector(".nhsuk-header__navigation-list"),this.mobileMenu=document.createElement("ul"),this.mobileMenuToggleButton=document.querySelector(".nhsuk-header__menu-toggle"),this.mobileMenuCloseButton=document.createElement("button"),this.mobileMenuContainer=document.querySelector(".nhsuk-mobile-menu-container"),this.breakpoints=[],this.width=document.body.offsetWidth}).prototype,[{key:"init",value:function(){var e=this;this.navigation&&this.navigationList&&this.mobileMenuToggleButton&&this.mobileMenuContainer&&(this.setupMobileMenu(),this.calculateBreakpoints(),this.updateNavigation(),this.doOnOrientationChange(),this.handleResize=this.debounce(function(){e.calculateBreakpoints(),e.updateNavigation()}),this.mobileMenuToggleButton.addEventListener("click",this.toggleMobileMenu.bind(this)),window.addEventListener("resize",this.handleResize),window.addEventListener("orientationchange",this.doOnOrientationChange()))}},{key:"debounce",value:function(i){var o,a=this,s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];clearTimeout(o),o=setTimeout(function(){i.apply(a,t)},s)}}},{key:"calculateBreakpoints",value:function(){for(var e=0,t=0;t<this.navigationList.children.length;t++)e+=this.navigationList.children[t].offsetWidth,this.breakpoints[t]=e}},{key:"setupMobileMenu",value:function(){this.mobileMenuContainer.appendChild(this.mobileMenu),this.mobileMenu.classList.add("nhsuk-header__drop-down","nhsuk-header__drop-down--hidden")}},{key:"closeMobileMenu",value:function(){this.menuIsOpen=!1,this.mobileMenu.classList.add("nhsuk-header__drop-down--hidden"),this.navigation.style.marginBottom=0,this.mobileMenuToggleButton.setAttribute("aria-expanded","false"),this.mobileMenuToggleButton.focus(),this.mobileMenuCloseButton.removeEventListener("click",this.closeMobileMenu.bind(this)),document.removeEventListener("keydown",this.handleEscapeKey.bind(this))}},{key:"handleEscapeKey",value:function(e){"Escape"===e.key&&this.closeMobileMenu()}},{key:"openMobileMenu",value:function(){this.menuIsOpen=!0,this.mobileMenu.classList.remove("nhsuk-header__drop-down--hidden");var e=this.mobileMenu.offsetHeight;this.navigation.style.marginBottom="".concat(e,"px"),this.mobileMenuToggleButton.setAttribute("aria-expanded","true"),document.addEventListener("keydown",this.handleEscapeKey.bind(this)),this.mobileMenuCloseButton.addEventListener("click",this.closeMobileMenu.bind(this))}},{key:"toggleMobileMenu",value:function(){this.menuIsOpen?this.closeMobileMenu():this.openMobileMenu()}},{key:"updateNavigation",value:function(){var e=this.navigation.offsetWidth,t=this.navigationList.children.length;if(e<this.breakpoints[t-1]){if(this.mobileMenuToggleButton.classList.add("nhsuk-header__menu-toggle--visible"),this.mobileMenuContainer.classList.add("nhsuk-mobile-menu-container--visible"),2===t)return;for(;e<this.breakpoints[t-1];)this.mobileMenu.insertBefore(this.navigationList.children[t-2],this.mobileMenu.firstChild),--t}else if(e>this.breakpoints[t])for(;e>this.breakpoints[t];)this.navigationList.insertBefore(this.mobileMenu.removeChild(this.mobileMenu.firstChild),this.mobileMenuContainer),t+=1;this.mobileMenu.children.length||(this.mobileMenuToggleButton.classList.remove("nhsuk-header__menu-toggle--visible"),this.mobileMenuContainer.classList.remove("nhsuk-mobile-menu-container--visible")),document.body.offsetWidth!==this.width&&this.menuIsOpen&&this.closeMobileMenu()}},{key:"doOnOrientationChange",value:function(){var e=this;90===window.orientation&&setTimeout(function(){e.calculateBreakpoints(),e.updateNavigation()},200)}}]),Object.defineProperty(p,"prototype",{writable:!1});var f=p;function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){e=function(e){if("object"!=v(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=v(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e);return"symbol"==v(e)?e:e+""}(i.key),i)}}y=[{key:"getHref",value:function(e){e=e.getAttribute("href");return e.slice(e.indexOf("#"),e.length)}}],m((p=k).prototype,[{key:"init",value:function(){"function"==typeof window.matchMedia&&this.responsive?this.setupResponsiveChecks():this.setup()}},{key:"setupResponsiveChecks",value:function(){this.mql=window.matchMedia("(min-width: 641px)"),this.mql.addEventListener("change",this.checkMode.bind(this)),this.checkMode()}},{key:"checkMode",value:function(){this.mql.matches?this.setup():this.teardown()}},{key:"setup",value:function(){var t=this,e=this.$module,n=this.$tabs,i=e.querySelector(".".concat(this.namespace,"__list")),o=e.querySelectorAll(".".concat(this.namespace,"__list-item"));n&&i&&o&&(i.setAttribute("role","tablist"),o.forEach(function(e){e.setAttribute("role","presentation")}),n.forEach(function(e){t.setAttributes(e),e.boundTabClick=t.onTabClick.bind(t),e.boundTabKeydown=t.onTabKeydown.bind(t),e.addEventListener("click",e.boundTabClick,!0),e.addEventListener("keydown",e.boundTabKeydown,!0),t.hideTab(e)}),i=this.getTab(window.location.hash)||this.$tabs[0],this.showTab(i),this.historyEnabled)&&(e.boundOnHashChange=this.onHashChange.bind(this),window.addEventListener("hashchange",e.boundOnHashChange,!0))}},{key:"teardown",value:function(){var t=this,e=this.$module,n=this.$tabs,i=e.querySelector(".".concat(this.namespace,"__list")),o=e.querySelectorAll(".".concat(this.namespace,"__list-item"));n&&i&&o&&(i.removeAttribute("role"),o.forEach(function(e){e.removeAttribute("role","presentation")}),n.forEach(function(e){e.removeEventListener("click",e.boundTabClick,!0),e.removeEventListener("keydown",e.boundTabKeydown,!0),t.unsetAttributes(e)}),this.historyEnabled)&&window.removeEventListener("hashchange",e.boundOnHashChange,!0)}},{key:"onHashChange",value:function(){var e,t=window.location.hash,t=this.getTab(t);t&&(this.changingHash?this.changingHash=!1:(e=this.getCurrentTab(),this.hideTab(e),this.showTab(t),t.focus()))}},{key:"hideTab",value:function(e){this.unhighlightTab(e),this.hidePanel(e)}},{key:"showTab",value:function(e){this.highlightTab(e),this.showPanel(e)}},{key:"getTab",value:function(e){return this.$module.querySelector(".".concat(this.namespace,'__tab[href="').concat(e,'"]'))}},{key:"setAttributes",value:function(e){var t=k.getHref(e).slice(1),t=(e.setAttribute("id","tab_".concat(t)),e.setAttribute("role","tab"),e.setAttribute("aria-controls",t),e.setAttribute("aria-selected","false"),e.setAttribute("tabindex","-1"),this.getPanel(e));t.setAttribute("role","tabpanel"),t.setAttribute("aria-labelledby",e.id),t.classList.add(this.jsHiddenClass)}},{key:"unsetAttributes",value:function(e){e.removeAttribute("id"),e.removeAttribute("role"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-selected"),e.removeAttribute("tabindex");e=this.getPanel(e);e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.removeAttribute("tabindex"),e.classList.remove(this.jsHiddenClass)}},{key:"onTabClick",value:function(e){e.target.classList.contains("".concat(this.namespace,"__tab"))||(e.stopPropagation(),e.preventDefault()),e.preventDefault();var e=e.target,t=this.getCurrentTab();this.hideTab(t),this.showTab(e),this.createHistoryEntry(e)}},{key:"createHistoryEntry",value:function(e){var t,n;this.historyEnabled&&(n=(t=this.getPanel(e)).id,t.id="",this.changingHash=!0,window.location.hash=k.getHref(e).slice(1),t.id=n)}},{key:"onTabKeydown",value:function(e){switch(e.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),e.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),e.preventDefault()}}},{key:"activateNextTab",value:function(){var e,t=this.getCurrentTab(),n=t.parentNode.nextElementSibling;(e=n?n.querySelector(".".concat(this.namespace,"__tab")):e)&&(this.hideTab(t),this.showTab(e),e.focus(),this.createHistoryEntry(e))}},{key:"activatePreviousTab",value:function(){var e,t=this.getCurrentTab(),n=t.parentNode.previousElementSibling;(e=n?n.querySelector(".".concat(this.namespace,"__tab")):e)&&(this.hideTab(t),this.showTab(e),e.focus(),this.createHistoryEntry(e))}},{key:"getPanel",value:function(e){return this.$module.querySelector(k.getHref(e))}},{key:"showPanel",value:function(e){e=this.getPanel(e);e.classList.remove(this.jsHiddenClass),e.dispatchEvent(this.showEvent)}},{key:"hidePanel",value:function(e){e=this.getPanel(e);e.classList.add(this.jsHiddenClass),e.dispatchEvent(this.hideEvent)}},{key:"unhighlightTab",value:function(e){e.setAttribute("aria-selected","false"),e.parentNode.classList.remove("".concat(this.namespace,"__list-item--selected")),e.setAttribute("tabindex","-1")}},{key:"highlightTab",value:function(e){e.setAttribute("aria-selected","true"),e.parentNode.classList.add("".concat(this.namespace,"__list-item--selected")),e.setAttribute("tabindex","0")}},{key:"getCurrentTab",value:function(){return this.$module.querySelector(".".concat(this.namespace,"__list-item--selected .").concat(this.namespace,"__tab"))}}]),m(p,y),Object.defineProperty(p,"prototype",{writable:!1});var p,y,g=p;function k(e,t,n,i){if(!(this instanceof k))throw new TypeError("Cannot call a class as a function");this.$module=e,this.namespace=t,this.responsive=n,this.historyEnabled=i,this.$tabs=e.querySelectorAll(".".concat(this.namespace,"__tab")),this.keys={down:40,left:37,right:39,up:38},this.jsHiddenClass="".concat(this.namespace,"__panel--hidden"),this.showEvent=new CustomEvent("tab.show"),this.hideEvent=new CustomEvent("tab.hide")}function w(e){!function(e){e=(0<arguments.length&&void 0!==e?e:{}).scope;(void 0===e?document:e).querySelectorAll('[data-module="nhsuk-button"]').forEach(function(e){new t(e).init()})}({scope:e}),function(e){e=(0<arguments.length&&void 0!==e?e:{}).scope;(void 0===e?document:e).querySelectorAll('[data-module="nhsuk-character-count"]').forEach(function(e){new i(e).init()})}({scope:e}),function(e){function t(e){var t,n;l(e.target,"nhsuk-checkboxes__conditional--hidden"),e.target.checked&&(e.target.hasAttribute("data-checkbox-exclusive")?((t=e.target).form.querySelectorAll('input[type="checkbox"][data-checkbox-exclusive-group="'.concat(t.getAttribute("data-checkbox-exclusive-group"),'"]')).forEach(function(e){t.form===e.form&&e!==t&&(e.checked=!1)}),c(t)):((n=e.target).form.querySelectorAll('input[type="checkbox"][data-checkbox-exclusive][data-checkbox-exclusive-group="'.concat(n.getAttribute("data-checkbox-exclusive-group"),'"]')).forEach(function(e){n.form===e.form&&(e.checked=!1)}),c(n)))}var e=(0<arguments.length&&void 0!==e?e:{}).scope,n=(void 0===e?document:e).querySelectorAll(".nhsuk-checkboxes .nhsuk-checkboxes__input");"onpageshow"in window?window.addEventListener("pageshow",function(){return n.forEach(c)}):window.addEventListener("DOMContentLoaded",function(){return n.forEach(c)}),n.forEach(c),n.forEach(function(e){e.addEventListener("change",t)})}({scope:e}),function(e){var e=(0<arguments.length&&void 0!==e?e:{}).scope,a=void 0===e?document:e;"boolean"!=typeof document.createElement("details").open&&(e=a.querySelectorAll("details")).length&&e.forEach(function(e,t){var n,i,o;e.hasAttribute("nhsuk-polyfilled")||(t=t,(n=e).setAttribute("nhsuk-polyfilled","true"),n.id||n.setAttribute("id","nhsuk-details".concat(t)),(i=a.querySelector("#".concat(n.id," .nhsuk-details__text"))).id||i.setAttribute("id","nhsuk-details__text".concat(t)),(o=a.querySelector("#".concat(n.id," .nhsuk-details__summary"))).setAttribute("role","button"),o.setAttribute("aria-controls",i.id),o.setAttribute("tabIndex","0"),1==(null!==n.getAttribute("open"))?(o.setAttribute("aria-expanded","true"),i.setAttribute("aria-hidden","false")):(o.setAttribute("aria-expanded","false"),i.setAttribute("aria-hidden","true"),i.style.display="none"),o.addEventListener("click",function(){u(o,"aria-expanded"),u(i,"aria-hidden"),i.style.display="true"===i.getAttribute("aria-hidden")?"none":"",n.hasAttribute("open")?n.removeAttribute("open"):n.setAttribute("open","open")}),o.addEventListener("keydown",function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),o.click())}))})}({scope:e}),function(e){var e=0<arguments.length&&void 0!==e?e:{},t=e.focusOnPageLoad,t=void 0===t||t,e=e.scope,e=(void 0===e?document:e).querySelector(".nhsuk-error-summary");e&&(t&&e.focus(),e.addEventListener("click",h))}({scope:e}),function(e){function t(){n.forEach(function(e){return l(e,"nhsuk-radios__conditional--hidden")})}var e=(0<arguments.length&&void 0!==e?e:{}).scope,n=(void 0===e?document:e).querySelectorAll(".nhsuk-radios--conditional .nhsuk-radios__input");"onpageshow"in window?window.addEventListener("pageshow",t):window.addEventListener("DOMContentLoaded",t),t(),n.forEach(function(e){e.addEventListener("change",t)})}({scope:e}),function(e){var e=0<arguments.length&&void 0!==e?e:{},t=e.namespace,n=void 0===t?"nhsuk-tabs":t,t=e.responsive,i=void 0===t||t,t=e.historyEnabled,o=void 0===t||t,t=e.scope;(void 0===t?document:t).querySelectorAll('[data-module="'.concat(n,'"]')).forEach(function(e){new g(e,n,i,o).init()})}({scope:e})}E(621),document.addEventListener("DOMContentLoaded",function(){var t,e;(new f).init(),t=document.querySelector("h1"),e=document.querySelector(".nhsuk-skip-link"),t&&e&&(e.addEventListener("click",function(e){e.preventDefault(),t.setAttribute("tabIndex","-1"),t.focus()}),t.addEventListener("blur",function(e){e.preventDefault(),t.removeAttribute("tabIndex")})),w(document)})})()})();
(()=>{var n={621:()=>{NodeList.prototype.forEach||(NodeList.prototype.forEach=Array.prototype.forEach),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{enumerable:!1,value:function(t){return 0<this.filter(function(e){return e===t}).length}}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t}while(null!==(t=t.parentElement||t.parentNode)&&1===t.nodeType);return null}),"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n})}},i={};function E(e){var t=i[e];return void 0!==t||(t=i[e]={exports:{}},n[e](t,t.exports,E)),t.exports}(()=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n){(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}function s(e){e=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=n(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e);return"symbol"==n(e)?e:e+""}var t=function(){for(var e,e=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");a(this,"KEY_SPACE",32),a(this,"DEBOUNCE_TIMEOUT_IN_SECONDS",1),this.$module=t,this.debounceFormSubmitTimer=null},t=e.prototype,n=[{key:"handleKeyDown",value:function(e){var t=e.target;"button"===t.getAttribute("role")&&e.keyCode===this.KEY_SPACE&&(e.preventDefault(),t.click())}},{key:"debounce",value:function(e){var t=this;if("true"===e.target.getAttribute("data-prevent-double-click"))return this.debounceFormSubmitTimer?(e.preventDefault(),!1):void(this.debounceFormSubmitTimer=setTimeout(function(){t.debounceFormSubmitTimer=null},1e3*this.DEBOUNCE_TIMEOUT_IN_SECONDS))}},{key:"init",value:function(){this.$module.addEventListener("keydown",this.handleKeyDown.bind(this)),this.$module.addEventListener("click",this.debounce.bind(this))}}],i=0;i<n.length;i++){var o=n[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,s(o.key),o)}return Object.defineProperty(e,"prototype",{writable:!1}),e}();function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){e=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=o(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e);return"symbol"==o(e)?e:e+""}(i.key),i)}}p=[{key:"getDataset",value:function(e){var t={},n=e.attributes;if(n)for(var i=0;i<n.length;i++){var o=n[i],a=o.name.match(/^data-(.+)/);a&&(t[a[1]]=o.value)}return t}}],e((y=r).prototype,[{key:"init",value:function(){var e,t,n,i;this.$textarea&&(e=this.$module,t=this.$textarea,n=document.getElementById("".concat(t.id,"-info")),t.insertAdjacentElement("afterend",n),(i=document.createElement("div")).className="nhsuk-character-count__sr-status nhsuk-u-visually-hidden",i.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=i,n.insertAdjacentElement("afterend",i),(i=document.createElement("div")).className=n.className,i.classList.add("nhsuk-character-count__status"),i.setAttribute("aria-hidden","true"),this.$visibleCountMessage=i,n.insertAdjacentElement("afterend",i),n.classList.add("nhsuk-u-visually-hidden"),this.options=r.getDataset(e),i=this.defaults.characterCountAttribute,this.options.maxwords&&(i=this.defaults.wordCountAttribute),this.maxLength=e.getAttribute(i),this.maxLength)&&(t.removeAttribute("maxlength"),this.bindChangeEvents(),"onpageshow"in window?window.addEventListener("pageshow",this.updateCountMessage.bind(this)):window.addEventListener("DOMContentLoaded",this.updateCountMessage.bind(this)),this.updateCountMessage())}},{key:"count",value:function(e){return(this.options.maxwords?e.match(/\S+/g)||[]:e).length}},{key:"bindChangeEvents",value:function(){var e=this.$textarea;e.addEventListener("keyup",this.handleKeyUp.bind(this)),e.addEventListener("focus",this.handleFocus.bind(this)),e.addEventListener("blur",this.handleBlur.bind(this))}},{key:"checkIfValueChanged",value:function(){this.$textarea.oldValue||(this.$textarea.oldValue=""),this.$textarea.value!==this.$textarea.oldValue&&(this.$textarea.oldValue=this.$textarea.value,this.updateCountMessage())}},{key:"updateCountMessage",value:function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}},{key:"updateVisibleCountMessage",value:function(){var e=this.$textarea,t=this.$visibleCountMessage,n=this.maxLength-this.count(e.value);this.isOverThreshold()?t.classList.remove("nhsuk-character-count__message--disabled"):t.classList.add("nhsuk-character-count__message--disabled"),n<0?(e.classList.add("nhsuk-textarea--error"),t.classList.remove("nhsuk-hint"),t.classList.add("nhsuk-error-message")):(e.classList.remove("nhsuk-textarea--error"),t.classList.remove("nhsuk-error-message"),t.classList.add("nhsuk-hint")),t.innerHTML=this.formattedUpdateMessage()}},{key:"updateScreenReaderCountMessage",value:function(){var e=this.$screenReaderCountMessage;this.isOverThreshold()?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",!0),e.innerHTML=this.formattedUpdateMessage()}},{key:"formattedUpdateMessage",value:function(){var e=this.$textarea,t=this.options,e=this.maxLength-this.count(e.value),n="character";return t.maxwords&&(n="word"),n+=-1==e||1==e?"":"s",t=e<0?"too many":"remaining",e=Math.abs(e),"You have ".concat(e," ").concat(n," ").concat(t)}},{key:"isOverThreshold",value:function(){var e=this.$textarea,t=this.options,e=this.count(e.value);return this.maxLength*(t.threshold||0)/100<=e}},{key:"handleKeyUp",value:function(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}},{key:"handleFocus",value:function(){var e=this;this.valueChecker=setInterval(function(){(!e.lastInputTimestamp||Date.now()-500>=e.lastInputTimestamp)&&e.checkIfValueChanged()},1e3)}},{key:"handleBlur",value:function(){clearInterval(this.valueChecker)}}]),e(y,p),Object.defineProperty(y,"prototype",{writable:!1});var i=y;function r(e){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function");this.$module=e,this.$textarea=e.querySelector(".nhsuk-js-character-count"),this.$visibleCountMessage=null,this.$screenReaderCountMessage=null,this.lastInputTimestamp=null}i.prototype.defaults={characterCountAttribute:"data-maxlength",wordCountAttribute:"data-maxwords"};function u(e,t){var n;e&&t&&(n="true"===e.getAttribute(t)?"false":"true",e.setAttribute(t,n))}function c(e){e.form.querySelectorAll('input[type="checkbox"]').forEach(function(e){return l(e,"nhsuk-checkboxes__conditional--hidden")})}var l=function(e,t){var n;e&&t&&(n=e.getAttribute("aria-controls"))&&(n=document.getElementById(n))&&(e.checked?(n.classList.remove(t),e.setAttribute("aria-expanded",!0)):(n.classList.add(t),e.setAttribute("aria-expanded",!1)))};function h(e){!function(e){if("A"===e.tagName&&!1!==e.href){var t,e=document.querySelector(e.hash);if(e)return(t=function(e){var t=e.closest("fieldset");if(t){t=t.getElementsByTagName("legend");if(t.length){t=t[0];if("checkbox"===e.type||"radio"===e.type)return t;var n=t.getBoundingClientRect().top,i=e.getBoundingClientRect();if(i.height&&window.innerHeight&&i.top+i.height-n<window.innerHeight/2)return t}}return document.querySelector("label[for='".concat(e.getAttribute("id"),"']"))||e.closest("label")}(e))&&(t.scrollIntoView(),e.focus({preventScroll:!0}),1)}}(e.target)||e.preventDefault()}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){e=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=d(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e);return"symbol"==d(e)?e:e+""}(i.key),i)}}b((p=function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.menuIsOpen=!1,this.navigation=document.querySelector(".nhsuk-navigation"),this.navigationList=document.querySelector(".nhsuk-header__navigation-list"),this.mobileMenu=document.createElement("ul"),this.mobileMenuToggleButton=document.querySelector(".nhsuk-header__menu-toggle"),this.mobileMenuCloseButton=document.createElement("button"),this.mobileMenuContainer=document.querySelector(".nhsuk-mobile-menu-container"),this.breakpoints=[],this.width=document.body.offsetWidth}).prototype,[{key:"init",value:function(){var e=this;this.navigation&&this.navigationList&&this.mobileMenuToggleButton&&this.mobileMenuContainer&&(this.setupMobileMenu(),this.calculateBreakpoints(),this.updateNavigation(),this.doOnOrientationChange(),this.handleResize=this.debounce(function(){e.calculateBreakpoints(),e.updateNavigation()}),this.mobileMenuToggleButton.addEventListener("click",this.toggleMobileMenu.bind(this)),window.addEventListener("resize",this.handleResize),window.addEventListener("orientationchange",this.doOnOrientationChange()))}},{key:"debounce",value:function(i){var o,a=this,s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];clearTimeout(o),o=setTimeout(function(){i.apply(a,t)},s)}}},{key:"calculateBreakpoints",value:function(){for(var e=window.getComputedStyle(this.navigationList).getPropertyValue("gap"),t=Number(e.replace("px","")),n=0,i=0;i<this.navigationList.children.length;i++)n+=this.navigationList.children[i].offsetWidth+t,this.breakpoints[i]=n}},{key:"setupMobileMenu",value:function(){this.mobileMenuContainer.appendChild(this.mobileMenu),this.mobileMenu.classList.add("nhsuk-header__drop-down","nhsuk-header__drop-down--hidden")}},{key:"closeMobileMenu",value:function(){this.menuIsOpen=!1,this.mobileMenu.classList.add("nhsuk-header__drop-down--hidden"),this.navigation.style.marginBottom=0,this.mobileMenuToggleButton.setAttribute("aria-expanded","false"),this.mobileMenuToggleButton.focus(),this.mobileMenuCloseButton.removeEventListener("click",this.closeMobileMenu.bind(this)),document.removeEventListener("keydown",this.handleEscapeKey.bind(this))}},{key:"handleEscapeKey",value:function(e){"Escape"===e.key&&this.closeMobileMenu()}},{key:"openMobileMenu",value:function(){this.menuIsOpen=!0,this.mobileMenu.classList.remove("nhsuk-header__drop-down--hidden");var e=this.mobileMenu.offsetHeight;this.navigation.style.marginBottom="".concat(e,"px"),this.mobileMenuToggleButton.setAttribute("aria-expanded","true"),document.addEventListener("keydown",this.handleEscapeKey.bind(this)),this.mobileMenuCloseButton.addEventListener("click",this.closeMobileMenu.bind(this))}},{key:"toggleMobileMenu",value:function(){this.menuIsOpen?this.closeMobileMenu():this.openMobileMenu()}},{key:"updateNavigation",value:function(){var e=this.navigationList.offsetWidth,t=this.navigationList.children.length;if(e<this.breakpoints[t-1]){if(this.mobileMenuToggleButton.classList.add("nhsuk-header__menu-toggle--visible"),this.mobileMenuContainer.classList.add("nhsuk-mobile-menu-container--visible"),2===t)return;for(;e<this.breakpoints[t-1];)this.mobileMenu.insertBefore(this.navigationList.children[t-2],this.mobileMenu.firstChild),--t}else if(e>this.breakpoints[t])for(;e>this.breakpoints[t];)this.navigationList.insertBefore(this.mobileMenu.removeChild(this.mobileMenu.firstChild),this.mobileMenuContainer),t+=1;this.mobileMenu.children.length||(this.mobileMenuToggleButton.classList.remove("nhsuk-header__menu-toggle--visible"),this.mobileMenuContainer.classList.remove("nhsuk-mobile-menu-container--visible")),document.body.offsetWidth!==this.width&&this.menuIsOpen&&this.closeMobileMenu()}},{key:"doOnOrientationChange",value:function(){var e=this;90===window.orientation&&setTimeout(function(){e.calculateBreakpoints(),e.updateNavigation()},200)}}]),Object.defineProperty(p,"prototype",{writable:!1});var f=p;function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){e=function(e){if("object"!=v(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=v(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e);return"symbol"==v(e)?e:e+""}(i.key),i)}}y=[{key:"getHref",value:function(e){e=e.getAttribute("href");return e.slice(e.indexOf("#"),e.length)}}],m((p=k).prototype,[{key:"init",value:function(){"function"==typeof window.matchMedia&&this.responsive?this.setupResponsiveChecks():this.setup()}},{key:"setupResponsiveChecks",value:function(){this.mql=window.matchMedia("(min-width: 641px)"),this.mql.addEventListener("change",this.checkMode.bind(this)),this.checkMode()}},{key:"checkMode",value:function(){this.mql.matches?this.setup():this.teardown()}},{key:"setup",value:function(){var t=this,e=this.$module,n=this.$tabs,i=e.querySelector(".".concat(this.namespace,"__list")),o=e.querySelectorAll(".".concat(this.namespace,"__list-item"));n&&i&&o&&(i.setAttribute("role","tablist"),o.forEach(function(e){e.setAttribute("role","presentation")}),n.forEach(function(e){t.setAttributes(e),e.boundTabClick=t.onTabClick.bind(t),e.boundTabKeydown=t.onTabKeydown.bind(t),e.addEventListener("click",e.boundTabClick,!0),e.addEventListener("keydown",e.boundTabKeydown,!0),t.hideTab(e)}),i=this.getTab(window.location.hash)||this.$tabs[0],this.showTab(i),this.historyEnabled)&&(e.boundOnHashChange=this.onHashChange.bind(this),window.addEventListener("hashchange",e.boundOnHashChange,!0))}},{key:"teardown",value:function(){var t=this,e=this.$module,n=this.$tabs,i=e.querySelector(".".concat(this.namespace,"__list")),o=e.querySelectorAll(".".concat(this.namespace,"__list-item"));n&&i&&o&&(i.removeAttribute("role"),o.forEach(function(e){e.removeAttribute("role","presentation")}),n.forEach(function(e){e.removeEventListener("click",e.boundTabClick,!0),e.removeEventListener("keydown",e.boundTabKeydown,!0),t.unsetAttributes(e)}),this.historyEnabled)&&window.removeEventListener("hashchange",e.boundOnHashChange,!0)}},{key:"onHashChange",value:function(){var e,t=window.location.hash,t=this.getTab(t);t&&(this.changingHash?this.changingHash=!1:(e=this.getCurrentTab(),this.hideTab(e),this.showTab(t),t.focus()))}},{key:"hideTab",value:function(e){this.unhighlightTab(e),this.hidePanel(e)}},{key:"showTab",value:function(e){this.highlightTab(e),this.showPanel(e)}},{key:"getTab",value:function(e){return this.$module.querySelector(".".concat(this.namespace,'__tab[href="').concat(e,'"]'))}},{key:"setAttributes",value:function(e){var t=k.getHref(e).slice(1),t=(e.setAttribute("id","tab_".concat(t)),e.setAttribute("role","tab"),e.setAttribute("aria-controls",t),e.setAttribute("aria-selected","false"),e.setAttribute("tabindex","-1"),this.getPanel(e));t.setAttribute("role","tabpanel"),t.setAttribute("aria-labelledby",e.id),t.classList.add(this.jsHiddenClass)}},{key:"unsetAttributes",value:function(e){e.removeAttribute("id"),e.removeAttribute("role"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-selected"),e.removeAttribute("tabindex");e=this.getPanel(e);e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.removeAttribute("tabindex"),e.classList.remove(this.jsHiddenClass)}},{key:"onTabClick",value:function(e){e.target.classList.contains("".concat(this.namespace,"__tab"))||(e.stopPropagation(),e.preventDefault()),e.preventDefault();var e=e.target,t=this.getCurrentTab();this.hideTab(t),this.showTab(e),this.createHistoryEntry(e)}},{key:"createHistoryEntry",value:function(e){var t,n;this.historyEnabled&&(n=(t=this.getPanel(e)).id,t.id="",this.changingHash=!0,window.location.hash=k.getHref(e).slice(1),t.id=n)}},{key:"onTabKeydown",value:function(e){switch(e.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),e.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),e.preventDefault()}}},{key:"activateNextTab",value:function(){var e,t=this.getCurrentTab(),n=t.parentNode.nextElementSibling;(e=n?n.querySelector(".".concat(this.namespace,"__tab")):e)&&(this.hideTab(t),this.showTab(e),e.focus(),this.createHistoryEntry(e))}},{key:"activatePreviousTab",value:function(){var e,t=this.getCurrentTab(),n=t.parentNode.previousElementSibling;(e=n?n.querySelector(".".concat(this.namespace,"__tab")):e)&&(this.hideTab(t),this.showTab(e),e.focus(),this.createHistoryEntry(e))}},{key:"getPanel",value:function(e){return this.$module.querySelector(k.getHref(e))}},{key:"showPanel",value:function(e){e=this.getPanel(e);e.classList.remove(this.jsHiddenClass),e.dispatchEvent(this.showEvent)}},{key:"hidePanel",value:function(e){e=this.getPanel(e);e.classList.add(this.jsHiddenClass),e.dispatchEvent(this.hideEvent)}},{key:"unhighlightTab",value:function(e){e.setAttribute("aria-selected","false"),e.parentNode.classList.remove("".concat(this.namespace,"__list-item--selected")),e.setAttribute("tabindex","-1")}},{key:"highlightTab",value:function(e){e.setAttribute("aria-selected","true"),e.parentNode.classList.add("".concat(this.namespace,"__list-item--selected")),e.setAttribute("tabindex","0")}},{key:"getCurrentTab",value:function(){return this.$module.querySelector(".".concat(this.namespace,"__list-item--selected .").concat(this.namespace,"__tab"))}}]),m(p,y),Object.defineProperty(p,"prototype",{writable:!1});var p,y,g=p;function k(e,t,n,i){if(!(this instanceof k))throw new TypeError("Cannot call a class as a function");this.$module=e,this.namespace=t,this.responsive=n,this.historyEnabled=i,this.$tabs=e.querySelectorAll(".".concat(this.namespace,"__tab")),this.keys={down:40,left:37,right:39,up:38},this.jsHiddenClass="".concat(this.namespace,"__panel--hidden"),this.showEvent=new CustomEvent("tab.show"),this.hideEvent=new CustomEvent("tab.hide")}function w(e){!function(e){e=(0<arguments.length&&void 0!==e?e:{}).scope;(void 0===e?document:e).querySelectorAll('[data-module="nhsuk-button"]').forEach(function(e){new t(e).init()})}({scope:e}),function(e){e=(0<arguments.length&&void 0!==e?e:{}).scope;(void 0===e?document:e).querySelectorAll('[data-module="nhsuk-character-count"]').forEach(function(e){new i(e).init()})}({scope:e}),function(e){function t(e){var t,n;l(e.target,"nhsuk-checkboxes__conditional--hidden"),e.target.checked&&(e.target.hasAttribute("data-checkbox-exclusive")?((t=e.target).form.querySelectorAll('input[type="checkbox"][data-checkbox-exclusive-group="'.concat(t.getAttribute("data-checkbox-exclusive-group"),'"]')).forEach(function(e){t.form===e.form&&e!==t&&(e.checked=!1)}),c(t)):((n=e.target).form.querySelectorAll('input[type="checkbox"][data-checkbox-exclusive][data-checkbox-exclusive-group="'.concat(n.getAttribute("data-checkbox-exclusive-group"),'"]')).forEach(function(e){n.form===e.form&&(e.checked=!1)}),c(n)))}var e=(0<arguments.length&&void 0!==e?e:{}).scope,n=(void 0===e?document:e).querySelectorAll(".nhsuk-checkboxes .nhsuk-checkboxes__input");"onpageshow"in window?window.addEventListener("pageshow",function(){return n.forEach(c)}):window.addEventListener("DOMContentLoaded",function(){return n.forEach(c)}),n.forEach(c),n.forEach(function(e){e.addEventListener("change",t)})}({scope:e}),function(e){var e=(0<arguments.length&&void 0!==e?e:{}).scope,a=void 0===e?document:e;"boolean"!=typeof document.createElement("details").open&&(e=a.querySelectorAll("details")).length&&e.forEach(function(e,t){var n,i,o;e.hasAttribute("nhsuk-polyfilled")||(t=t,(n=e).setAttribute("nhsuk-polyfilled","true"),n.id||n.setAttribute("id","nhsuk-details".concat(t)),(i=a.querySelector("#".concat(n.id," .nhsuk-details__text"))).id||i.setAttribute("id","nhsuk-details__text".concat(t)),(o=a.querySelector("#".concat(n.id," .nhsuk-details__summary"))).setAttribute("role","button"),o.setAttribute("aria-controls",i.id),o.setAttribute("tabIndex","0"),1==(null!==n.getAttribute("open"))?(o.setAttribute("aria-expanded","true"),i.setAttribute("aria-hidden","false")):(o.setAttribute("aria-expanded","false"),i.setAttribute("aria-hidden","true"),i.style.display="none"),o.addEventListener("click",function(){u(o,"aria-expanded"),u(i,"aria-hidden"),i.style.display="true"===i.getAttribute("aria-hidden")?"none":"",n.hasAttribute("open")?n.removeAttribute("open"):n.setAttribute("open","open")}),o.addEventListener("keydown",function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),o.click())}))})}({scope:e}),function(e){var e=0<arguments.length&&void 0!==e?e:{},t=e.focusOnPageLoad,t=void 0===t||t,e=e.scope,e=(void 0===e?document:e).querySelector(".nhsuk-error-summary");e&&(t&&e.focus(),e.addEventListener("click",h))}({scope:e}),function(e){function t(){n.forEach(function(e){return l(e,"nhsuk-radios__conditional--hidden")})}var e=(0<arguments.length&&void 0!==e?e:{}).scope,n=(void 0===e?document:e).querySelectorAll(".nhsuk-radios--conditional .nhsuk-radios__input");"onpageshow"in window?window.addEventListener("pageshow",t):window.addEventListener("DOMContentLoaded",t),t(),n.forEach(function(e){e.addEventListener("change",t)})}({scope:e}),function(e){var e=0<arguments.length&&void 0!==e?e:{},t=e.namespace,n=void 0===t?"nhsuk-tabs":t,t=e.responsive,i=void 0===t||t,t=e.historyEnabled,o=void 0===t||t,t=e.scope;(void 0===t?document:t).querySelectorAll('[data-module="'.concat(n,'"]')).forEach(function(e){new g(e,n,i,o).init()})}({scope:e})}E(621),document.addEventListener("DOMContentLoaded",function(){var t,e;(new f).init(),t=document.querySelector("h1"),e=document.querySelector(".nhsuk-skip-link"),t&&e&&(e.addEventListener("click",function(e){e.preventDefault(),t.setAttribute("tabIndex","-1"),t.focus()}),t.addEventListener("blur",function(e){e.preventDefault(),t.removeAttribute("tabIndex")})),w(document)})})()})();
{
"name": "nhsuk-frontend",
"version": "9.0.1",
"version": "9.1.0",
"description": "NHS.UK frontend contains the code you need to start building user interfaces for NHS websites and services.",

@@ -62,3 +62,3 @@ "engines": {

"nunjucks": "^3.2.4",
"prettier": "^3.3.2",
"prettier": "3.3.3",
"puppeteer": "^22.12.1",

@@ -65,0 +65,0 @@ "sass": "^1.77.6",

@@ -57,5 +57,10 @@ /**

calculateBreakpoints() {
// Get the width of the gap between each navigation item
const navigationListStyles = window.getComputedStyle(this.navigationList)
const gapPixels = navigationListStyles.getPropertyValue('gap')
const gap = Number(gapPixels.replace('px', ''))
let childrenWidth = 0
for (let i = 0; i < this.navigationList.children.length; i++) {
childrenWidth += this.navigationList.children[i].offsetWidth
childrenWidth += this.navigationList.children[i].offsetWidth + gap
this.breakpoints[i] = childrenWidth

@@ -76,3 +81,3 @@ }

*
* Remvoes the margin-bottom from the navigation
* Removes the margin-bottom from the navigation
*/

@@ -120,3 +125,3 @@ closeMobileMenu() {

// add event listerer for esc key to close menu
// add event listener for esc key to close menu
document.addEventListener('keydown', this.handleEscapeKey.bind(this))

@@ -151,3 +156,3 @@

*
* Additionaly will close the mobile menu if the window gets resized
* Additionally will close the mobile menu if the window gets resized
* and the menu is open.

@@ -157,3 +162,3 @@ */

updateNavigation() {
const availableSpace = this.navigation.offsetWidth
const availableSpace = this.navigationList.offsetWidth
let itemsVisible = this.navigationList.children.length

@@ -160,0 +165,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc