!function(e){"use strict";!function(){const e={NODE_ENV:"production"};try{if(process)return process.env=Object.assign({},process.env),void Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}}();var t=window.CustomEvent;function o(e,t){var o="on"+t.type.toLowerCase();return"function"==typeof e[o]&&e[o](t),e.dispatchEvent(t)}function n(e){for(;e;){if("dialog"===e.localName)return e;e=e.parentElement?e.parentElement:e.parentNode?e.parentNode.host:null}return null}function i(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function r(e,t){for(var o=0;o=0&&(e=this.dialog_),e||(e=s(this.dialog_)),i(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e, the polyfill may not work correctly",e),"dialog"!==e.localName)throw new Error("Failed to register dialog: The element is not a dialog.");new u(e)},registerDialog:function(e){e.showModal||h.forceRegisterDialog(e)},DialogManager:function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var o=[];t.forEach(function(e){for(var t,n=0;t=e.removedNodes[n];++n)t instanceof Element&&("dialog"===t.localName&&o.push(t), o=o.concat(t.querySelectorAll("dialog")))}),o.length&&e(o)}))}};if(h.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},h.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},h.DialogManager.prototype.updateStacking=function(){for(var e,t=this.zIndexHigh_,o=0;e=this.pendingDialogStack[o];++o)e.updateZIndex(--t,--t),0===o&&(this.overlay.style.zIndex=--t);var n=this.pendingDialogStack[0];n?(n.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},h.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=n(e);){for(var t,o=0;t=this.pendingDialogStack[o];++o)if(t.dialog===e)return 0===o;e=e.parentElement}return!1},h.DialogManager.prototype.handleFocus_=function(e){var t=e.composedPath?e.composedPath()[0]:e.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),i(t),void 0!==this.forwardTab_)){var o=this.pendingDialogStack[0];return o.dialog.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?o.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},h.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,27===e.keyCode){e.preventDefault(),e.stopPropagation();var n=new t("cancel",{bubbles:!1,cancelable:!0}),i=this.pendingDialogStack[0];i&&o(i.dialog,n)&&i.dialog.close()}else 9===e.keyCode&&(this.forwardTab_=!e.shiftKey)},h.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){-1!==e.indexOf(t.dialog)?t.downgradeModal():t.maybeHideModal()})},h.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return!(this.pendingDialogStack.length>=t)&&(1===this.pendingDialogStack.unshift(e)&&this.blockDocument(),this.updateStacking(),!0)},h.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);-1!==t&&(this.pendingDialogStack.splice(t,1),0===this.pendingDialogStack.length&&this.unblockDocument(),this.updateStacking())},h.dm=new h.DialogManager,h.formSubmitter=null,h.imagemapUseValue=null,void 0===window.HTMLDialogElement){var p=document.createElement("form");if(p.setAttribute("method","dialog"),"dialog"!==p.method){var m=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(m){var g=m.get;m.get=function(){return a(this)?"dialog":g.call(this)};var f=m.set;m.set=function(e){return"string"==typeof e&&"dialog"===e.toLowerCase()?this.setAttribute("method",e):f.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",m)}}document.addEventListener("click",function(e){if(h.formSubmitter=null,h.imagemapUseValue=null,!e.defaultPrevented){var t=e.target;if("composedPath"in e)t=e.composedPath().shift()||t;if(t&&a(t.form)){if(!("submit"===t.type&&["button","input"].indexOf(t.localName)>-1)){if("input"!==t.localName||"image"!==t.type)return;h.imagemapUseValue=e.offsetX+","+e.offsetY}n(t)&&(h.formSubmitter=t)}}},!1),document.addEventListener("submit",function(e){var t=e.target;if(!n(t)){var o=c(e);"dialog"===(o&&o.getAttribute("formmethod")||t.getAttribute("method"))&&e.preventDefault()}});var y=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(){if(!a(this))return y.call(this);var e=n(this);e&&e.close()}}class v{constructor(e){var t;this.dialogElement=e,v.isAlreadyRegistered(e)||(e.showModal||h.registerDialog(e),"BODY"!==this.dialogElement.parentElement.tagName&&document.body.appendChild(this.dialogElement),this.updateFocusableElements(),this.mutationObserver=new MutationObserver(()=>{ this.updateFocusableElements()}),this.mutationObserver.observe(e,{subtree:!0,childList:!0,attributes:!0}),e.addEventListener("click",e=>{void 0!==e.composedPath().find(e=>{var t;return e&&(null===(t=e.classList)||void 0===t?void 0:t.contains("dialog-close"))})&&this.close()}),e.addEventListener("keydown",e=>{var t,o,n,i,r;if("Esc"!==e.key&&"Escape"!==e.key||(e.preventDefault(),e.stopPropagation(),"true"!==this.dialogElement.dataset.noEsc&&this.close()),"Tab"===e.key){e.preventDefault(),this.updateFocusableElements();const a=this.focusableElements,s=null!==(t=a.findIndex(e=>e===document.activeElement))&&void 0!==t?t:0;e.shiftKey?0===s?null===(o=a[a.length-1])||void 0===o||o.focus():null===(n=a[s-1])||void 0===n||n.focus():s===a.length-1?null===(i=a[0])||void 0===i||i.focus():null===(r=a[s+1])||void 0===r||r.focus()}}),""!==(null===(t=this.dialogElement.id)||void 0===t?void 0:t.trim())&&document.querySelectorAll(`button[aria-controls="${this.dialogElement.id}"], a[aria-controls="${this.dialogElement.id}"]`).forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),this.open()})}),this.handleDatePickers(),this.dialogElement.dataset.registeredDialog="true")}updateFocusableElements(){this.focusableElements=Array.from(this.dialogElement.querySelectorAll("a:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), summary")).filter(e=>{var t,o;return(null===(o=null===(t=e.checkVisibility)||void 0===t?void 0:t.call(e))||void 0===o||o)&&null!==e.offsetParent&&(e.childNodes.length>0||"A"!==e.tagName)})}handleDatePickers(){e(this.dialogElement).on("ab.datepicker.opened",e=>{const t=e.target,o=this.dialogElement.querySelector(`#${t.getAttribute("aria-controls")}`);this.dialogElement.appendChild(t);const n=o.getBoundingClientRect(),i=this.dialogElement.getBoundingClientRect();if(t.style.left=n.left-i.left+"px",t.classList.contains("above")){const e=n.top-i.top-t.clientHeight,o=Math.max(-i.top,e);t.style.top=`${o}px`}else{const e=window.innerHeight-i.top-t.clientHeight,o=n.bottom-i.top,r=Math.min(e,o);t.style.top=`${r}px`}})}open(){this.dialogElement.hasAttribute("open")||this.dialogElement.showModal()}close(){this.dialogElement.close()}delete(){this.mutationObserver.disconnect(),this.dialogElement.remove()}static isAlreadyRegistered(e){var t;return"true"===(null===(t=null==e?void 0:e.dataset)||void 0===t?void 0:t.registeredDialog)}static updateDialogTriggers(){v.whenWrapperDefined(()=>{document.querySelectorAll("button[aria-controls], a[aria-controls]").forEach(e=>{const t=e.getAttribute("aria-controls"),o=document.querySelector(`dialog#${t}`);o&&e.addEventListener("click",()=>{o.showModal()})})})}static blankDialog(e){var t,o;const n=`\n \n \n
\n
\n ${(null==e?void 0:e.noTitle)?"":`

${null!==(t=e.title)&&void 0!==t?t:""}

`}\n ${(null==e?void 0:e.hideCloseButtonInHeader)?"":'\n
\n \n
'}\n
\n
\n ${null!==(o=null==e?void 0:e.content)&&void 0!==o?o:""}\n
\n \n
\n \n
\n `;return(new DOMParser).parseFromString(n,"text/html").querySelector("sb-dialog-wrapper")}static whenWrapperDefined(e){window.customElements.whenDefined("sb-dialog-wrapper").then(()=>{e()})}}class b extends HTMLElement{ constructor(){super(),this.wantsToShowModal=!1,this.wantsToShow=!1,this.dialogElement=null}connectedCallback(){if(this.isConnected){if(this.dialogElement||(this.dialogElement=this.querySelector(":scope > dialog")),!this.dialogElement)throw new Error("sb-dialog-wrapper must contain a element as a child");v.isAlreadyRegistered(this.dialogElement)||new v(this.dialogElement),this.wantsToShow?(this.show(),this.wantsToShow=!1):this.wantsToShowModal&&(this.showModal(),this.wantsToShowModal=!1)}}show(){this.isConnected?this.dialogElement.show():this.wantsToShow=!0}showModal(){this.isConnected?this.dialogElement.showModal():this.wantsToShowModal=!0}close(){this.dialogElement.close()}get open(){return this.dialogElement.open}}window.customElements.define("sb-dialog-wrapper",b);const w=e=>{switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"`":return"`";default:return e}};function E(e){return"string"!=typeof e?"":e.replace(/[&<>"'`]/g,w)}class k extends HTMLElement{connectedCallback(){if(!this.isConnected)return;const e=JSON.parse(this.querySelector(".pair-list-json").innerHTML),t=this.querySelectorAll("select"),o=t[0],n=t[1];o.addEventListener("change",()=>{const t=o.value,i=e[t.replace("1=","")];n.innerHTML=i.map(e=>``).join("\n")})}}window.customElements.define("sb-pair-list-wrapper",k);const S=()=>document.getElementById("email-owner-link"),_=()=>document.getElementById("email-page-owner"),L=new DOMParser;function x(){const e=_();e.classList.contains("hidden")?(e.classList.remove("hidden"),e.scrollIntoView(!0)):e.classList.add("hidden")}function M(e){e.querySelector("#message-submit").addEventListener("click",t=>{t.preventDefault(),async function(){const e=S().getAttribute("href"),t=fetch(e,{method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(new FormData(_().querySelector("form")))});_().innerHTML=' Sending...';const o=await t;return o.ok?o.text().then(e=>L.parseFromString(e,"text/html")).catch(e=>Promise.reject(`Could not parse response after submitting email page contact form: ${e}`)):Promise.reject("Could not submit email page contact form")}().then(t=>{var o;if("Success"===(null===(o=t.body.querySelector("h1"))||void 0===o?void 0:o.innerText))e.innerHTML=' Sent';else{e.innerHTML="",e.appendChild(t.body.querySelector("div"));const o=e.querySelector("#emailPageOwnerAntiSpam");o&&window.grecaptcha.render(o,o.dataset.sitekey),M(e)}})}),e.querySelector("#message-cancel").addEventListener("click",e=>{e.preventDefault(),x()})}async function D(e){const t=document.getElementById("emailPageOwnerAntiSpam");if(void 0!==window.grecaptcha&&t)window.grecaptcha.render(t,t.dataset.sitekey);else{const t=await async function(){const e=S().getAttribute("href"),t=await fetch(e);return t.ok?t.text().then(e=>L.parseFromString(e,"text/html")).catch(e=>Promise.reject(`Could not parse page contact email form: ${e}`)):Promise.reject("Could not get page contact email form")}();if(e.appendChild(t.body.querySelector("div")),document.getElementById("emailPageOwnerAntiSpam")){const e=document.createElement("script");e.async=!0,e.src="https://www.recaptcha.net/recaptcha/api.js",e.onerror=()=>{v.whenWrapperDefined(()=>{document.querySelector("#captchaFailure-emailPageOwnerAntiSpam").showModal()})},document.querySelector("head").appendChild(e)}M(e)}}const q={ x:'\n \n '.trim(),"x-square":'\n \n '.trim()},A=["fa-stack-1x","fa-stack-2x","fa-inverse","fa-fw","fa-2x","fa-3x","fa-4x","fa-5x","fa-flip-vertical","fa-flip-horizontal","fa-rotate-90","fa-rotate-180","fa-rotate-270","fa"],T={keepOriginal:!1};function C(e,t,o,n){o.querySelectorAll(t).forEach(t=>{if(n.keepOriginal&&t.dataset.xCloned)return;const o=function(e){const t=document.createElement("div");return t.innerHTML=q[e],t.querySelector("svg")}(e).cloneNode(!0);A.forEach(e=>{t.classList.contains(e)&&o.classList.add(e)}),n.keepOriginal?(t.dataset.xCloned="true",t.classList.add("hidden"),t.insertAdjacentElement("afterend",o)):t.replaceWith(o)})}const I={fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},O={silent:{level:-1},fatal:{level:I.fatal},error:{level:I.error},warn:{level:I.warn},log:{level:I.log},info:{level:I.info},success:{level:I.success},fail:{level:I.fail},ready:{level:I.info},start:{level:I.info},box:{level:I.info},debug:{level:I.debug},trace:{level:I.trace},verbose:{level:I.verbose}};function j(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&(!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e)))}function F(e,t,o=".",n){if(!j(t))return F(e,{},o);const i=Object.assign({},t);for(const t in e){if("__proto__"===t||"constructor"===t)continue;const n=e[t];null!=n&&(Array.isArray(n)&&Array.isArray(i[t])?i[t]=[...n,...i[t]]:j(n)&&j(i[t])?i[t]=F(n,i[t],(o?`${o}.`:"")+t.toString()):i[t]=n)}return i}const H=(...e)=>e.reduce((e,t)=>F(e,t,""),{});function P(e){return t=e,"[object Object]"===Object.prototype.toString.call(t)&&(!(!e.message&&!e.args)&&!e.stack);var t}let N=!1;const $=[];class R{options;_lastLog;_mockFn;constructor(e={}){const t=e.types||O;this.options=H({...e,defaults:{...e.defaults},level:B(e.level,t),reporters:[...e.reporters||[]]},{types:O,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const e in t){const o={type:e,...this.options.defaults,...t[e]};this[e]=this._wrapLogFn(o),this[e].raw=this._wrapLogFn(o,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=B(e,this.options.types,this.options.level)}prompt(e,t){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,t)}create(e){const t=new R({...this.options,...e});return this._mockFn&&t.mockTypes(this._mockFn),t}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const t=this.options.reporters.indexOf(e);if(-1!==t)return this.options.reporters.splice(t,1) }else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,t){e&&(e.__write||(e.__write=e.write),e.write=e=>{this[t].raw(String(e).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){N=!0}resumeLogs(){N=!1;const e=$.splice(0);for(const t of e)t[0]._logFn(t[1],t[2])}mockTypes(e){const t=e||this.options.mockFn;if(this._mockFn=t,"function"==typeof t)for(const e in this.options.types)this[e]=t(e,this.options.types[e])||this[e],this[e].raw=this[e]}_wrapLogFn(e,t){return(...o)=>{if(!N)return this._logFn(e,o,t);$.push([this,e,o,t])}}_logFn(e,t,o){if((e.level||0)>this.level)return!1;const n={date:new Date,args:[],...e,level:B(e.level,this.options.types)};!o&&1===t.length&&P(t[0])?Object.assign(n,t[0]):n.args=[...t],n.message&&(n.args.unshift(n.message),delete n.message),n.additional&&(Array.isArray(n.additional)||(n.additional=n.additional.split("\n")),n.args.push("\n"+n.additional.join("\n")),delete n.additional),n.type="string"==typeof n.type?n.type.toLowerCase():"log",n.tag="string"==typeof n.tag?n.tag:"";const i=(e=!1)=>{const t=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&t>0){const e=[...this._lastLog.object.args];t>1&&e.push(`(repeated ${t} times)`),this._log({...this._lastLog.object,args:e}),this._lastLog.count=1}e&&(this._lastLog.object=n,this._log(n))};clearTimeout(this._lastLog.timeout);const r=this._lastLog.time&&n.date?n.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=n.date,rthis.options.throttleMin))return void(this._lastLog.timeout=setTimeout(i,this.options.throttle))}catch{}i(!0)}_log(e){for(const t of this.options.reporters)t.log(e,{options:this.options})}}function B(e,t={},o=3){return void 0===e?o:"number"==typeof e?e:t[e]&&void 0!==t[e].level?t[e].level:o}R.prototype.add=R.prototype.addReporter,R.prototype.remove=R.prototype.removeReporter,R.prototype.clear=R.prototype.removeReporter,R.prototype.withScope=R.prototype.withTag,R.prototype.mock=R.prototype.mockTypes,R.prototype.pause=R.prototype.pauseLogs,R.prototype.resume=R.prototype.resumeLogs;class V{options;defaultColor;levelColorMap;typeColorMap;constructor(e){this.options={...e},this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}_getLogFn(e){return e<1?console.__error||console.error:1===e?console.__warn||console.warn:console.__log||console.log}log(e){const t=this._getLogFn(e.level),o="log"===e.type?"":e.type,n=e.tag||"",i=`\n background: ${this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor};\n border-radius: 0.5em;\n color: white;\n font-weight: bold;\n padding: 2px 0.5em;\n `,r=`%c${[n,o].filter(Boolean).join(":")}`;"string"==typeof e.args[0]?t(`${r}%c ${e.args[0]}`,i,"",...e.args.slice(1)):t(r,i,...e.args)}}const z=function(e={}){return function(e={}){return new R(e)}({reporters:e.reporters||[new V({})],prompt:(e,t={})=>"confirm"===t.type?Promise.resolve(confirm(e)):Promise.resolve(prompt(e)),...e})}();let K=null;function U(e){e.querySelectorAll(".checkbox").forEach(e=>{ e.querySelector('input[type="checkbox"]').checked?e.classList.add("selected"):e.classList.remove("selected")})}function W(e){if("true"!==e.dataset.initialised){e.querySelectorAll('input[type="checkbox"]').forEach(t=>{const o=t.closest(".checkbox"),n=o.classList.contains("disabled")?"fas fa-fw fa-check fa-lg":"far fa-fw fa-check-square fa-2x";t.insertAdjacentHTML("afterend",``),t.addEventListener("change",()=>{U(e)}),t.addEventListener("focus",()=>{o.classList.add("focused")}),t.addEventListener("blur",()=>{o.classList.remove("focused")})}),U(e),function(e){null===K&&(K={functional:e.querySelector("input#cookie-modal-functional-cookies").checked,advertising:e.querySelector("input#cookie-modal-advertising-cookies").checked,performance:e.querySelector("input#cookie-modal-performance-cookies").checked})}(e),e.dataset.initialised="true"}}function Z(){var e;let t=document.querySelector("#cookie-modal-wrapper"),o=document.querySelector("#cookie-modal");if(o){const n=document.querySelector("#cookie-banner");(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.zIndex)&&(o.style.zIndex=(parseInt(n.style.zIndex,10)+1).toString());const i=o.querySelector("form");!function(e){e.querySelector("input#cookie-modal-functional-cookies").checked=K.functional,e.querySelector("input#cookie-modal-advertising-cookies").checked=K.advertising,e.querySelector("input#cookie-modal-performance-cookies").checked=K.performance}(i),W(i),U(i),v.whenWrapperDefined(()=>{t.showModal()})}else{const e=encodeURIComponent(window.location.pathname+window.location.search);fetch(`/sitebuilder2/user/cookiepreference/modal.htm?returnTo=${e}`).then(e=>{e.text().then(e=>{document.querySelector(".cookie-preference-modal-container").innerHTML=e,t=document.querySelector("#cookie-modal-wrapper"),o=document.querySelector("#cookie-modal");const n=o.querySelector("form");W(n),o.querySelector(".cookie-preference-submit").addEventListener("click",()=>{n.submit()}),v.whenWrapperDefined(()=>{o.showModal()})})})}}const J=e=>(t={},...o)=>function(e,t,...o){const n=document.createElement(e);return Object.keys(t).forEach(e=>{null!==t[e]&&void 0!==t[e]&&n.setAttribute(e,t[e])}),o.forEach(e=>{null==e||("string"==typeof e?n.appendChild(document.createTextNode(e)):Array.isArray(e)?e.forEach(e=>n.appendChild(e)):n.appendChild(e))}),n}(e,t,...o),Y=J("i"),G=J("img");function X(e){return e.replace(/^\d+-/,"")}function Q(e,t,o){switch(e.type){case"and":return e.conditions.every(e=>Q(e,t,o));case"or":return void 0!==e.conditions.find(e=>Q(e,t,o))}if(!e.targetElementId)return!0;const n=t.elements.find(t=>t.id===e.targetElementId);if(!n)return!0;const i=o[n.id];if("dateTimeElement"===n.type&&!te.test(i))return"isblank"===e.type;switch(e.type){case"eq":if("string"==typeof i)return"listElement"===n.type||"paymentElement"===n.type?X(i)===X(e.value):i===e.value;if("object"==typeof i)return i.checked.map(e=>X(e)).includes(X(e.value));break;case"isblank":return ee(n,i);case"notblank":return!ee(n,i);case"contains":return i.includes(e.value);case"isother":return function(e,t){var o,n;switch(e.type){case"checkboxElement":case"radioElement":return""!==(null!==(n=null===(o=null==t?void 0:t.other)||void 0===o?void 0:o.trim())&&void 0!==n?n:"");case"paymentElement":return""!==t.trim()&&!t.includes("-");default:return!1}}(n,i);case"greaterthan":case"lessthan":return function(e,t,o){if(!o||""===o.trim())return!1;let n,i;switch(t.type){case"numberElement":n=parseInt(e.value,10),i=parseInt(o,10);break;case"dateTimeElement":n=oe(e.value),i=oe(o);break;case"paymentElement":n=parseInt(e.value,10),i=parseFloat(X(o));break;default:return!0}if("greaterthan"===e.type)return i>n;if("lessthan"===e.type)return i{ne[e].addChangeListener(()=>{this.update()})}),this.update()}update(){const e=Q(this.condition.json,re.allElementsJson,ie),t=e&&"hide"===this.logic.outcome.type||!e&&"show"===this.logic.outcome.type;this.element.classList.toggle("hidden",t),this.element.dispatchEvent(new CustomEvent("ConditionalLogicUpdate",{bubbles:!0}))}}re.allElementsJson={elements:[]};class ae{constructor(e){if(this.changeListeners=[],this.value=null,this.canHaveOther=!1,this.hasComparableValues=!1,this.json=e,this.container=document.querySelector(`[data-element-id="${e.id}"]`),this.canHaveOther="checkboxElement"===e.type||"radioElement"===e.type,this.hasComparableValues=["numberElement","dateTimeElement","paymentElement"].includes(e.type),this.container){switch(e.type){case"textFieldElement":case"emailElement":case"phoneNumber":case"numberElement":case"dateTimeElement":this.input=this.container.querySelector("input"),this.isSimpleInput=!0;break;case"textBoxElement":this.input=this.container.querySelector("textarea"),this.isSimpleInput=!0;break;case"listElement":this.input=this.container.querySelector("select"),this.isSimpleInput=!0;break;case"paymentElement":this.input=this.container.querySelector("select");break;default:this.isSimpleInput=!1}if(this.input){if(["focus","blur","change","keydown"].forEach(e=>this.input.addEventListener(e,()=>{this.change()})),"paymentElement"===e.type){const e=this.container.querySelector("input.payment-other");e&&["focus","blur","change","keydown"].forEach(t=>e.addEventListener(t,()=>{this.change()}))}}else switch(e.type){case"checkboxElement":case"radioElement":this.container.querySelectorAll("input").forEach(e=>{e.addEventListener("change",()=>{this.change()})});break;case"pairList":this.container.querySelectorAll("select.pairDropdown").forEach(e=>{e.addEventListener("change",()=>{this.change()})});break;case"attachment":this.observeFileAttachments()}this.value=this.getCurrentValue(),ie[this.json.id]=this.value}}observeFileAttachments(){new MutationObserver(()=>{this.change()}).observe(this.container.querySelector("#attachmentResult"),{childList:!0})}change(){this.value=this.getCurrentValue(),ie[this.json.id]=this.value,this.changeListeners.forEach(e=>{e(this.value)})}getCurrentValue(){var e;if(!this.container)return null;if(this.isSimpleInput||"paymentElement"===this.json.type&&""!==this.input.value)return this.input.value;switch(this.json.type){case"checkboxElement":case"radioElement":return{checked:Array.from(this.container.querySelectorAll("input")).filter(e=>e.checked).map(e=>e.value),other:null===(e=this.container.querySelector('input[type="text"]'))||void 0===e?void 0:e.value};case"pairList":return this.getPairListValue();case"attachment":return this.container.querySelector("[data-file-name]")?"has-attachment":"";case"paymentElement":return this.container.querySelector("input.payment-other").value}return null}getPairListValue(){const e=this.container.querySelectorAll("select");return`${e[0].value}${e[1].value}`}addChangeListener(e){this.changeListeners.push(e)}}class se{constructor(e){var t,o;this.ignore=!1,this.json=e, this.targetElement=ne[this.json.targetElementId],this.targetElement||"and"===this.json.type||"or"===this.json.type?(null!==(o=null===(t=this.json.conditions)||void 0===t?void 0:t.length)&&void 0!==o?o:0)>0&&(this.conditions=this.json.conditions.map(e=>new se(e))):this.ignore=!0}getRelatedElementIds(){var e,t;return this.ignore?[]:"and"===this.json.type||"or"===this.json.type?null!==(t=null===(e=this.conditions)||void 0===e?void 0:e.flatMap(e=>e.getRelatedElementIds()))&&void 0!==t?t:[]:[this.targetElement.json.id]}}!function(){const e=_();let t=!1;const o=S();null==o||o.addEventListener("click",async o=>{o.preventDefault(),t||(await D(e),t=!0),x()})}(),function(e,t){const o=Object.assign({},T,t);C("x","i.fa-twitter,em.fa-twitter",e,o),C("x-square","i.fa-twitter-square,em.fa-twitter-square",e,o)}(document.body),function(){document.querySelectorAll(".cookie-banner-modal-button, #cookie-preference-link").forEach(e=>{e.addEventListener("click",e=>{e.preventDefault(),Z()})});const e=document.querySelector("#cookie-banner-wrapper"),t=document.querySelector("#cookie-banner");if(t){const o=()=>{document.documentElement.style.setProperty("--w-sys-cookieBanner-height",`${t.offsetHeight}px`)};o(),window.addEventListener("resize",o),v.whenWrapperDefined(()=>{e.showModal()})}const o=document.querySelector("#cookiePreferenceForm");if(o){const e=o.querySelector(".btn-accept-all");null==e||e.addEventListener("mouseover",()=>{!function(e){e.querySelectorAll(".checkbox:not(.disabled)").forEach(e=>{e.classList.add("ghostTick")})}(o)}),null==e||e.addEventListener("mouseout",()=>{!function(e){e.querySelectorAll(".checkbox:not(.disabled)").forEach(e=>{e.classList.remove("ghostTick")})}(o)}),W(o)}const n=document.querySelector(".cookie-policy-link a");n&&(null==n||n.addEventListener("click",async e=>{e.preventDefault();let t=document.querySelector("#cookie-policy-dialog");if(t)v.whenWrapperDefined(()=>{t.showModal()});else{t=v.blankDialog({wrapperId:"cookie-policy-dialog-wrapper",dialogId:"cookie-policy-dialog",title:"Cookie Policy",hideCloseButtonInFooter:!0,content:'

Loading

'});let e=document.querySelector("#cookie-policy-dialog-wrapper");document.body.appendChild(e),v.whenWrapperDefined(()=>{e.showModal()});const o=t.querySelector(".dialog-body");try{const e=await fetch(n.getAttribute("href")+"?xdoplain=true"),t=await e.text();o.innerHTML="",o.insertAdjacentHTML("beforeend",(new DOMParser).parseFromString(t,"text/html").querySelector(".content-text").innerHTML)}catch(e){o.innerHTML='

There was an error loading the cookie policy. Refresh the page and try again.

',z.error("Error loading cookie policy:",e)}}}))}(),function(){const e=document.querySelectorAll(".id7-main-content-area a[rel^=lightbox]");if(e.length>0){const t=v.blankDialog({wrapperId:"image-modal-wrapper",dialogId:"image-modal",dialogClasses:"image-modal maximised",title:"Viewing image"}),o=t.querySelector(".dialog-body"),n=t.querySelector(".dialog-footer");document.body.appendChild(t);const i=Y({class:"image-controls left fa fa-chevron-left fa-2x","aria-hidden":"true"}),r=Y({class:"image-controls right fa fa-chevron-right fa-2x","aria-hidden":"true"});function a(t){const n=o.querySelector("img:not(.hidden)");let i=parseInt(n.getAttribute("data-image-index"),10)+t;i<0&&(i=0),i>e.length-1&&(i=e.length-1),s(i,e[i].querySelector("img").getAttribute("title"))}function s(t,a){const s=e[t],l=s.href.split("?")[0],c=new URLSearchParams(s.href.split("?")[1]),d=new URLSearchParams,u=["maxwidth","maxheight"];if(c.forEach((e,t)=>{u.includes(t.toLowerCase())||d.append(t,e)}),!o.querySelector(`img[data-image-index="${t}"]`)){const e=G({src:`${l}?${d}`,"data-image-index":t.toString(10),alt:""});o.appendChild(e)}o.querySelectorAll("img").forEach(e=>{e.classList.toggle("hidden",e.getAttribute("data-image-index")!==t.toString(10))}),n.innerText=a, i.classList.toggle("hidden",0===t),r.classList.toggle("hidden",t===e.length-1)}o.appendChild(i),o.appendChild(r),e.forEach((e,o)=>{e.addEventListener("click",n=>{n.preventDefault(),s(o,e.querySelector("img").getAttribute("title")),v.whenWrapperDefined(()=>{t.showModal()})})}),i.addEventListener("click",()=>{a(-1)}),r.addEventListener("click",()=>{a(1)}),document.addEventListener("keydown",e=>{t.open&&("ArrowLeft"!==e.key&&"Left"!==e.key||a(-1),"ArrowRight"!==e.key&&"Right"!==e.key||a(1))})}}(),function(){if(!document.querySelector(".conditional-logic-json")||!document.getElementById("form-elements-json"))return;const e=JSON.parse(document.getElementById("form-elements-json").innerHTML);e.elements.forEach(e=>ne[e.id]=new ae(e));const t=document.querySelectorAll(".fieldgroup");if(0===t.length)return;re.allElementsJson=e,t.forEach(e=>new re(e));const o=document.getElementById("processFormId");o.addEventListener("submit",e=>{e.preventDefault(),document.querySelectorAll(".fieldgroup.hidden").forEach(e=>{e.querySelectorAll("input, textarea").forEach(e=>{e.value="",e.checked=!1}),e.querySelectorAll("option").forEach(e=>e.selected=!1)}),o.submit()})}()}(jQuery);//# sourceMappingURL=sitebuilder.js.map