(()=>{"use strict";const t=function(t){"complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()};function e(e){const{component:n,load:r,name:o,querySelector:i={},querySelectorAll:a={},options:l={}}=e;if("function"!=typeof n)return;const c=()=>{(()=>{const t=void 0===o?null==e?void 0:e.root:`[data-component='${o}']`;let n;try{n=document.querySelectorAll(t)}catch(t){return console.error(t),[]}return n.length<1?(console.log(`No elements found for ${t}`),[]):Array.from(n).map((t=>{const e={};return Object.keys(i).forEach((n=>{e[n]=t.querySelector(i[n])})),Object.keys(a).forEach((n=>{const r=t.querySelectorAll(a[n]);e[n]=Array.from(r)})),{element:t,children:e,options:l}}))})().forEach((t=>new n(t)))};if(!1===r)return c;!0!==r?function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e)if("function"==typeof n)n(e);else if(Array.isArray(n)){const[t,r]=n;null==t||t.addEventListener(r,e)}}(c,r):c()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){return o="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},o(t)}function i(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,i(r.key),r)}}function l(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t,e,n){return(e=i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t,e,n){return t.set(f(t,e),n),n}function f(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var d=new WeakMap,h=function(){return l((function t(e){var n,o,i,a=this,l=e.element,f=e.options;r(this,t),c(this,"initialized",!1),c(this,"useTransition",!1),c(this,"closeButton",null),c(this,"firstInteractiveChild",null),c(this,"lastInteractiveChild",null),i=!1,function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(n=this,o=d),o.set(n,i),c(this,"init",(function(){a.target.setAttribute("aria-hidden","true"),a.target.setAttribute("role","dialog"),a.target.setAttribute("aria-modal","true"),a.controller.addEventListener("click",a.show),a.target.addEventListener("keydown",a.handleTargetKeydown),null!=a.closeButton&&(a.closeButton.addEventListener("click",a.handleCloseButtonClick),a.closeButton.addEventListener("keydown",a.handleCloseButtonKeydown)),a.useTransition&&a.target.addEventListener("transitionend",a.handleTargetShown),a.initialized=!0})),c(this,"handleTargetKeydown",(function(t){var e=t.code,n=t.shiftKey,r=document.activeElement;if("Escape"===e&&a.expanded)t.preventDefault(),requestAnimationFrame((function(){a.hide()}));else if("Tab"===e){var o;if(n)a.firstInteractiveChild===r&&(t.preventDefault(),a.closeButton?a.closeButton.focus():null===(o=a.lastInteractiveChild)||void 0===o||o.focus());else if(a.lastInteractiveChild===r){var i;t.preventDefault(),a.closeButton?a.closeButton.focus():null===(i=a.firstInteractiveChild)||void 0===i||i.focus()}}})),c(this,"handleCloseButtonClick",(function(t){a.expanded&&(t.preventDefault(),requestAnimationFrame((function(){a.hide()})))})),c(this,"handleCloseButtonKeydown",(function(t){var e=t.code,n=t.shiftKey;if("Escape"===e&&a.expanded)t.preventDefault(),requestAnimationFrame((function(){a.hide()}));else if("Tab"===e&&a.expanded){var r,o;t.preventDefault(),n?null===(r=a.lastInteractiveChild)||void 0===r||r.focus():null===(o=a.firstInteractiveChild)||void 0===o||o.focus()}})),c(this,"handleTargetShown",(function(t){var e;a.target===t.target&&(null===(e=a.closeButton)||void 0===e||e.focus())})),c(this,"show",(function(){a.expanded=!0})),c(this,"hide",(function(){a.expanded=!1,a.controller.focus()})),c(this,"destroy",(function(){a.controller.removeAttribute("aria-expanded"),a.target.removeAttribute("aria-hidden"),a.target.removeAttribute("role"),a.target.removeAttribute("aria-modal"),a.controller.removeEventListener("click",a.show),a.target.removeEventListener("keydown",a.handleTargetKeydown),null!=a.closeButton&&(a.closeButton.removeEventListener("click",a.handleCloseButtonClick),a.closeButton.removeEventListener("keydown",a.handleCloseButtonKeydown)),a.useTransition&&a.target.removeEventListener("transitionend",a.handleTargetShown),u(d,a,!1)})),this.controller=l,this.target=this.constructor.getTargetElement(l),this.initialized=!1;var h=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({useTransition:!1,close:""},f),v=h.close,m=h.useTransition;this.useTransition=m,""!==v&&(this.closeButton=document.querySelector(v)),this.init()}),[{key:"expanded",get:function(){return(t=d).get(f(t,this));var t},set:function(t){var e,r,o,i,a,l,c,s,f=this;if(u(d,this,t),requestAnimationFrame((function(){f.controller.setAttribute("aria-expanded",f.expanded.toString())})),this.expanded?(requestAnimationFrame((function(){f.target.setAttribute("aria-hidden","false")})),!this.useTransition&&this.closeButton&&this.closeButton.focus()):requestAnimationFrame((function(){f.target.setAttribute("aria-hidden","true")})),!this.firstInteractiveChild||!this.lastInteractiveChild){var h=(l=this.target,c=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(","),s=l.querySelectorAll(c),Array.from(s).filter((function(t){return t instanceof HTMLElement&&null!==t.offsetParent})));if(h.length>0){var v=(o=h,i=Array.isArray(o)?o:o instanceof HTMLElement?[o]:o instanceof NodeList||o instanceof HTMLCollection?Array.from(o):[],a=i.length-1,e=[i[0],i[a]],r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,r)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=v[0],y=v[1];this.firstInteractiveChild=m,this.lastInteractiveChild=y}}}}],[{key:"getTargetElement",value:function(t){if(!t.hasAttribute("aria-controls"))throw new Error("Configuration error: ".concat("The component element is missing the required 'aria-controls' attribute"));var e=t.getAttribute("aria-controls"),n=e?document.getElementById(e):null;if(null===n){var r="A target element with ID of '".concat(e,"' is not found");throw new Error("Configuration error: ".concat(r))}return n}}])}(),v=function(t){return t.Local="localStorage",t.Session="sessionStorage",t}({}),m=l((function t(e){var n=this,o=e.element;e.options,r(this,t),c(this,"initialized",!1),c(this,"init",(function(){n.controller.addEventListener("click",n.save),n.initialized=!0})),c(this,"save",(function(){(function(t){var e;try{e=window[t];var n="__storage_test__";return e.setItem(n,n),e.removeItem(n),!0}catch(t){return Boolean(t instanceof DOMException&&"QuotaExceededError"===t.name&&e&&0!==e.length)}})(v.Local)&&n.controller.dataset.slug&&localStorage.setItem("spLanguageSelection",n.controller.dataset.slug)})),c(this,"destroy",(function(){n.controller.removeEventListener("click",n.save)})),this.controller=o,this.initialized=!1,this.init()}));e({name:"language-picker",component:h,options:{close:".language-picker__button--close"}}),e({name:"language-picker-option",component:m})})();;
(()=>{"use strict";const t=function(t){"complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()};function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function n(t){return n="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},n(t)}function r(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function o(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,r(o.key),o)}}function i(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function l(t,e,n){return t.set(c(t,e),n),n}function c(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var u=new WeakMap;!function(e){const{component:n,load:r,name:o,querySelector:i={},querySelectorAll:a={},options:l={}}=e;if("function"!=typeof n)return;const c=()=>{(()=>{const t=void 0===o?null==e?void 0:e.root:`[data-component='${o}']`;let n;try{n=document.querySelectorAll(t)}catch(t){return console.error(t),[]}return n.length<1?(console.log(`No elements found for ${t}`),[]):Array.from(n).map((t=>{const e={};return Object.keys(i).forEach((n=>{e[n]=t.querySelector(i[n])})),Object.keys(a).forEach((n=>{const r=t.querySelectorAll(a[n]);e[n]=Array.from(r)})),{element:t,children:e,options:l}}))})().forEach((t=>new n(t)))};if(!1===r)return c;!0!==r?function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e)if("function"==typeof n)n(e);else if(Array.isArray(n)){const[t,r]=n;null==t||t.addEventListener(r,e)}}(c,r):c()}({name:"menu-button",component:function(){return t=function t(e){var n=this,r=e.element,o=e.options;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,"initialized",!1),i(this,"useTransition",!1),i(this,"closeButton",null),i(this,"firstInteractiveChild",null),i(this,"lastInteractiveChild",null),function(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}(this,u,!1),i(this,"init",(function(){n.target.setAttribute("aria-hidden","true"),n.target.setAttribute("role","dialog"),n.target.setAttribute("aria-modal","true"),n.controller.addEventListener("click",n.show),n.target.addEventListener("keydown",n.handleTargetKeydown),null!=n.closeButton&&(n.closeButton.addEventListener("click",n.handleCloseButtonClick),n.closeButton.addEventListener("keydown",n.handleCloseButtonKeydown)),n.useTransition&&n.target.addEventListener("transitionend",n.handleTargetShown),n.initialized=!0})),i(this,"handleTargetKeydown",(function(t){var e=t.code,r=t.shiftKey,o=document.activeElement;if("Escape"===e&&n.expanded)t.preventDefault(),requestAnimationFrame((function(){n.hide()}));else if("Tab"===e){var i;if(r)n.firstInteractiveChild===o&&(t.preventDefault(),n.closeButton?n.closeButton.focus():null===(i=n.lastInteractiveChild)||void 0===i||i.focus());else if(n.lastInteractiveChild===o){var a;t.preventDefault(),n.closeButton?n.closeButton.focus():null===(a=n.firstInteractiveChild)||void 0===a||a.focus()}}})),i(this,"handleCloseButtonClick",(function(t){n.expanded&&(t.preventDefault(),requestAnimationFrame((function(){n.hide()})))})),i(this,"handleCloseButtonKeydown",(function(t){var e=t.code,r=t.shiftKey;if("Escape"===e&&n.expanded)t.preventDefault(),requestAnimationFrame((function(){n.hide()}));else if("Tab"===e&&n.expanded){var o,i;t.preventDefault(),r?null===(o=n.lastInteractiveChild)||void 0===o||o.focus():null===(i=n.firstInteractiveChild)||void 0===i||i.focus()}})),i(this,"handleTargetShown",(function(t){var e;n.target===t.target&&(null===(e=n.closeButton)||void 0===e||e.focus())})),i(this,"show",(function(){n.expanded=!0})),i(this,"hide",(function(){n.expanded=!1,n.controller.focus()})),i(this,"destroy",(function(){n.controller.removeAttribute("aria-expanded"),n.target.removeAttribute("aria-hidden"),n.target.removeAttribute("role"),n.target.removeAttribute("aria-modal"),n.controller.removeEventListener("click",n.show),n.target.removeEventListener("keydown",n.handleTargetKeydown),null!=n.closeButton&&(n.closeButton.removeEventListener("click",n.handleCloseButtonClick),n.closeButton.removeEventListener("keydown",n.handleCloseButtonKeydown)),n.useTransition&&n.target.removeEventListener("transitionend",n.handleTargetShown),l(u,n,!1)})),this.controller=r,this.target=this.constructor.getTargetElement(r),this.initialized=!1;var c=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({useTransition:!1,close:""},o),s=c.close,f=c.useTransition;this.useTransition=f,""!==s&&(this.closeButton=document.querySelector(s)),this.init()},r=[{key:"getTargetElement",value:function(t){if(!t.hasAttribute("aria-controls"))throw new Error("Configuration error: ".concat("The component element is missing the required 'aria-controls' attribute"));var e=t.getAttribute("aria-controls"),n=e?document.getElementById(e):null;if(null===n){var r="A target element with ID of '".concat(e,"' is not found");throw new Error("Configuration error: ".concat(r))}return n}}],(n=[{key:"expanded",get:function(){return(t=u).get(c(t,this));var t},set:function(t){var n,r,o,i,a,c,s=this;if(l(u,this,t),requestAnimationFrame((function(){s.controller.setAttribute("aria-expanded",s.expanded.toString())})),this.expanded?(requestAnimationFrame((function(){s.target.setAttribute("aria-hidden","false")})),!this.useTransition&&this.closeButton&&this.closeButton.focus()):requestAnimationFrame((function(){s.target.setAttribute("aria-hidden","true")})),!this.firstInteractiveChild||!this.lastInteractiveChild){var f=(i=this.target,a=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(","),c=i.querySelectorAll(a),Array.from(c).filter((function(t){return t instanceof HTMLElement&&null!==t.offsetParent})));if(f.length>0){var d=function(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((n=f,r=Array.isArray(n)?n:n instanceof HTMLElement?[n]:n instanceof NodeList||n instanceof HTMLCollection?Array.from(n):[],o=r.length-1,[r[0],r[o]]),2),h=d[0],v=d[1];this.firstInteractiveChild=h,this.lastInteractiveChild=v}}}}])&&o(t.prototype,n),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,r}(),options:{close:".menu-toggle__button--close"}})})();;
