/*! * native-validator-bootstrap v0.0.6 * Copyright 2020 Iskandar Jamil */ function vc(t){var e=t.currentTarget,i=e.getAttribute("data-vc").trim(),n=i==e.value.trim();if(n){var r=e.parentNode.querySelector('[name="spamCheck"]');r.value=i,r.classList.remove("is-invalid")}return n}!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Validator=e():t.Validator=e()}(window,function(){return i={},t.m=e=[function(t,e,i){(function(e){function i(){return c.Date.now()}var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof e&&e&&e.Object===Object&&e,u="object"==typeof self&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),d=Object.prototype.toString,f=Math.max,h=Math.min;function v(t){var e=typeof t;return t&&("object"==e||"function"==e)}function m(t){if("number"==typeof t)return t;if("symbol"==typeof(e=t)||(i=e)&&"object"==typeof i&&"[object Symbol]"==d.call(e))return NaN;var e,i,l;if(v(t)&&(t=v(l="function"==typeof t.valueOf?t.valueOf():t)?l+"":l),"string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var u=a.test(t);return u||o.test(t)?s(t.slice(2),u?2:8):r.test(t)?NaN:+t}t.exports=function(t,e,n){var r,a,o,s,l,u,c=0,d=!1,y=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var i=r,n=a;return r=a=void 0,c=e,s=t.apply(n,i)}function b(t){var i=t-u;return void 0===u||e<=i||i<0||y&&o<=t-c}function E(){var t,n,r=i();if(b(r))return w(r);l=setTimeout(E,(n=e-((t=r)-u),y?h(n,o-(t-c)):n))}function w(t){return l=void 0,p&&r?g(t):(r=a=void 0,s)}function L(){var t,n=i(),o=b(n);if(r=arguments,a=this,u=n,o){if(void 0===l)return c=t=u,l=setTimeout(E,e),d?g(t):s;if(y)return l=setTimeout(E,e),g(u)}return void 0===l&&(l=setTimeout(E,e)),s}return e=m(e)||0,v(n)&&(d=!!n.leading,o=(y="maxWait"in n)?f(m(n.maxWait)||0,e):o,p="trailing"in n?!!n.trailing:p),L.cancel=function(){void 0!==l&&clearTimeout(l),r=u=a=l=void(c=0)},L.flush=function(){return void 0===l?s:w(i())},L}}).call(this,i(2))},function(t,e,i){var n=i(5).default;n.plugin=n.prototype.plugin,n.plugin("match",i(3).default),n.plugin("email",i(4).default),t.exports=n},function(t,e){var i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";i.r(e),e.default={install:function(){},validate:function(t,e){return t.value===document.querySelector(e).value}}},function(t,e,i){"use strict";i.r(e),e.default={install:function(){},validate:function(t){return/^[_A-z0-9._%+-]+@[_A-z0-9.-]+\.[_A-z]{2,}$/.test(t.value)}}},function(t,e,i){"use strict";i.r(e),i.d(e,"default",function(){return l});var n=i(0),r=i.n(n);function a(t,e){for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),i=e.length;0<=--i&&e.item(i)!==this;);return-1/^(\+44|01|02|03|04|05|06|07|08|09)[0-9 ()-]+$/.test(t.value)}),Validator.plugin("spam",{install(){},validate:(t,e)=>vc({currentTarget:t})}),Validator.plugin("function",{install(){},validate(t,e){const i=e;return"function"==typeof window[i]?window[i](t,e):(console.error(`Validation function ${i} does not exist.`),!1)}});var validatorInit=function(){document.querySelectorAll("form").forEach(function(t){new Validator(t,{})});for(var t=document.getElementsByName("txtSpam"),e=0;e{if(t.ok)return t.json();throw t}).then(e=>{document.querySelectorAll(".error-message").forEach(t=>t.remove()),t.querySelector("button.af-submit").classList.remove("af-processing");var i=window[n];"function"==typeof i?i(t,e):af_success(t,e),setTimeout(function(){""!==a&&document.body.classList.remove(a)},1500)}).catch(e=>{e.text().then(e=>{var i=JSON.parse(e);for(var n in document.querySelectorAll(".invalid-feedback").forEach(t=>t.innerHTML=""),t.querySelector("button.af-submit").classList.remove("af-processing"),i.errors){var a=t.querySelector('[name="'+n+'"]');if(a){a.classList.remove("is-valid"),a.classList.add("is-invalid");for(var o=[],s=a.nextElementSibling;s;){if(s.classList.contains("invalid-feedback")){o.push(s);break}s=s.nextElementSibling}s&&(s.innerHTML=i.errors[n].msg)}}var l=window[r];"function"==typeof l?l(t,e):console.log(i)})})}}function af_load(t){document.querySelectorAll("form[data-af-success] button.af-submit").forEach(function(t){t.addEventListener("click",function(t){if(!t.target.classList.contains("af-processing")){var e=t.target.closest("form")||null;e&&AUTOFORM_NODE(e)}})})}function af_success(){parent.showAlert("icon-ok-circled","Success","Thank you for your interest","#FFFFFF",!1),"undefined"!=typeof modalClose&&modalClose()}function af_fail(){parent.showAlert("icon-cancel-circled","Fail","There was an error with the form, please make sure all required information is entered and try again.","#FFFFFF",!1),"undefined"!=typeof modalClose&&modalClose()}validatorInit(),document.addEventListener("DOMContentLoaded",function(){af_load(document)});var modaloElement=document.querySelector(".modalo"),overlay_EventAttached=!1;function isIframe(){try{return window.self!==window.top}catch(t){return!0}}function showOverlay(t){if(void 0!==t&&null!=t){var e=t.URL||"",i=t.Contents||"",n=t.W||1024,r=t.H||600,a=(t.NoExit,{W:screen.width,H:screen.height});void 0!==window.matchMedia&&(window.matchMedia("(orientation: portrait)").matches?a.W=screen.width:window.matchMedia("(orientation: landscape)").matches&&screen.height>a.W&&(a.W=screen.height,a.H=screen.width)),t.NoExit&&document.body.classList.add("noexit"),modaloElement.style.maxWidth=n+"px",modaloElement.style.maxHeight=r+"px";var o=Math.max(a.H/2-r/2-a.H/2,0);if(modaloElement.style.top=o+"px",isIframe())return window.location=e;if(modaloElement.classList.remove("loaded"),modaloElement.innerHTML=i,""!==e){var s=n,l=r;s=s>a.W?a.W:s,l=l>a.H?a.H:l;var u="/_components/web_optimised/overlay-iframe.css";if(!document.head.querySelector('link[href="'+u+'"]')){var c=document.createElement("link");c.rel="stylesheet",c.href=u,document.head.appendChild(c)}var d=document.createElement("div");d.id="close",d.innerHTML="",modaloElement.appendChild(d);var f=document.createElement("iframe");f.width=s,f.id="iframeOverlay",f.src=e,modaloElement.appendChild(f),f.addEventListener("load",function(){modaloElement.classList.add("loaded")})}else modaloElement.classList.add("loaded");overlay_EventAttached||(document.body.addEventListener("click",clicked),overlay_EventAttached=!0),setTimeout(function(){document.body.classList.add("overlay")},0)}}function clicked(t){if(!document.body.classList.contains("noexit")){var e=t?.target||t?.srcElement;e&&3===e.nodeType&&(e=e.parentNode),e&&e.classList.contains("modal")||(document.body.classList.remove("overlay"),parent.document?.body.classList.remove("overlay"),window.lastLink&&(window.location.href=window.lastLink,window.lastLink=null),setTimeout(()=>{document.body.classList.contains("overlay")||(document.querySelector(".modalo").innerHTML="")},5e3))}}function showAlert(t,e,i,n,r){showOverlay({Contents:'

'+e+"

"+i+"

",NoExit:r})}