"use strict";var _slicedToArray=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},_typeof="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};window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),Array.from||(Array.from=function(){var u;try{u=Symbol.iterator?Symbol.iterator:"Symbol(Symbol.iterator)"}catch(t){u="Symbol(Symbol.iterator)"}var e=Object.prototype.toString,l=function(t){return"function"==typeof t||"[object Function]"===e.call(t)},n=Math.pow(2,53)-1,d=function(t){var e,r=(e=Number(t),isNaN(e)?0:0!==e&&isFinite(e)?(0<e?1:-1)*Math.floor(Math.abs(e)):e);return Math.min(Math.max(r,0),n)};return function(t){var e=Object(t),r=l(e[u]);if(null==t&&!r)throw new TypeError("Array.from requires an array-like object or iterator - not null or undefined");var n,o=1<arguments.length?arguments[1]:void 0;if(void 0!==o){if(!l(o))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(n=arguments[2])}var i,a,s,c=d(e.length);return function(t,e,r,n,o,i){for(var a=0;a<r||o;){var s=n(a),c=o?s.value:s;if(o&&s.done)return e;e[a]=i?void 0===t?i(c,a):i.call(t,c,a):c,a+=1}if(o)throw new TypeError("Array.from: provided arrayLike or iterator has length more then 2 ** 52 - 1");return e.length=r,e}(n,l(this)?Object(new this(c)):new Array(c),c,(a=e,s=(i=r)&&a[u](),function(t){return i?s.next():a[t]}),r,o)}}()),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),r=1;r<arguments.length;r++){var n=arguments[r];if(null!=n){n=Object(n);for(var o=Object.keys(Object(n)),i=0,a=o.length;i<a;i++){var s=o[i],c=Object.getOwnPropertyDescriptor(n,s);void 0!==c&&c.enumerable&&(e[s]=n[s])}}}return e}}),function(){if("function"==typeof window.CustomEvent)return;function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var r=document.createEvent("CustomEvent");return r.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),r}t.prototype=window.Event.prototype,window.Event=t}(),function(i,e){try{i.querySelector(":scope body")}catch(t){["querySelector","querySelectorAll"].forEach(function(n){var o=e[n];e[n]=function(t){if(/(^|,)\s*:scope/.test(t)){var e=this.id;this.id="ID_"+Date.now(),t=t.replace(/((^|,)\s*):scope/g,"$1#"+this.id);var r=i[n](t);return this.id=e,r}return o.call(this,t)}})}}(window.document,Element.prototype),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(t){t.hasOwnProperty("append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=Array.prototype.slice.call(arguments),r=document.createDocumentFragment();t.forEach(function(t){var e=t instanceof Node;r.appendChild(e?t:document.createTextNode(String(t)))}),this.appendChild(r)}})}),function(){function t(){this.parentNode&&this.parentNode.removeChild(this)}Element.prototype.remove||(Element.prototype.remove=t),Text&&!Text.prototype.remove&&(Text.prototype.remove=t)}(),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(Element.prototype.matches.call(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}),String.prototype.contains||(String.prototype.contains=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),function(){if("object"===("undefined"==typeof window?"undefined":_typeof(window)))if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return 0<this.intersectionRatio}});else{var w=function(t){for(var e=window.document,r=s(e);r;)r=s(e=r.ownerDocument);return e}(),r=[],_=null,E=null;t.prototype.THROTTLE_TIMEOUT=100,t.prototype.POLL_INTERVAL=null,t.prototype.USE_MUTATION_OBSERVER=!0,t._setupCrossOriginUpdater=function(){return _||(_=function(t,e){E=t&&e?L(t,e):{top:0,bottom:0,left:0,right:0,width:0,height:0},r.forEach(function(t){t._checkForIntersections()})}),_},t._resetCrossOriginUpdater=function(){E=_=null},t.prototype.observe=function(e){if(!this._observationTargets.some(function(t){return t.element==e})){if(!e||1!=e.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:e,entry:null}),this._monitorIntersections(e.ownerDocument),this._checkForIntersections()}},t.prototype.unobserve=function(e){this._observationTargets=this._observationTargets.filter(function(t){return t.element!=e}),this._unmonitorIntersections(e.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},t.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},t.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},t.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter(function(t,e,r){if("number"!=typeof t||isNaN(t)||t<0||1<t)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==r[e-1]})},t.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map(function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}});return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},t.prototype._monitorIntersections=function(e){var t=e.defaultView;if(t&&-1==this._monitoringDocuments.indexOf(e)){var r=this._checkForIntersections,n=null,o=null;this.POLL_INTERVAL?n=t.setInterval(r,this.POLL_INTERVAL):(c(t,"resize",r,!0),c(e,"scroll",r,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in t&&(o=new t.MutationObserver(r)).observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(e),this._monitoringUnsubscribes.push(function(){var t=e.defaultView;t&&(n&&t.clearInterval(n),u(t,"resize",r,!0)),u(e,"scroll",r,!0),o&&o.disconnect()});var i=this.root&&(this.root.ownerDocument||this.root)||w;if(e!=i){var a=s(e);a&&this._monitorIntersections(a.ownerDocument)}}},t.prototype._unmonitorIntersections=function(n){var t=this._monitoringDocuments.indexOf(n);if(-1!=t){var o=this.root&&(this.root.ownerDocument||this.root)||w;if(!this._observationTargets.some(function(t){var e=t.element.ownerDocument;if(e==n)return!0;for(;e&&e!=o;){var r=s(e);if((e=r&&r.ownerDocument)==n)return!0}return!1})){var e=this._monitoringUnsubscribes[t];if(this._monitoringDocuments.splice(t,1),this._monitoringUnsubscribes.splice(t,1),e(),n!=o){var r=s(n);r&&this._unmonitorIntersections(r.ownerDocument)}}}},t.prototype._unmonitorAllIntersections=function(){var t=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0;for(var e=this._monitoringUnsubscribes.length=0;e<t.length;e++)t[e]()},t.prototype._checkForIntersections=function(){if(this.root||!_||E){var c=this._rootIsInDom(),u=c?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach(function(t){var e=t.element,r=T(e),n=this._rootContainsTarget(e),o=t.entry,i=c&&n&&this._computeTargetAndRootIntersection(e,r,u),a=null;this._rootContainsTarget(e)?_&&!this.root||(a=u):a={top:0,bottom:0,left:0,right:0,width:0,height:0};var s=t.entry=new l({time:window.performance&&performance.now&&performance.now(),target:e,boundingClientRect:r,rootBounds:a,intersectionRect:i});o?c&&n?this._hasCrossedThreshold(o,s)&&this._queuedEntries.push(s):o&&o.isIntersecting&&this._queuedEntries.push(s):this._queuedEntries.push(s)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},t.prototype._computeTargetAndRootIntersection=function(t,e,r){if("none"!=window.getComputedStyle(t).display){for(var n,o,i,a,s,c,u,l,d=e,h=S(t),f=!1;!f&&h;){var p=null,m=1==h.nodeType?window.getComputedStyle(h):{};if("none"==m.display)return null;if(h==this.root||9==h.nodeType)if(f=!0,h==this.root||h==w)_&&!this.root?!E||0==E.width&&0==E.height?d=p=h=null:p=E:p=r;else{var v=S(h),g=v&&T(v),y=v&&this._computeTargetAndRootIntersection(v,g,r);g&&y?(h=v,p=L(g,y)):d=h=null}else{var b=h.ownerDocument;h!=b.body&&h!=b.documentElement&&"visible"!=m.overflow&&(p=T(h))}if(p&&(n=p,o=d,void 0,i=Math.max(n.top,o.top),a=Math.min(n.bottom,o.bottom),s=Math.max(n.left,o.left),c=Math.min(n.right,o.right),l=a-i,d=0<=(u=c-s)&&0<=l&&{top:i,bottom:a,left:s,right:c,width:u,height:l}||null),!d)break;h=h&&S(h)}return d}},t.prototype._getRootRect=function(){var t;if(this.root&&!o(this.root))t=T(this.root);else{var e=o(this.root)?this.root:w,r=e.documentElement,n=e.body;t={top:0,left:0,right:r.clientWidth||n.clientWidth,width:r.clientWidth||n.clientWidth,bottom:r.clientHeight||n.clientHeight,height:r.clientHeight||n.clientHeight}}return this._expandRectByRootMargin(t)},t.prototype._expandRectByRootMargin=function(r){var t=this._rootMarginValues.map(function(t,e){return"px"==t.unit?t.value:t.value*(e%2?r.width:r.height)/100}),e={top:r.top-t[0],right:r.right+t[1],bottom:r.bottom+t[2],left:r.left-t[3]};return e.width=e.right-e.left,e.height=e.bottom-e.top,e},t.prototype._hasCrossedThreshold=function(t,e){var r=t&&t.isIntersecting?t.intersectionRatio||0:-1,n=e.isIntersecting?e.intersectionRatio||0:-1;if(r!==n)for(var o=0;o<this.thresholds.length;o++){var i=this.thresholds[o];if(i==r||i==n||i<r!=i<n)return!0}},t.prototype._rootIsInDom=function(){return!this.root||n(w,this.root)},t.prototype._rootContainsTarget=function(t){var e=this.root&&(this.root.ownerDocument||this.root)||w;return n(e,t)&&(!this.root||e==t.ownerDocument)},t.prototype._registerInstance=function(){r.indexOf(this)<0&&r.push(this)},t.prototype._unregisterInstance=function(){var t=r.indexOf(this);-1!=t&&r.splice(t,1)},window.IntersectionObserver=t,window.IntersectionObserverEntry=l}function s(t){try{return t.defaultView&&t.defaultView.frameElement||null}catch(t){return null}}function l(t){this.time=t.time,this.target=t.target,this.rootBounds=i(t.rootBounds),this.boundingClientRect=i(t.boundingClientRect),this.intersectionRect=i(t.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0}),this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,r=e.width*e.height,n=this.intersectionRect,o=n.width*n.height;this.intersectionRatio=r?Number((o/r).toFixed(4)):this.isIntersecting?1:0}function t(t,e){var r,n,o,i=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(i.root&&1!=i.root.nodeType&&9!=i.root.nodeType)throw new Error("root must be a Document or Element");this._checkForIntersections=(r=this._checkForIntersections.bind(this),n=this.THROTTLE_TIMEOUT,o=null,function(){o||(o=setTimeout(function(){r(),o=null},n))}),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(i.rootMargin),this.thresholds=this._initThresholds(i.threshold),this.root=i.root||null,this.rootMargin=this._rootMarginValues.map(function(t){return t.value+t.unit}).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}function c(t,e,r,n){"function"==typeof t.addEventListener?t.addEventListener(e,r,n||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,r)}function u(t,e,r,n){"function"==typeof t.removeEventListener?t.removeEventListener(e,r,n||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,r)}function T(t){var e;try{e=t.getBoundingClientRect()}catch(t){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function i(t){return!t||"x"in t?t:{top:t.top,y:t.top,bottom:t.bottom,left:t.left,x:t.left,right:t.right,width:t.width,height:t.height}}function L(t,e){var r=e.top-t.top,n=e.left-t.left;return{top:r,left:n,height:e.height,width:e.width,bottom:r+e.height,right:n+e.width}}function n(t,e){for(var r=e;r;){if(r==t)return!0;r=S(r)}return!1}function S(t){var e=t.parentNode;return 9==t.nodeType&&t!=w?s(t):(e&&e.assignedSlot&&(e=e.assignedSlot.parentNode),e&&11==e.nodeType&&e.host?e.host:e)}function o(t){return t&&9===t.nodeType}}();var MOBILE_BREAKPOINT="320",MOBILE_LARGE_BREAKPOINT="414",TABLET_BREAKPOINT="769",TABLET_LARGE_BREAKPOINT="820",DESKTOP_SMALL_BREAKPOINT="940",DESKTOP_BREAKPOINT="1170",XHR_REQUEST=new XMLHttpRequest,debounce=function(r,n){var o=void 0;return function(){var t=this,e=arguments;clearTimeout(o),o=setTimeout(function(){return r.apply(t,e)},n)}},doLoop=function(t,e){for(var r=0;r<t.length&&!1!==e(r,t[r]);r++);},wrap=function(t,e){t.parentNode.insertBefore(e,t),e.appendChild(t)},createEl=function(t,e){var r=document.createElement(t);return r.className=e,r},toggleAriaExpanded=function(t){t.setAttribute("aria-expanded","false"===t.getAttribute("aria-expanded")?"true":"false")},toggleAriaHidden=function(t){t.setAttribute("aria-hidden","false"===t.getAttribute("aria-hidden")?"true":"false")},toggleAnswerVisibility=function(t,e){t.classList.contains(e)?t.style.visibility="visible":t.style.visibility="hidden"},calculateHeight=function(t,e){for(var r=t.children,n=0,o=0;o<r.length;o++)n+=r[o].offsetHeight;t.classList.contains(e)?t.style.height=n+"px":t.removeAttribute("style")},trimHtml=function(t,e){for(var r=(e=e||{}).limit||100,n=void 0===e.preserveTags||e.preserveTags,o=void 0!==e.wordBreak&&e.wordBreak,i=e.suffix||"...",a=e.moreLink||"",s=t.replace(/</g,"\n<").replace(/>/g,">\n").replace(/\n\n/g,"\n").replace(/^\n/g,"").replace(/\n$/g,"").split("\n"),c=0,u=void 0,l=void 0,d=void 0,h=void 0,f=[],p=!1,m=0;m<s.length;m++){var v=s[m],g=v.replace(/[ ]+/g," ");if(v.length){if("<"!==v[0])if(r<=c)v="";else if(c+g.length>=r){if(" "===v[(u=r-c)-1])for(;u&&" "===v[(u-=1)-1];);else l=v.substring(u).split("").indexOf(" "),o||(-1!==l?u+=l:u=v.length);v=v.substring(0,u)+i,a&&(v+='<p><a class="'+a.class+'" href="'+a.link+'" aria-expanded="false" aria-label="Show full text" role="button">Read More</a></p>'),c=r,p=!0}else c+=g.length;else if(n){if(r<=c)if(h=(d=v.match(/[a-zA-Z]+/))?d[0]:"")if("</"!==v.substring(0,2))f.push(h),v="";else{for(;f[f.length-1]!==h&&f.length;)f.pop();f.length&&(v=""),f.pop()}else v=""}else v="";s[m]=v}}return{html:s.join("\n").replace(/\n/g,""),more:p}},findAncestor=function(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t},addRecaptchaError=function(t){t.querySelector(".g-recaptcha--error").innerHTML='<p class="error">Validation failed, please try again.</p>'},recaptchaValidation=function(r){var n=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],t=document.querySelector("#RecaptchaSiteKey").value,i=document.querySelector("#g-recaptcha-response"),a=r.querySelector(".submit");if(t&&i){var e=r.querySelector(".g-recaptcha--error .error");e&&e.remove(),a.classList.add("bn--disabled"),a.setAttribute("disabled",!0),grecaptcha.ready(function(){grecaptcha.execute(t,{action:"submit"}).then(function(t){if(t){var e=r.closest("form")||r.querySelector("form");i.value=t,o?o(t):n?e.submit():e.requestSubmit()}else addRecaptchaError(r);a.classList.remove("bn--disabled"),a.removeAttribute("disabled")})})}},RenderRecaptchas=function(){["f13","m92","m106","f25","f32"].forEach(function(t){var e=window[""+t];e&&e.reCAPTCHArender&&document.querySelector("."+t.toLowerCase())&&e.reCAPTCHArender()})},getQueryStringParams=function(t){if(t){var e=t;return/^[?#]/.test(t)&&(e=t.slice(1)),e.split("&").reduce(function(t,e){var r=e.split("="),n=_slicedToArray(r,2),o=n[0],i=n[1];return t[o]=i?decodeURIComponent(i.replace(/\+/g," ")):"",t},{})}return{}},validateAnPostCode=function(t){var e=t.substr(t.length-1),r=t.substring(0,t.length-1),n=[8,6,4,2,3,5,9,7],o=0,i=0;if(8!==r.length)for(var a=new Array(8-r.length),s=0;s<a.length;s++)r="0"+r;switch(doLoop(r,function(t,e){o+=parseInt(e,10)*parseInt(n[t],10)}),o%11){case 0:i=5;break;case 1:i=0;break;default:i=11-o%11}return parseInt(e,10)===parseInt(i,10)};function numberWithCommas(t){return t?t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","):""}Math.log10=Math.log10||function(t){return Math.log(t)*Math.LOG10E};var checkIsValidDate=function(t,e,r){var n=new Date;return n.setFullYear(r,e-1,t),n.getFullYear()===r&&n.getMonth()+1===e&&n.getDate()===t},setSessionCookie=function(t,e){var r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2]?encodeURIComponent(e):e;document.cookie=t+"="+r+";path=/"},getCookie=function(t){for(var e=t+"=",r=decodeURIComponent(document.cookie).split(";"),n=0;n<r.length;n++){for(var o=r[n];" "===o.charAt(0);)o=o.substring(1);if(0===o.indexOf(e))return o.substring(e.length,o.length)}return""},deleteCookie=function(t,e){var r=new Date;r.setMonth(r.getMonth()-1),document.cookie=t+" = "+escape(e)+";expires = "+r.toUTCString()+";path=/"},showAPLoader=function(t){var e=document.querySelector(".js-loader"),r="loader-wrapper--shown";e&&(t?e.classList.add(r):e.classList.remove(r))},redirectTimer=void 0,setRedirectTimer=function(t,e){var r=6e4*e;clearTimeout(redirectTimer),redirectTimer=setTimeout(function(){window.location.href=t},r)},reauthenticateUser=function(){location.search.includes("loggedout")?M78.openLoginRegistration("AP-login"):window.location.href=window.location.origin+"/myAccount/Auth?loggedout=true"},truncateString=function(t,e){return t.length>e?t.substring(0,e-3)+"...":t},checkForAnPostApp=function(){return 0<navigator.userAgent.indexOf("An Post")},trackItem=function(t,e){if(window.dataLayer=window.dataLayer||[],isFormValid(t)&&e){var r=e.match(/^([a-z]{2})[0-9]{9}([a-z]{2})$/i);r?dataLayer.push({event:"trackItem",result:"found",serviceCode:r[1].toUpperCase(),countryCode:r[2].toUpperCase()}):dataLayer.push({event:"trackItem",result:"not found",serviceCode:"not found",countryCode:"not found"}),console.log(dataLayer)}},pushDataLayer=function(t){window.dataLayer.push(t)},virtualPageView=function(t,e){pushDataLayer({event:"virtualPageView",pageview_url:t,pageview_title:e})};function doValidation(o,i){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,t=3<arguments.length&&void 0!==arguments[3]&&arguments[3],a=4<arguments.length&&void 0!==arguments[4]&&arguments[4],s=o.querySelector(".submit");s&&s.addEventListener("click",function(t){handleFormSubmit(o,t,i,e)});for(var r=o.querySelectorAll("[data-required]"),n=0;n<r.length;++n)r.item(n).addEventListener("change",function(t){var e=o.querySelector(".g-recaptcha--error .error");e&&e.remove();var r=validate(o,i)||{};showErrorsForInput(o,this,r[this.name]),a&&u(o,s)}),t&&(r.item(n).addEventListener("keyup",function(t){var e=o.querySelector(".g-recaptcha--error .error");e&&e.remove();var r=validate(o,i)||{};if(r[this.name]&&d(this,r[this.name])){var n=this.value.slice(0,-1);this.value=n}a&&u(o,s)}),"number"===r.item(n).type&&r.item(n).addEventListener("keypress",function(t){c(t)}));function c(t){var e=void 0===(t=t||window.event).which?t.keyCode:t.which;String.fromCharCode(e).match(/^[0-9\.\+]$/)||t.preventDefault()}var u=function(t,e){!function(t){for(var e=t.querySelectorAll("[data-required]"),r=0;r<e.length;++r)if(!e[r].value)return!1;return!0}(t)?(e.disabled=!0,e.classList.add("bn--disabled"),e.getAttribute("data-disabled-text")&&(e.innerHTML=e.getAttribute("data-disabled-text"),e.value=e.getAttribute("data-disabled-text"))):(e.disabled=!1,e.classList.remove("bn--disabled"),e.getAttribute("data-enabled-text")&&(e.innerHTML=e.getAttribute("data-enabled-text"),e.value=e.getAttribute("data-enabled-text")))};function l(t,e,r){var n=!1;return"function"==typeof t&&(t=t(r.value)),t&&t.message&&-1!==e.indexOf(t.message.replace("^",""))&&(t.maximum&&r.value.length>t.maximum?n=!0:t.lessThanOrEqualTo&&parseInt(r.value)>t.lessThanOrEqualTo?n=!0:t.strict&&!t.allowKeyup&&(n=!0)),n}function d(t,e){var r=!1;return(r=l(i[t.name].length,e,t))||(r=l(i[t.name].format,e,t)),r||(r=l(i[t.name].numericality,e,t)),r}}function handleFormSubmit(t,e,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,o=validate(t,r);showErrors(t,o||{}),o?(t.classList.remove("form-is-valid"),e.preventDefault()):(t.classList.add("form-is-valid"),disableButtonAfterSubmission(t),n&&(e.preventDefault(),"string"==typeof n?window[n]():n()))}function isFormValid(t){return!!t.classList.contains("form-is-valid")}function showErrors(t,e){for(var r=t.querySelectorAll("[data-required]"),n=!1,o=0;o<r.length;o++)showErrorsForInput(t,r[o],e&&e[r[o].name]),e&&!n&&e[r[o].name]&&(r[o].scrollIntoView(),r[o].focus(),window.scrollBy(0,-100),n=!0)}function showErrorsForInput(t,e,r){t.classList.add("form-is-changed"),t.classList.remove("form-is-valid");var n=closestParent(e.parentNode,"form__group")||closestParent(e.parentNode,"form__group__checkbox")||closestParent(e.parentNode,"form__group__radio"),o=n.querySelector(".form__group__error");if(resetFormGroup(n),r){n.classList.add("has-error");for(var i=0;i<r.length;i++)e.setAttribute("aria-label",r[i]),addError(o,r[i])}else n.classList.add("has-success"),e.removeAttribute("aria-label")}function closestParent(t,e){return t&&t!=document?t.classList.contains(e)?t:closestParent(t.parentNode,e):null}function resetFormGroup(t){t.classList.remove("has-error"),t.classList.remove("has-success");for(var e=t.querySelectorAll(".error"),r=0;r<e.length;r++)e[r].parentNode.removeChild(e[r])}function addError(t,e){var r=document.createElement("p");r.classList.add("error"),r.innerText=e,t.appendChild(r)}function disableButtonAfterSubmission(t){var e=t.querySelector(".js-disable-on-submit");e&&(e.classList.add("bn--disabled"),"BUTTON"===e.tagName.toUpperCase()?e.textContent="Please wait...":"INPUT"===e.tagName.toUpperCase()&&(e.value="Please wait..."))}var Forms=function(){var o="js-slideup",i="js-slideup-select",a="js-slideup-textarea",s="js-radio-group",r="form__group__focused",n="js-show-password",c="js-show-password--selected",u=function(t,e){t.onfocus=function(){e.classList.add(r)}},l=function(t,e){t.oninput=function(){e.classList.add(r)}},d=function(t,e){t.onchange=function(){e.classList.add(r)}},h=function(t,e){t.value?e.classList.add(r):e.classList.remove(r)},f=function(t,e){t.onblur=function(){t.value||e.classList.remove(r)}},p=function(t,e){t.onblur=function(){e.classList.remove(r)}},m=function(t,e){"number"===t.type&&(t.onkeydown=function(){return 69!==event.keyCode})},v=function(e,t){"password"===e.type&&t.querySelector("."+n)&&t.querySelector("."+n).addEventListener("click",function(t){t.target.classList.contains(c)?e.type="password":e.type="text",t.target.classList.toggle(c)})};return{init:function(){var t=document.querySelectorAll("."+o);t&&doLoop(t,function(t,e){var r=e.querySelector("input");r&&(u(r,e),f(r,e),l(r,e),h(r,e),m(r,e),v(r,e))});var e=document.querySelectorAll("."+i);e&&doLoop(e,function(t,e){var r=e.querySelector("select");d(r,e),h(r,e)});var r=document.querySelectorAll("."+a);r&&doLoop(r,function(t,e){var r=e.querySelector("textarea");u(r,e),f(r,e),h(r,e)});var n=document.querySelectorAll("."+s);n&&doLoop(n,function(t,e){var r=e.querySelector("input");u(r,e),p(r,e)})}}}(),m67=function(){var a={webChatAvailabilityHours:document.querySelector(".js-webchat-availability-hours input"),webChatAvailable:document.querySelector(".js-webchat-available input")},s=void 0,c=function(){var t=new Date,e=i(t.getFullYear(),3),r=i(t.getFullYear(),10),n=void 0,o=void 0;e=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),1)),r=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),1)),s=(o=(n=e<t&&t<r?t.getUTCHours()+1:t.getUTCHours(),t.getUTCMinutes()),parseFloat(n+"."+o))},i=function(t,e){var r=new Date(t,e,0);return r.setDate(r.getDate()-r.getDay()),r},u=function(){var t=setInterval(function(){window.OnetrustActiveGroups&&(clearInterval(t),window.OnetrustActiveGroups.includes("C0003")||(e(),r(),n(),f()))},100)},e=function(){var t=document.querySelector("#rejectedCookiesChatCTA").innerHTML,e=document.querySelector("footer.footer"),r=document.createElement("div");r.className="m67__webchat",r.innerHTML=t,e.insertAdjacentElement("afterend",r)},r=function(){var t=document.querySelector("#rejectedCookiesChatNotification").innerHTML,e=document.querySelector("header .header__utility");document.createElement("div").innerHTML=t,e.insertAdjacentHTML("beforebegin",t)},n=function(){var t=document.querySelector("#rejectedCookiesChatModal").innerHTML,e=document.querySelector("footer.footer");document.createElement("div").innerHTML=t,e.insertAdjacentHTML("afterend",t)},o=function(){document.querySelector(".m67__modal-container").classList.add("hide"),t()},t=function(){var t="."+document.querySelector(".m67__modal-cta").getAttribute("data-target").toString().split(" ").join(".");document.querySelector(t).closest("button").focus()},l=function(t){document.querySelector("#m67__functional").checked?(OneTrust.UpdateConsent("Category","C0003:1"),document.querySelector(".m67__webchat").classList.add("disappear"),document.querySelector(".m67__notification-container").classList.add("disappear"),setTimeout(function(){document.querySelector(".m67__webchat").classList.add("hide"),document.querySelector(".m67__notification-container").classList.add("hide")},550)):OneTrust.UpdateConsent("Category","C0003:0"),o()},d=function(t){var e=document.querySelector(".m67__modal-container").querySelectorAll("button, input"),r=e[0],n=e[e.length-1];"Tab"===t.key&&(t.shiftKey&&document.activeElement===r?(t.preventDefault(),n.focus()):t.shiftKey||document.activeElement!==n||(t.preventDefault(),r.focus())),"Enter"===t.key&&"checkbox"===document.activeElement.type&&t.preventDefault()},h=function(t){var e=t.target,r=document.querySelector(".m67__modal-container");r.classList.remove("hide"),r.querySelector(".m67__close").focus(),r.querySelector(".m67__modal-cta").setAttribute("data-target",e.className)},f=function(){var t=document.querySelectorAll(".m67__modal-trigger"),e=document.querySelector(".m67__modal-cta"),r=document.querySelector(".m67__close");t.forEach(function(t){t.addEventListener("click",h)}),e.addEventListener("click",l),document.querySelector(".m67__modal").addEventListener("keydown",d),r.addEventListener("click",o)};return{init:function(){a.webChatAvailabilityHours&&function(){var t=(new Date).getUTCDay();c();var e=a.webChatAvailabilityHours.value,r=a.webChatAvailable.value,n=!1;if(e&&r){"false"==r&&(n=!0);var o=parseFloat(e.substring(0,2)+"."+e.substring(2,4)),i=parseFloat(e.substring(4,6)+"."+e.substring(6,8));(6<t||s<o||i<s)&&(n=!0),n||u(),window.addEventListener("load",function(){var t=window.LC_API||{};t&&(t.on_after_load=function(){n&&t.hide_chat_window()})})}}()}}}();m67.init();