hmrc-frontend 5.26.0 → 5.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hmrc/VERSION.txt +1 -1
- package/hmrc/{accessible-autocomplete-5.26.0.css → accessible-autocomplete-5.28.0.css} +1 -1
- package/hmrc/all.js +4 -3
- package/hmrc/components/timeout-dialog/timeout-dialog.js +4 -3
- package/hmrc/{hmrc-frontend-5.26.0.min.css → hmrc-frontend-5.28.0.min.css} +1 -1
- package/hmrc/{hmrc-frontend-5.26.0.min.js → hmrc-frontend-5.28.0.min.js} +2 -2
- package/hmrc/{hmrc-frontend-ie8-5.26.0.min.css → hmrc-frontend-ie8-5.28.0.min.css} +1 -1
- package/hmrc/maps/{accessible-autocomplete-5.26.0.css.map → accessible-autocomplete-5.28.0.css.map} +1 -1
- package/hmrc/maps/{hmrc-frontend-5.26.0.min.css.map → hmrc-frontend-5.28.0.min.css.map} +1 -1
- package/hmrc/maps/hmrc-frontend-5.28.0.min.js.map +1 -0
- package/hmrc/maps/{hmrc-frontend-ie8-5.26.0.min.css.map → hmrc-frontend-ie8-5.28.0.min.css.map} +1 -1
- package/package.json +1 -1
- package/hmrc/maps/hmrc-frontend-5.26.0.min.js.map +0 -1
- /package/hmrc/{accessible-autocomplete-5.26.0.js → accessible-autocomplete-5.28.0.js} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=e((function(e,n){!function(e){function n(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e.call(window,t[n],n,t)}function o(){for(var t=function(t){var e={},n=function(t,o){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i],s=o?o+"."+i:i;"object"==typeof r?n(r,s):e[s]=r}};return n(t),e},e={},n=0;n<arguments.length;n++){var o=t(arguments[n]);for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e}function i(t,e){if(!t||"object"!=typeof t)throw new Error('Provide a `configObject` of type "object".');if(!e||"string"!=typeof e)throw new Error('Provide a `namespace` of type "string" to filter the `configObject` by.');var n={};for(var o in t){var i=o.split(".");Object.prototype.hasOwnProperty.call(t,o)&&i[0]===e&&(i.length>1&&i.shift(),n[i.join(".")]=t[o])}return n}function r(t){if("string"!=typeof t)return t;var e=t.trim();return"true"===e||"false"!==e&&(e.length>0&&isFinite(e)?Number(e):t)}function s(t){var e={};for(var n in t)e[n]=r(t[n]);return e}function a(t,e){this.translations=t||{},this.locale=e&&e.locale||document.documentElement.lang||"en"}(function(t){var e,n,o;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),o="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,i,r){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,i,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var s=String(i),a="value"in r||"writable"in r,c="get"in r&&typeof r.get,l="set"in r&&typeof r.set;if(c){if("function"!==c)throw new TypeError("Getter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineGetter__.call(t,s,r.get)}else t[s]=r.value;if(l){if("function"!==l)throw new TypeError("Setter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineSetter__.call(t,s,r.set)}return"value"in r&&(t[s]=r.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,o=Element.prototype=n.appendChild(n.createElement("*")),i={},r=function(t,e){var n,o,s,a=t.childNodes||[],c=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,i)o=i[n],t[n]=o;for(;s=e&&a[++c];)r(s,e);return t},s=document.getElementsByTagName("*"),a=document.createElement,c=100;o.attachEvent("onpropertychange",(function(t){for(var e,n=t.propertyName,r=!i.hasOwnProperty(n),a=o[n],c=i[n],l=-1;e=s[++l];)1===e.nodeType&&(r||e[n]===c)&&(e[n]=a);i[n]=a})),o.constructor=Element,o.hasAttribute||(o.hasAttribute=function(t){return null!==this.getAttribute(t)}),l()||(document.onreadystatechange=l,t=setInterval(l,25)),document.createElement=function(t){var e=a(String(t).toLowerCase());return r(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function l(){return c--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState)||(r(document,!0),t&&document.body.prototype&&clearTimeout(t),!document.body.prototype))}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){(function(){if(!document.documentElement.dataset)return!1;var t=document.createElement("div");return t.setAttribute("data-a-b","c"),t.dataset&&"c"==t.dataset.aB})()||Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=this.attributes,e={},n=0;n<t.length;n++){var o=t[n];if(o&&o.name&&/^data-\w[.\w-]*$/.test(o.name)){var i=o.name,r=o.value,s=i.substr(5).replace(/-./g,(function(t){return t.charAt(1).toUpperCase()}));"__defineGetter__"in Object.prototype&&"__defineSetter__"in Object.prototype?Object.defineProperty(e,s,{enumerable:!0,get:function(){return this.value}.bind({value:r||""}),set:function(t,e){void 0!==e?this.setAttribute(t,e):this.removeAttribute(t)}.bind(this,i)}):e[s]=r}}return e}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"trim"in String.prototype||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),a.prototype.t=function(t,e){if(!t)throw new Error("i18n: lookup key missing");if(e&&"undefined"!=typeof e.count&&(t=t+"."+this.getPluralSuffix(t,e.count)),t in this.translations){var n=this.translations[t];if(n.match(/%{(.\S+)}/)){if(!e)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(n,e)}return n}return t},a.prototype.replacePlaceholders=function(t,e){var n;return this.hasIntlNumberFormatSupport()&&(n=new Intl.NumberFormat(this.locale)),t.replace(/%{(.\S+)}/g,(function(t,o){if(Object.prototype.hasOwnProperty.call(e,o)){var i=e[o];return!1===i?"":"number"==typeof i&&n?n.format(i):i}throw new Error("i18n: no data found to replace "+t+" placeholder in string")}))},a.prototype.hasIntlPluralRulesSupport=function(){return Boolean(window.Intl&&"PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)},a.prototype.hasIntlNumberFormatSupport=function(){return Boolean(window.Intl&&"NumberFormat"in window.Intl&&Intl.NumberFormat.supportedLocalesOf(this.locale).length)},a.prototype.getPluralSuffix=function(t,e){if(e=Number(e),!isFinite(e))return"other";var n;if(t+"."+(n=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(e):this.selectPluralFormUsingFallbackRules(e))in this.translations)return n;if(t+".other"in this.translations)return console&&"warn"in console&&console.warn('i18n: Missing plural form ".'+n+'" for "'+this.locale+'" locale. Falling back to ".other".'),"other";throw new Error('i18n: Plural form ".other" is required for "'+this.locale+'" locale')},a.prototype.selectPluralFormUsingFallbackRules=function(t){t=Math.abs(Math.floor(t));var e=this.getPluralRulesForLocale();return e?a.pluralRules[e](t):"other"},a.prototype.getPluralRulesForLocale=function(){var t=this.locale,e=t.split("-")[0];for(var n in a.pluralRulesMap)if(Object.prototype.hasOwnProperty.call(a.pluralRulesMap,n))for(var o=a.pluralRulesMap[n],i=0;i<o.length;i++)if(o[i]===t||o[i]===e)return n},a.pluralRulesMap={arabic:["ar"],chinese:["my","zh","id","ja","jv","ko","ms","th","vi"],french:["hy","bn","fr","gu","hi","fa","pa","zu"],german:["af","sq","az","eu","bg","ca","da","nl","en","et","fi","ka","de","el","hu","lb","no","so","sw","sv","ta","te","tr","ur"],irish:["ga"],russian:["ru","uk"],scottish:["gd"],spanish:["pt-PT","it","es"],welsh:["cy"]},a.pluralRules={arabic:function(t){return 0===t?"zero":1===t?"one":2===t?"two":t%100>=3&&t%100<=10?"few":t%100>=11&&t%100<=99?"many":"other"},chinese:function(){return"other"},french:function(t){return 0===t||1===t?"one":"other"},german:function(t){return 1===t?"one":"other"},irish:function(t){return 1===t?"one":2===t?"two":t>=3&&t<=6?"few":t>=7&&t<=10?"many":"other"},russian:function(t){var e=t%100,n=e%10;return 1===n&&11!==e?"one":n>=2&&n<=4&&!(e>=12&&e<=14)?"few":0===n||n>=5&&n<=9||e>=11&&e<=14?"many":"other"},scottish:function(t){return 1===t||11===t?"one":2===t||12===t?"two":t>=3&&t<=10||t>=13&&t<=19?"few":"other"},spanish:function(t){return 1===t?"one":t%1e6==0&&0!==t?"many":"other"},welsh:function(t){return 0===t?"zero":1===t?"one":2===t?"two":3===t?"few":6===t?"many":"other"}},function(t){var e;"DOMTokenList"in this&&(!("classList"in(e=document.createElement("x")))||!e.classList.toggle("x",!1)&&!e.className)||function(e){var n;"DOMTokenList"in e&&e.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(e.DOMTokenList=function(){var e=!0,o=function(t,n,o,i){Object.defineProperty?Object.defineProperty(t,n,{configurable:!1===e||!!i,get:o}):t.__defineGetter__(n,o)};try{o({},"support")}catch(n){e=!1}return function(e,n){var i=this,r=[],s={},a=0,c=0,l=function(t){o(i,t,(function(){return d(),r[t]}),!1)},u=function(){if(a>=c)for(;c<a;++c)l(c)},d=function(){var t,o,i=arguments,c=/\s+/;if(i.length)for(o=0;o<i.length;++o)if(c.test(i[o]))throw(t=new SyntaxError('String "'+i[o]+'" contains an invalid character')).code=5,t.name="InvalidCharacterError",t;for(""===(r="object"==typeof e[n]?(""+e[n].baseVal).replace(/^\s+|\s+$/g,"").split(c):(""+e[n]).replace(/^\s+|\s+$/g,"").split(c))[0]&&(r=[]),s={},o=0;o<r.length;++o)s[r[o]]=!0;a=r.length,u()};return d(),o(i,"length",(function(){return d(),a})),i.toLocaleString=i.toString=function(){return d(),r.join(" ")},i.item=function(t){return d(),r[t]},i.contains=function(t){return d(),!!s[t]},i.add=function(){d.apply(i,t=arguments);for(var t,o,c=0,l=t.length;c<l;++c)o=t[c],s[o]||(r.push(o),s[o]=!0);a!==r.length&&(a=r.length>>>0,"object"==typeof e[n]?e[n].baseVal=r.join(" "):e[n]=r.join(" "),u())},i.remove=function(){d.apply(i,t=arguments);for(var t,o={},c=0,l=[];c<t.length;++c)o[t[c]]=!0,delete s[t[c]];for(c=0;c<r.length;++c)o[r[c]]||l.push(r[c]);r=l,a=l.length>>>0,"object"==typeof e[n]?e[n].baseVal=r.join(" "):e[n]=r.join(" "),u()},i.toggle=function(e,n){return d.apply(i,[e]),t!==n?n?(i.add(e),!0):(i.remove(e),!1):s[e]?(i.remove(e),!1):(i.add(e),!0)},i}}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(e){var n=arguments[1];if(n===t){var o=!this.contains(e);return this[o?"add":"remove"](e),o}return this[(n=!!n)?"add":"remove"](e),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var e=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,n=arguments.length,o=0;o<n;o++)e.call(this,t[o])}}}(),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a"),t.classList.add("b"),t.classList.remove("a","b"),t.classList.contains("b"))){var e=t.classList.constructor.prototype.remove;t.classList.constructor.prototype.remove=function(){for(var t=arguments,n=arguments.length,o=0;o<n;o++)e.call(this,t[o])}}}()}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){var e;"document"in this&&"classList"in document.documentElement&&"Element"in this&&"classList"in Element.prototype&&((e=document.createElement("span")).classList.add("a","b"),e.classList.contains("b"))||function(t){var n=!0,o=function(t,e,o,i){Object.defineProperty?Object.defineProperty(t,e,{configurable:!1===n||!!i,get:o}):t.__defineGetter__(e,o)};try{o({},"support")}catch(e){n=!1}var i=function(t,e,r){o(t.prototype,e,(function(){var t,s="__defineGetter__DEFINE_PROPERTY"+e;if(this[s])return t;if(this[s]=!0,!1===n){for(var a,c=i.mirror||document.createElement("div"),l=c.childNodes,u=l.length,d=0;d<u;++d)if(l[d]._R===this){a=l[d];break}a||(a=c.appendChild(document.createElement("div"))),t=DOMTokenList.call(a,this,r)}else t=new DOMTokenList(this,r);return o(this,e,(function(){return t})),delete this[s],t}),!0)};i(t.Element,"classList","className"),i(t.HTMLElement,"classList","className"),i(t.HTMLLinkElement,"relList","rel"),i(t.HTMLAnchorElement,"relList","rel"),i(t.HTMLAreaElement,"relList","rel")}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"document"in this&&"matches"in document.documentElement||(Element.prototype.matches=Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),n=0;e[n]&&e[n]!==this;)++n;return!!e[n]})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"document"in this&&"closest"in document.documentElement||(Element.prototype.closest=function(t){for(var e=this;e;){if(e.matches(t))return e;e="SVGElement"in window&&e instanceof SVGElement?e.parentNode:e.parentElement}return null})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"Window"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&function(t){t.constructor?t.Window=t.constructor:(t.Window=t.constructor=new Function("return function Window() {}")()).prototype=this}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){(function(t){if(!("Event"in t))return!1;if("function"==typeof t.Event)return!0;try{return new Event("click"),!0}catch(e){return!1}})(this)||function(){var e={click:1,dblclick:1,keyup:1,keypress:1,keydown:1,mousedown:1,mouseup:1,mousemove:1,mouseover:1,mouseenter:1,mouseleave:1,mouseout:1,storage:1,storagecommit:1,textinput:1};if("undefined"!=typeof document&&"undefined"!=typeof window){var n=window.Event&&window.Event.prototype||null;window.Event=Window.prototype.Event=function(e,n){if(!e)throw new Error("Not enough arguments");var o;if("createEvent"in document){o=document.createEvent("Event");var i=!(!n||n.bubbles===t)&&n.bubbles,r=!(!n||n.cancelable===t)&&n.cancelable;return o.initEvent(e,i,r),o}return(o=document.createEventObject()).type=e,o.bubbles=!(!n||n.bubbles===t)&&n.bubbles,o.cancelable=!(!n||n.cancelable===t)&&n.cancelable,o},n&&Object.defineProperty(window.Event,"prototype",{configurable:!1,enumerable:!1,writable:!0,value:n}),"createEvent"in document||(window.addEventListener=Window.prototype.addEventListener=Document.prototype.addEventListener=Element.prototype.addEventListener=function(){var t=this,n=arguments[0],i=arguments[1];if(t===window&&n in e)throw new Error("In IE8 the event: "+n+" is not available on the window object. Please see https://github.com/Financial-Times/polyfill-service/issues/317 for more information.");t._events||(t._events={}),t._events[n]||(t._events[n]=function(e){var n,i=t._events[e.type].list,r=i.slice(),s=-1,a=r.length;for(e.preventDefault=function(){!1!==e.cancelable&&(e.returnValue=!1)},e.stopPropagation=function(){e.cancelBubble=!0},e.stopImmediatePropagation=function(){e.cancelBubble=!0,e.cancelImmediate=!0},e.currentTarget=t,e.relatedTarget=e.fromElement||null,e.target=e.target||e.srcElement||t,e.timeStamp=(new Date).getTime(),e.clientX&&(e.pageX=e.clientX+document.documentElement.scrollLeft,e.pageY=e.clientY+document.documentElement.scrollTop);++s<a&&!e.cancelImmediate;)s in r&&-1!==o(i,n=r[s])&&"function"==typeof n&&n.call(t,e)},t._events[n].list=[],t.attachEvent&&t.attachEvent("on"+n,t._events[n])),t._events[n].list.push(i)},window.removeEventListener=Window.prototype.removeEventListener=Document.prototype.removeEventListener=Element.prototype.removeEventListener=function(){var t,e=this,n=arguments[0],i=arguments[1];e._events&&e._events[n]&&e._events[n].list&&-1!==(t=o(e._events[n].list,i))&&(e._events[n].list.splice(t,1),e._events[n].list.length||(e.detachEvent&&e.detachEvent("on"+n,e._events[n]),delete e._events[n]))},window.dispatchEvent=Window.prototype.dispatchEvent=Document.prototype.dispatchEvent=Element.prototype.dispatchEvent=function(t){if(!arguments.length)throw new Error("Not enough arguments");if(!t||"string"!=typeof t.type)throw new Error("DOM Events Exception 0");var e=this,n=t.type;try{if(!t.bubbles){t.cancelBubble=!0;var o=function(t){t.cancelBubble=!0,(e||window).detachEvent("on"+n,o)};this.attachEvent("on"+n,o)}this.fireEvent("on"+n,t)}catch(i){t.target=e;do{t.currentTarget=e,"_events"in e&&"function"==typeof e._events[n]&&e._events[n].call(e,t),"function"==typeof e["on"+n]&&e["on"+n].call(e,t),e=9===e.nodeType?e.parentWindow:e.parentNode}while(e&&!t.cancelBubble)}return!0},document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0}))})))}function o(t,e){for(var n=-1,o=t.length;++n<o;)if(n in t&&t[n]===e)return n;return-1}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"bind"in Function.prototype||Object.defineProperty(Function.prototype,"bind",{value:function(t){var e,n=Array,o=Object,i=o.prototype,r=n.prototype,s=function(){},a=i.toString,c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,l=Function.prototype.toString,u=function(t){try{return l.call(t),!0}catch(e){return!1}},d="[object Function]",h="[object GeneratorFunction]";e=function(t){if("function"!=typeof t)return!1;if(c)return u(t);var e=a.call(t);return e===d||e===h};var p=r.slice,f=r.concat,m=r.push,b=Math.max,y=this;if(!e(y))throw new TypeError("Function.prototype.bind called on incompatible "+y);for(var v,g=p.call(arguments,1),w=function(){if(this instanceof v){var e=y.apply(this,f.call(g,p.call(arguments)));return o(e)===e?e:this}return y.apply(t,f.call(g,p.call(arguments)))},E=b(0,y.length-g.length),k=[],S=0;S<E;S++)m.call(k,"$"+S);return v=Function("binder","return function ("+k.join(",")+"){ return binder.apply(this, arguments); }")(w),y.prototype&&(s.prototype=y.prototype,v.prototype=new s,s.prototype=null),v}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{});var c={hideAllSections:"Hide all sections",hideSection:"Hide",hideSectionAriaLabel:"Hide this section",showAllSections:"Show all sections",showSection:"Show",showSectionAriaLabel:"Show this section"};function l(t,e){this.$module=t;var n={i18n:c};this.config=o(n,e||{},s(t.dataset)),this.i18n=new a(i(this.config,"i18n")),this.controlsClass="govuk-accordion__controls",this.showAllClass="govuk-accordion__show-all",this.showAllTextClass="govuk-accordion__show-all-text",this.sectionClass="govuk-accordion__section",this.sectionExpandedClass="govuk-accordion__section--expanded",this.sectionButtonClass="govuk-accordion__section-button",this.sectionHeaderClass="govuk-accordion__section-header",this.sectionHeadingClass="govuk-accordion__section-heading",this.sectionHeadingDividerClass="govuk-accordion__section-heading-divider",this.sectionHeadingTextClass="govuk-accordion__section-heading-text",this.sectionHeadingTextFocusClass="govuk-accordion__section-heading-text-focus",this.sectionShowHideToggleClass="govuk-accordion__section-toggle",this.sectionShowHideToggleFocusClass="govuk-accordion__section-toggle-focus",this.sectionShowHideTextClass="govuk-accordion__section-toggle-text",this.upChevronIconClass="govuk-accordion-nav__chevron",this.downChevronIconClass="govuk-accordion-nav__chevron--down",this.sectionSummaryClass="govuk-accordion__section-summary",this.sectionSummaryFocusClass="govuk-accordion__section-summary-focus",this.sectionContentClass="govuk-accordion__section-content",this.$sections=this.$module.querySelectorAll("."+this.sectionClass),this.browserSupportsSessionStorage=u.checkForSessionStorage()}l.prototype.init=function(){if(this.$module){this.initControls(),this.initSectionHeaders();var t=this.checkIfAllSectionsOpen();this.updateShowAllButton(t)}},l.prototype.initControls=function(){this.$showAllButton=document.createElement("button"),this.$showAllButton.setAttribute("type","button"),this.$showAllButton.setAttribute("class",this.showAllClass),this.$showAllButton.setAttribute("aria-expanded","false"),this.$showAllIcon=document.createElement("span"),this.$showAllIcon.classList.add(this.upChevronIconClass),this.$showAllButton.appendChild(this.$showAllIcon);var t=document.createElement("div");t.setAttribute("class",this.controlsClass),t.appendChild(this.$showAllButton),this.$module.insertBefore(t,this.$module.firstChild),this.$showAllText=document.createElement("span"),this.$showAllText.classList.add(this.showAllTextClass),this.$showAllButton.appendChild(this.$showAllText),this.$showAllButton.addEventListener("click",this.onShowOrHideAllToggle.bind(this)),"onbeforematch"in document&&document.addEventListener("beforematch",this.onBeforeMatch.bind(this))},l.prototype.initSectionHeaders=function(){n(this.$sections,function(t,e){var n=t.querySelector("."+this.sectionHeaderClass);this.constructHeaderMarkup(n,e),this.setExpanded(this.isExpanded(t),t),n.addEventListener("click",this.onSectionToggle.bind(this,t)),this.setInitialState(t)}.bind(this))},l.prototype.constructHeaderMarkup=function(t,e){var n=t.querySelector("."+this.sectionButtonClass),o=t.querySelector("."+this.sectionHeadingClass),i=t.querySelector("."+this.sectionSummaryClass),r=document.createElement("button");r.setAttribute("type","button"),r.setAttribute("aria-controls",this.$module.id+"-content-"+(e+1));for(var s=0;s<n.attributes.length;s++){var a=n.attributes.item(s);"id"!==a.nodeName&&r.setAttribute(a.nodeName,a.nodeValue)}var c=document.createElement("span");c.classList.add(this.sectionHeadingTextClass),c.id=n.id;var l=document.createElement("span");l.classList.add(this.sectionHeadingTextFocusClass),c.appendChild(l),l.innerHTML=n.innerHTML;var u=document.createElement("span");u.classList.add(this.sectionShowHideToggleClass),u.setAttribute("data-nosnippet","");var d=document.createElement("span");d.classList.add(this.sectionShowHideToggleFocusClass),u.appendChild(d);var h=document.createElement("span"),p=document.createElement("span");if(p.classList.add(this.upChevronIconClass),d.appendChild(p),h.classList.add(this.sectionShowHideTextClass),d.appendChild(h),r.appendChild(c),r.appendChild(this.getButtonPunctuationEl()),null!=i){var f=document.createElement("span"),m=document.createElement("span");m.classList.add(this.sectionSummaryFocusClass),f.appendChild(m);for(var b=0,y=i.attributes.length;b<y;++b){var v=i.attributes.item(b).nodeName,g=i.attributes.item(b).nodeValue;f.setAttribute(v,g)}m.innerHTML=i.innerHTML,i.parentNode.replaceChild(f,i),r.appendChild(f),r.appendChild(this.getButtonPunctuationEl())}r.appendChild(u),o.removeChild(n),o.appendChild(r)},l.prototype.onBeforeMatch=function(t){var e=t.target.closest("."+this.sectionClass);e&&this.setExpanded(!0,e)},l.prototype.onSectionToggle=function(t){var e=this.isExpanded(t);this.setExpanded(!e,t),this.storeState(t)},l.prototype.onShowOrHideAllToggle=function(){var t=this,e=this.$sections,o=!this.checkIfAllSectionsOpen();n(e,(function(e){t.setExpanded(o,e),t.storeState(e)})),t.updateShowAllButton(o)},l.prototype.setExpanded=function(t,e){var n=e.querySelector("."+this.upChevronIconClass),o=e.querySelector("."+this.sectionShowHideTextClass),i=e.querySelector("."+this.sectionButtonClass),r=e.querySelector("."+this.sectionContentClass),s=t?this.i18n.t("hideSection"):this.i18n.t("showSection");o.innerText=s,i.setAttribute("aria-expanded",t);var a=[],c=e.querySelector("."+this.sectionHeadingTextClass);c&&a.push(c.innerText.trim());var l=e.querySelector("."+this.sectionSummaryClass);l&&a.push(l.innerText.trim());var u=t?this.i18n.t("hideSectionAriaLabel"):this.i18n.t("showSectionAriaLabel");a.push(u),i.setAttribute("aria-label",a.join(" , ")),t?(r.removeAttribute("hidden"),e.classList.add(this.sectionExpandedClass),n.classList.remove(this.downChevronIconClass)):(r.setAttribute("hidden","until-found"),e.classList.remove(this.sectionExpandedClass),n.classList.add(this.downChevronIconClass));var d=this.checkIfAllSectionsOpen();this.updateShowAllButton(d)},l.prototype.isExpanded=function(t){return t.classList.contains(this.sectionExpandedClass)},l.prototype.checkIfAllSectionsOpen=function(){return this.$sections.length===this.$module.querySelectorAll("."+this.sectionExpandedClass).length},l.prototype.updateShowAllButton=function(t){var e=t?this.i18n.t("hideAllSections"):this.i18n.t("showAllSections");this.$showAllButton.setAttribute("aria-expanded",t),this.$showAllText.innerText=e,t?this.$showAllIcon.classList.remove(this.downChevronIconClass):this.$showAllIcon.classList.add(this.downChevronIconClass)};var u={checkForSessionStorage:function(){var t,e="this is the test string";try{return window.sessionStorage.setItem(e,e),t=window.sessionStorage.getItem(e)===e.toString(),window.sessionStorage.removeItem(e),t}catch(n){return!1}}};function d(t,e){if(!t)return this;this.$module=t,this.debounceFormSubmitTimer=null,this.config=o({preventDoubleClick:!1},e||{},s(t.dataset))}function h(t,e){var n=t.closest("["+e+"]");if(n)return n.getAttribute(e)}l.prototype.storeState=function(t){if(this.browserSupportsSessionStorage){var e=t.querySelector("."+this.sectionButtonClass);if(e){var n=e.getAttribute("aria-controls"),o=e.getAttribute("aria-expanded");n&&o&&window.sessionStorage.setItem(n,o)}}},l.prototype.setInitialState=function(t){if(this.browserSupportsSessionStorage){var e=t.querySelector("."+this.sectionButtonClass);if(e){var n=e.getAttribute("aria-controls"),o=n?window.sessionStorage.getItem(n):null;null!==o&&this.setExpanded("true"===o,t)}}},l.prototype.getButtonPunctuationEl=function(){var t=document.createElement("span");return t.classList.add("govuk-visually-hidden",this.sectionHeadingDividerClass),t.innerHTML=", ",t},d.prototype.init=function(){this.$module&&(this.$module.addEventListener("keydown",this.handleKeyDown),this.$module.addEventListener("click",this.debounce.bind(this)))},d.prototype.handleKeyDown=function(t){var e=t.target;"button"===e.getAttribute("role")&&32===t.keyCode&&(t.preventDefault(),e.click())},d.prototype.debounce=function(t){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(t.preventDefault(),!1):void(this.debounceFormSubmitTimer=setTimeout(function(){this.debounceFormSubmitTimer=null}.bind(this),1e3))},function(t){"Date"in self&&"now"in self.Date&&"getTime"in self.Date.prototype||(Date.now=function(){return(new Date).getTime()})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{});var p={charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}};function f(t,e){if(!t)return this;var n={threshold:0,i18n:p},r=s(t.dataset),c={};if(("maxwords"in r||"maxlength"in r)&&(c={maxlength:!1,maxwords:!1}),this.config=o(n,e||{},c,r),this.i18n=new a(i(this.config,"i18n"),{locale:h(t,"lang")}),this.config.maxwords)this.maxLength=this.config.maxwords;else{if(!this.config.maxlength)return;this.maxLength=this.config.maxlength}this.$module=t,this.$textarea=t.querySelector(".govuk-js-character-count"),this.$visibleCountMessage=null,this.$screenReaderCountMessage=null,this.lastInputTimestamp=null}function m(t){this.$module=t,this.$inputs=t.querySelectorAll('input[type="checkbox"]')}function b(t){this.$module=t}function y(t,e){if(!t)return this;this.$module=t,this.config=o({disableAutoFocus:!1},e||{},s(t.dataset))}function v(t){this.$module=t,this.$menuButton=t&&t.querySelector(".govuk-js-header-toggle"),this.$menu=this.$menuButton&&t.querySelector("#"+this.$menuButton.getAttribute("aria-controls")),this.menuIsOpen=!1,this.mql=null}function g(t,e){this.$module=t,this.config=o({disableAutoFocus:!1},e||{},s(t.dataset))}function w(t){this.$module=t,this.$inputs=t.querySelectorAll('input[type="radio"]')}function E(t){this.$module=t,this.$linkedElement=null,this.linkedElementListener=!1}function k(t){this.$module=t,this.$tabs=t.querySelectorAll(".govuk-tabs__tab"),this.keys={left:37,right:39,up:38,down:40},this.jsHiddenClass="govuk-tabs__panel--hidden"}f.prototype.init=function(){if(this.$textarea){var t=this.$textarea,e=document.getElementById(t.id+"-info");e.innerText.match(/^\s*$/)&&(e.innerText=this.i18n.t("textareaDescription",{count:this.maxLength})),t.insertAdjacentElement("afterend",e);var n=document.createElement("div");n.className="govuk-character-count__sr-status govuk-visually-hidden",n.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=n,e.insertAdjacentElement("afterend",n);var o=document.createElement("div");o.className=e.className,o.classList.add("govuk-character-count__status"),o.setAttribute("aria-hidden","true"),this.$visibleCountMessage=o,e.insertAdjacentElement("afterend",o),e.classList.add("govuk-visually-hidden"),t.removeAttribute("maxlength"),this.bindChangeEvents(),"onpageshow"in window?window.addEventListener("pageshow",this.updateCountMessage.bind(this)):window.addEventListener("DOMContentLoaded",this.updateCountMessage.bind(this)),this.updateCountMessage()}},f.prototype.bindChangeEvents=function(){var t=this.$textarea;t.addEventListener("keyup",this.handleKeyUp.bind(this)),t.addEventListener("focus",this.handleFocus.bind(this)),t.addEventListener("blur",this.handleBlur.bind(this))},f.prototype.handleKeyUp=function(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()},f.prototype.handleFocus=function(){this.valueChecker=setInterval(function(){(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}.bind(this),1e3)},f.prototype.handleBlur=function(){clearInterval(this.valueChecker)},f.prototype.updateIfValueChanged=function(){this.$textarea.oldValue||(this.$textarea.oldValue=""),this.$textarea.value!==this.$textarea.oldValue&&(this.$textarea.oldValue=this.$textarea.value,this.updateCountMessage())},f.prototype.updateCountMessage=function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()},f.prototype.updateVisibleCountMessage=function(){var t=this.$textarea,e=this.$visibleCountMessage,n=this.maxLength-this.count(t.value);this.isOverThreshold()?e.classList.remove("govuk-character-count__message--disabled"):e.classList.add("govuk-character-count__message--disabled"),n<0?(t.classList.add("govuk-textarea--error"),e.classList.remove("govuk-hint"),e.classList.add("govuk-error-message")):(t.classList.remove("govuk-textarea--error"),e.classList.remove("govuk-error-message"),e.classList.add("govuk-hint")),e.innerText=this.getCountMessage()},f.prototype.updateScreenReaderCountMessage=function(){var t=this.$screenReaderCountMessage;this.isOverThreshold()?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",!0),t.innerText=this.getCountMessage()},f.prototype.count=function(t){return this.config.maxwords?(t.match(/\S+/g)||[]).length:t.length},f.prototype.getCountMessage=function(){var t=this.maxLength-this.count(this.$textarea.value),e=this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)},f.prototype.formatCountMessage=function(t,e){if(0===t)return this.i18n.t(e+"AtLimit");var n=t<0?"OverLimit":"UnderLimit";return this.i18n.t(e+n,{count:Math.abs(t)})},f.prototype.isOverThreshold=function(){if(!this.config.threshold)return!0;var t=this.$textarea,e=this.count(t.value);return this.maxLength*this.config.threshold/100<=e},m.prototype.init=function(){var t=this.$module;n(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),"onpageshow"in window?window.addEventListener("pageshow",this.syncAllConditionalReveals.bind(this)):window.addEventListener("DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),t.addEventListener("click",this.handleClick.bind(this))},m.prototype.syncAllConditionalReveals=function(){n(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},m.prototype.syncConditionalRevealWithInputState=function(t){var e=document.getElementById(t.getAttribute("aria-controls"));if(e&&e.classList.contains("govuk-checkboxes__conditional")){var n=t.checked;t.setAttribute("aria-expanded",n),e.classList.toggle("govuk-checkboxes__conditional--hidden",!n)}},m.prototype.unCheckAllInputsExcept=function(t){n(document.querySelectorAll('input[type="checkbox"][name="'+t.name+'"]'),function(e){t.form===e.form&&e!==t&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}.bind(this))},m.prototype.unCheckExclusiveInputs=function(t){n(document.querySelectorAll('input[data-behaviour="exclusive"][type="checkbox"][name="'+t.name+'"]'),function(e){t.form===e.form&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}.bind(this))},m.prototype.handleClick=function(t){var e=t.target;"checkbox"===e.type&&(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),e.checked&&("exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)))},b.prototype.init=function(){this.$module&&("boolean"==typeof this.$module.open||this.polyfillDetails())},b.prototype.polyfillDetails=function(){var t,e=this.$module,n=this.$summary=e.getElementsByTagName("summary").item(0),o=this.$content=e.getElementsByTagName("div").item(0);n&&o&&(o.id||(o.id="details-content-"+(t=(new Date).getTime(),"undefined"!=typeof window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})))),e.setAttribute("role","group"),n.setAttribute("role","button"),n.setAttribute("aria-controls",o.id),n.tabIndex=0,this.$module.hasAttribute("open")?n.setAttribute("aria-expanded","true"):(n.setAttribute("aria-expanded","false"),o.style.display="none"),this.polyfillHandleInputs(this.polyfillSetAttributes.bind(this)))},b.prototype.polyfillSetAttributes=function(){return this.$module.hasAttribute("open")?(this.$module.removeAttribute("open"),this.$summary.setAttribute("aria-expanded","false"),this.$content.style.display="none"):(this.$module.setAttribute("open","open"),this.$summary.setAttribute("aria-expanded","true"),this.$content.style.display=""),!0},b.prototype.polyfillHandleInputs=function(t){this.$summary.addEventListener("keypress",(function(e){var n=e.target;13!==e.keyCode&&32!==e.keyCode||"summary"===n.nodeName.toLowerCase()&&(e.preventDefault(),n.click?n.click():t(e))})),this.$summary.addEventListener("keyup",(function(t){var e=t.target;32===t.keyCode&&"summary"===e.nodeName.toLowerCase()&&t.preventDefault()})),this.$summary.addEventListener("click",t)},y.prototype.init=function(){var t=this.$module;t&&(this.setFocus(),t.addEventListener("click",this.handleClick.bind(this)))},y.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")})),t.focus())},y.prototype.handleClick=function(t){var e=t.target;this.focusTarget(e)&&t.preventDefault()},y.prototype.focusTarget=function(t){if("A"!==t.tagName||!1===t.href)return!1;var e=this.getFragmentFromUrl(t.href),n=document.getElementById(e);if(!n)return!1;var o=this.getAssociatedLegendOrLabel(n);return!!o&&(o.scrollIntoView(),n.focus({preventScroll:!0}),!0)},y.prototype.getFragmentFromUrl=function(t){return-1!==t.indexOf("#")&&t.split("#").pop()},y.prototype.getAssociatedLegendOrLabel=function(t){var e=t.closest("fieldset");if(e){var n=e.getElementsByTagName("legend");if(n.length){var o=n[0];if("checkbox"===t.type||"radio"===t.type)return o;var i=o.getBoundingClientRect().top,r=t.getBoundingClientRect();if(r.height&&window.innerHeight&&r.top+r.height-i<window.innerHeight/2)return o}}return document.querySelector("label[for='"+t.getAttribute("id")+"']")||t.closest("label")},v.prototype.init=function(){this.$module&&this.$menuButton&&this.$menu&&("matchMedia"in window?(this.mql=window.matchMedia("(min-width: 48.0625em)"),"addEventListener"in this.mql?this.mql.addEventListener("change",this.syncState.bind(this)):this.mql.addListener(this.syncState.bind(this)),this.syncState(),this.$menuButton.addEventListener("click",this.handleMenuButtonClick.bind(this))):this.$menuButton.setAttribute("hidden",""))},v.prototype.syncState=function(){this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden",""))},v.prototype.handleMenuButtonClick=function(){this.menuIsOpen=!this.menuIsOpen,this.syncState()},g.prototype.init=function(){this.$module&&this.setFocus()},g.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||"alert"===t.getAttribute("role")&&(t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")}))),t.focus())},w.prototype.init=function(){var t=this.$module;n(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),"onpageshow"in window?window.addEventListener("pageshow",this.syncAllConditionalReveals.bind(this)):window.addEventListener("DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),t.addEventListener("click",this.handleClick.bind(this))},w.prototype.syncAllConditionalReveals=function(){n(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},w.prototype.syncConditionalRevealWithInputState=function(t){var e=document.getElementById(t.getAttribute("aria-controls"));if(e&&e.classList.contains("govuk-radios__conditional")){var n=t.checked;t.setAttribute("aria-expanded",n),e.classList.toggle("govuk-radios__conditional--hidden",!n)}},w.prototype.handleClick=function(t){var e=t.target;"radio"===e.type&&n(document.querySelectorAll('input[type="radio"][aria-controls]'),function(t){var n=t.form===e.form;t.name===e.name&&n&&this.syncConditionalRevealWithInputState(t)}.bind(this))},E.prototype.init=function(){this.$module&&(this.$linkedElement=this.getLinkedElement(),this.$linkedElement&&this.$module.addEventListener("click",this.focusLinkedElement.bind(this)))},E.prototype.getLinkedElement=function(){var t=this.getFragmentFromUrl();return!!t&&document.getElementById(t)},E.prototype.focusLinkedElement=function(){var t=this.$linkedElement;t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.classList.add("govuk-skip-link-focused-element"),this.linkedElementListener||(this.$linkedElement.addEventListener("blur",this.removeFocusProperties.bind(this)),this.linkedElementListener=!0)),t.focus()},E.prototype.removeFocusProperties=function(){this.$linkedElement.removeAttribute("tabindex"),this.$linkedElement.classList.remove("govuk-skip-link-focused-element")},E.prototype.getFragmentFromUrl=function(){return!!this.$module.hash&&this.$module.hash.split("#").pop()},function(t){"document"in this&&"nextElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"nextElementSibling",{get:function(){for(var t=this.nextSibling;t&&1!==t.nodeType;)t=t.nextSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"document"in this&&"previousElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"previousElementSibling",{get:function(){for(var t=this.previousSibling;t&&1!==t.nodeType;)t=t.previousSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),k.prototype.init=function(){"function"==typeof window.matchMedia?this.setupResponsiveChecks():this.setup()},k.prototype.setupResponsiveChecks=function(){this.mql=window.matchMedia("(min-width: 40.0625em)"),this.mql.addListener(this.checkMode.bind(this)),this.checkMode()},k.prototype.checkMode=function(){this.mql.matches?this.setup():this.teardown()},k.prototype.setup=function(){var t=this.$module,e=this.$tabs,o=t.querySelector(".govuk-tabs__list"),i=t.querySelectorAll(".govuk-tabs__list-item");if(e&&o&&i){o.setAttribute("role","tablist"),n(i,(function(t){t.setAttribute("role","presentation")})),n(e,function(t){this.setAttributes(t),t.boundTabClick=this.onTabClick.bind(this),t.boundTabKeydown=this.onTabKeydown.bind(this),t.addEventListener("click",t.boundTabClick,!0),t.addEventListener("keydown",t.boundTabKeydown,!0),this.hideTab(t)}.bind(this));var r=this.getTab(window.location.hash)||this.$tabs[0];this.showTab(r),t.boundOnHashChange=this.onHashChange.bind(this),window.addEventListener("hashchange",t.boundOnHashChange,!0)}},k.prototype.teardown=function(){var t=this.$module,e=this.$tabs,o=t.querySelector(".govuk-tabs__list"),i=t.querySelectorAll(".govuk-tabs__list-item");e&&o&&i&&(o.removeAttribute("role"),n(i,(function(t){t.removeAttribute("role","presentation")})),n(e,function(t){t.removeEventListener("click",t.boundTabClick,!0),t.removeEventListener("keydown",t.boundTabKeydown,!0),this.unsetAttributes(t)}.bind(this)),window.removeEventListener("hashchange",t.boundOnHashChange,!0))},k.prototype.onHashChange=function(t){var e=window.location.hash,n=this.getTab(e);if(n)if(this.changingHash)this.changingHash=!1;else{var o=this.getCurrentTab();this.hideTab(o),this.showTab(n),n.focus()}},k.prototype.hideTab=function(t){this.unhighlightTab(t),this.hidePanel(t)},k.prototype.showTab=function(t){this.highlightTab(t),this.showPanel(t)},k.prototype.getTab=function(t){return this.$module.querySelector('.govuk-tabs__tab[href="'+t+'"]')},k.prototype.setAttributes=function(t){var e=this.getHref(t).slice(1);t.setAttribute("id","tab_"+e),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");var n=this.getPanel(t);n.setAttribute("role","tabpanel"),n.setAttribute("aria-labelledby",t.id),n.classList.add(this.jsHiddenClass)},k.prototype.unsetAttributes=function(t){t.removeAttribute("id"),t.removeAttribute("role"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-selected"),t.removeAttribute("tabindex");var e=this.getPanel(t);e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.classList.remove(this.jsHiddenClass)},k.prototype.onTabClick=function(t){if(!t.target.classList.contains("govuk-tabs__tab"))return!1;t.preventDefault();var e=t.target,n=this.getCurrentTab();this.hideTab(n),this.showTab(e),this.createHistoryEntry(e)},k.prototype.createHistoryEntry=function(t){var e=this.getPanel(t),n=e.id;e.id="",this.changingHash=!0,window.location.hash=this.getHref(t).slice(1),e.id=n},k.prototype.onTabKeydown=function(t){switch(t.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),t.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),t.preventDefault()}},k.prototype.activateNextTab=function(){var t=this.getCurrentTab();if(t){var e=t.parentElement.nextElementSibling;if(e){var n=e.querySelector(".govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},k.prototype.activatePreviousTab=function(){var t=this.getCurrentTab();if(t){var e=t.parentElement.previousElementSibling;if(e){var n=e.querySelector(".govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},k.prototype.getPanel=function(t){return this.$module.querySelector(this.getHref(t))},k.prototype.showPanel=function(t){this.getPanel(t).classList.remove(this.jsHiddenClass)},k.prototype.hidePanel=function(t){this.getPanel(t).classList.add(this.jsHiddenClass)},k.prototype.unhighlightTab=function(t){t.setAttribute("aria-selected","false"),t.parentNode.classList.remove("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","-1")},k.prototype.highlightTab=function(t){t.setAttribute("aria-selected","true"),t.parentNode.classList.add("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","0")},k.prototype.getCurrentTab=function(){return this.$module.querySelector(".govuk-tabs__list-item--selected .govuk-tabs__tab")},k.prototype.getHref=function(t){var e=t.getAttribute("href");return e.slice(e.indexOf("#"),e.length)},e.initAll=function(t){var e="undefined"!=typeof(t=void 0!==t?t:{}).scope?t.scope:document;n(e.querySelectorAll('[data-module="govuk-accordion"]'),(function(e){new l(e,t.accordion).init()})),n(e.querySelectorAll('[data-module="govuk-button"]'),(function(e){new d(e,t.button).init()})),n(e.querySelectorAll('[data-module="govuk-character-count"]'),(function(e){new f(e,t.characterCount).init()})),n(e.querySelectorAll('[data-module="govuk-checkboxes"]'),(function(t){new m(t).init()})),n(e.querySelectorAll('[data-module="govuk-details"]'),(function(t){new b(t).init()}));var o=e.querySelector('[data-module="govuk-error-summary"]');o&&new y(o,t.errorSummary).init();var i=e.querySelector('[data-module="govuk-header"]');i&&new v(i).init(),n(e.querySelectorAll('[data-module="govuk-notification-banner"]'),(function(e){new g(e,t.notificationBanner).init()})),n(e.querySelectorAll('[data-module="govuk-radios"]'),(function(t){new w(t).init()})),new E(e.querySelector('[data-module="govuk-skip-link"]')).init(),n(e.querySelectorAll('[data-module="govuk-tabs"]'),(function(t){new k(t).init()}))},e.Accordion=l,e.Button=d,e.Details=b,e.CharacterCount=f,e.Checkboxes=m,e.ErrorSummary=y,e.Header=v,e.NotificationBanner=g,e.Radios=w,e.SkipLink=E,e.Tabs=k}(n)}));function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,a(o.key),o)}}function s(t,e,n){return(e=a(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(n!==undefined){var o=n.call(t,e||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}e((function(e,n){(function(t){var e,n,o;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),o="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,i,r){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,i,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var s=String(i),a="value"in r||"writable"in r,c="get"in r&&typeof r.get,l="set"in r&&typeof r.set;if(c){if("function"!==c)throw new TypeError("Getter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineGetter__.call(t,s,r.get)}else t[s]=r.value;if(l){if("function"!==l)throw new TypeError("Setter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineSetter__.call(t,s,r.set)}return"value"in r&&(t[s]=r.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{})})),e((function(e,n){(function(t){var e,n,o;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),o="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,i,r){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,i,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var s=String(i),a="value"in r||"writable"in r,c="get"in r&&typeof r.get,l="set"in r&&typeof r.set;if(c){if("function"!==c)throw new TypeError("Getter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineGetter__.call(t,s,r.get)}else t[s]=r.value;if(l){if("function"!==l)throw new TypeError("Setter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineSetter__.call(t,s,r.set)}return"value"in r&&(t[s]=r.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"bind"in Function.prototype||Object.defineProperty(Function.prototype,"bind",{value:function(t){var e,n=Array,o=Object,i=o.prototype,r=n.prototype,s=function(){},a=i.toString,c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,l=Function.prototype.toString,u=function(t){try{return l.call(t),!0}catch(e){return!1}},d="[object Function]",h="[object GeneratorFunction]";e=function(t){if("function"!=typeof t)return!1;if(c)return u(t);var e=a.call(t);return e===d||e===h};var p=r.slice,f=r.concat,m=r.push,b=Math.max,y=this;if(!e(y))throw new TypeError("Function.prototype.bind called on incompatible "+y);for(var v,g=p.call(arguments,1),w=function(){if(this instanceof v){var e=y.apply(this,f.call(g,p.call(arguments)));return o(e)===e?e:this}return y.apply(t,f.call(g,p.call(arguments)))},E=b(0,y.length-g.length),k=[],S=0;S<E;S++)m.call(k,"$"+S);return v=Function("binder","return function ("+k.join(",")+"){ return binder.apply(this, arguments); }")(w),y.prototype&&(s.prototype=y.prototype,v.prototype=new s,s.prototype=null),v}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{})}));(function(t){"getOwnPropertyDescriptor"in Object&&"function"==typeof Object.getOwnPropertyDescriptor&&function(){try{var t={test:0};return 0===Object.getOwnPropertyDescriptor(t,"test").value}catch(e){return!1}}()||function(){var t,e,n,o=Function.prototype.call,r=Object.prototype,s=o.bind(r.hasOwnProperty);function a(t){try{return t.sentinel=0,0===Object.getOwnPropertyDescriptor(t,"sentinel").value}catch(e){}}if((n=s(r,"__defineGetter__"))&&(t=o.bind(r.__lookupGetter__),e=o.bind(r.__lookupSetter__)),Object.defineProperty){var c=a({});if(!("undefined"==typeof document||a(document.createElement("div")))||!c)var l=Object.getOwnPropertyDescriptor}if(!Object.getOwnPropertyDescriptor||l){Object.getOwnPropertyDescriptor=function(o,a){if("object"!=i(o)&&"function"!=typeof o||null===o)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+o);if(l)try{return l.call(Object,o,a)}catch(p){}if(s(o,a)){var c={enumerable:!0,configurable:!0};if(n){var u=o.__proto__;o.__proto__=r;var d=t(o,a),h=e(o,a);if(o.__proto__=u,d||h)return d&&(c.get=d),h&&(c.set=h),c}return c.value=o[a],c.writable=!0,c}}}}()}).call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{});e((function(e,n){(function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{})})),e((function(e,n){(function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,o=Element.prototype=n.appendChild(n.createElement("*")),i={},r=function(t,e){var n,o,s,a=t.childNodes||[],c=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,i)o=i[n],t[n]=o;for(;s=e&&a[++c];)r(s,e);return t},s=document.getElementsByTagName("*"),a=document.createElement,c=100;o.attachEvent("onpropertychange",(function(t){for(var e,n=t.propertyName,r=!i.hasOwnProperty(n),a=o[n],c=i[n],l=-1;e=s[++l];)1===e.nodeType&&(r||e[n]===c)&&(e[n]=a);i[n]=a})),o.constructor=Element,o.hasAttribute||(o.hasAttribute=function(t){return null!==this.getAttribute(t)}),l()||(document.onreadystatechange=l,t=setInterval(l,25)),document.createElement=function(t){var e=a(String(t).toLowerCase());return r(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function l(){return c--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState)||(r(document,!0),t&&document.body.prototype&&clearTimeout(t),!document.body.prototype))}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{})}));(function(t){"document"in this&&"querySelector"in this.document||function(){var t=document.getElementsByTagName("head")[0];function e(e,n,o){var i,r,s=document.createElement("div"),a="qsa"+String(Math.random()).slice(3);return s.innerHTML="x<style>"+n+"{qsa:"+a+";}",i=t.appendChild(s.lastChild),r=function c(t,e,n,o){var i,r=/1|9/.test(t.nodeType),s=t.childNodes,a=[],l=-1;if(r&&t.currentStyle&&t.currentStyle.qsa===o&&a.push(t)&&n)return a;for(;i=s[++l];)if(a=a.concat(c(i,e,n,o)),n&&a.length)return a;return a}(e,n,o,a),t.removeChild(i),o?r[0]:r}Document.prototype.querySelector=Element.prototype.querySelector=function(t){return e(this,t,!0)},Document.prototype.querySelectorAll=Element.prototype.querySelectorAll=function(t){return e(this,t,!1)}}()}).call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{}),function(t){!function(){if(!document.documentElement.dataset)return!1;var t=document.createElement("div");t.setAttribute("data-a-b","c"),t.dataset&&t.dataset.aB}(),Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=this.attributes,e={},n=0;n<t.length;n++){var o=t[n];if(o&&o.name&&/^data-\w[\w\-]*$/.test(o.name)){var i=o.name,r=o.value,s=i.substr(5).replace(/-./g,(function(t){return t.charAt(1).toUpperCase()}));Object.defineProperty(e,s,{enumerable:this.enumerable,get:function(){return this.value}.bind({value:r||""}),set:function(t,e){void 0!==e?this.setAttribute(t,e):this.removeAttribute(t)}.bind(this,i)})}}return e}})}.call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{});var c={xs:0,mobile:320,tablet:641,desktop:769};function l(t){return Object.keys(c).reduce((function(e,n){return(t||window.innerWidth)>=c[n]?n:e}))}var u=function(t){return t.innerWidth<=768};function d(t){this.$module=document.querySelector(t),this.$moduleBottomMargin=this.$module.style.marginBottom,this.$mainNav=this.$module.querySelector(".hmrc-account-menu__main"),this.$showNavLinkMobile=this.$module.querySelector(".hmrc-account-menu__link--menu"),this.$currentBreakpoint=l()}function h(t,e,n){this.$module=t,this.window=e,this.document=n}function p(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n<t.length;n+=1)e.call(window,t[n],n,t)}d.prototype.init=function(){this.setup(),this.$showNavLinkMobile.addEventListener("click",this.eventHandlers.showNavLinkMobileClick.bind(this)),window.addEventListener("resize",function(t,e,n){var o,i=this;return function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];var c=i,l=function(){o=null,n||t.apply(c,s)},u=n&&!o;clearTimeout(o),o=setTimeout(l,e),u&&t.apply(c,s)}}(this.reinstantiate.bind(this)))},d.prototype.reinstantiate=function(t){var e=l(t.target.innerWidth);this.$currentBreakpoint!==e&&(this.$currentBreakpoint=e,this.setup())},d.prototype.eventHandlers={showNavLinkMobileClick:function(t){t.preventDefault(),u(window)&&(this.$mainNav.classList.contains("main-nav-is-open")?this.hideMainNavMobile(t.currentTarget):this.showMainNavMobile())}},d.prototype.setup=function(){u(window)?(this.$module.classList.add("is-smaller"),this.$showNavLinkMobile.setAttribute("aria-hidden","false"),this.$showNavLinkMobile.removeAttribute("tabindex"),this.$showNavLinkMobile.classList.remove("js-hidden"),this.hideMainNavMobile(this.$showNavLinkMobile)):(this.$module.classList.remove("is-smaller"),this.$mainNav.classList.remove("main-nav-is-open","js-hidden"),this.$showNavLinkMobile.setAttribute("aria-hidden","true"),this.$showNavLinkMobile.setAttribute("tabindex","-1"),this.$showNavLinkMobile.classList.add("js-hidden"))},d.prototype.showMainNavMobile=function(){this.$mainNav.classList.remove("js-hidden"),this.$mainNav.classList.add("main-nav-is-open"),this.$mainNav.setAttribute("aria-expanded","true"),this.$showNavLinkMobile.setAttribute("aria-expanded","true"),this.$showNavLinkMobile.classList.add("hmrc-account-home--account--is-open")},d.prototype.hideMainNavMobile=function(t){this.$mainNav.classList.remove("main-nav-is-open"),this.$mainNav.setAttribute("aria-expanded","false"),t.classList.contains("hmrc-account-menu__link--menu")&&(this.$mainNav.classList.add("js-hidden"),this.$showNavLinkMobile.setAttribute("aria-expanded","false"),this.$showNavLinkMobile.classList.remove("hmrc-account-home--account--is-open"))},h.prototype.init=function(){var t=this;if(this.window.history){var e=this.document.referrer;this.window.history.replaceState&&"function"==typeof this.window.history.replaceState&&this.window.history.replaceState(null,null,this.window.location.href),this.$module.addEventListener("click",(function(n){n.preventDefault(),t.window.history.back&&"function"==typeof t.window.history.back&&""!==e&&-1!==e.indexOf(t.window.location.host)&&t.window.history.back()}))}},function(t){"forEach"in Array.prototype||(Array.prototype.forEach=function(e){if(this===t||null===this)throw new TypeError(this+" is not an object");if("function"!=typeof e)throw new TypeError(e+" is not a function");for(var n=Object(this),o=arguments[1],i=n instanceof String?n.split(""):n,r=Math.max(Math.min(i.length,9007199254740991),0)||0,s=-1;++s<r;)s in i&&e.call(o,i[s],s,n)})}.call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{}),function(t){var e,n,o,r,s,a,c,l,u;"keys"in Object&&function(){return 2===Object.keys(arguments).length}(1,2)&&function(){try{return!0}catch(t){return!1}}()||(Object.keys=(e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),s=o.call((function(){}),"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(t){var e=t.constructor;return e&&e.prototype===t},l={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!l["$"+t]&&e.call(window,t)&&null!==window[t]&&"object"===i(window[t]))try{c(window[t])}catch(n){return!0}}catch(n){return!0}return!1}(),function(o){var l,d,h,p="[object Function]"===n.call(o),f=(l=o,d=n.call(l),(h="[object Arguments]"===d)||(h="[object Array]"!==d&&null!==l&&"object"===i(l)&&"number"==typeof l.length&&l.length>=0&&"[object Function]"===n.call(l.callee)),h),m="[object String]"===n.call(o),b=[];if(o===t||null===o)throw new TypeError("Cannot convert undefined or null to object");var y=s&&p;if(m&&o.length>0&&!e.call(o,0))for(var v=0;v<o.length;++v)b.push(String(v));if(f&&o.length>0)for(var g=0;g<o.length;++g)b.push(String(g));else for(var w in o)y&&"prototype"===w||!e.call(o,w)||b.push(String(w));if(r)for(var E=function(t){if("undefined"==typeof window||!u)return c(t);try{return c(t)}catch(e){return!1}}(o),k=0;k<a.length;++k)E&&"constructor"===a[k]||!e.call(o,a[k])||b.push(a[k]);return b}))}.call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{}),function(t){"assign"in Object||function(){function e(e){if(null===e||e===t)throw new TypeError("Cannot call method on "+e);return Object(e)}Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(n,o){var i=e(n);if(1===arguments.length)return i;var r,s,a,c,l=Array.prototype.slice.call(arguments,1);for(r=0;r<l.length;r++){var u=l[r];for(u===t||null===u?a=[]:(c=e(u),a=Object.keys(c)),s=0;s<a.length;s++){var d=a[s],h=Object.getOwnPropertyDescriptor(c,d);if(h!==t&&h.enumerable){var p=c[d];i[d]=p}}}return i}})}()}.call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{}),function(t){"Date"in this&&"now"in this.Date&&"getTime"in this.Date.prototype||(Date.now=function(){return(new Date).getTime()})}.call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{});var f=console.warn,m={generateDomElementFromString:function(t){var e=document.createElement("div");return e.innerHTML=t,e.firstChild},generateDomElementFromStringAndAppendText:function(t,e){var n=m.generateDomElementFromString(t);return n.innerText=e,n},hasClass:function(t,e){return document.querySelector(t).classList.contains(e)},addClass:function(t,e){p(document.querySelectorAll(t),(function(t){t.classList.add(e)}))},removeClass:function(t,e){p(document.querySelectorAll(t),(function(t){t.classList.remove(e)}))},removeElement:function(t){var e=t.parentNode;e?e.removeChild(t):f("couldn't find parent for elem",t)},ajaxGet:function(t,e){var n=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");return n.open("GET",t),n.onreadystatechange=function(){n.readyState>3&&200===n.status&&e(n.responseText)},n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(),n}};var b={displayDialog:function(t){var e=m.generateDomElementFromString('<div id="hmrc-timeout-dialog" tabindex="-1" role="dialog" aria-modal="true" class="hmrc-timeout-dialog">'),n=m.generateDomElementFromString('<div id="hmrc-timeout-overlay" class="hmrc-timeout-overlay">'),o="string"==typeof t?m.generateDomElementFromString(t):t,i=[],r=[];e.appendChild(o),m.hasClass("html","noScroll")||(m.addClass("html","noScroll"),i.push((function(){m.removeClass("html","noScroll")}))),document.body.appendChild(e),document.body.appendChild(n),i.push((function(){m.removeElement(e),m.removeElement(n)}));var s,a=document.querySelectorAll(["#skiplink-container","body > header","#global-cookie-message","main[role=main]","body > footer","body > .govuk-skip-link",".cbanner-govuk-cookie-banner","body > .govuk-width-container"].join(", ")),c=function(){for(;i.length>0;){i.shift()()}};return p(a,(function(t){var e=t.getAttribute("aria-hidden");t.setAttribute("aria-hidden","true"),i.push((function(){e?t.setAttribute("aria-hidden",e):t.removeAttribute("aria-hidden")}))})),function(){function t(t){var e=document.getElementById("hmrc-timeout-dialog");e&&(t.target===e||e.contains(t.target)||(t.stopPropagation(),e.focus()))}var n=document.activeElement;e.focus(),document.addEventListener("focus",t,!0),i.push((function(){document.removeEventListener("focus",t),n.focus()}))}(),function(){function t(t){27===t.keyCode&&(r.forEach((function(t){t()})),c())}document.addEventListener("keydown",t),i.push((function(){document.removeEventListener("keydown",t)}))}(),s=function(t){1===(t.touches||t.changedTouches||[]).length&&t.preventDefault()},document.addEventListener("touchmove",s,!0),i.push((function(){document.removeEventListener("touchmove",s,!0)})),{closeDialog:function(){c()},setAriaLabelledBy:function(t){t?e.setAttribute("aria-labelledby",t):e.removeAttribute("aria-labelledby")},addCloseHandler:function(t){r.push(t)}}}};function y(){}function v(){}function g(t,e){var n,r={},a={},c=[],l=e;var u=function(){a.synchroniseTabs&&l.onActivity((function(t){var e=t.timestamp;S(),p(e)}))},d=function(t){var e=[];if(["timeout","countdown","keepAliveUrl","signOutUrl"].forEach((function(n){t[n]||e.push("data-".concat(n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()))})),e.length>0)throw new Error("Missing config item(s): [".concat(e.join(", "),"]"))},h=function A(t,e){var n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t);return Object.keys(e).forEach((function(o){"object"===i(n[o])&&(n[o]=A(t[o],e[o])),n[o]!==undefined&&""!==n[o]||(n[o]=e[o])})),n},p=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:w(),e=t+1e3*a.timeout,o=w()-t,i=a.timeout-a.countdown,r=window.setTimeout((function(){f(e)}),1e3*i-o);c.push((function(){window.clearTimeout(r),n&&window.clearTimeout(n)}))},f=function(t){var e=m.generateDomElementFromString("<div>");if(a.title){var o=m.generateDomElementFromStringAndAppendText('<h1 id="hmrc-timeout-heading" class="govuk-heading-m push--top">',a.title);e.appendChild(o)}var i=m.generateDomElementFromString('<span id="hmrc-timeout-countdown" class="hmrc-timeout-dialog__countdown">'),r=m.generateDomElementFromString('<p id="hmrc-timeout-message" class="govuk-visually-hidden screenreader-content" aria-live="assertive">'),s=m.generateDomElementFromStringAndAppendText('<p class="govuk-body hmrc-timeout-dialog__message" aria-hidden="true">',a.message);s.appendChild(document.createTextNode(" ")),s.appendChild(i),s.appendChild(document.createTextNode(".")),a.messageSuffix&&s.appendChild(document.createTextNode(" ".concat(a.messageSuffix)));var l,u,d=m.generateDomElementFromStringAndAppendText('<button id="hmrc-timeout-keep-signin-btn" class="govuk-button">',a.keepAliveButtonText),h=m.generateDomElementFromStringAndAppendText('<a id="hmrc-timeout-sign-out-link" class="govuk-link hmrc-timeout-dialog__link">',a.signOutButtonText);d.addEventListener("click",g),h.addEventListener("click",E),h.setAttribute("href",a.signOutUrl),e.appendChild(s),e.appendChild(r),e.appendChild(d),e.appendChild(document.createTextNode(" ")),e.appendChild((l=h,(u=document.createElement("div")).classList.add("hmrc-timeout-dialog__link-wrapper"),u.appendChild(l),u));var p=b.displayDialog(e);c.push((function(){p.closeDialog()})),p.addCloseHandler(g),p.setAriaLabelledBy("hmrc-timeout-heading hmrc-timeout-message");var f=function(){return t-w()},y=function(t){var e,n;return t<60?n="".concat(t," ").concat(a.properties[1!==t?"seconds":"second"]):(e=Math.ceil(t/60),n="".concat(e," ").concat(a.properties[1===e?"minute":"minutes"])),n},v=function(t){return t>60?t:t<20?20:20*Math.ceil(t/20)},S=function(t,e){t.innerText!==e&&(t.innerText=e)},A=function(t){var e=y(t),n=function(t){var e=y(v(t)),n=[a.message," ",e,"."];return a.messageSuffix&&(n.push(" "),n.push(a.messageSuffix)),n.join("")}(t);S(i,e),S(r,n)};!function L(){var t,e,o=Math.round(f()/1e3);A(o),o<=0&&k(),n=window.setTimeout(L,(t=f(),(e=1e3*Math.floor(f()/1e3))<=6e4?t-e||1e3:t-(e-(e%6e4||6e4))))}()},g=function(){S(),p(),m.ajaxGet(a.keepAliveUrl,(function(){})),l.logActivity()},w=function(){return Date.now()},E=function(){v.redirectToUrl(a.signOutUrl)},k=function(){v.redirectToUrl(a.timeoutUrl)},S=function(){for(;c.length>0;){c.shift()()}};return{init:function(){var e=y;function n(e){return(t.attributes.getNamedItem(e)||{}).value}var o="cy"===e.string(n("data-language"))?{title:"Rydych ar fin cael eich allgofnodi",message:"Er eich diogelwch, byddwn yn eich allgofnodi cyn pen",keepAliveButtonText:"Parhau i fod wedi’ch mewngofnodi",signOutButtonText:"Allgofnodi",properties:{minutes:"funud",minute:"funud",seconds:"eiliad",second:"eiliad"}}:{title:"You’re about to be signed out",message:"For your security, we will sign you out in",keepAliveButtonText:"Stay signed in",signOutButtonText:"Sign out",properties:{minutes:"minutes",minute:"minute",seconds:"seconds",second:"second"}};(r={timeout:e.int(n("data-timeout")),countdown:e.int(n("data-countdown")),keepAliveUrl:e.string(n("data-keep-alive-url")),signOutUrl:e.string(n("data-sign-out-url")),timeoutUrl:e.string(n("data-timeout-url")),title:e.string(n("data-title")),message:e.string(n("data-message")),messageSuffix:e.string(n("data-message-suffix")),keepAliveButtonText:e.string(n("data-keep-alive-button-text")),signOutButtonText:e.string(n("data-sign-out-button-text")),synchroniseTabs:e.boolean(n("data-synchronise-tabs")||!1)}).timeoutUrl=r.timeoutUrl||r.signOutUrl,d(r),a=h(r,o),p(),u()},cleanup:S}}Number.isNaN=Number.isNaN||function(t){return"number"==typeof t&&t!=t},y.int=function(t){var e=parseInt(t,10);return Number.isNaN(e)?undefined:e},y.string=function(t){return"string"==typeof t?t:undefined},y.boolean=function(t){return"true"===String(t).toLowerCase()},v.redirectToUrl=function(t){window.location.href=t},g.dialog=b,g.redirectHelper=v,g.utils=m;function w(t){this.$module=t,this.$closeLink=this.$module.querySelector(".hmrc-user-research-banner__close"),this.cookieName="mdtpurr",this.cookieExpiryDays=28}w.prototype.init=function(){null==function(t){for(var e="".concat(t,"="),n=document.cookie.split(";"),o=0,i=n.length;o<i;o+=1){for(var r=n[o];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(e))return decodeURIComponent(r.substring(e.length))}return null}(this.cookieName)&&(this.$module.classList.add("hmrc-user-research-banner--show"),this.$closeLink.addEventListener("click",this.eventHandlers.noThanksClick.bind(this)))},w.prototype.eventHandlers={noThanksClick:function(t){t.preventDefault(),function(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},o="".concat(t,"=").concat(e,"; path=/");if(n.days){var i=new Date;i.setTime(i.getTime()+24*n.days*60*60*1e3),o="".concat(o,"; expires=").concat(i.toGMTString())}"https:"===window.location.protocol&&(o+="; Secure"),document.cookie=o}(this.cookieName,"suppress_for_all_services",{days:this.cookieExpiryDays}),this.$module.classList.remove("hmrc-user-research-banner--show")}};var E=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.activityChannel=e&&new e("session-activity")}var e,n,o;return e=t,(n=[{key:"logActivity",value:function(){if(this.activityChannel){var t={timestamp:Date.now()};this.activityChannel.postMessage(t)}}},{key:"onActivity",value:function(t){this.activityChannel&&(this.activityChannel.onmessage=function(e){t(e.data)})}}])&&r(e.prototype,n),o&&r(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();var k={initAll:function(){document.querySelector('[data-module="hmrc-account-menu"]')&&new d('[data-module="hmrc-account-menu"]').init();var t=new E(window.BroadcastChannel);t.logActivity();var e=document.querySelector('meta[name="hmrc-timeout-dialog"]');e&&new g(e,t).init();var n=document.querySelector('[data-module="hmrc-user-research-banner"]');n&&new w(n).init(),p(document.querySelectorAll('[data-module="hmrc-back-link"]'),(function(t){new h(t,window,document).init()}))},AccountMenu:d,TimeoutDialog:g,UserResearchBanner:w,BackLinkHelper:h};window.GOVUKFrontend=n,window.HMRCFrontend=k,n.initAll(),k.initAll()}();
|
|
1
|
+
!function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=e((function(e,n){!function(e){function n(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e.call(window,t[n],n,t)}function o(){for(var t=function(t){var e={},n=function(t,o){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i],s=o?o+"."+i:i;"object"==typeof r?n(r,s):e[s]=r}};return n(t),e},e={},n=0;n<arguments.length;n++){var o=t(arguments[n]);for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e}function i(t,e){if(!t||"object"!=typeof t)throw new Error('Provide a `configObject` of type "object".');if(!e||"string"!=typeof e)throw new Error('Provide a `namespace` of type "string" to filter the `configObject` by.');var n={};for(var o in t){var i=o.split(".");Object.prototype.hasOwnProperty.call(t,o)&&i[0]===e&&(i.length>1&&i.shift(),n[i.join(".")]=t[o])}return n}function r(t){if("string"!=typeof t)return t;var e=t.trim();return"true"===e||"false"!==e&&(e.length>0&&isFinite(e)?Number(e):t)}function s(t){var e={};for(var n in t)e[n]=r(t[n]);return e}function a(t,e){this.translations=t||{},this.locale=e&&e.locale||document.documentElement.lang||"en"}(function(t){var e,n,o;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),o="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,i,r){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,i,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var s=String(i),a="value"in r||"writable"in r,c="get"in r&&typeof r.get,l="set"in r&&typeof r.set;if(c){if("function"!==c)throw new TypeError("Getter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineGetter__.call(t,s,r.get)}else t[s]=r.value;if(l){if("function"!==l)throw new TypeError("Setter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineSetter__.call(t,s,r.set)}return"value"in r&&(t[s]=r.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,o=Element.prototype=n.appendChild(n.createElement("*")),i={},r=function(t,e){var n,o,s,a=t.childNodes||[],c=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,i)o=i[n],t[n]=o;for(;s=e&&a[++c];)r(s,e);return t},s=document.getElementsByTagName("*"),a=document.createElement,c=100;o.attachEvent("onpropertychange",(function(t){for(var e,n=t.propertyName,r=!i.hasOwnProperty(n),a=o[n],c=i[n],l=-1;e=s[++l];)1===e.nodeType&&(r||e[n]===c)&&(e[n]=a);i[n]=a})),o.constructor=Element,o.hasAttribute||(o.hasAttribute=function(t){return null!==this.getAttribute(t)}),l()||(document.onreadystatechange=l,t=setInterval(l,25)),document.createElement=function(t){var e=a(String(t).toLowerCase());return r(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function l(){return c--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState)||(r(document,!0),t&&document.body.prototype&&clearTimeout(t),!document.body.prototype))}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){(function(){if(!document.documentElement.dataset)return!1;var t=document.createElement("div");return t.setAttribute("data-a-b","c"),t.dataset&&"c"==t.dataset.aB})()||Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=this.attributes,e={},n=0;n<t.length;n++){var o=t[n];if(o&&o.name&&/^data-\w[.\w-]*$/.test(o.name)){var i=o.name,r=o.value,s=i.substr(5).replace(/-./g,(function(t){return t.charAt(1).toUpperCase()}));"__defineGetter__"in Object.prototype&&"__defineSetter__"in Object.prototype?Object.defineProperty(e,s,{enumerable:!0,get:function(){return this.value}.bind({value:r||""}),set:function(t,e){void 0!==e?this.setAttribute(t,e):this.removeAttribute(t)}.bind(this,i)}):e[s]=r}}return e}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"trim"in String.prototype||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),a.prototype.t=function(t,e){if(!t)throw new Error("i18n: lookup key missing");if(e&&"undefined"!=typeof e.count&&(t=t+"."+this.getPluralSuffix(t,e.count)),t in this.translations){var n=this.translations[t];if(n.match(/%{(.\S+)}/)){if(!e)throw new Error("i18n: cannot replace placeholders in string if no option data provided");return this.replacePlaceholders(n,e)}return n}return t},a.prototype.replacePlaceholders=function(t,e){var n;return this.hasIntlNumberFormatSupport()&&(n=new Intl.NumberFormat(this.locale)),t.replace(/%{(.\S+)}/g,(function(t,o){if(Object.prototype.hasOwnProperty.call(e,o)){var i=e[o];return!1===i?"":"number"==typeof i&&n?n.format(i):i}throw new Error("i18n: no data found to replace "+t+" placeholder in string")}))},a.prototype.hasIntlPluralRulesSupport=function(){return Boolean(window.Intl&&"PluralRules"in window.Intl&&Intl.PluralRules.supportedLocalesOf(this.locale).length)},a.prototype.hasIntlNumberFormatSupport=function(){return Boolean(window.Intl&&"NumberFormat"in window.Intl&&Intl.NumberFormat.supportedLocalesOf(this.locale).length)},a.prototype.getPluralSuffix=function(t,e){if(e=Number(e),!isFinite(e))return"other";var n;if(t+"."+(n=this.hasIntlPluralRulesSupport()?new Intl.PluralRules(this.locale).select(e):this.selectPluralFormUsingFallbackRules(e))in this.translations)return n;if(t+".other"in this.translations)return console&&"warn"in console&&console.warn('i18n: Missing plural form ".'+n+'" for "'+this.locale+'" locale. Falling back to ".other".'),"other";throw new Error('i18n: Plural form ".other" is required for "'+this.locale+'" locale')},a.prototype.selectPluralFormUsingFallbackRules=function(t){t=Math.abs(Math.floor(t));var e=this.getPluralRulesForLocale();return e?a.pluralRules[e](t):"other"},a.prototype.getPluralRulesForLocale=function(){var t=this.locale,e=t.split("-")[0];for(var n in a.pluralRulesMap)if(Object.prototype.hasOwnProperty.call(a.pluralRulesMap,n))for(var o=a.pluralRulesMap[n],i=0;i<o.length;i++)if(o[i]===t||o[i]===e)return n},a.pluralRulesMap={arabic:["ar"],chinese:["my","zh","id","ja","jv","ko","ms","th","vi"],french:["hy","bn","fr","gu","hi","fa","pa","zu"],german:["af","sq","az","eu","bg","ca","da","nl","en","et","fi","ka","de","el","hu","lb","no","so","sw","sv","ta","te","tr","ur"],irish:["ga"],russian:["ru","uk"],scottish:["gd"],spanish:["pt-PT","it","es"],welsh:["cy"]},a.pluralRules={arabic:function(t){return 0===t?"zero":1===t?"one":2===t?"two":t%100>=3&&t%100<=10?"few":t%100>=11&&t%100<=99?"many":"other"},chinese:function(){return"other"},french:function(t){return 0===t||1===t?"one":"other"},german:function(t){return 1===t?"one":"other"},irish:function(t){return 1===t?"one":2===t?"two":t>=3&&t<=6?"few":t>=7&&t<=10?"many":"other"},russian:function(t){var e=t%100,n=e%10;return 1===n&&11!==e?"one":n>=2&&n<=4&&!(e>=12&&e<=14)?"few":0===n||n>=5&&n<=9||e>=11&&e<=14?"many":"other"},scottish:function(t){return 1===t||11===t?"one":2===t||12===t?"two":t>=3&&t<=10||t>=13&&t<=19?"few":"other"},spanish:function(t){return 1===t?"one":t%1e6==0&&0!==t?"many":"other"},welsh:function(t){return 0===t?"zero":1===t?"one":2===t?"two":3===t?"few":6===t?"many":"other"}},function(t){var e;"DOMTokenList"in this&&(!("classList"in(e=document.createElement("x")))||!e.classList.toggle("x",!1)&&!e.className)||function(e){var n;"DOMTokenList"in e&&e.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(e.DOMTokenList=function(){var e=!0,o=function(t,n,o,i){Object.defineProperty?Object.defineProperty(t,n,{configurable:!1===e||!!i,get:o}):t.__defineGetter__(n,o)};try{o({},"support")}catch(n){e=!1}return function(e,n){var i=this,r=[],s={},a=0,c=0,l=function(t){o(i,t,(function(){return d(),r[t]}),!1)},u=function(){if(a>=c)for(;c<a;++c)l(c)},d=function(){var t,o,i=arguments,c=/\s+/;if(i.length)for(o=0;o<i.length;++o)if(c.test(i[o]))throw(t=new SyntaxError('String "'+i[o]+'" contains an invalid character')).code=5,t.name="InvalidCharacterError",t;for(""===(r="object"==typeof e[n]?(""+e[n].baseVal).replace(/^\s+|\s+$/g,"").split(c):(""+e[n]).replace(/^\s+|\s+$/g,"").split(c))[0]&&(r=[]),s={},o=0;o<r.length;++o)s[r[o]]=!0;a=r.length,u()};return d(),o(i,"length",(function(){return d(),a})),i.toLocaleString=i.toString=function(){return d(),r.join(" ")},i.item=function(t){return d(),r[t]},i.contains=function(t){return d(),!!s[t]},i.add=function(){d.apply(i,t=arguments);for(var t,o,c=0,l=t.length;c<l;++c)o=t[c],s[o]||(r.push(o),s[o]=!0);a!==r.length&&(a=r.length>>>0,"object"==typeof e[n]?e[n].baseVal=r.join(" "):e[n]=r.join(" "),u())},i.remove=function(){d.apply(i,t=arguments);for(var t,o={},c=0,l=[];c<t.length;++c)o[t[c]]=!0,delete s[t[c]];for(c=0;c<r.length;++c)o[r[c]]||l.push(r[c]);r=l,a=l.length>>>0,"object"==typeof e[n]?e[n].baseVal=r.join(" "):e[n]=r.join(" "),u()},i.toggle=function(e,n){return d.apply(i,[e]),t!==n?n?(i.add(e),!0):(i.remove(e),!1):s[e]?(i.remove(e),!1):(i.add(e),!0)},i}}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(e){var n=arguments[1];if(n===t){var o=!this.contains(e);return this[o?"add":"remove"](e),o}return this[(n=!!n)?"add":"remove"](e),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var e=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,n=arguments.length,o=0;o<n;o++)e.call(this,t[o])}}}(),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a"),t.classList.add("b"),t.classList.remove("a","b"),t.classList.contains("b"))){var e=t.classList.constructor.prototype.remove;t.classList.constructor.prototype.remove=function(){for(var t=arguments,n=arguments.length,o=0;o<n;o++)e.call(this,t[o])}}}()}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){var e;"document"in this&&"classList"in document.documentElement&&"Element"in this&&"classList"in Element.prototype&&((e=document.createElement("span")).classList.add("a","b"),e.classList.contains("b"))||function(t){var n=!0,o=function(t,e,o,i){Object.defineProperty?Object.defineProperty(t,e,{configurable:!1===n||!!i,get:o}):t.__defineGetter__(e,o)};try{o({},"support")}catch(e){n=!1}var i=function(t,e,r){o(t.prototype,e,(function(){var t,s="__defineGetter__DEFINE_PROPERTY"+e;if(this[s])return t;if(this[s]=!0,!1===n){for(var a,c=i.mirror||document.createElement("div"),l=c.childNodes,u=l.length,d=0;d<u;++d)if(l[d]._R===this){a=l[d];break}a||(a=c.appendChild(document.createElement("div"))),t=DOMTokenList.call(a,this,r)}else t=new DOMTokenList(this,r);return o(this,e,(function(){return t})),delete this[s],t}),!0)};i(t.Element,"classList","className"),i(t.HTMLElement,"classList","className"),i(t.HTMLLinkElement,"relList","rel"),i(t.HTMLAnchorElement,"relList","rel"),i(t.HTMLAreaElement,"relList","rel")}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"document"in this&&"matches"in document.documentElement||(Element.prototype.matches=Element.prototype.webkitMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.mozMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),n=0;e[n]&&e[n]!==this;)++n;return!!e[n]})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"document"in this&&"closest"in document.documentElement||(Element.prototype.closest=function(t){for(var e=this;e;){if(e.matches(t))return e;e="SVGElement"in window&&e instanceof SVGElement?e.parentNode:e.parentElement}return null})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"Window"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&function(t){t.constructor?t.Window=t.constructor:(t.Window=t.constructor=new Function("return function Window() {}")()).prototype=this}(this)}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){(function(t){if(!("Event"in t))return!1;if("function"==typeof t.Event)return!0;try{return new Event("click"),!0}catch(e){return!1}})(this)||function(){var e={click:1,dblclick:1,keyup:1,keypress:1,keydown:1,mousedown:1,mouseup:1,mousemove:1,mouseover:1,mouseenter:1,mouseleave:1,mouseout:1,storage:1,storagecommit:1,textinput:1};if("undefined"!=typeof document&&"undefined"!=typeof window){var n=window.Event&&window.Event.prototype||null;window.Event=Window.prototype.Event=function(e,n){if(!e)throw new Error("Not enough arguments");var o;if("createEvent"in document){o=document.createEvent("Event");var i=!(!n||n.bubbles===t)&&n.bubbles,r=!(!n||n.cancelable===t)&&n.cancelable;return o.initEvent(e,i,r),o}return(o=document.createEventObject()).type=e,o.bubbles=!(!n||n.bubbles===t)&&n.bubbles,o.cancelable=!(!n||n.cancelable===t)&&n.cancelable,o},n&&Object.defineProperty(window.Event,"prototype",{configurable:!1,enumerable:!1,writable:!0,value:n}),"createEvent"in document||(window.addEventListener=Window.prototype.addEventListener=Document.prototype.addEventListener=Element.prototype.addEventListener=function(){var t=this,n=arguments[0],i=arguments[1];if(t===window&&n in e)throw new Error("In IE8 the event: "+n+" is not available on the window object. Please see https://github.com/Financial-Times/polyfill-service/issues/317 for more information.");t._events||(t._events={}),t._events[n]||(t._events[n]=function(e){var n,i=t._events[e.type].list,r=i.slice(),s=-1,a=r.length;for(e.preventDefault=function(){!1!==e.cancelable&&(e.returnValue=!1)},e.stopPropagation=function(){e.cancelBubble=!0},e.stopImmediatePropagation=function(){e.cancelBubble=!0,e.cancelImmediate=!0},e.currentTarget=t,e.relatedTarget=e.fromElement||null,e.target=e.target||e.srcElement||t,e.timeStamp=(new Date).getTime(),e.clientX&&(e.pageX=e.clientX+document.documentElement.scrollLeft,e.pageY=e.clientY+document.documentElement.scrollTop);++s<a&&!e.cancelImmediate;)s in r&&-1!==o(i,n=r[s])&&"function"==typeof n&&n.call(t,e)},t._events[n].list=[],t.attachEvent&&t.attachEvent("on"+n,t._events[n])),t._events[n].list.push(i)},window.removeEventListener=Window.prototype.removeEventListener=Document.prototype.removeEventListener=Element.prototype.removeEventListener=function(){var t,e=this,n=arguments[0],i=arguments[1];e._events&&e._events[n]&&e._events[n].list&&-1!==(t=o(e._events[n].list,i))&&(e._events[n].list.splice(t,1),e._events[n].list.length||(e.detachEvent&&e.detachEvent("on"+n,e._events[n]),delete e._events[n]))},window.dispatchEvent=Window.prototype.dispatchEvent=Document.prototype.dispatchEvent=Element.prototype.dispatchEvent=function(t){if(!arguments.length)throw new Error("Not enough arguments");if(!t||"string"!=typeof t.type)throw new Error("DOM Events Exception 0");var e=this,n=t.type;try{if(!t.bubbles){t.cancelBubble=!0;var o=function(t){t.cancelBubble=!0,(e||window).detachEvent("on"+n,o)};this.attachEvent("on"+n,o)}this.fireEvent("on"+n,t)}catch(i){t.target=e;do{t.currentTarget=e,"_events"in e&&"function"==typeof e._events[n]&&e._events[n].call(e,t),"function"==typeof e["on"+n]&&e["on"+n].call(e,t),e=9===e.nodeType?e.parentWindow:e.parentNode}while(e&&!t.cancelBubble)}return!0},document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0}))})))}function o(t,e){for(var n=-1,o=t.length;++n<o;)if(n in t&&t[n]===e)return n;return-1}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"bind"in Function.prototype||Object.defineProperty(Function.prototype,"bind",{value:function(t){var e,n=Array,o=Object,i=o.prototype,r=n.prototype,s=function(){},a=i.toString,c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,l=Function.prototype.toString,u=function(t){try{return l.call(t),!0}catch(e){return!1}},d="[object Function]",h="[object GeneratorFunction]";e=function(t){if("function"!=typeof t)return!1;if(c)return u(t);var e=a.call(t);return e===d||e===h};var p=r.slice,f=r.concat,m=r.push,b=Math.max,y=this;if(!e(y))throw new TypeError("Function.prototype.bind called on incompatible "+y);for(var v,g=p.call(arguments,1),w=function(){if(this instanceof v){var e=y.apply(this,f.call(g,p.call(arguments)));return o(e)===e?e:this}return y.apply(t,f.call(g,p.call(arguments)))},E=b(0,y.length-g.length),k=[],S=0;S<E;S++)m.call(k,"$"+S);return v=Function("binder","return function ("+k.join(",")+"){ return binder.apply(this, arguments); }")(w),y.prototype&&(s.prototype=y.prototype,v.prototype=new s,s.prototype=null),v}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{});var c={hideAllSections:"Hide all sections",hideSection:"Hide",hideSectionAriaLabel:"Hide this section",showAllSections:"Show all sections",showSection:"Show",showSectionAriaLabel:"Show this section"};function l(t,e){this.$module=t;var n={i18n:c};this.config=o(n,e||{},s(t.dataset)),this.i18n=new a(i(this.config,"i18n")),this.controlsClass="govuk-accordion__controls",this.showAllClass="govuk-accordion__show-all",this.showAllTextClass="govuk-accordion__show-all-text",this.sectionClass="govuk-accordion__section",this.sectionExpandedClass="govuk-accordion__section--expanded",this.sectionButtonClass="govuk-accordion__section-button",this.sectionHeaderClass="govuk-accordion__section-header",this.sectionHeadingClass="govuk-accordion__section-heading",this.sectionHeadingDividerClass="govuk-accordion__section-heading-divider",this.sectionHeadingTextClass="govuk-accordion__section-heading-text",this.sectionHeadingTextFocusClass="govuk-accordion__section-heading-text-focus",this.sectionShowHideToggleClass="govuk-accordion__section-toggle",this.sectionShowHideToggleFocusClass="govuk-accordion__section-toggle-focus",this.sectionShowHideTextClass="govuk-accordion__section-toggle-text",this.upChevronIconClass="govuk-accordion-nav__chevron",this.downChevronIconClass="govuk-accordion-nav__chevron--down",this.sectionSummaryClass="govuk-accordion__section-summary",this.sectionSummaryFocusClass="govuk-accordion__section-summary-focus",this.sectionContentClass="govuk-accordion__section-content",this.$sections=this.$module.querySelectorAll("."+this.sectionClass),this.browserSupportsSessionStorage=u.checkForSessionStorage()}l.prototype.init=function(){if(this.$module){this.initControls(),this.initSectionHeaders();var t=this.checkIfAllSectionsOpen();this.updateShowAllButton(t)}},l.prototype.initControls=function(){this.$showAllButton=document.createElement("button"),this.$showAllButton.setAttribute("type","button"),this.$showAllButton.setAttribute("class",this.showAllClass),this.$showAllButton.setAttribute("aria-expanded","false"),this.$showAllIcon=document.createElement("span"),this.$showAllIcon.classList.add(this.upChevronIconClass),this.$showAllButton.appendChild(this.$showAllIcon);var t=document.createElement("div");t.setAttribute("class",this.controlsClass),t.appendChild(this.$showAllButton),this.$module.insertBefore(t,this.$module.firstChild),this.$showAllText=document.createElement("span"),this.$showAllText.classList.add(this.showAllTextClass),this.$showAllButton.appendChild(this.$showAllText),this.$showAllButton.addEventListener("click",this.onShowOrHideAllToggle.bind(this)),"onbeforematch"in document&&document.addEventListener("beforematch",this.onBeforeMatch.bind(this))},l.prototype.initSectionHeaders=function(){n(this.$sections,function(t,e){var n=t.querySelector("."+this.sectionHeaderClass);this.constructHeaderMarkup(n,e),this.setExpanded(this.isExpanded(t),t),n.addEventListener("click",this.onSectionToggle.bind(this,t)),this.setInitialState(t)}.bind(this))},l.prototype.constructHeaderMarkup=function(t,e){var n=t.querySelector("."+this.sectionButtonClass),o=t.querySelector("."+this.sectionHeadingClass),i=t.querySelector("."+this.sectionSummaryClass),r=document.createElement("button");r.setAttribute("type","button"),r.setAttribute("aria-controls",this.$module.id+"-content-"+(e+1));for(var s=0;s<n.attributes.length;s++){var a=n.attributes.item(s);"id"!==a.nodeName&&r.setAttribute(a.nodeName,a.nodeValue)}var c=document.createElement("span");c.classList.add(this.sectionHeadingTextClass),c.id=n.id;var l=document.createElement("span");l.classList.add(this.sectionHeadingTextFocusClass),c.appendChild(l),l.innerHTML=n.innerHTML;var u=document.createElement("span");u.classList.add(this.sectionShowHideToggleClass),u.setAttribute("data-nosnippet","");var d=document.createElement("span");d.classList.add(this.sectionShowHideToggleFocusClass),u.appendChild(d);var h=document.createElement("span"),p=document.createElement("span");if(p.classList.add(this.upChevronIconClass),d.appendChild(p),h.classList.add(this.sectionShowHideTextClass),d.appendChild(h),r.appendChild(c),r.appendChild(this.getButtonPunctuationEl()),null!=i){var f=document.createElement("span"),m=document.createElement("span");m.classList.add(this.sectionSummaryFocusClass),f.appendChild(m);for(var b=0,y=i.attributes.length;b<y;++b){var v=i.attributes.item(b).nodeName,g=i.attributes.item(b).nodeValue;f.setAttribute(v,g)}m.innerHTML=i.innerHTML,i.parentNode.replaceChild(f,i),r.appendChild(f),r.appendChild(this.getButtonPunctuationEl())}r.appendChild(u),o.removeChild(n),o.appendChild(r)},l.prototype.onBeforeMatch=function(t){var e=t.target.closest("."+this.sectionClass);e&&this.setExpanded(!0,e)},l.prototype.onSectionToggle=function(t){var e=this.isExpanded(t);this.setExpanded(!e,t),this.storeState(t)},l.prototype.onShowOrHideAllToggle=function(){var t=this,e=this.$sections,o=!this.checkIfAllSectionsOpen();n(e,(function(e){t.setExpanded(o,e),t.storeState(e)})),t.updateShowAllButton(o)},l.prototype.setExpanded=function(t,e){var n=e.querySelector("."+this.upChevronIconClass),o=e.querySelector("."+this.sectionShowHideTextClass),i=e.querySelector("."+this.sectionButtonClass),r=e.querySelector("."+this.sectionContentClass),s=t?this.i18n.t("hideSection"):this.i18n.t("showSection");o.innerText=s,i.setAttribute("aria-expanded",t);var a=[],c=e.querySelector("."+this.sectionHeadingTextClass);c&&a.push(c.innerText.trim());var l=e.querySelector("."+this.sectionSummaryClass);l&&a.push(l.innerText.trim());var u=t?this.i18n.t("hideSectionAriaLabel"):this.i18n.t("showSectionAriaLabel");a.push(u),i.setAttribute("aria-label",a.join(" , ")),t?(r.removeAttribute("hidden"),e.classList.add(this.sectionExpandedClass),n.classList.remove(this.downChevronIconClass)):(r.setAttribute("hidden","until-found"),e.classList.remove(this.sectionExpandedClass),n.classList.add(this.downChevronIconClass));var d=this.checkIfAllSectionsOpen();this.updateShowAllButton(d)},l.prototype.isExpanded=function(t){return t.classList.contains(this.sectionExpandedClass)},l.prototype.checkIfAllSectionsOpen=function(){return this.$sections.length===this.$module.querySelectorAll("."+this.sectionExpandedClass).length},l.prototype.updateShowAllButton=function(t){var e=t?this.i18n.t("hideAllSections"):this.i18n.t("showAllSections");this.$showAllButton.setAttribute("aria-expanded",t),this.$showAllText.innerText=e,t?this.$showAllIcon.classList.remove(this.downChevronIconClass):this.$showAllIcon.classList.add(this.downChevronIconClass)};var u={checkForSessionStorage:function(){var t,e="this is the test string";try{return window.sessionStorage.setItem(e,e),t=window.sessionStorage.getItem(e)===e.toString(),window.sessionStorage.removeItem(e),t}catch(n){return!1}}};function d(t,e){if(!t)return this;this.$module=t,this.debounceFormSubmitTimer=null,this.config=o({preventDoubleClick:!1},e||{},s(t.dataset))}function h(t,e){var n=t.closest("["+e+"]");if(n)return n.getAttribute(e)}l.prototype.storeState=function(t){if(this.browserSupportsSessionStorage){var e=t.querySelector("."+this.sectionButtonClass);if(e){var n=e.getAttribute("aria-controls"),o=e.getAttribute("aria-expanded");n&&o&&window.sessionStorage.setItem(n,o)}}},l.prototype.setInitialState=function(t){if(this.browserSupportsSessionStorage){var e=t.querySelector("."+this.sectionButtonClass);if(e){var n=e.getAttribute("aria-controls"),o=n?window.sessionStorage.getItem(n):null;null!==o&&this.setExpanded("true"===o,t)}}},l.prototype.getButtonPunctuationEl=function(){var t=document.createElement("span");return t.classList.add("govuk-visually-hidden",this.sectionHeadingDividerClass),t.innerHTML=", ",t},d.prototype.init=function(){this.$module&&(this.$module.addEventListener("keydown",this.handleKeyDown),this.$module.addEventListener("click",this.debounce.bind(this)))},d.prototype.handleKeyDown=function(t){var e=t.target;"button"===e.getAttribute("role")&&32===t.keyCode&&(t.preventDefault(),e.click())},d.prototype.debounce=function(t){if(this.config.preventDoubleClick)return this.debounceFormSubmitTimer?(t.preventDefault(),!1):void(this.debounceFormSubmitTimer=setTimeout(function(){this.debounceFormSubmitTimer=null}.bind(this),1e3))},function(t){"Date"in self&&"now"in self.Date&&"getTime"in self.Date.prototype||(Date.now=function(){return(new Date).getTime()})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{});var p={charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}};function f(t,e){if(!t)return this;var n={threshold:0,i18n:p},r=s(t.dataset),c={};if(("maxwords"in r||"maxlength"in r)&&(c={maxlength:!1,maxwords:!1}),this.config=o(n,e||{},c,r),this.i18n=new a(i(this.config,"i18n"),{locale:h(t,"lang")}),this.config.maxwords)this.maxLength=this.config.maxwords;else{if(!this.config.maxlength)return;this.maxLength=this.config.maxlength}this.$module=t,this.$textarea=t.querySelector(".govuk-js-character-count"),this.$visibleCountMessage=null,this.$screenReaderCountMessage=null,this.lastInputTimestamp=null}function m(t){this.$module=t,this.$inputs=t.querySelectorAll('input[type="checkbox"]')}function b(t){this.$module=t}function y(t,e){if(!t)return this;this.$module=t,this.config=o({disableAutoFocus:!1},e||{},s(t.dataset))}function v(t){this.$module=t,this.$menuButton=t&&t.querySelector(".govuk-js-header-toggle"),this.$menu=this.$menuButton&&t.querySelector("#"+this.$menuButton.getAttribute("aria-controls")),this.menuIsOpen=!1,this.mql=null}function g(t,e){this.$module=t,this.config=o({disableAutoFocus:!1},e||{},s(t.dataset))}function w(t){this.$module=t,this.$inputs=t.querySelectorAll('input[type="radio"]')}function E(t){this.$module=t,this.$linkedElement=null,this.linkedElementListener=!1}function k(t){this.$module=t,this.$tabs=t.querySelectorAll(".govuk-tabs__tab"),this.keys={left:37,right:39,up:38,down:40},this.jsHiddenClass="govuk-tabs__panel--hidden"}f.prototype.init=function(){if(this.$textarea){var t=this.$textarea,e=document.getElementById(t.id+"-info");e.innerText.match(/^\s*$/)&&(e.innerText=this.i18n.t("textareaDescription",{count:this.maxLength})),t.insertAdjacentElement("afterend",e);var n=document.createElement("div");n.className="govuk-character-count__sr-status govuk-visually-hidden",n.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=n,e.insertAdjacentElement("afterend",n);var o=document.createElement("div");o.className=e.className,o.classList.add("govuk-character-count__status"),o.setAttribute("aria-hidden","true"),this.$visibleCountMessage=o,e.insertAdjacentElement("afterend",o),e.classList.add("govuk-visually-hidden"),t.removeAttribute("maxlength"),this.bindChangeEvents(),"onpageshow"in window?window.addEventListener("pageshow",this.updateCountMessage.bind(this)):window.addEventListener("DOMContentLoaded",this.updateCountMessage.bind(this)),this.updateCountMessage()}},f.prototype.bindChangeEvents=function(){var t=this.$textarea;t.addEventListener("keyup",this.handleKeyUp.bind(this)),t.addEventListener("focus",this.handleFocus.bind(this)),t.addEventListener("blur",this.handleBlur.bind(this))},f.prototype.handleKeyUp=function(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()},f.prototype.handleFocus=function(){this.valueChecker=setInterval(function(){(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}.bind(this),1e3)},f.prototype.handleBlur=function(){clearInterval(this.valueChecker)},f.prototype.updateIfValueChanged=function(){this.$textarea.oldValue||(this.$textarea.oldValue=""),this.$textarea.value!==this.$textarea.oldValue&&(this.$textarea.oldValue=this.$textarea.value,this.updateCountMessage())},f.prototype.updateCountMessage=function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()},f.prototype.updateVisibleCountMessage=function(){var t=this.$textarea,e=this.$visibleCountMessage,n=this.maxLength-this.count(t.value);this.isOverThreshold()?e.classList.remove("govuk-character-count__message--disabled"):e.classList.add("govuk-character-count__message--disabled"),n<0?(t.classList.add("govuk-textarea--error"),e.classList.remove("govuk-hint"),e.classList.add("govuk-error-message")):(t.classList.remove("govuk-textarea--error"),e.classList.remove("govuk-error-message"),e.classList.add("govuk-hint")),e.innerText=this.getCountMessage()},f.prototype.updateScreenReaderCountMessage=function(){var t=this.$screenReaderCountMessage;this.isOverThreshold()?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",!0),t.innerText=this.getCountMessage()},f.prototype.count=function(t){return this.config.maxwords?(t.match(/\S+/g)||[]).length:t.length},f.prototype.getCountMessage=function(){var t=this.maxLength-this.count(this.$textarea.value),e=this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)},f.prototype.formatCountMessage=function(t,e){if(0===t)return this.i18n.t(e+"AtLimit");var n=t<0?"OverLimit":"UnderLimit";return this.i18n.t(e+n,{count:Math.abs(t)})},f.prototype.isOverThreshold=function(){if(!this.config.threshold)return!0;var t=this.$textarea,e=this.count(t.value);return this.maxLength*this.config.threshold/100<=e},m.prototype.init=function(){var t=this.$module;n(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),"onpageshow"in window?window.addEventListener("pageshow",this.syncAllConditionalReveals.bind(this)):window.addEventListener("DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),t.addEventListener("click",this.handleClick.bind(this))},m.prototype.syncAllConditionalReveals=function(){n(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},m.prototype.syncConditionalRevealWithInputState=function(t){var e=document.getElementById(t.getAttribute("aria-controls"));if(e&&e.classList.contains("govuk-checkboxes__conditional")){var n=t.checked;t.setAttribute("aria-expanded",n),e.classList.toggle("govuk-checkboxes__conditional--hidden",!n)}},m.prototype.unCheckAllInputsExcept=function(t){n(document.querySelectorAll('input[type="checkbox"][name="'+t.name+'"]'),function(e){t.form===e.form&&e!==t&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}.bind(this))},m.prototype.unCheckExclusiveInputs=function(t){n(document.querySelectorAll('input[data-behaviour="exclusive"][type="checkbox"][name="'+t.name+'"]'),function(e){t.form===e.form&&(e.checked=!1,this.syncConditionalRevealWithInputState(e))}.bind(this))},m.prototype.handleClick=function(t){var e=t.target;"checkbox"===e.type&&(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),e.checked&&("exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)))},b.prototype.init=function(){this.$module&&("boolean"==typeof this.$module.open||this.polyfillDetails())},b.prototype.polyfillDetails=function(){var t,e=this.$module,n=this.$summary=e.getElementsByTagName("summary").item(0),o=this.$content=e.getElementsByTagName("div").item(0);n&&o&&(o.id||(o.id="details-content-"+(t=(new Date).getTime(),"undefined"!=typeof window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})))),e.setAttribute("role","group"),n.setAttribute("role","button"),n.setAttribute("aria-controls",o.id),n.tabIndex=0,this.$module.hasAttribute("open")?n.setAttribute("aria-expanded","true"):(n.setAttribute("aria-expanded","false"),o.style.display="none"),this.polyfillHandleInputs(this.polyfillSetAttributes.bind(this)))},b.prototype.polyfillSetAttributes=function(){return this.$module.hasAttribute("open")?(this.$module.removeAttribute("open"),this.$summary.setAttribute("aria-expanded","false"),this.$content.style.display="none"):(this.$module.setAttribute("open","open"),this.$summary.setAttribute("aria-expanded","true"),this.$content.style.display=""),!0},b.prototype.polyfillHandleInputs=function(t){this.$summary.addEventListener("keypress",(function(e){var n=e.target;13!==e.keyCode&&32!==e.keyCode||"summary"===n.nodeName.toLowerCase()&&(e.preventDefault(),n.click?n.click():t(e))})),this.$summary.addEventListener("keyup",(function(t){var e=t.target;32===t.keyCode&&"summary"===e.nodeName.toLowerCase()&&t.preventDefault()})),this.$summary.addEventListener("click",t)},y.prototype.init=function(){var t=this.$module;t&&(this.setFocus(),t.addEventListener("click",this.handleClick.bind(this)))},y.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")})),t.focus())},y.prototype.handleClick=function(t){var e=t.target;this.focusTarget(e)&&t.preventDefault()},y.prototype.focusTarget=function(t){if("A"!==t.tagName||!1===t.href)return!1;var e=this.getFragmentFromUrl(t.href),n=document.getElementById(e);if(!n)return!1;var o=this.getAssociatedLegendOrLabel(n);return!!o&&(o.scrollIntoView(),n.focus({preventScroll:!0}),!0)},y.prototype.getFragmentFromUrl=function(t){return-1!==t.indexOf("#")&&t.split("#").pop()},y.prototype.getAssociatedLegendOrLabel=function(t){var e=t.closest("fieldset");if(e){var n=e.getElementsByTagName("legend");if(n.length){var o=n[0];if("checkbox"===t.type||"radio"===t.type)return o;var i=o.getBoundingClientRect().top,r=t.getBoundingClientRect();if(r.height&&window.innerHeight&&r.top+r.height-i<window.innerHeight/2)return o}}return document.querySelector("label[for='"+t.getAttribute("id")+"']")||t.closest("label")},v.prototype.init=function(){this.$module&&this.$menuButton&&this.$menu&&("matchMedia"in window?(this.mql=window.matchMedia("(min-width: 48.0625em)"),"addEventListener"in this.mql?this.mql.addEventListener("change",this.syncState.bind(this)):this.mql.addListener(this.syncState.bind(this)),this.syncState(),this.$menuButton.addEventListener("click",this.handleMenuButtonClick.bind(this))):this.$menuButton.setAttribute("hidden",""))},v.prototype.syncState=function(){this.mql.matches?(this.$menu.removeAttribute("hidden"),this.$menuButton.setAttribute("hidden","")):(this.$menuButton.removeAttribute("hidden"),this.$menuButton.setAttribute("aria-expanded",this.menuIsOpen),this.menuIsOpen?this.$menu.removeAttribute("hidden"):this.$menu.setAttribute("hidden",""))},v.prototype.handleMenuButtonClick=function(){this.menuIsOpen=!this.menuIsOpen,this.syncState()},g.prototype.init=function(){this.$module&&this.setFocus()},g.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||"alert"===t.getAttribute("role")&&(t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")}))),t.focus())},w.prototype.init=function(){var t=this.$module;n(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),"onpageshow"in window?window.addEventListener("pageshow",this.syncAllConditionalReveals.bind(this)):window.addEventListener("DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),t.addEventListener("click",this.handleClick.bind(this))},w.prototype.syncAllConditionalReveals=function(){n(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},w.prototype.syncConditionalRevealWithInputState=function(t){var e=document.getElementById(t.getAttribute("aria-controls"));if(e&&e.classList.contains("govuk-radios__conditional")){var n=t.checked;t.setAttribute("aria-expanded",n),e.classList.toggle("govuk-radios__conditional--hidden",!n)}},w.prototype.handleClick=function(t){var e=t.target;"radio"===e.type&&n(document.querySelectorAll('input[type="radio"][aria-controls]'),function(t){var n=t.form===e.form;t.name===e.name&&n&&this.syncConditionalRevealWithInputState(t)}.bind(this))},E.prototype.init=function(){this.$module&&(this.$linkedElement=this.getLinkedElement(),this.$linkedElement&&this.$module.addEventListener("click",this.focusLinkedElement.bind(this)))},E.prototype.getLinkedElement=function(){var t=this.getFragmentFromUrl();return!!t&&document.getElementById(t)},E.prototype.focusLinkedElement=function(){var t=this.$linkedElement;t.getAttribute("tabindex")||(t.setAttribute("tabindex","-1"),t.classList.add("govuk-skip-link-focused-element"),this.linkedElementListener||(this.$linkedElement.addEventListener("blur",this.removeFocusProperties.bind(this)),this.linkedElementListener=!0)),t.focus()},E.prototype.removeFocusProperties=function(){this.$linkedElement.removeAttribute("tabindex"),this.$linkedElement.classList.remove("govuk-skip-link-focused-element")},E.prototype.getFragmentFromUrl=function(){return!!this.$module.hash&&this.$module.hash.split("#").pop()},function(t){"document"in this&&"nextElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"nextElementSibling",{get:function(){for(var t=this.nextSibling;t&&1!==t.nodeType;)t=t.nextSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"document"in this&&"previousElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"previousElementSibling",{get:function(){for(var t=this.previousSibling;t&&1!==t.nodeType;)t=t.previousSibling;return t}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),k.prototype.init=function(){"function"==typeof window.matchMedia?this.setupResponsiveChecks():this.setup()},k.prototype.setupResponsiveChecks=function(){this.mql=window.matchMedia("(min-width: 40.0625em)"),this.mql.addListener(this.checkMode.bind(this)),this.checkMode()},k.prototype.checkMode=function(){this.mql.matches?this.setup():this.teardown()},k.prototype.setup=function(){var t=this.$module,e=this.$tabs,o=t.querySelector(".govuk-tabs__list"),i=t.querySelectorAll(".govuk-tabs__list-item");if(e&&o&&i){o.setAttribute("role","tablist"),n(i,(function(t){t.setAttribute("role","presentation")})),n(e,function(t){this.setAttributes(t),t.boundTabClick=this.onTabClick.bind(this),t.boundTabKeydown=this.onTabKeydown.bind(this),t.addEventListener("click",t.boundTabClick,!0),t.addEventListener("keydown",t.boundTabKeydown,!0),this.hideTab(t)}.bind(this));var r=this.getTab(window.location.hash)||this.$tabs[0];this.showTab(r),t.boundOnHashChange=this.onHashChange.bind(this),window.addEventListener("hashchange",t.boundOnHashChange,!0)}},k.prototype.teardown=function(){var t=this.$module,e=this.$tabs,o=t.querySelector(".govuk-tabs__list"),i=t.querySelectorAll(".govuk-tabs__list-item");e&&o&&i&&(o.removeAttribute("role"),n(i,(function(t){t.removeAttribute("role","presentation")})),n(e,function(t){t.removeEventListener("click",t.boundTabClick,!0),t.removeEventListener("keydown",t.boundTabKeydown,!0),this.unsetAttributes(t)}.bind(this)),window.removeEventListener("hashchange",t.boundOnHashChange,!0))},k.prototype.onHashChange=function(t){var e=window.location.hash,n=this.getTab(e);if(n)if(this.changingHash)this.changingHash=!1;else{var o=this.getCurrentTab();this.hideTab(o),this.showTab(n),n.focus()}},k.prototype.hideTab=function(t){this.unhighlightTab(t),this.hidePanel(t)},k.prototype.showTab=function(t){this.highlightTab(t),this.showPanel(t)},k.prototype.getTab=function(t){return this.$module.querySelector('.govuk-tabs__tab[href="'+t+'"]')},k.prototype.setAttributes=function(t){var e=this.getHref(t).slice(1);t.setAttribute("id","tab_"+e),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e),t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");var n=this.getPanel(t);n.setAttribute("role","tabpanel"),n.setAttribute("aria-labelledby",t.id),n.classList.add(this.jsHiddenClass)},k.prototype.unsetAttributes=function(t){t.removeAttribute("id"),t.removeAttribute("role"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-selected"),t.removeAttribute("tabindex");var e=this.getPanel(t);e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.classList.remove(this.jsHiddenClass)},k.prototype.onTabClick=function(t){if(!t.target.classList.contains("govuk-tabs__tab"))return!1;t.preventDefault();var e=t.target,n=this.getCurrentTab();this.hideTab(n),this.showTab(e),this.createHistoryEntry(e)},k.prototype.createHistoryEntry=function(t){var e=this.getPanel(t),n=e.id;e.id="",this.changingHash=!0,window.location.hash=this.getHref(t).slice(1),e.id=n},k.prototype.onTabKeydown=function(t){switch(t.keyCode){case this.keys.left:case this.keys.up:this.activatePreviousTab(),t.preventDefault();break;case this.keys.right:case this.keys.down:this.activateNextTab(),t.preventDefault()}},k.prototype.activateNextTab=function(){var t=this.getCurrentTab();if(t){var e=t.parentElement.nextElementSibling;if(e){var n=e.querySelector(".govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},k.prototype.activatePreviousTab=function(){var t=this.getCurrentTab();if(t){var e=t.parentElement.previousElementSibling;if(e){var n=e.querySelector(".govuk-tabs__tab");n&&(this.hideTab(t),this.showTab(n),n.focus(),this.createHistoryEntry(n))}}},k.prototype.getPanel=function(t){return this.$module.querySelector(this.getHref(t))},k.prototype.showPanel=function(t){this.getPanel(t).classList.remove(this.jsHiddenClass)},k.prototype.hidePanel=function(t){this.getPanel(t).classList.add(this.jsHiddenClass)},k.prototype.unhighlightTab=function(t){t.setAttribute("aria-selected","false"),t.parentNode.classList.remove("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","-1")},k.prototype.highlightTab=function(t){t.setAttribute("aria-selected","true"),t.parentNode.classList.add("govuk-tabs__list-item--selected"),t.setAttribute("tabindex","0")},k.prototype.getCurrentTab=function(){return this.$module.querySelector(".govuk-tabs__list-item--selected .govuk-tabs__tab")},k.prototype.getHref=function(t){var e=t.getAttribute("href");return e.slice(e.indexOf("#"),e.length)},e.initAll=function(t){var e="undefined"!=typeof(t=void 0!==t?t:{}).scope?t.scope:document;n(e.querySelectorAll('[data-module="govuk-accordion"]'),(function(e){new l(e,t.accordion).init()})),n(e.querySelectorAll('[data-module="govuk-button"]'),(function(e){new d(e,t.button).init()})),n(e.querySelectorAll('[data-module="govuk-character-count"]'),(function(e){new f(e,t.characterCount).init()})),n(e.querySelectorAll('[data-module="govuk-checkboxes"]'),(function(t){new m(t).init()})),n(e.querySelectorAll('[data-module="govuk-details"]'),(function(t){new b(t).init()}));var o=e.querySelector('[data-module="govuk-error-summary"]');o&&new y(o,t.errorSummary).init();var i=e.querySelector('[data-module="govuk-header"]');i&&new v(i).init(),n(e.querySelectorAll('[data-module="govuk-notification-banner"]'),(function(e){new g(e,t.notificationBanner).init()})),n(e.querySelectorAll('[data-module="govuk-radios"]'),(function(t){new w(t).init()})),new E(e.querySelector('[data-module="govuk-skip-link"]')).init(),n(e.querySelectorAll('[data-module="govuk-tabs"]'),(function(t){new k(t).init()}))},e.Accordion=l,e.Button=d,e.Details=b,e.CharacterCount=f,e.Checkboxes=m,e.ErrorSummary=y,e.Header=v,e.NotificationBanner=g,e.Radios=w,e.SkipLink=E,e.Tabs=k}(n)}));function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,a(o.key),o)}}function s(t,e,n){return(e=a(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(n!==undefined){var o=n.call(t,e||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}e((function(e,n){(function(t){var e,n,o;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),o="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,i,r){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,i,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var s=String(i),a="value"in r||"writable"in r,c="get"in r&&typeof r.get,l="set"in r&&typeof r.set;if(c){if("function"!==c)throw new TypeError("Getter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineGetter__.call(t,s,r.get)}else t[s]=r.value;if(l){if("function"!==l)throw new TypeError("Setter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineSetter__.call(t,s,r.set)}return"value"in r&&(t[s]=r.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{})})),e((function(e,n){(function(t){var e,n,o;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),o="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,i,r){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,i,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var s=String(i),a="value"in r||"writable"in r,c="get"in r&&typeof r.get,l="set"in r&&typeof r.set;if(c){if("function"!==c)throw new TypeError("Getter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineGetter__.call(t,s,r.get)}else t[s]=r.value;if(l){if("function"!==l)throw new TypeError("Setter must be a function");if(!n)throw new TypeError("Getters & setters cannot be defined on this javascript engine");if(a)throw new TypeError(o);Object.__defineSetter__.call(t,s,r.set)}return"value"in r&&(t[s]=r.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"bind"in Function.prototype||Object.defineProperty(Function.prototype,"bind",{value:function(t){var e,n=Array,o=Object,i=o.prototype,r=n.prototype,s=function(){},a=i.toString,c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,l=Function.prototype.toString,u=function(t){try{return l.call(t),!0}catch(e){return!1}},d="[object Function]",h="[object GeneratorFunction]";e=function(t){if("function"!=typeof t)return!1;if(c)return u(t);var e=a.call(t);return e===d||e===h};var p=r.slice,f=r.concat,m=r.push,b=Math.max,y=this;if(!e(y))throw new TypeError("Function.prototype.bind called on incompatible "+y);for(var v,g=p.call(arguments,1),w=function(){if(this instanceof v){var e=y.apply(this,f.call(g,p.call(arguments)));return o(e)===e?e:this}return y.apply(t,f.call(g,p.call(arguments)))},E=b(0,y.length-g.length),k=[],S=0;S<E;S++)m.call(k,"$"+S);return v=Function("binder","return function ("+k.join(",")+"){ return binder.apply(this, arguments); }")(w),y.prototype&&(s.prototype=y.prototype,v.prototype=new s,s.prototype=null),v}})}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{})}));(function(t){"getOwnPropertyDescriptor"in Object&&"function"==typeof Object.getOwnPropertyDescriptor&&function(){try{var t={test:0};return 0===Object.getOwnPropertyDescriptor(t,"test").value}catch(e){return!1}}()||function(){var t,e,n,o=Function.prototype.call,r=Object.prototype,s=o.bind(r.hasOwnProperty);function a(t){try{return t.sentinel=0,0===Object.getOwnPropertyDescriptor(t,"sentinel").value}catch(e){}}if((n=s(r,"__defineGetter__"))&&(t=o.bind(r.__lookupGetter__),e=o.bind(r.__lookupSetter__)),Object.defineProperty){var c=a({});if(!("undefined"==typeof document||a(document.createElement("div")))||!c)var l=Object.getOwnPropertyDescriptor}if(!Object.getOwnPropertyDescriptor||l){Object.getOwnPropertyDescriptor=function(o,a){if("object"!=i(o)&&"function"!=typeof o||null===o)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+o);if(l)try{return l.call(Object,o,a)}catch(p){}if(s(o,a)){var c={enumerable:!0,configurable:!0};if(n){var u=o.__proto__;o.__proto__=r;var d=t(o,a),h=e(o,a);if(o.__proto__=u,d||h)return d&&(c.get=d),h&&(c.set=h),c}return c.value=o[a],c.writable=!0,c}}}}()}).call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{});e((function(e,n){(function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{})})),e((function(e,n){(function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,o=Element.prototype=n.appendChild(n.createElement("*")),i={},r=function(t,e){var n,o,s,a=t.childNodes||[],c=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,i)o=i[n],t[n]=o;for(;s=e&&a[++c];)r(s,e);return t},s=document.getElementsByTagName("*"),a=document.createElement,c=100;o.attachEvent("onpropertychange",(function(t){for(var e,n=t.propertyName,r=!i.hasOwnProperty(n),a=o[n],c=i[n],l=-1;e=s[++l];)1===e.nodeType&&(r||e[n]===c)&&(e[n]=a);i[n]=a})),o.constructor=Element,o.hasAttribute||(o.hasAttribute=function(t){return null!==this.getAttribute(t)}),l()||(document.onreadystatechange=l,t=setInterval(l,25)),document.createElement=function(t){var e=a(String(t).toLowerCase());return r(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function l(){return c--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState)||(r(document,!0),t&&document.body.prototype&&clearTimeout(t),!document.body.prototype))}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof t&&t||{})}));(function(t){"document"in this&&"querySelector"in this.document||function(){var t=document.getElementsByTagName("head")[0];function e(e,n,o){var i,r,s=document.createElement("div"),a="qsa"+String(Math.random()).slice(3);return s.innerHTML="x<style>"+n+"{qsa:"+a+";}",i=t.appendChild(s.lastChild),r=function c(t,e,n,o){var i,r=/1|9/.test(t.nodeType),s=t.childNodes,a=[],l=-1;if(r&&t.currentStyle&&t.currentStyle.qsa===o&&a.push(t)&&n)return a;for(;i=s[++l];)if(a=a.concat(c(i,e,n,o)),n&&a.length)return a;return a}(e,n,o,a),t.removeChild(i),o?r[0]:r}Document.prototype.querySelector=Element.prototype.querySelector=function(t){return e(this,t,!0)},Document.prototype.querySelectorAll=Element.prototype.querySelectorAll=function(t){return e(this,t,!1)}}()}).call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{}),function(t){!function(){if(!document.documentElement.dataset)return!1;var t=document.createElement("div");t.setAttribute("data-a-b","c"),t.dataset&&t.dataset.aB}(),Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=this.attributes,e={},n=0;n<t.length;n++){var o=t[n];if(o&&o.name&&/^data-\w[\w\-]*$/.test(o.name)){var i=o.name,r=o.value,s=i.substr(5).replace(/-./g,(function(t){return t.charAt(1).toUpperCase()}));Object.defineProperty(e,s,{enumerable:this.enumerable,get:function(){return this.value}.bind({value:r||""}),set:function(t,e){void 0!==e?this.setAttribute(t,e):this.removeAttribute(t)}.bind(this,i)})}}return e}})}.call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{});var c={xs:0,mobile:320,tablet:641,desktop:769};function l(t){return Object.keys(c).reduce((function(e,n){return(t||window.innerWidth)>=c[n]?n:e}))}var u=function(t){return t.innerWidth<=768};function d(t){this.$module=document.querySelector(t),this.$moduleBottomMargin=this.$module.style.marginBottom,this.$mainNav=this.$module.querySelector(".hmrc-account-menu__main"),this.$showNavLinkMobile=this.$module.querySelector(".hmrc-account-menu__link--menu"),this.$currentBreakpoint=l()}function h(t,e,n){this.$module=t,this.window=e,this.document=n}function p(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n<t.length;n+=1)e.call(window,t[n],n,t)}d.prototype.init=function(){this.setup(),this.$showNavLinkMobile.addEventListener("click",this.eventHandlers.showNavLinkMobileClick.bind(this)),window.addEventListener("resize",function(t,e,n){var o,i=this;return function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];var c=i,l=function(){o=null,n||t.apply(c,s)},u=n&&!o;clearTimeout(o),o=setTimeout(l,e),u&&t.apply(c,s)}}(this.reinstantiate.bind(this)))},d.prototype.reinstantiate=function(t){var e=l(t.target.innerWidth);this.$currentBreakpoint!==e&&(this.$currentBreakpoint=e,this.setup())},d.prototype.eventHandlers={showNavLinkMobileClick:function(t){t.preventDefault(),u(window)&&(this.$mainNav.classList.contains("main-nav-is-open")?this.hideMainNavMobile(t.currentTarget):this.showMainNavMobile())}},d.prototype.setup=function(){u(window)?(this.$module.classList.add("is-smaller"),this.$showNavLinkMobile.setAttribute("aria-hidden","false"),this.$showNavLinkMobile.removeAttribute("tabindex"),this.$showNavLinkMobile.classList.remove("js-hidden"),this.hideMainNavMobile(this.$showNavLinkMobile)):(this.$module.classList.remove("is-smaller"),this.$mainNav.classList.remove("main-nav-is-open","js-hidden"),this.$showNavLinkMobile.setAttribute("aria-hidden","true"),this.$showNavLinkMobile.setAttribute("tabindex","-1"),this.$showNavLinkMobile.classList.add("js-hidden"))},d.prototype.showMainNavMobile=function(){this.$mainNav.classList.remove("js-hidden"),this.$mainNav.classList.add("main-nav-is-open"),this.$mainNav.setAttribute("aria-expanded","true"),this.$showNavLinkMobile.setAttribute("aria-expanded","true"),this.$showNavLinkMobile.classList.add("hmrc-account-home--account--is-open")},d.prototype.hideMainNavMobile=function(t){this.$mainNav.classList.remove("main-nav-is-open"),this.$mainNav.setAttribute("aria-expanded","false"),t.classList.contains("hmrc-account-menu__link--menu")&&(this.$mainNav.classList.add("js-hidden"),this.$showNavLinkMobile.setAttribute("aria-expanded","false"),this.$showNavLinkMobile.classList.remove("hmrc-account-home--account--is-open"))},h.prototype.init=function(){var t=this;if(this.window.history){var e=this.document.referrer;this.window.history.replaceState&&"function"==typeof this.window.history.replaceState&&this.window.history.replaceState(null,null,this.window.location.href),this.$module.addEventListener("click",(function(n){n.preventDefault(),t.window.history.back&&"function"==typeof t.window.history.back&&""!==e&&-1!==e.indexOf(t.window.location.host)&&t.window.history.back()}))}},function(t){"forEach"in Array.prototype||(Array.prototype.forEach=function(e){if(this===t||null===this)throw new TypeError(this+" is not an object");if("function"!=typeof e)throw new TypeError(e+" is not a function");for(var n=Object(this),o=arguments[1],i=n instanceof String?n.split(""):n,r=Math.max(Math.min(i.length,9007199254740991),0)||0,s=-1;++s<r;)s in i&&e.call(o,i[s],s,n)})}.call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{}),function(t){var e,n,o,r,s,a,c,l,u;"keys"in Object&&function(){return 2===Object.keys(arguments).length}(1,2)&&function(){try{return!0}catch(t){return!1}}()||(Object.keys=(e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),s=o.call((function(){}),"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(t){var e=t.constructor;return e&&e.prototype===t},l={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!l["$"+t]&&e.call(window,t)&&null!==window[t]&&"object"===i(window[t]))try{c(window[t])}catch(n){return!0}}catch(n){return!0}return!1}(),function(o){var l,d,h,p="[object Function]"===n.call(o),f=(l=o,d=n.call(l),(h="[object Arguments]"===d)||(h="[object Array]"!==d&&null!==l&&"object"===i(l)&&"number"==typeof l.length&&l.length>=0&&"[object Function]"===n.call(l.callee)),h),m="[object String]"===n.call(o),b=[];if(o===t||null===o)throw new TypeError("Cannot convert undefined or null to object");var y=s&&p;if(m&&o.length>0&&!e.call(o,0))for(var v=0;v<o.length;++v)b.push(String(v));if(f&&o.length>0)for(var g=0;g<o.length;++g)b.push(String(g));else for(var w in o)y&&"prototype"===w||!e.call(o,w)||b.push(String(w));if(r)for(var E=function(t){if("undefined"==typeof window||!u)return c(t);try{return c(t)}catch(e){return!1}}(o),k=0;k<a.length;++k)E&&"constructor"===a[k]||!e.call(o,a[k])||b.push(a[k]);return b}))}.call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{}),function(t){"assign"in Object||function(){function e(e){if(null===e||e===t)throw new TypeError("Cannot call method on "+e);return Object(e)}Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(n,o){var i=e(n);if(1===arguments.length)return i;var r,s,a,c,l=Array.prototype.slice.call(arguments,1);for(r=0;r<l.length;r++){var u=l[r];for(u===t||null===u?a=[]:(c=e(u),a=Object.keys(c)),s=0;s<a.length;s++){var d=a[s],h=Object.getOwnPropertyDescriptor(c,d);if(h!==t&&h.enumerable){var p=c[d];i[d]=p}}}return i}})}()}.call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{}),function(t){"Date"in this&&"now"in this.Date&&"getTime"in this.Date.prototype||(Date.now=function(){return(new Date).getTime()})}.call("object"===("undefined"==typeof window?"undefined":i(window))&&window||"object"===("undefined"==typeof self?"undefined":i(self))&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global||{});var f=console.warn,m={generateDomElementFromString:function(t){var e=document.createElement("div");return e.innerHTML=t,e.firstChild},generateDomElementFromStringAndAppendText:function(t,e){var n=m.generateDomElementFromString(t);return n.innerText=e,n},hasClass:function(t,e){return document.querySelector(t).classList.contains(e)},addClass:function(t,e){p(document.querySelectorAll(t),(function(t){t.classList.add(e)}))},removeClass:function(t,e){p(document.querySelectorAll(t),(function(t){t.classList.remove(e)}))},removeElement:function(t){var e=t.parentNode;e?e.removeChild(t):f("couldn't find parent for elem",t)},ajaxGet:function(t,e){var n=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");return n.open("GET",t),n.onreadystatechange=function(){n.readyState>3&&200===n.status&&e(n.responseText)},n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(),n}};var b={displayDialog:function(t){var e=m.generateDomElementFromString('<div id="hmrc-timeout-dialog" tabindex="-1" role="dialog" aria-modal="true" class="hmrc-timeout-dialog">'),n=m.generateDomElementFromString('<div id="hmrc-timeout-overlay" class="hmrc-timeout-overlay">'),o="string"==typeof t?m.generateDomElementFromString(t):t,i=[],r=[];e.appendChild(o),m.hasClass("html","noScroll")||(m.addClass("html","noScroll"),i.push((function(){m.removeClass("html","noScroll")}))),document.body.appendChild(e),document.body.appendChild(n),i.push((function(){m.removeElement(e),m.removeElement(n)}));var s,a=document.querySelectorAll(["#skiplink-container","body > header","#global-cookie-message","main[role=main]","body > footer","body > .govuk-skip-link",".cbanner-govuk-cookie-banner","body > .govuk-width-container"].join(", ")),c=function(){for(;i.length>0;){i.shift()()}};return p(a,(function(t){var e=t.getAttribute("aria-hidden");t.setAttribute("aria-hidden","true"),i.push((function(){e?t.setAttribute("aria-hidden",e):t.removeAttribute("aria-hidden")}))})),function(){function t(t){var e=document.getElementById("hmrc-timeout-dialog");e&&(t.target===e||e.contains(t.target)||(t.stopPropagation(),e.focus()))}var n=document.activeElement;e.focus(),document.addEventListener("focus",t,!0),i.push((function(){document.removeEventListener("focus",t),n.focus()}))}(),function(){function t(t){27===t.keyCode&&(r.forEach((function(t){t()})),c())}document.addEventListener("keydown",t),i.push((function(){document.removeEventListener("keydown",t)}))}(),s=function(t){1===(t.touches||t.changedTouches||[]).length&&t.preventDefault()},document.addEventListener("touchmove",s,!0),i.push((function(){document.removeEventListener("touchmove",s,!0)})),{closeDialog:function(){c()},setAriaLabelledBy:function(t){t?e.setAttribute("aria-labelledby",t):e.removeAttribute("aria-labelledby")},addCloseHandler:function(t){r.push(t)}}}};function y(){}function v(){}function g(t,e){var n,r={},a={},c=[],l=e;var u=function(){a.synchroniseTabs&&l.onActivity((function(t){var e=t.timestamp;S(),p(e)}))},d=function(t){var e=[];if(["timeout","countdown","keepAliveUrl","signOutUrl"].forEach((function(n){t[n]||e.push("data-".concat(n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()))})),e.length>0)throw new Error("Missing config item(s): [".concat(e.join(", "),"]"))},h=function A(t,e){var n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},t);return Object.keys(e).forEach((function(o){"object"===i(n[o])&&(n[o]=A(t[o],e[o])),n[o]!==undefined&&""!==n[o]||(n[o]=e[o])})),n},p=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:w(),e=t+1e3*a.timeout,o=w()-t,i=a.timeout-a.countdown,r=window.setTimeout((function(){f(e)}),1e3*i-o);c.push((function(){window.clearTimeout(r),n&&window.clearTimeout(n)}))},f=function(t){var e=m.generateDomElementFromString("<div>");if(a.title){var o=m.generateDomElementFromStringAndAppendText('<h1 id="hmrc-timeout-heading" class="govuk-heading-m push--top">',a.title);e.appendChild(o)}var i=m.generateDomElementFromString('<span id="hmrc-timeout-countdown" class="hmrc-timeout-dialog__countdown">'),r=m.generateDomElementFromString('<p id="hmrc-timeout-message" class="govuk-visually-hidden screenreader-content" aria-live="assertive">'),s=m.generateDomElementFromStringAndAppendText('<p class="govuk-body hmrc-timeout-dialog__message" aria-hidden="true">',a.message);s.appendChild(document.createTextNode(" ")),s.appendChild(i),s.appendChild(document.createTextNode(".")),a.messageSuffix&&s.appendChild(document.createTextNode(" ".concat(a.messageSuffix)));var l,u,d=m.generateDomElementFromStringAndAppendText('<button id="hmrc-timeout-keep-signin-btn" class="govuk-button">',a.keepAliveButtonText),h=m.generateDomElementFromStringAndAppendText('<a id="hmrc-timeout-sign-out-link" class="govuk-link hmrc-timeout-dialog__link">',a.signOutButtonText);d.addEventListener("click",g),h.addEventListener("click",E),h.setAttribute("href",a.signOutUrl),e.appendChild(s),e.appendChild(r),e.appendChild(d),e.appendChild(document.createTextNode(" ")),e.appendChild((l=h,(u=document.createElement("div")).classList.add("hmrc-timeout-dialog__link-wrapper"),u.appendChild(l),u));var p=b.displayDialog(e);c.push((function(){p.closeDialog()})),p.addCloseHandler(g),p.setAriaLabelledBy("hmrc-timeout-heading hmrc-timeout-message");var f=function(){return t-w()},y=function(t){var e,n;return t<60?n="".concat(t," ").concat(a.properties[1!==t?"seconds":"second"]):(e=Math.ceil(t/60),n="".concat(e," ").concat(a.properties[1===e?"minute":"minutes"])),n},v=function(t){return t>60?t:t<20?20:20*Math.ceil(t/20)},S=function(t,e){t.innerText!==e&&(t.innerText=e)},A=function(t){var e=y(t),n=function(t){var e=y(v(t)),n=[a.message," ",e,"."];return a.messageSuffix&&(n.push(" "),n.push(a.messageSuffix)),n.join("")}(t);S(i,e),S(r,n)};!function L(){var t,e,o=Math.max(Math.round(f()/1e3),0);A(o),0===o?k():n=window.setTimeout(L,(t=f(),(e=1e3*Math.floor(f()/1e3))<=6e4?t-e||1e3:t-(e-(e%6e4||6e4))))}()},g=function(){S(),p(),m.ajaxGet(a.keepAliveUrl,(function(){})),l.logActivity()},w=function(){return Date.now()},E=function(){v.redirectToUrl(a.signOutUrl)},k=function(){v.redirectToUrl(a.timeoutUrl)},S=function(){for(;c.length>0;){c.shift()()}};return{init:function(){var e=y;function n(e){return(t.attributes.getNamedItem(e)||{}).value}var o="cy"===e.string(n("data-language"))?{title:"Rydych ar fin cael eich allgofnodi",message:"Er eich diogelwch, byddwn yn eich allgofnodi cyn pen",keepAliveButtonText:"Parhau i fod wedi’ch mewngofnodi",signOutButtonText:"Allgofnodi",properties:{minutes:"funud",minute:"funud",seconds:"eiliad",second:"eiliad"}}:{title:"You’re about to be signed out",message:"For your security, we will sign you out in",keepAliveButtonText:"Stay signed in",signOutButtonText:"Sign out",properties:{minutes:"minutes",minute:"minute",seconds:"seconds",second:"second"}};(r={timeout:e.int(n("data-timeout")),countdown:e.int(n("data-countdown")),keepAliveUrl:e.string(n("data-keep-alive-url")),signOutUrl:e.string(n("data-sign-out-url")),timeoutUrl:e.string(n("data-timeout-url")),title:e.string(n("data-title")),message:e.string(n("data-message")),messageSuffix:e.string(n("data-message-suffix")),keepAliveButtonText:e.string(n("data-keep-alive-button-text")),signOutButtonText:e.string(n("data-sign-out-button-text")),synchroniseTabs:e.boolean(n("data-synchronise-tabs")||!1)}).timeoutUrl=r.timeoutUrl||r.signOutUrl,d(r),a=h(r,o),p(),u()},cleanup:S}}Number.isNaN=Number.isNaN||function(t){return"number"==typeof t&&t!=t},y.int=function(t){var e=parseInt(t,10);return Number.isNaN(e)?undefined:e},y.string=function(t){return"string"==typeof t?t:undefined},y.boolean=function(t){return"true"===String(t).toLowerCase()},v.redirectToUrl=function(t){window.location.href=t},g.dialog=b,g.redirectHelper=v,g.utils=m;function w(t){this.$module=t,this.$closeLink=this.$module.querySelector(".hmrc-user-research-banner__close"),this.cookieName="mdtpurr",this.cookieExpiryDays=28}w.prototype.init=function(){null==function(t){for(var e="".concat(t,"="),n=document.cookie.split(";"),o=0,i=n.length;o<i;o+=1){for(var r=n[o];" "===r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(e))return decodeURIComponent(r.substring(e.length))}return null}(this.cookieName)&&(this.$module.classList.add("hmrc-user-research-banner--show"),this.$closeLink.addEventListener("click",this.eventHandlers.noThanksClick.bind(this)))},w.prototype.eventHandlers={noThanksClick:function(t){t.preventDefault(),function(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},o="".concat(t,"=").concat(e,"; path=/");if(n.days){var i=new Date;i.setTime(i.getTime()+24*n.days*60*60*1e3),o="".concat(o,"; expires=").concat(i.toGMTString())}"https:"===window.location.protocol&&(o+="; Secure"),document.cookie=o}(this.cookieName,"suppress_for_all_services",{days:this.cookieExpiryDays}),this.$module.classList.remove("hmrc-user-research-banner--show")}};var E=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.activityChannel=e&&new e("session-activity")}var e,n,o;return e=t,(n=[{key:"logActivity",value:function(){if(this.activityChannel){var t={timestamp:Date.now()};this.activityChannel.postMessage(t)}}},{key:"onActivity",value:function(t){this.activityChannel&&(this.activityChannel.onmessage=function(e){t(e.data)})}}])&&r(e.prototype,n),o&&r(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();var k={initAll:function(){document.querySelector('[data-module="hmrc-account-menu"]')&&new d('[data-module="hmrc-account-menu"]').init();var t=new E(window.BroadcastChannel);t.logActivity();var e=document.querySelector('meta[name="hmrc-timeout-dialog"]');e&&new g(e,t).init();var n=document.querySelector('[data-module="hmrc-user-research-banner"]');n&&new w(n).init(),p(document.querySelectorAll('[data-module="hmrc-back-link"]'),(function(t){new h(t,window,document).init()}))},AccountMenu:d,TimeoutDialog:g,UserResearchBanner:w,BackLinkHelper:h};window.GOVUKFrontend=n,window.HMRCFrontend=k,n.initAll(),k.initAll()}();
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=maps/hmrc-frontend-5.
|
|
3
|
+
//# sourceMappingURL=maps/hmrc-frontend-5.28.0.min.js.map
|