1function FormValidator(e){var t={};function r(e){function r(r,n){return function(){var a=arguments;return t[e].push((function(e){if(!n.apply(e,a))return(a[n.length]||r).replace("{}",a[0])})),this}}return t[e]||(t[e]=[]),{required:r("Required",(function(){return this.length})),matches:r("Invalid format",(function(e){return e.test(this)})),notMatches:r("Invalid format",(function(e){return!e.test(this)})),min:r("Value must be greater than or equal to {}",(function(e){return parseFloat(this)>=e})),max:r("Value must be lesser than or equal to {}",(function(e){return parseFloat(this)<=e})),minLength:r("Too short",(function(e){return this.length>=e})),maxLength:r("Too large",(function(e){return this.length<=e})),isEmail:r("Invalid email",(function(){return/^\S+@\S+\.\S{2,}$/.test(this)})),isUrl:r("Invalid URL",(function(){return/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/.test(this)})),custom:r("{}",(function(e,t){return t(this)})),removeAll:function(){t[e]=[]}}}return r.validate=function(r){var n=t[r];if(n){var a=$(':input[name="'+r+'"]',e).filter(":checked, :not(:radio,:checkbox)");a.is("select, :radio, :checkbox, :file")||a.val((function(e,t){return t&&t.trim()}));for(var o=a.val()||"",i=0;i<n.length;i++){var s=n[i](o);if(s)return s}}},r.validateAll=function(){var e={};for(var n in t){var a=r.validate(n);a&&(e[n]=a)}return e},r}jQuery((function(e){"use strict";const t=e("#form");e(":input",t).prop("required",!1);const r=/[/\\:#&;()[\]{}<>"]|[0-9]{2,}/,n=FormValidator(t);function a(r,n){r=e(':input[name="'+r.prop("name")+'"]',t),e("#error_"+r.prop("name")).text(n||""),r.removeClass("is-valid is-invalid"),n?r.addClass("is-invalid"):r.val()&&r.val().trim()&&r.addClass("is-valid")}function o(r){let n=!1;e(":input",t).each((function(){const t=e(this),o=r[t.prop("name")];a(t,o),o&&!n&&(t.trigger("focus"),n=!0)}))}function i(r){const n=t.serialize();return e.ajax({url:r,data:n,type:"POST"})}function s(t){e("#submit_btn").prop("disabled",t),e("#submit_btn_spinner").prop("hidden",!t)}function u(e){s(!1),window.location.href=e||"/thankyouapply"}n("firstname").required().minLength(3,"Too short, must be atleast {} characters long").maxLength(25,"Too long, must be not more than {} characters long").notMatches(r,"Invalid characters, please don't use special characters"),n("lastname").required().minLength(3,"Too short, must be atleast {} characters long").maxLength(25,"Too long, must be not more than {} characters long").notMatches(r,"Invalid characters, please don't use special characters"),n("email").required().isEmail(),n("phone").required().matches(/^\+?\d+$/,"Invalid phone number, please use only numbers and the plus sign").minLength(6,"Your phone number must be at least {} characters long"),n("job").required().minLength(3,"Your occupation must be at least {} characters long").notMatches(r,"Invalid characters, please don't use special characters"),n("country").required().matches(/^[A-Z]{2}$/,"Please select a country"),n("age").required().matches(/^\d+$/,"Invalid age, please enter a number").min(18,"You must be over {} years old to join our programmes").max(100,"At over {} years old maybe you should be teaching us ;)"),n("course").required("Please choose a programme"),e(":input",t).on("change blur",(function(){const t=e(this);a(t,n.validate(t.prop("name")))})),t.on("submit",(function(r){r.preventDefault();const a=n.validateAll();if(!e.isEmptyObject(a))return void o(a);s(!0),e("#submit_error").prop("hidden",!0);const l=addUrlParam(t.prop("action"),"json",1);function c(t,r,n){let a=t.find(`input[name="${r}"]`);a.length>0?(a.val(n),console.log(`updated ${r} to ${n} in form`)):(a=e("<input>").attr({type:"hidden",name:r,value:n}),t.append(a),console.log(`added ${r}=${n} to form`))}c(t,"resolution",screen.width+"x"+screen.height),c(t,"devicePixelRatio",window.devicePixelRatio),i(l).done((function(e){e.success?("undefined"!=typeof sessionStorage&&sessionStorage.setItem("catData",t.serialize()),u(e&&e.redirect)):(e.errors&&o(e.errors),s(!1))}
1)).fail((function(r){if(0===r.status||r.status>=500){if(backupCatalogueFormUrl){!function(e,t){let r=e.split("?")[1];if(r){r=r.split("#")[0],r=r.split("&");for(let e=0;e<r.length;e++){const n=r[e].split("="),a=n[0],o=n[1];c(t,a,decodeURIComponent(o))}}}(l,t),c(t,"referrerUrl",window.document.referrer),c(t,"url",window.location.href);const r=Cookies.get("visid");return r&&c(t,"visid",r),void i(backupCatalogueFormUrl).done((function(e){if(e.success){"undefined"!=typeof sessionStorage&&sessionStorage.setItem("catData",t.serialize());let r="/thankfaunaapply?applyref=catyF&email="+t.find('input[name="email"]').val();e.urlParams&&e.urlParams.xLead&&(r+="&xLead="+e.urlParams.xLead),u(r)}else e.errors&&o(e.errors)})).fail((function(t){t.responseJSON&&t.responseJSON.errors&&t.responseJSON.errors.submit&&"Error: instance not unique"===t.responseJSON.errors.submit?u():(t.responseJSON&&t.responseJSON.errors&&o(t.responseJSON.errors),e("#submit_error").prop("hidden",!1)),s(!1)}))}e("#submit_error").prop("hidden",!1)}r.responseJSON&&o(r.responseJSON.errors),s(!1)}))}))})); 2//# sourceMappingURL=catalogue.min.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.