PageSourceSearch

https://aimwa.com/sc/03bb0a28.e5d2d287.8873d800.7dd0b848.js.v1

js aimwa.com collected 2026-09-29 21:50:52 UTC 83,765 bytes, 374 lines download raw bytes

1'use strict';var Common;(function(Common){let Functions;(function(Functions){function RedirectToLoginPage(redirect,email){const logInUri=new URI('/log-in');if(redirect){logInUri.addSearch('Redirect',redirect);}
2if(email){logInUri.addSearch('Email',email);}
3window.location.href=logInUri.toString();}
4Functions.RedirectToLoginPage=RedirectToLoginPage;function ValidateRecaptchaForForm(formId){var _a;try{const recaptchaElement=document.querySelector(`.g-recaptcha[data-form-id="${formId}"]`);const recaptchaResponse=(_a=document.getElementById('g-recaptcha-response'))===null||_a===void 0?void 0:_a.value;const recaptchaValidationMessage=document.getElementById(`RecaptchaValidationMessage-${formId}`);if(!recaptchaElement||!recaptchaValidationMessage){console.error(`reCAPTCHA or validation message not found for form: ${formId}`);return false;}
5if(!recaptchaResponse){recaptchaValidationMessage.classList.remove('d-none');recaptchaValidationMessage.classList.add('d-block');console.warn(`reCAPTCHA not completed for form: ${formId}`);return false;}
6else{recaptchaValidationMessage.classList.remove('d-block');recaptchaValidationMessage.classList.add('d-none');return true;}}
7catch(error){console.error(`An error occurred during reCAPTCHA validation for form: ${formId}`,error);return false;}}
8Functions.ValidateRecaptchaForForm=ValidateRecaptchaForForm;function BlobToBase64(blob){return new Promise((resolve,reject)=>{const reader=new FileReader();reader.onload=()=>resolve(reader.result.split(',')[1]);reader.onerror=reject;reader.readAsDataURL(blob);});}
9Functions.BlobToBase64=BlobToBase64;;function SetMessage(message,alertClass='alert-success',isHtml,domElement){const element=domElement||document.getElementById('MessageContainer');if(!element){return;}
10if(message){isHtml?element.innerHTML=message:element.textContent=message;element.className='alert';element.classList.add(alertClass);Unhide(element);if(!ElementIsInViewport(element)){element.scrollIntoView();}}
11else{element.textContent='';Hide(element);}}
12Functions.SetMessage=SetMessage;function SetApiToken(apiToken){try{if(apiToken){localStorage.setItem('apiToken',apiToken);}
13else{localStorage.removeItem('apiToken');}}
14catch(e){console.error(e,e.stack);}}
15Functions.SetApiToken=SetApiToken;function IsLoggedIn(){const jwt=GetApiToken();if(HasJwtExpired(jwt)){return false;}
16return true;}
17Functions.IsLoggedIn=IsLoggedIn;function PerformSearch(query){window.location.href=`/search?q=${encodeURIComponent(query)}`;}
18Functions.PerformSearch=PerformSearch;function InsensitiveStringEquals(stringA,stringB){return stringA.localeCompare(stringB,undefined,{sensitivity:'accent'})===0;}
19Functions.InsensitiveStringEquals=InsensitiveStringEquals;function AwaitHttpRequests(httpCalls,runAfter){for(let i=0;i<httpCalls.length;++i){if(httpCalls[i].readyState!==XMLHttpRequest.DONE){httpCalls[i].onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE){AwaitHttpRequests(httpCalls,runAfter);}};return;}}
20if(runAfter){runAfter();}}
21Functions.AwaitHttpRequests=AwaitHttpRequests;function HttpStatusIsSuccess(status){return status>=200&&status<400;}
22Functions.HttpStatusIsSuccess=HttpStatusIsSuccess;function IsProfessionalMemberType(memberType){return['M','F','AF'].indexOf(memberType)>-1;}
23Functions.IsProfessionalMemberType=IsProfessionalMemberType;function CanUpgradeProfessionalMembership(memberType){return['M','AF'].indexOf(memberType)>-1;}
24Functions.CanUpgradeProfessionalMembership=CanUpgradeProfessionalMembership;function GetFileSizeMiB(file){return file.size/1048576;}
25Functions.GetFileSizeMiB=GetFileSizeMiB;function LowercaseCapitaliseFirstLetter(string){return string.toLowerCase().charAt(0).toUpperCase()+string.slice(1);}
26Functions.LowercaseCapitaliseFirstLetter=LowercaseCapitaliseFirstLetter;function SetEventLocation(event){var _a;const domLocation=document.getElementById('Location');const domEventLocation=document.getElementById('EventLocation');const domLocationHeading=document.getElementById('LocationHeading');const dombookedLocation=document.getElementById('bookedLocation');
26if(domEventLocation){if(Common.Functions.InsensitiveStringEquals((_a=event.address.suburb)!==null&&_a!==void 0?_a:"",'Virtual')){domLocationHeading.innerHTML='Location';domEventLocation.innerHTML='Delivered Virtually';}
27else{domLocationHeading.innerHTML='Address';if(event.address.addressLines.length||event.address.suburb.length){domEventLocation.innerHTML=GetFormattedEventAddress(event.address);}
28else{Hide(domLocation);if(dombookedLocation){Hide(dombookedLocation);}}}}}
29Functions.SetEventLocation=SetEventLocation;})(Functions=Common.Functions||(Common.Functions={}));let Models;(function(Models){class RegistrantClass{constructor(apiData){this.code=apiData.Code;this.name=apiData.Name;}}
30Models.RegistrantClass=RegistrantClass;class Price{constructor(apiData){this.registrantClass=apiData.RegistrantClass;this.rate=apiData.Rate;this.regularRate=apiData.RegularRate;}}
31Models.Price=Price;class EventAddress{constructor(apiData){this.addressLines=apiData.AddressLines;this.country=apiData.Country;this.suburb=apiData.Suburb;this.postcode=apiData.Postcode;this.state=apiData.State;}}
32Models.EventAddress=EventAddress;class Event{constructor(apiData){this.eventCode=apiData.EventCode;this.title=apiData.Title;this.beginDateTime=moment(`${apiData.BeginDateTime}+08:00`).utcOffset('+0800');this.endDateTime=moment(`${apiData.EndDateTime}+08:00`).utcOffset('+0800');this.placesAvailable=apiData.PlacesAvailable;this.address=new EventAddress(apiData.Address);this.room=apiData.Room;this.taxIncluded=apiData.TaxIncluded;this.canRegisterOthers=apiData.CanRegisterOthers;this.canRegisterGuests=apiData.CanRegisterGuests;this.registerable=apiData.Registerable;this.isEarlyBird=apiData.IsEarlyBird;this.displayable=apiData.Displayable;this.prices=apiData.Prices.map(p=>new Price(p));}}
33Models.Event=Event;class DietaryOption{constructor(apiData){this.code=apiData.Code;this.description=apiData.Description;}}
34Models.DietaryOption=DietaryOption;class Address{constructor(apiData){this.addressLines=apiData.AddressLines;this.suburb=apiData.Suburb;this.postcode=apiData.Postcode;this.state=apiData.State;this.country=apiData.Country;this.preferredBill=apiData.PreferredBill;this.preferredMail=apiData.PreferredMail;this.preferredShip=apiData.PreferredShip;}}
35Models.Address=Address;class Company{constructor(apiData){this.billingAddress=new Address(apiData.BillingAddress);this.id=apiData.Id;this.memberType=apiData.MemberType;this.name=apiData.Name;this.registrantClass=apiData.RegistrantClass;}}
36Models.Company=Company;class CartItemAttendee{constructor(isMe,id,totalExGst,gst,discount,prefix,firstName,lastName,preferredName,email,workPhone,mobilePhone,positionTitle,dietaryRequirements,isWaitlisted,preventInitialComms){this.isMe=isMe;this.id=id;this.totalExGst=totalExGst;this.gst=gst;this.discount=discount;this.prefix=prefix;this.firstName=firstName;this.lastName=lastName;this.preferredName=preferredName;this.email=email;this.workPhone=workPhone;this.mobilePhone=mobilePhone;this.positionTitle=positionTitle;this.dietaryRequirements=dietaryRequirements;this.isWaitlisted=isWaitlisted;this.preventInitialComms=preventInitialComms;}}
37Models.CartItemAttendee=CartItemAttendee;class User{constructor(apiData){this.company=apiData.Company?new Company(apiData.Company):null;this.creationDate=apiData.CreationDate?moment(apiData.CreationDate):null;this.dietaryRequirements=apiData.DietaryRequirements;this.designation=apiData.Designation;this.email=apiData.Email;this.firstName=apiData.FirstName;this.fullName=apiData.FullName;this.id=apiData.Id;this.informalName=apiData.InformalName;this.lastName=apiData.LastName;this.memberType=apiData.MemberType;this.registrantClass=apiData.RegistrantClass;this.middleName=apiData.MiddleName;this.mobilePhone=apiData.MobilePhone;this.paidThrough=apiData.PaidThrough?moment(apiData.PaidThrough):null;this.prefix=apiData.Prefix;this.previousMemberType=apiData.PreviousMemberType;this.positionTitle=apiData.PositionTitle;this.website=apiData.Website;this.workPhone=apiData.WorkPhone;this.eventsAttending=apiData.EventsAttending;this.companyAddress=apiData.CompanyAddress?new Address(apiData.CompanyAddress):null;this.otherAddress=apiData.OtherAddress?new Address(apiData.OtherAddress):null;this.gender=apiData.Gender;this.generation=apiData.Generation;this.industry=apiData.Industry;this.enteredGiveaway2025=apiData.EnteredGiveaway2025;}}
38Models.User=User;class CourseAttendee{}
39Models.CourseAttendee=CourseAttendee;})(Models=Common.Models||(Common.Models={}));let CustomValidation;(function(CustomValidation){function Init(){initOneValidInGroup();initSameAs();}
40CustomValidation.Init=Init;const attrOneValidInGroup='data-customValidationOneValidInGroup';const attrOneValidInGroupInitialised='data-customValidationOneInGroupInitialised';function initOneValidInGroup(){Array.from(document.querySelectorAll(`input[${attrOneValidInGroup}
40]`)).forEach(element=>{const groupName=element.getAttribute(attrOneValidInGroup);element.addEventListener('input',()=>{OneValidInGroup(groupName);});element.setAttribute(attrOneValidInGroupInitialised,'');OneValidInGroup(groupName);});}
41function OneValidInGroup(groupName){if(!groupName){return;}
42const groupElements=Array.from(document.querySelectorAll(`input[${attrOneValidInGroup}=${groupName}]`));groupElements.forEach(element=>element.setCustomValidity(''));const groupElementsWithValues=groupElements.filter(element=>element.value);const isValid=groupElementsWithValues.length?groupElementsWithValues.some(element=>element.validity.valid):false;groupElements.forEach(element=>element.setCustomValidity(isValid?'':'Invalid'));}
43CustomValidation.OneValidInGroup=OneValidInGroup;const attrSameAs='data-customValidationSameAs';const attrSameAsInitialised='data-customValidationSameAsInitialised';function initSameAs(){Array.from(document.querySelectorAll(`input[${attrSameAs}]`)).forEach(thisElement=>{const sameAsElement=document.getElementById(thisElement.getAttribute(attrSameAs));if(!thisElement.getAttribute(attrSameAsInitialised)){thisElement.addEventListener('input',()=>{SameAs(thisElement,sameAsElement);});sameAsElement.addEventListener('input',()=>{SameAs(thisElement,sameAsElement);});thisElement.setAttribute(attrSameAsInitialised,'');}
44SameAs(thisElement,sameAsElement);});}
45function SameAs(thisElement,sameAsElement){thisElement.setCustomValidity(thisElement.value===sameAsElement.value?'':'Invalid');}
46CustomValidation.SameAs=SameAs;})(CustomValidation=Common.CustomValidation||(Common.CustomValidation={}));let AISurveyAPI;(function(AISurveyAPI){const baseUrl='/umbraco/api/aiagent';class ValidationError extends Error{constructor(message,allowedOptions){super(message);this.allowedOptions=allowedOptions;this.name='ValidationError';}}
47AISurveyAPI.ValidationError=ValidationError;async function startSurvey(initialAnswers,isGated=true){const response=await fetch(`${baseUrl}/start-survey`,{method:'POST',headers:{'Content-Type':'application/json',},body:JSON.stringify({initialAnswers:initialAnswers,isGated:isGated})});if(!response.ok){throw new Error(`HTTP error! status: ${response.status}`);}
48return await response.json();}
49AISurveyAPI.startSurvey=startSurvey;async function continueSurvey(request){const response=await fetch(`${baseUrl}/continue-survey`,{method:'POST',headers:{'Content-Type':'application/json',},body:JSON.stringify(request),});const result=await response.json();if(!response.ok){if(response.status===400&&result.allowedOptions){throw new ValidationError(result.error,result.allowedOptions);}
50throw new Error(result.error||`HTTP error! status: ${response.status}`);}
51return result;}
52AISurveyAPI.continueSurvey=continueSurvey;async function submitUserInfo(userInfo){const response=await fetch(`${baseUrl}/collect-user-info`,{method:'POST',headers:{'Content-Type':'application/json',},body:JSON.stringify(userInfo),});if(!response.ok){const error=await response.json();throw new Error(error.error||`HTTP error! status: ${response.status}`);}
53return await response.json();}
54AISurveyAPI.submitUserInfo=submitUserInfo;async function checkHealth(){try{const response=await fetch(`${baseUrl}/health`);const result=await response.json();return result.success&&result.status==='healthy';}
55catch(_a){return false;}}
56AISurveyAPI.checkHealth=checkHealth;async function ValidateGrecaptchaToken(grecaptchaToken){try{const response=await fetch(Common.AimwaApiUrl+'v1/Form/Validate-Recaptcha',{method:'POST',headers:{'Content-Type':'application/json',},body:JSON.stringify({GrecaptchaToken:grecaptchaToken})});if(!response.ok){return false;}
57const result=await response.json();return result.success===true;}
58catch(error){console.error('reCAPTCHA validation error:',error);return false;}}
59AISurveyAPI.ValidateGrecaptchaToken=ValidateGrecaptchaToken;})(AISurveyAPI=Common.AISurveyAPI||(Common.AISurveyAPI={}));let Api;(function(Api){function SendRequest(requestMethod,url,setAuthorizationHeader,bodyObject,responseType){const uri=new URI(url);uri.addSearch('Time',new Date().getTime());const request=new XMLHttpRequest();request.open(requestMethod,uri.toString(),true);request.setRequestHeader('Content-Type','application/json');
59if(responseType!=null){request.responseType=responseType;}
60if(setAuthorizationHeader){const apiToken=GetApiToken();request.setRequestHeader('Authorization',`Bearer ${apiToken}`);}
61request.send(bodyObject?JSON.stringify(bodyObject):null);return request;}
62Api.SendRequest=SendRequest;async function SendRequestFetch(requestMethod,url,setAuthorizationHeader,bodyObject){const apiToken=GetApiToken();const response=await fetch(url,{method:requestMethod,headers:{'Content-Type':'application/json','Authorization':setAuthorizationHeader?`Bearer ${apiToken}`:``},body:bodyObject?JSON.stringify(bodyObject):null});return response;}
63Api.SendRequestFetch=SendRequestFetch;function UserExists(emailAddress){const uri=new URI(Common.AimwaApiUrl+'v1/Users/User-Exists/');uri.addSearch('EmailAddress',emailAddress);return SendRequest('GET',uri.toString());}
64Api.UserExists=UserExists;function EligibleForFreeMembership(emailAddress){const uri=new URI(Common.AimwaApiUrl+'v1/Users/Eligible-For-Free-Membership/');uri.addSearch('EmailAddress',emailAddress);return SendRequest('GET',uri.toString());}
65Api.EligibleForFreeMembership=EligibleForFreeMembership;function ResetPasswordStage1(email){return SendRequest('PUT',Common.AimwaApiUrl+'v1/Users/Reset-Password-Stage-1',false,{Email:email});}
66Api.ResetPasswordStage1=ResetPasswordStage1;function ResetPasswordStage2(resetToken,newPassword){return SendRequest('PUT',Common.AimwaApiUrl+'v1/Users/Reset-Password-Stage-2',false,{Token:resetToken,NewPassword:newPassword});}
67Api.ResetPasswordStage2=ResetPasswordStage2;function Login(username,password){return SendRequest('POST',Common.AimwaApiUrl+'v1/Users/Log-In',false,{Username:username,Password:password});}
68Api.Login=Login;function Register(dataObject){return SendRequest('POST',Common.AimwaApiUrl+'v1/Users/Register',false,dataObject);}
69Api.Register=Register;function ChangePassword(oldPassword,newPassword){return SendRequest('POST',Common.AimwaApiUrl+'v1/User/Change-Password',true,{OldPassword:oldPassword,NewPassword:newPassword});}
70Api.ChangePassword=ChangePassword;function GetInvoices(limit=25,offset=0){return SendRequest('GET',Common.AimwaApiUrl+'v1/User/Invoices?limit='+limit+'&offset='+offset,true);}
71Api.GetInvoices=GetInvoices;function GetInvoiceByOrderNumber(orderNumber){return SendRequest('GET',Common.AimwaApiUrl+'v1/User/Invoices/'+orderNumber,true);}
72Api.GetInvoiceByOrderNumber=GetInvoiceByOrderNumber;function DownloadInvoice(orderNumber){return SendRequest('GET',Common.AimwaApiUrl+'v1/User/Invoices/'+orderNumber+'/Download',true,null,'blob');}
73Api.DownloadInvoice=DownloadInvoice;function RequestGuide(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Form/Request-Guide',true,data);}
74Api.RequestGuide=RequestGuide;function PayInvoices(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Invoices/',false,data);}
75Api.PayInvoices=PayInvoices;function GetInvoiceListByBillToId(billToId,invoiceNumber,invoiceDate){return SendRequest('POST',Common.AimwaApiUrl+'v1/Invoices/InvoiceListById/',true,{BillToId:billToId,InvoiceNumber:invoiceNumber,InvoiceDate:invoiceDate});}
76Api.GetInvoiceListByBillToId=GetInvoiceListByBillToId;function DownloadInvoiceFromStatement(invoiceNumber,orderNumber){return SendRequest('GET',Common.AimwaApiUrl+'v1/Invoices/DownloadInvoice/'+invoiceNumber+'/'+orderNumber,true,null,'blob');}
77Api.DownloadInvoiceFromStatement=DownloadInvoiceFromStatement;function GetOpenPrograms(beginDateFrom,beginDateTo,onlyShowDisplayable,onlyShowRegisterable,limit,offset){const uri=new URI(Common.AimwaApiUrl+'v1/Open-Programs/');if(beginDateFrom){uri.addSearch('BeginDateStart',beginDateFrom.format('YYYY-MM-DD'));}
78if(beginDateTo){uri.addSearch('BeginDateEnd',beginDateTo.format('YYYY-MM-DD'));}
79if(onlyShowRegisterable){uri.addSearch('onlyShowRegisterable',onlyShowRegisterable);}
80if(onlyShowDisplayable){uri.addSearch('onlyShowDisplayable',onlyShowDisplayable);}
81if(limit){uri.addSearch('Limit',limit);}
82if(offset){uri.addSearch('Offset',offset);}
83return SendRequest('GET',uri.toString(),true);}
84Api.GetOpenPrograms=GetOpenPrograms;function GetOpenProgramsByProgramNumber(programNumber,beginDateFrom,beginDateTo,onlyShowDisplayable,onlyShowRegisterable,limit,offset){const uri=new URI(Common.AimwaApiUrl+'v1/Open-Programs/By-Program-Number/'+programNumber+'/');if(beginDateFrom){uri.addSearch('BeginDateStart',beginDateFrom.format('YYYY-MM-DD'));}
85if(beginDateTo){uri.addSearch('BeginDateEnd',beginDateTo.format('YYYY-MM-DD'));}
86if(onlyShowRegisterable){uri.addSearch('onlyShowRegisterable',onlyShowRegisterable);}
87if(onlyShowDisplayable){uri.addSearch('onlyShowDisplayable',onlyShowDisplayable);}
88if(limit){uri.addSearch('Limit',limit);}
89if(offset){uri.addSearch('Offset',offset);}
90return SendRequest('GET',uri.toString(),true);}
91Api.GetOpenProgramsByProgramNumber=GetOpenProgramsByProgramNumber;function GetComputingOpenPrograms(beginDateFrom,beginDateTo,onlyShowDisplayable,onlyShowRegisterable,limit,offset){const uri=new URI(Common.AimwaApiUrl+'v1/Open-Programs/Computing/');if(beginDateFrom){uri.addSearch('BeginDateStart',beginDateFrom.format('YYYY-MM-DD'));}
92if(beginDateTo){uri.addSearch('BeginDateEnd',beginDateTo.format('YYYY-MM-DD'));}
93if(onlyShowRegisterable){uri.addSearch('onlyShowRegisterable',onlyShowRegisterable);}
94if(onlyShowDisplayable){uri.addSearch('onlyShowDisplayable',onlyShowDisplayable);}
95if(limit){uri.addSearch('Limit',limit);}
96if(offset){uri.addSearch('Offset',offset);}
97return SendRequest('GET',uri.toString(),true);}
98Api.GetComputingOpenPrograms=GetComputingOpenPrograms;function GetExecutiveEducationOpenPrograms(beginDateFrom,beginDateTo,onlyShowDisplayable,onlyShowRegisterable,limit,offset){const uri=new URI(Common.AimwaApiUrl+'v1/Open-Programs/Executive-Education/');if(beginDateFrom){uri.addSearch('BeginDateStart',beginDateFrom.format('YYYY-MM-DD'));}
99if(beginDateTo){uri.addSearch('BeginDateEnd',beginDateTo.format('YYYY-MM-DD'));}
100if(onlyShowRegisterable){uri.addSearch('onlyShowRegisterable',onlyShowRegisterable);}
101if(onlyShowDisplayable){uri.addSearch('onlyShowDisplayable',onlyShowDisplayable);}
102if(limit){uri.addSearch('Limit',limit);}
103if(offset){uri.addSearch('Offset',offset);}
104return SendRequest('GET',uri.toString(),true);}
105Api.GetExecutiveEducationOpenPrograms=GetExecutiveEducationOpenPrograms;function GetRegistrantClasses(){return SendRequest('GET',Common.AimwaApiUrl+'v1/Users/Registrant-Classes');}
106Api.GetRegistrantClasses=GetRegistrantClasses;function AddEventToCart(eventCode){return SendRequest('PUT',Common.AimwaApiUrl+'v1/Cart/Event/'+eventCode,true);}
107Api.AddEventToCart=AddEventToCart;
107async function AddEventToCartFetch(eventCode){return await SendRequestFetch('PUT',Common.AimwaApiUrl+'v1/Cart/Event/'+eventCode,true);}
108Api.AddEventToCartFetch=AddEventToCartFetch;function GetEvents(beginDateFrom,beginDateTo,onlyShowDisplayable,onlyShowRegisterable,limit,offset){const uri=new URI(Common.AimwaApiUrl+'v1/Events/');if(beginDateFrom){uri.addSearch('BeginDateStart',beginDateFrom.format('YYYY-MM-DD'));}
109if(beginDateTo){uri.addSearch('BeginDateEnd',beginDateTo.format('YYYY-MM-DD'));}
110if(onlyShowRegisterable){uri.addSearch('onlyShowRegisterable',onlyShowRegisterable);}
111if(onlyShowDisplayable){uri.addSearch('onlyShowDisplayable',onlyShowDisplayable);}
112if(limit){uri.addSearch('Limit',limit);}
113if(offset){uri.addSearch('Offset',offset);}
114return SendRequest('GET',uri.toString(),true);}
115Api.GetEvents=GetEvents;function GetEventByEventCode(eventCode){return SendRequest('GET',Common.AimwaApiUrl+'v1/Events/By-Code/'+eventCode,true);}
116Api.GetEventByEventCode=GetEventByEventCode;async function GetEventByEventCodeFetch(eventCode){return await SendRequestFetch('GET',Common.AimwaApiUrl+'v1/Events/By-Code/'+eventCode,true);}
117Api.GetEventByEventCodeFetch=GetEventByEventCodeFetch;async function GetEventsByEventCodes(eventCodes){const url=new URL(Common.AimwaApiUrl+'v1/Events/By-Codes');eventCodes.forEach(code=>url.searchParams.append('codes',code));return await SendRequestFetch('GET',url.toString(),true);}
118Api.GetEventsByEventCodes=GetEventsByEventCodes;async function SubmitQuoteRequest(name,email,phoneNumber,quantity,eventCode,quoteIsForRequester,participantNames){return await SendRequestFetch('POST',`${Common.AimwaApiUrl}v1/Open-Programs/Get-Quote/`,true,{Name:name,Email:email,PhoneNumber:phoneNumber,Quantity:quantity,EventCode:eventCode,QuoteIsForRequester:quoteIsForRequester,ParticipantNames:participantNames});}
119Api.SubmitQuoteRequest=SubmitQuoteRequest;function DownloadCompanyExpenditureReport(companyId,startDate,endDate){const uri=new URI(Common.AimwaApiUrl+'v1/Company/'+companyId+'/Company-Expenditure-Report/');if(startDate){uri.addSearch('StartDate',startDate.format('YYYY-MM-DD'));}
120if(endDate){uri.addSearch('EndDate',endDate.format('YYYY-MM-DD'));}
121return SendRequest('GET',uri.toString(),true,null,'blob');}
122Api.DownloadCompanyExpenditureReport=DownloadCompanyExpenditureReport;function GetMyCompanies(){return SendRequest('GET',Common.AimwaApiUrl+'v1/User/My-Companies/',true);}
123Api.GetMyCompanies=GetMyCompanies;function AddAttendeeById(eventCode,attendeeId){return SendRequest('POST',Common.AimwaApiUrl+'v1/Cart/Event/'+eventCode+'/Attendee/',true,{UserID:attendeeId});}
124Api.AddAttendeeById=AddAttendeeById;function RemoveAttendee(eventCode,attendeeId){return SendRequest('DELETE',Common.AimwaApiUrl+'v1/Cart/Event/'+eventCode+'/Attendee/'+attendeeId,true);}
125Api.RemoveAttendee=RemoveAttendee;function RemoveCartItem(eventCode){return SendRequest('DELETE',Common.AimwaApiUrl+'v1/Cart/Event/'+eventCode,true);}
126Api.RemoveCartItem=RemoveCartItem;function ApplyPromoCode(promoCode){return SendRequest('PUT',Common.AimwaApiUrl+'v1/Cart/PromoCode/'+promoCode,true);}
127Api.ApplyPromoCode=ApplyPromoCode;function GetCurrencyRate(currencyCode){return fetch(`/api/Cost/${currencyCode}`).then(response=>{if(!response.ok)
128throw new Error('Network response was not ok');return response.json();});}
129Api.GetCurrencyRate=GetCurrencyRate;function RemovePromoCode(){return SendRequest('DELETE',Common.AimwaApiUrl+'v1/Cart/PromoCode/',true);}
130Api.RemovePromoCode=RemovePromoCode;function GetCart(){return SendRequest('GET',Common.AimwaApiUrl+'v1/Cart',true);}
131Api.GetCart=GetCart;function SendLocalCartDataToApi(){const existingBookings=JSON.parse(localStorage.getItem('existingBookings')||'[]');return SendRequest('POST',Common.AimwaApiUrl+'v1/Cart/LocalCart',true,existingBookings);}
132Api.SendLocalCartDataToApi=SendLocalCartDataToApi;function UpdateCart(preferredBilling){return SendRequest('PUT',Common.AimwaApiUrl+'v1/Cart',true,{PreferredBilling:preferredBilling});}
133Api.UpdateCart=UpdateCart;function SubmitCart(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Cart',true,data);}
134Api.SubmitCart=SubmitCart;function GetLoggedInUser(){return SendRequest('GET',Common.AimwaApiUrl+'v1/User',true);}
135Api.GetLoggedInUser=GetLoggedInUser;function UpdateLoggedInUser(apiUpdateLoggedInUserData){return SendRequest('PUT',Common.AimwaApiUrl+'v1/User',true,apiUpdateLoggedInUserData);}
136Api.UpdateLoggedInUser=UpdateLoggedInUser;function UpdateAttendee(eventCode,cartItemAttendee){return SendRequest('PUT',Common.AimwaApiUrl+'v1/Cart/Event/'+eventCode+'/Attendee/'+cartItemAttendee.id,true,{Prefix:cartItemAttendee.prefix,FirstName:cartItemAttendee.firstName,LastName:cartItemAttendee.lastName,PreferredName:cartItemAttendee.preferredName,Email:cartItemAttendee.email,WorkPhone:cartItemAttendee.workPhone,MobilePhone:cartItemAttendee.mobilePhone,PositionTitle:cartItemAttendee.positionTitle,CompanyName:cartItemAttendee.companyName,CompanyCity:cartItemAttendee.companyCity,DietaryRequirements:cartItemAttendee.dietaryRequirements,PreventInitialComms:cartItemAttendee.preventInitialComms});}
137Api.UpdateAttendee=UpdateAttendee;function AddGuest(eventCode,cartItemAttendee){return SendRequest('POST',Common.AimwaApiUrl+'v1/Cart/Event/'+eventCode+'/Guest/',true,{Prefix:cartItemAttendee.prefix,FirstName:cartItemAttendee.firstName,LastName:cartItemAttendee.lastName,PreferredName:cartItemAttendee.preferredName,Email:cartItemAttendee.email,WorkPhone:cartItemAttendee.workPhone,MobilePhone:cartItemAttendee.mobilePhone,PositionTitle:cartItemAttendee.positionTitle,CompanyName:cartItemAttendee.companyName,CompanyCity:cartItemAttendee.companyCity,DietaryRequirements:cartItemAttendee.dietaryRequirements,PreventInitialComms:cartItemAttendee.preventInitialComms});}
138Api.AddGuest=AddGuest;async function AddGuestFetch(eventCode,cartItemAttendee){return await Send
138RequestFetch('POST',Common.AimwaApiUrl+'v1/Cart/Event/'+eventCode+'/Guest/',true,{Prefix:cartItemAttendee.prefix,FirstName:cartItemAttendee.firstName,LastName:cartItemAttendee.lastName,PreferredName:cartItemAttendee.preferredName,Email:cartItemAttendee.email,WorkPhone:cartItemAttendee.workPhone,MobilePhone:cartItemAttendee.mobilePhone,PositionTitle:cartItemAttendee.positionTitle,CompanyName:cartItemAttendee.companyName,CompanyCity:cartItemAttendee.companyCity,DietaryRequirements:cartItemAttendee.dietaryRequirements,PreventInitialComms:cartItemAttendee.preventInitialComms});}
139Api.AddGuestFetch=AddGuestFetch;function AddAttendee(eventCode,cartItemAttendee){return SendRequest('POST',Common.AimwaApiUrl+'v1/Cart/Event/'+eventCode+'/Attendee/',true,{Prefix:cartItemAttendee.prefix,FirstName:cartItemAttendee.firstName,LastName:cartItemAttendee.lastName,PreferredName:cartItemAttendee.preferredName,Email:cartItemAttendee.email,WorkPhone:cartItemAttendee.workPhone,MobilePhone:cartItemAttendee.mobilePhone,PositionTitle:cartItemAttendee.positionTitle,CompanyName:cartItemAttendee.companyName,CompanyCity:cartItemAttendee.companyCity,DietaryRequirements:cartItemAttendee.dietaryRequirements,PreventInitialComms:cartItemAttendee.preventInitialComms});}
140Api.AddAttendee=AddAttendee;async function AddAttendeeFetch(eventCode,cartItemAttendee){return await SendRequestFetch('POST',Common.AimwaApiUrl+'v1/Cart/Event/'+eventCode+'/Attendee/',true,{Prefix:cartItemAttendee.prefix,FirstName:cartItemAttendee.firstName,LastName:cartItemAttendee.lastName,PreferredName:cartItemAttendee.preferredName,Email:cartItemAttendee.email,WorkPhone:cartItemAttendee.workPhone,MobilePhone:cartItemAttendee.mobilePhone,PositionTitle:cartItemAttendee.positionTitle,CompanyName:cartItemAttendee.companyName,CompanyCity:cartItemAttendee.companyCity,DietaryRequirements:cartItemAttendee.dietaryRequirements,PreventInitialComms:cartItemAttendee.preventInitialComms});}
141Api.AddAttendeeFetch=AddAttendeeFetch;function CompanyExistsWithDomain(domain){return SendRequest('GET',Common.AimwaApiUrl+'v1/Company/Exists-With-Domain/'+domain+'/');}
142Api.CompanyExistsWithDomain=CompanyExistsWithDomain;function RegisterForNewsletter(email,firstName,lastName){return SendRequest('POST',Common.AimwaApiUrl+'v1/Users/Register-For-Newsletter',true,{Email:email,FirstName:firstName,LastName:lastName});}
143Api.RegisterForNewsletter=RegisterForNewsletter;function MakeAnEnquiry(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Form/Make-an-Enquiry',true,data);}
144Api.MakeAnEnquiry=MakeAnEnquiry;function TableBooking(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Form/Table-Booking',true,data);}
145Api.TableBooking=TableBooking;function BeediyarEnquiry(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Form/Beediyar-Enquiry',true,data);}
146Api.BeediyarEnquiry=BeediyarEnquiry;function Feedback(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Form/Feedback',true,data);}
147Api.Feedback=Feedback;function SubmitBeediyarApplication(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Form/Beediyar-Application',true,data);}
148Api.SubmitBeediyarApplication=SubmitBeediyarApplication;function AutomaticallyAttachToCompany(suburb,postcode,state,country){return SendRequest('PUT',Common.AimwaApiUrl+'v1/User/Automatically-Attach-To-Company/',true,{Suburb:suburb,Postcode:postcode,State:state,Country:country});}
149Api.AutomaticallyAttachToCompany=AutomaticallyAttachToCompany;function DetachFromCompany(){return SendRequest('PUT',Common.AimwaApiUrl+'v1/User/Detach-From-Company/',true);}
150Api.DetachFromCompany=DetachFromCompany;function SubmitCorporateRenewal(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Form/Corporate-Renewal',true,data);}
151Api.SubmitCorporateRenewal=SubmitCorporateRenewal;function SubmitCorporateApplication(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Form/Corporate-Application',true,data);}
152Api.SubmitCorporateApplication=SubmitCorporateApplication;function SubmitProfessionalMembershipApplication(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Form/Professional-Membership-Application',true,data);}
153Api.SubmitProfessionalMembershipApplication=SubmitProfessionalMembershipApplication;function SubmitProfessionalMembershipUpgrade(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Form/Professional-Membership-Upgrade',true,data);}
154Api.SubmitProfessionalMembershipUpgrade=SubmitProfessionalMembershipUpgrade;function GetStatesByCountry(country){return SendRequest('GET',Common.AimwaApiUrl+'v1/Users/States/'+country);}
155Api.GetStatesByCountry=GetStatesByCountry;function GetInterests(){return SendRequest('GET',Common.AimwaApiUrl+'v1/Users/Interests');}
156Api.GetInterests=GetInterests;function GetLoggedInUserInterests(){return SendRequest('GET',Common.AimwaApiUrl+'v1/User/Interests',true);}
157Api.GetLoggedInUserInterests=GetLoggedInUserInterests;function UpdateLoggedInUserInterests(interests){return SendRequest('PUT',Common.AimwaApiUrl+'v1/User/Interests',true,interests);}
158Api.UpdateLoggedInUserInterests=UpdateLoggedInUserInterests;function GetTitles(){return SendRequest('GET',Common.AimwaApiUrl+'v1/Users/Titles');}
159Api.GetTitles=GetTitles;function GetAnzsicOptions(){return SendRequest('GET',Common.AimwaApiUrl+'v1/Users/AnzsicOptions');}
160Api.GetAnzsicOptions=GetAnzsicOptions;function GetCountries(){return SendRequest('GET',Common.AimwaApiUrl+'v1/Users/Countries');}
161Api.GetCountries=GetCountries;function GetDietaryOptions(){return SendRequest('GET',Common.AimwaApiUrl+'v1/Users/DietaryOptions');}
162Api.GetDietaryOptions=GetDietaryOptions;function SubmitPinnaclesEntryForm(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/Form/Pinnacles-Award-Entry/',false,data);}
163Api.SubmitPinnaclesEntryForm=SubmitPinnaclesEntryForm;function GetFreeCourseEligibility(){return SendRequest('GET',Common.AimwaApiUrl+'v1/User/Free-Course-Eligibility/',true);}
164Api.GetFreeCourseEligibility=GetFreeCourseEligibility;function ActivateFreeCourses(data){return SendRequest('POST',Common.AimwaApiUrl+'v1/User/Activate-Free-Courses/',true,data);}
165Api.ActivateFreeCourses=ActivateFreeCourses;function MoodleLogIn(){return SendRequest('POST',Common.AimwaApiUrl+'v1/User/Moodle-Log-In',true);}
166Api.MoodleLogIn=MoodleLogIn;})(Api=Common.Api||(Common.Api={}));function CreateJsonLd(object){const el=document.createElement('script');el.type='application/ld+json';el.text=JSON.stringify(object);document.querySelector('head').appendChild(el);}
167Common.CreateJsonLd=CreateJsonLd;})(Common||(Common={}));var GoogleTagManager;(function(GoogleTagManager){let Models;(function(Models){class Item{}
168Models.Item=Item;})(Models=GoogleTagManager.Models||(GoogleTagManager.Models={}));let Functions;(function(Functions){function ItemCategoryForEventCode(eventCode){switch(eventCode[0].toLowerCase()){case'C':case'T':case'Z':return'course';default:return undefined;}}
169Functions.ItemCategoryForEventCode=ItemCategoryForEventCode;})(Functions=GoogleTagManager.Functions||(GoogleTagManager.Functions={}));let Events;(function(Events){function ViewItemList(items,callback){pushEcommerceEvent({'event':'view_item_list','ecommerce':{'items':items}},callback);}
170Events.ViewItemList=ViewItemList;function SelectItem(items,callback){pushEcommerceEvent({'event':'select_item','ecommerce':{'items':items}},callback);}
171Events.SelectItem=SelectItem;function ViewItem(value,items,callback){pushEcommerceEvent({'event':'view_item','ecommerce':{'currency':'AUD','value':value,'items':items}},callback);}
172Events.ViewItem=ViewItem;function AddToCart(items,callback){pushEcommerceEvent({'event':'add_to_cart','ecommerce':{'items':items}},callback);}
173Events.AddToCart=AddToCart;function RemoveFromCart(items,callback){pushEcommerceEvent({'event':'remove_from_cart','ecommerce':{'items':items}},callback);}
174Events.RemoveFromCart=RemoveFromCart;function ViewCart(value,items,callback){pushEcommerceEvent({'event':'view_cart','ecommerce':{'currency':'AUD','value':value,'items':items}},callback);}
175Events.ViewCart=ViewCart;function BeginCheckout(items,callback){pushEcommerceEvent({'event':'begin_checkout','ecommerce':{'items':items}},callback);}
176Events.BeginCheckout=BeginCheckout;function AddShippingInfo(value,items,coupon,shippingTier,callback){pushEcommerceEvent({'event':'add_shipping_info','ecommerce':{'currency':'AUD','value':value,'coupon':coupon,'shipping_tier':shippingTier,'items':items}},callback);}
177Events.AddShippingInfo=AddShippingInfo;function AddPaymentInfo(value,items,coupon,paymentType,callback){pushEcommerceEvent({'event':'add_payment_info','ecommerce':{'currency':'AUD','value':value,'coupon':coupon,'payment_type':paymentType,'items':items}},callback);}
178Events.AddPaymentInfo=AddPaymentInfo;function Purchase(email,phone,transactionId,value,items,coupon,shipping,tax,callback){pushEcommerceEvent({'event':'purchase','email':email,'phone':phone,'ecommerce':{'currency':'AUD','transaction_id':transactionId,'value':value,'affiliation':'Website','coupon':coupon,'shipping':shipping,'tax':tax,'items':items}},callback);}
179Events.Purchase=Purchase;function SubmitPurchaseOld(transactionId,value,tax,shipping,items,coupon,callback){pushEcommerceEvent({'event':'Purchase','ecommerce':{'purchase':{'actionField':{'id':transactionId,'revenue':value,'shipping':shipping,'tax':tax,'coupon':coupon},'products':items}}},callback);}
180Events.SubmitPurchaseOld=SubmitPurchaseOld;function NewsletterSubscriptionSuccess(callback){pushEvent({'event':'NewsletterSubscriptionSuccess'},callback);}
181Events.NewsletterSubscriptionSuccess=NewsletterSubscriptionSuccess;function PMApplicationSuccess(callback){pushEvent({'event':'PMApplicationSuccess'},callback);}
182Events.PMApplicationSuccess=PMApplicationSuccess;function CMApplicationSuccess(callback){pushEvent({'event':'CMApplicationSuccess'},callback);}
183Events.CMApplicationSuccess=CMApplicationSuccess;function CMRenewalSuccess(callback){pushEvent({'event':'CMRenewalSuccess'},callback);}
184Events.CMRenewalSuccess=CMRenewalSuccess;function RegistrationSuccess(callback){pushEvent({'event':'RegistrationSuccess'},callback);}
185Events.RegistrationSuccess=RegistrationSuccess;function pushEvent(data,callback){if(dataLayer&&dataLayer.some(element=>
185element['gtm.start'])){if(callback){setTimeout(callback,1000);}
186dataLayer.push(data);}
187else{if(callback){callback();}}}
188function pushEcommerceEvent(data,callback){if(dataLayer){dataLayer.push({ecommerce:null});pushEvent(data,callback);}}})(Events=GoogleTagManager.Events||(GoogleTagManager.Events={}));})(GoogleTagManager||(GoogleTagManager={}));function LoadContentFromFileAsBase64(file,onLoad,onError){var reader=new FileReader();reader.onload=()=>{let result=reader.result;if(result){result=result.split(',')[1];}
189onLoad(result);};reader.onerror=onError;reader.readAsDataURL(file);}
190function InitCountrySelectElements(){const domCountrySelectElements=document.querySelectorAll('select[data-stateSelectId]');if(!domCountrySelectElements||!domCountrySelectElements.length){return;}
191domCountrySelectElements.forEach(domCountrySelect=>{const dataStateSelectId=domCountrySelect.getAttribute('data-stateSelectId');const domStateSelect=document.getElementById(dataStateSelectId);if(domStateSelect){domCountrySelect.addEventListener('change',()=>{UpdateStateSelect(domStateSelect,domCountrySelect);});}});}
192function UpdateStateSelect(domStateSelect,domCountrySelect){while(domStateSelect.options[0]){domStateSelect.remove(0);}
193const countryValue=domCountrySelect.value;const request=Common.Api.GetStatesByCountry(countryValue);Common.Functions.AwaitHttpRequests([request],()=>{if(Common.Functions.HttpStatusIsSuccess(request.status)){if(domCountrySelect.value===countryValue){const states=request.response?JSON.parse(request.response):[];states.map(state=>
193new Option(state.Name,state.Code)).forEach(option=>domStateSelect.add(option));domStateSelect.disabled=domCountrySelect.disabled||!states.length;domStateSelect.required=domCountrySelect.required&&states.length>0;}}
194else{domStateSelect.disabled=true;domStateSelect.required=false;domStateSelect.value='';}});}
195function InitDietaryOptionElements(){$('select.dietarySelect2').select2();}
196class SelectOption{constructor(text,value){this.text=text;this.value=value;}}
197function InitSelectElements(domSelectElements,options,emptyFirstOptionText){if(!domSelectElements){return;}
198Array.prototype.forEach.call(domSelectElements,domSelectElement=>{var initValue=domSelectElement.getAttribute('data-initValue');domSelectElement.innerHTML='';if(typeof emptyFirstOptionText==='string'){domSelectElement.add(new Option(emptyFirstOptionText,'',true));}
199if(options){options.forEach(option=>{const selected=option.value===initValue;domSelectElement.add(new Option(option.text,option.value,selected,selected));});}});}
200function SetUpTitleSelects(domElements){if(!domElements||!domElements.length){return;}
201var request=Common.Api.GetTitles();Common.Functions.AwaitHttpRequests([request],()=>{const jsonData=request.response?JSON.parse(request.response):null;if(Common.Functions.HttpStatusIsSuccess(request.status)&&jsonData){var options=[];jsonData.forEach(title=>{options.push(new SelectOption(title.Description,title.Code));});InitSelectElements(domElements,options,'');}});}
202function SetUpAnzsicSelects(domElements){if(!domElements||!domElements.length){return;}
203var request=Common.Api.GetAnzsicOptions();Common.Functions.AwaitHttpRequests([request],()=>{const jsonData=request.response?JSON.parse(request.response):null;if(Common.Functions.HttpStatusIsSuccess(request.status)&&jsonData){var options=[];jsonData.forEach(anzsicOption=>{options.push(new SelectOption(anzsicOption,anzsicOption));});InitSelectElements(domElements,options,'');}});}
204function SetUpCountrySelects(domElements){if(!domElements||!domElements.length){return;}
205var request=Common.Api.GetCountries();Common.Functions.AwaitHttpRequests([request],()=>{const jsonData=request.response?JSON.parse(request.response):null;if(Common.Functions.HttpStatusIsSuccess(request.status)&&jsonData){var options=[];jsonData.forEach(country=>{options.push(new SelectOption(country.Name,country.Name));});InitCountrySelects(domElements,options);}});}
206function InitCountrySelects(domCountrySelects,options){if(!domCountrySelects||!domCountrySelects.length){return;}
207Array.prototype.forEach.call(domCountrySelects,domCountrySelect=>{const initValue=domCountrySelect.getAttribute('data-initValue');if(!initValue){domCountrySelect.setAttribute('data-initValue','Australia');}});InitSelectElements(domCountrySelects,options);Array.prototype.forEach.call(domCountrySelects,domCountrySelect=>{if(domCountrySelect.getAttribute('data-stateSelect')){domCountrySelect.addEventListener('change',function(){SyncCountryAndStateSelect(this);});SyncCountryAndStateSelect(domCountrySelect);}});}
208function SyncCountryAndStateSelect(domCountrySelect){if(!domCountrySelect){return;}
209const stateSelectId=domCountrySelect.getAttribute('data-stateSelect');if(!stateSelectId){return;}
210var domStateSelect=document.getElementById(stateSelectId);if(!domStateSelect){return;}
211let queryNumber=parseInt(domStateSelect.getAttribute('data-queryNumber'))||0;domStateSelect.setAttribute('data-queryNumber',`${++queryNumber}`);var request=Common.Api.GetStatesByCountry(domCountrySelect.value);Common.Functions.AwaitHttpRequests([request],()=>{const states=request.response?JSON.parse(request.response):null;if(Common.Functions.HttpStatusIsSuccess(request.status)&&states){const latestQueryNumber=parseInt(domStateSelect.getAttribute('data-queryNumber'));if(queryNumber===latestQueryNumber){var options=[];states.forEach(state=>{options.push(new SelectOption(state.Name,state.Code));});InitSelectElements([domStateSelect],options,'State');domStateSelect.disabled=domCountrySelect.disabled||!options.length;domStateSelect.required=domCountrySelect.required&&options.length>0;}}
212else{domStateSelect.disabled=true;domStateSelect.required=false;domStateSelect.value='';}});}
213let DietaryOptionsCallbacks=[];let DietaryOptionsRequest;let DietaryOptions=[];function GetDietaryOptions(callback){if(!DietaryOptionsRequest){DietaryOptionsRequest=Common.Api.GetDietaryOptions();Common.Functions.AwaitHttpRequests([DietaryOptionsRequest],()=>{const apiDietaryOptions=DietaryOptionsRequest.response?JSON.parse(DietaryOptionsRequest.response):[];DietaryOptions=apiDietaryOptions.map(apiDietaryOption=>new Common.Models.DietaryOption(apiDietaryOption));if(DietaryOptionsCallbacks.length){DietaryOptionsCallbacks.forEach(callback=>{callback(DietaryOptions);});DietaryOptionsCallbacks=[];}});}
214if(callback){if(DietaryOptionsRequest.readyState===XMLHttpRequest.DONE){callback(DietaryOptions);}
215else{DietaryOptionsCallbacks.push(callback);}}}
216function SetUpDietaryOptionSelects(eSelects,callback){if(!eSelects.length){return;}
217GetDietaryOptions(dietaryOptions=>{eSelects.select2({data:dietaryOptions.map(dietaryOption=>{return{id:dietaryOption.code,text:dietaryOption.description};})});if(callback){callback();}});}
218function FormatDateRangeForDisplay(beginDate,endDate,shortDates=false){const monthFormat=shortDates?'MMM':'MMMM';if(beginDate.isSame(endDate,'day')){return beginDate.format(monthFormat+' DD, Y');}
219else if(beginDate.isSame(endDate,'month')){return beginDate.format(monthFormat+' DD')+' - '+endDate.format('DD, Y');}
220else if(beginDate.isSame(endDate,'year')){return beginDate.format(monthFormat+' DD')+' - '+endDate.format(monthFormat+' DD, Y');}
221else{return beginDate.format(monthFormat+' DD, Y')+' - '+endDate.format(monthFormat+' DD, Y');}}
222function IsUserAttendingEvent(user,eventCode){for(let i=0;i<user.eventsAttending.length;++i){const event=user.eventsAttending[i];if(Common.Functions.InsensitiveStringEquals(event,eventCode)){return true;}}
223return false;}
224function DownloadData(data,filename){if(window.navigator.msSaveBlob){const blob=new Blob([data],{type:'application/pdf'});window.navigator.msSaveBlob(blob,filename);}
225else{const downloadUrl=window.URL.createObjectURL(data);const anchor=document.createElement('a');anchor.href=downloadUrl;anchor.download=filename;document.body.appendChild(anchor);anchor.target='_blank';anchor.click();}}
226function HasJwtExpired(jwt){if(!jwt){return true;}
227const data=GetDataFromJwt(jwt);if(!data){return true;}
228const highestValidSeconds=data.exp-300;const now=Math.floor(new Date().getTime()/1000);return now>highestValidSeconds;}
229function GetDataFromJwt(jwt){if(!jwt){return null;}
230if((jwt.match(/\./g)||[]).length===2){const dataEncoded=jwt.split('.')[1];const data=JSON.parse(window.atob(dataEncoded));return data;}
231else{return null;}}
232function GetApiToken(){try{return localStorage.getItem('apiToken');}
233catch(e){console.error(e,e.stack);return null;}}
234function ScrollToTop(){$('html, body').animate({scrollTop:0});}
235function SetMessageByElement(element,message,isHtml=false){if(!element){return;}
236if(message){isHtml?element.innerHTML=message:element.textContent=message;Unhide(element);if(!ElementIsInViewport(element)){element.scrollIntoView();}}
237else{element.textContent='';Hide(element);}}
238function ElementIsInViewport(domElement){const bounding=domElement.getBoundingClientRect();return bounding.top>=0&&bounding.left>=0&&bounding.top<=(window.innerHeight||document.documentElement.clientHeight)&&bounding.left<=(window.innerWidth||document.documentElement.clientWidth);}
239function FormatCurrency(currency){return`$${currency.toFixed(currency % 1 === 0 ? 0 : 2)}`;}
240function FormatCurrencyComplex(currency){let parts=`$${currency.toFixed(currency % 1 === 0 ? 0 : 2)}`.split(".");return parts[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")+(parts[1]?"."+parts[1]:"");}
241function SpliceCommonPricing(registrantClassCodesToSplice,prices,customName,customRegistrantClass){const indexesToSplice=[];for(let q=0;q<registrantClassCodesToSplice.length;++q){const registrantClassCodeToSplice=registrantClassCodesToSplice[q];const registrantClassCodeToSpliceIndex=prices.findIndex(p=>
241Common.Functions.InsensitiveStringEquals(p.registrantClass,registrantClassCodeToSplice));if(registrantClassCodeToSpliceIndex<0){return;}
242indexesToSplice.push(registrantClassCodeToSpliceIndex);}
243if(indexesToSplice.length===0){return;}
244const firstItem=prices[indexesToSplice[0]];for(let j=1;j<indexesToSplice.length;++j){const indexToSplice=indexesToSplice[j];const item=prices[indexToSplice];if(firstItem.rate!==item.rate){return;}}
245indexesToSplice.sort((a,b)=>b-a).forEach(indexToSplice=>prices.splice(indexToSplice,1));prices.push({registrantClass:customRegistrantClass,rate:firstItem.rate,customName:customName});}
246function GetFormattedEventAddress(address){const formattedLines=[];if(address.addressLines){address.addressLines.forEach(addressLine=>{if(addressLine){formattedLines.push(addressLine);}});}
247const formattedRow=[];if(address.suburb){formattedRow.push(address.suburb+(address.state=='WA'?'':','));}
248if(address.state){formattedRow.push(address.state);}
249if(address.postcode){formattedRow.push(address.postcode);}
250if(formattedRow.length){formattedLines.push(formattedRow.join(' '));}
251if(address.country){formattedLines.push(address.country);}
252return formattedLines.join('<br>');}
253function UpdateEventInformation(event,registrantClasses){var _a;const domProgramInfo=document.getElementById('ProgramInfo');if(domProgramInfo){Load(domProgramInfo);}
254UpdatePlacesAvailable(event);const domProgramTime=document.getElementById('ProgramTime');if(domProgramTime){domProgramTime.textContent=event.beginDateTime.format('h:mm A - ')+event.endDateTime.format('h:mm A');}
255const domEventLocation=document.getElementById('EventLocation');
255if(domEventLocation){if(Common.Functions.InsensitiveStringEquals((_a=event.address.suburb)!==null&&_a!==void 0?_a:"",'Virtual')){domEventLocation.innerHTML='Delivered Virtually';}
256else{if(Common.Location){domEventLocation.innerHTML=Common.Location;}
257else if(event.address){domEventLocation.innerHTML=GetFormattedEventAddress(event.address);}
258else{const domEventLocationRow=domEventLocation.closest('tr');Hide(domEventLocationRow);}}}
259var domCanBook=document.getElementById('CanBook');var domCanNotBook=document.getElementById('CanNotBook');if(event.registerable){Unhide(domCanBook);Hide(domCanNotBook);}
260else{Hide(domCanBook);Unhide(domCanNotBook);}
261var domEarlyBird=document.getElementById('Earlybird');if(event.isEarlyBird){Unhide(domEarlyBird);}
262else{Hide(domEarlyBird);}
263event.prices=event.prices.filter(price=>!Common.Functions.InsensitiveStringEquals(price.registrantClass,'A'));SpliceCommonPricing(['F','AF','M'],event.prices,'Professional Member','PMS');SpliceCommonPricing(['CMB','CMBP'],event.prices,'Corporate Bronze','CMBPS');SpliceCommonPricing(['CMS','CMSP'],event.prices,'Corporate Silver','CMSPS');SpliceCommonPricing(['CMBPS','CMSPS','CMG'],event.prices,'Corporate Member','CORPORATE');SpliceCommonPricing(['PMS','CORPORATE','GUEST','NM'],event.prices,'Everyone','EVERYONE');SpliceCommonPricing(['PMS','CORPORATE','NM'],event.prices,'Everyone','EVERYONE');SpliceCommonPricing(['PMS','CORPORATE','GUEST','NM'],event.prices,'Everyone','EVERYONE');SpliceCommonPricing(['PMS','CORPORATE','NM'],event.prices,'Everyone','EVERYONE');SpliceCommonPricing(['PMS','CORPORATE','GUEST','NM'],event.prices,'Everyone','EVERYONE');SpliceCommonPricing(['PMS','GUEST','NM'],event.prices,'Everyone','EVERYONE');var pricesToDisplay=[];event.prices.forEach(price=>{var registrantClassName;if(price.customName){registrantClassName=price.customName;}
264else{const registrantClass=registrantClasses.find(c=>
264Common.Functions.InsensitiveStringEquals(c.code,price.registrantClass));if(!registrantClass){return;}
265registrantClassName=registrantClass.name;}
266pricesToDisplay.push({RegistrantClass:price.registrantClass,RegistrantClassName:registrantClassName,Price:price.rate});});var domSinglePrice=document.getElementById('SinglePrice');var domPriceList=document.getElementById('PriceList');if(domPriceList){domPriceList.innerHTML='';}
267if(pricesToDisplay.length===1&&(Common.Functions.InsensitiveStringEquals(pricesToDisplay[0].RegistrantClass,'Everyone')||Common.Functions.InsensitiveStringEquals(pricesToDisplay[0].RegistrantClass,'BHP'))){if(domPriceList){Hide(domPriceList);}
268if(domSinglePrice){domSinglePrice.textContent=pricesToDisplay[0].Price===0?'FREE!':FormatCurrency(pricesToDisplay[0].Price);Unhide(domSinglePrice);}}
269else{if(domSinglePrice){Hide(domSinglePrice);}
270if(domPriceList){var sortOrder=['GUEST','NM','F','AF','M','PMS','CMB','CMBP','CMBPS','CMS','CMSP','CMSPS','CMG'];pricesToDisplay.sort((a,b)=>{const indexOfA=sortOrder.indexOf(a.RegistrantClass);const indexOfB=sortOrder.indexOf(b.RegistrantClass);if(indexOfA!==-1&&indexOfB!==-1){return indexOfA-indexOfB;}
271else{return b.Price-a.Price;}}).forEach(item=>{const displayPrice=item.Price===0?'FREE!':`${FormatCurrency(item.Price)}`;domPriceList.insertAdjacentHTML('beforeend',`<tr><td class="priceRegistrantClass">${item.RegistrantClassName}</td><td class="priceRate">${displayPrice}</td></tr>`);});Unhide(domPriceList);}}
272var domTxtPricesIncludeGst=document.getElementById('TxtPricesIncludeGst');if(event.taxIncluded){Unhide(domTxtPricesIncludeGst);}
273else{Hide(domTxtPricesIncludeGst);}
274if(domProgramInfo){StopLoad(domProgramInfo);}}
275function Hide(domElement){if(!domElement){return;}
276domElement.style.display='none';}
277function Unhide(domElement){if(!domElement){return;}
278domElement.style.display='';}
279function GetCheckedRadioButton(domElements){for(let i=0;i<domElements.length;++i){if(domElements[i].checked){return domElements[i];}}
280return null;}
281function UpdatePlacesAvailable(event){const domWaitlistOnly=document.getElementById('WaitlistOnly');const domLimitedSpaces=document.getElementById('LimitedSpaces');Hide(domWaitlistOnly);Hide(domLimitedSpaces);
281if(Common.Functions.InsensitiveStringEquals(event.placesAvailable,'Waitlist')){Unhide(domWaitlistOnly);}
282else if(Common.Functions.InsensitiveStringEquals(event.placesAvailable,'Limited')){Unhide(domLimitedSpaces);}}
283var GetLoggedInUserCallbacks=[];var GetLoggedInUserRequest;var LoggedInUser;function GetLoggedInUser(callback,forceUpdate=false){const apiToken=GetApiToken();if(HasJwtExpired(apiToken)){if(callback){callback();}
284return;}
285if(!GetLoggedInUserRequest||forceUpdate){LoggedInUser=null;GetLoggedInUserRequest=Common.Api.GetLoggedInUser();Common.Functions.AwaitHttpRequests([GetLoggedInUserRequest],()=>{const data=GetLoggedInUserRequest.response?JSON.parse(GetLoggedInUserRequest.response):null;if(Common.Functions.HttpStatusIsSuccess(GetLoggedInUserRequest.status)){LoggedInUser=new Common.Models.User(data);}
286if(GetLoggedInUserCallbacks.length){GetLoggedInUserCallbacks.forEach(callback=>{callback(LoggedInUser);});GetLoggedInUserCallbacks=[];}});}
287if(callback){if(GetLoggedInUserRequest.readyState===XMLHttpRequest.DONE){callback(LoggedInUser);}
288else{GetLoggedInUserCallbacks.push(callback);}}}
289function InitialiseForm(domForm){domForm.addEventListener('submit',e=>{e.preventDefault();domForm.classList.add('was-validated');const firstInvalidElement=domForm.querySelector('input:invalid');if(firstInvalidElement&&!ElementIsInViewport(firstInvalidElement)){firstInvalidElement.scrollIntoView();}});}
290function Load(domElement,customLoaderClass='aimWaLoader-white'){domElement.insertAdjacentHTML('beforeend',`<div class="loadingOverlay d-flex align-items-center justify-content-center"><div class="aimWaLoader ${customLoaderClass}"><div></div><div></div><div></div><div></div><div></div></div></div>`);}
291function StopLoad(domElement){const domLoadingOverlay=domElement.querySelector('.loadingOverlay');if(domLoadingOverlay){domLoadingOverlay.parentNode.removeChild(domLoadingOverlay);}}
292(function(Common){var Template;(function(Template){const jwtData=GetDataFromJwt(GetApiToken());if(jwtData&&!jwtData.Username){Common.Functions.SetApiToken();}
293[...document.querySelectorAll('form.needs-validation')].forEach(InitialiseForm);[...document.getElementsByClassName('ccNumber')].forEach(item=>{$(item).payment('formatCardNumber');item.addEventListener('blur',()=>item.setCustomValidity($.payment.validateCardNumber(item.value.trim())?'':'Invalid'));});[...document.getElementsByClassName('ccExpiry')].forEach(item=>{$(item).payment('formatCardExpiry');item.addEventListener('blur',()=>item.setCustomValidity($.payment.validateCardExpiry($.payment.cardExpiryVal(item.value.trim()))?'':'Invalid'));});[...document.getElementsByClassName('ccCvv2')].forEach(item=>{$(item).payment('formatCardCVC');item.addEventListener('blur',()=>item.setCustomValidity($.payment.validateCardCVC(item.value.trim())?'':'Invalid'));});Common.CustomValidation.Init();[...document.getElementsByClassName('itemsPerPage')].forEach(item=>{item.addEventListener('change',e=>{e.preventDefault();const uri=new URI(window.location.href);const uriParameters=uri.search(true);if(item.value&&item.value!==uriParameters.l){window.location.href=uri.removeSearch('p').setSearch('l',item.value).toString();}});});[...document.getElementsByClassName('datePickerPast')].forEach(item=>{const options={field:item,format:'DD/MM/YYYY',maxDate:moment().toDate(),yearRange:100};new Pikaday(options);});[...document.getElementsByClassName('datePickerFuture')].forEach(item=>{const options={field:item,format:'DD/MM/YYYY',minDate:moment().toDate(),yearRange:100};new Pikaday(options);});[...document.getElementsByClassName('bootboxAlertLink')].forEach(element=>{element.addEventListener('click',e=>{e.preventDefault();const templateId=element.getAttribute('data-bootboxTemplate');if(!templateId){return;}
294const domTemplate=document.getElementById(templateId);if(!domTemplate){return;}
295const bootboxAlertOptions={centerVertical:true,message:domTemplate.innerHTML,size:element.getAttribute('data-bootboxSize')||'small'};bootbox.alert(bootboxAlertOptions);});});const domSocialPrint=document.getElementById('SocialPrint');if(domSocialPrint){document.getElementById('SocialPrint').addEventListener('click',e=>{e.preventDefault();window.print();});}
296const domSocialClose=document.getElementById('SocialClose');if(domSocialClose){domSocialClose.addEventListener('click',e=>{e.preventDefault();document.getElementById('SocialVertical').classList.remove('d-md-block');});}
297InitCountrySelectElements();InitDietaryOptionElements();SetUpCountrySelects(document.querySelectorAll('select.countrySelect'));SetUpTitleSelects(document.querySelectorAll('select.titleSelect'));SetUpAnzsicSelects(document.querySelectorAll('select.anzsicSelect'));SetUpDietaryOptionSelects($('.dietarySelect'));const viewedItems=[...document.querySelectorAll('[data-gtmItemId]')].map(el=>({item_id:el.getAttribute('data-gtmItemId')||undefined,item_category:el.getAttribute('data-gtmItemCategory')||undefined,item_category2:el.getAttribute('data-gtmItemCategory2')||undefined,item_name:el.getAttribute('data-gtmItemName')||undefined,}));if(viewedItems.length){GoogleTagManager.Events.ViewItemList(viewedItems);}})(Template=Common.Template||(Common.Template={}));})(Common||(Common={}));;;
298'use strict';var widgetId3;var widgetId4;var NewAimwaTemplate;(function(NewAimwaTemplate){let Constants;(function(Constants){Constants.GrecaptchaSiteKey='6LcD9ygrAAAAAKsYxu-sq_YuwhB2hRlXdSt0RHV6';})(Constants=NewAimwaTemplate.Constants||(NewAimwaTemplate.Constants={}));let Models;(function(Models){class Cart{constructor(apiData){this.orderNumber=apiData.OrderNumber;this.grandTotal=apiData.GrandTotal;this.totalExGst=apiData.TotalExGst;this.discount=apiData.Discount;this.gst=apiData.Gst;this.promoCode=apiData.PromoCode;this.billTo=new CartBillTo(apiData.BillTo);this.cartItems=apiData.CartItems.map(apiCartItem=>new CartItem(apiCartItem));}
299GetGTMItems(){const gtmItems=[];
299this.cartItems.forEach(cartItem=>cartItem.attendees.forEach(attendee=>gtmItems.push({item_id:cartItem.eventCode,item_name:cartItem.name,price:attendee.totalExGst+attendee.gst})));return gtmItems;}}
300Models.Cart=Cart;class CartBillTo{constructor(apiData){this.id=apiData.Id;this.name=apiData.Name;this.billingAddress=new Common.Models.Address(apiData.BillingAddress);this.memberType=apiData.MemberType;this.registrantClass=apiData.RegistrantClass;}}
301Models.CartBillTo=CartBillTo;class CartItem{constructor(apiData){this.canRegisterOthers=apiData.CanRegisterOthers;this.endDate=moment(apiData.EndDate);this.eventCode=apiData.EventCode;this.beginDate=moment(apiData.BeginDate);this.name=apiData.Name;this.attendees=apiData.Attendees.map(attendee=>new CartItemAttendee(attendee));this.waitlistedAttendees=apiData.Attendees.filter(x=>x.IsWaitlisted===true).length;this.location=apiData.Location;}
302GetGTMItems(){return this.attendees.map(attendee=>({item_id:this.eventCode,item_category:GoogleTagManager.Functions.ItemCategoryForEventCode(this.eventCode),item_category2:undefined,item_name:this.name,price:attendee.totalExGst+attendee.gst}));}}
303Models.CartItem=CartItem;class CartItemAttendee{constructor(apiData){this.id=apiData.Id;this.totalExGst=apiData.TotalExGst;this.gst=apiData.Gst;this.discount=apiData.Discount;this.prefix=apiData.Prefix;this.firstName=apiData.FirstName;this.lastName=apiData.LastName;this.preferredName=apiData.PreferredName;this.email=apiData.Email;this.workPhone=apiData.WorkPhone;this.mobilePhone=apiData.MobilePhone;this.positionTitle=apiData.PositionTitle;this.companyName=apiData.CompanyName;this.companyCity=apiData.CompanyCity;this.isWaitlisted=apiData.IsWaitlisted;this.dietaryRequirements=apiData.DietaryRequirements;this.isGuest=apiData.IsGuest;this.preventInitialComms=apiData.PreventInitialComms;}
304IsCompleted(){return this.firstName&&this.lastName&&this.email&&(this.workPhone||this.mobilePhone);}}
305Models.CartItemAttendee=CartItemAttendee;})(Models=NewAimwaTemplate.Models||(NewAimwaTemplate.Models={}));let Cart;(function(Cart){async function setCart(){const domCartCounter=document.getElementById('CartCounter');const domCartLozenge=document.getElementById('CartLozenge');const domCartDetails=document.getElementById('CartDetails');let existingBookings=JSON.parse(localStorage.getItem('existingBookings')||'[]');if(window.location.pathname!=='/cart'){existingBookings=existingBookings.filter(booking=>booking.attendeesNumber>0);localStorage.setItem('existingBookings',JSON.stringify(existingBookings));}
306let cart;if(window.location.pathname==='/cart'){Hide(domCartLozenge);domCartDetails.innerHTML='';return;}
307function updateLocalCartDetails(bookings,showRemoveButton=false){if(bookings.length){Unhide(domCartLozenge);domCartCounter.textContent=`(${bookings.length.toString()})`;domCartDetails.innerHTML=bookings.map((item,index)=>{const eventName=item.eventName||item.name||'Unknown Event';const attendees=item.attendeesNumber||item.attendees.length;const startDate=item.startDate||item.beginDate.format('D/MM/YY')||'Unknown Date';const endDate=item.finishDate||item.endDate.format('D/MM/YY')||'Unknown Date';const dateDisplay=startDate===endDate?startDate:`${startDate} - ${endDate}`;return`<div class="cartDetail">
308        <div class="d-flex justify-content-between">
309         <span><strong>${attendees}x</strong> ${eventName} </span>
310         <div class="ms-auto text-end ps-2"> (${dateDisplay})</div>
311         ${showRemoveButton ? `<button class="remove-booking btn p-0 ps-1" data-index="${index}" style="width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;">
312          <i class="bi bi-x m-0" style="color: red;"></i>
313         </button>` : ''}
314        </div>
315       </div>`;}).join('');const removeButtons=domCartDetails.getElementsByClassName('remove-booking');Array.from(removeButtons).forEach(button=>{button.addEventListener('click',(event)=>{const target=event.target;const buttonElement=target.closest('.remove-booking');const index=buttonElement.getAttribute('data-index');if(index!==null){removeBooking(parseInt(index));}});});}
316else{Hide(domCartLozenge);domCartDetails.innerHTML='';}}
317function removeBooking(index){const existingBookings=JSON.parse(localStorage.getItem('existingBookings')||'[]');existingBookings.splice(index,1);localStorage.setItem('existingBookings',JSON.stringify(existingBookings));setCart();}
318GetLoggedInUser(async(isLoggedIn)=>
318{if(isLoggedIn){const request=Common.Api.GetCart();Common.Functions.AwaitHttpRequests([request],async()=>{const jsonData=request.response?JSON.parse(request.response):null;if(Common.Functions.HttpStatusIsSuccess(request.status)&&jsonData){const initialLoad=!cart;let serverCart=new Models.Cart(jsonData);cart=await createCartData(serverCart);}
319if(domCartCounter){updateLocalCartDetails(cart===null||cart===void 0?void 0:cart.cartItems,false);}});}
320else{let eventCodes=existingBookings.map(data=>data.eventCode);let events=[];try{if(eventCodes.length!==0){const response=await Common.Api.GetEventsByEventCodes(eventCodes);if(response.ok){const eventsData=await response.json();if(Array.isArray(eventsData)){events=eventsData.map(eventData=>new Common.Models.Event(eventData));events=events.filter(event=>event.title!=="Event not found");existingBookings=existingBookings.filter(data=>events.some(event=>event.eventCode===data.eventCode));localStorage.setItem('existingBookings',JSON.stringify(existingBookings));}}}}
321catch(error){console.log(error);}
322if(domCartCounter){updateLocalCartDetails(existingBookings,true);}}});}
323Cart.setCart=setCart;})(Cart=NewAimwaTemplate.Cart||(NewAimwaTemplate.Cart={}));const ClassSearchExpanded='searchExpanded';const SuggestionsStallTimer=300;const domLogOutSubmit=document.getElementById('LogOutSubmit');const domNavbarContainer=document.getElementById('NavbarContainer');const domFrmNavbarSearchBar=document.getElementById('FrmNavbarSearchBar');const collapseFormNavbarSearchBar=new bootstrap.Collapse(domFrmNavbarSearchBar.parentElement,{toggle:false});const domFrmNavbarSearchBarInput=document.getElementById('FrmNavbarSearchBarInput');const domFrmNavbarSearchBarSubmit=document.getElementById('FrmNavbarSearchBarSubmit');const domFrmOffcanvasSearch=document.getElementById('FrmOffcanvasSearch');const domFrmOffcanvasSearchInput=document.getElementById('FrmOffcanvasSearchInput');const domEnquiryModal=document.getElementById('enquiryModal');const domBookingModal=document.getElementById('tableBookingModal');const domFrmModalSearch=document.getElementById('FrmModalSearch');const domModalSearchInput=document.getElementById('modalSearchInput');const domSearchModal=document.getElementById('SearchModal');const domNavSearchXxl=document.getElementById('NavSearchXxl');const collapseNavSearchXxl=new bootstrap.Collapse(domNavSearchXxl.parentElement,{toggle:false});const domCartLozenge=document.getElementById('CartLozenge');const domCartDetails=document.getElementById('CartDetails');const domCartTitle=document.getElementById('CartTitle');var apiToken=GetApiToken();var isApiTokenValid=!HasJwtExpired(apiToken);function checkNavbarSearchFocus(){if(domFrmNavbarSearchBar.parentElement.classList.contains('show')&&!domFrmNavbarSearchBar.contains(document.activeElement)){toggleNavbarSearch();}}
324function toggleNavbarSearch(){if(domNavbarContainer.classList.contains(ClassSearchExpanded)){domNavbarContainer.classList.remove(ClassSearchExpanded);}
325else{domNavbarContainer.classList.add(ClassSearchExpanded);}
326collapseFormNavbarSearchBar.toggle();collapseNavSearchXxl.toggle();}
327function performSearch(query){window.location.href=`/search?q=${query}`;}
328function updateCharCounter(charCounter,textArea){const length=textArea.value.length;charCounter.textContent=length.toString();if(length>1500){if(!charCounter.classList.contains('text-danger')){charCounter.classList.add('text-danger');textArea.setCustomValidity('Enquiry has too many characters');}}
329else{if(charCounter.classList.contains('text-danger')){charCounter.classList.remove('text-danger');textArea.setCustomValidity('');}}}
330function initialiseCharCounters(){const charCounters=document.querySelectorAll('.charCounter');charCounters.forEach(charCounter=>{const textArea=charCounter.parentElement.parentElement.parentElement.querySelector('textarea');textArea.addEventListener('input',()=>{updateCharCounter(charCounter,textArea);});updateCharCounter(charCounter,textArea);});}
331function setUpSuggestionsSearch(searchInputElement,endpoint){searchInputElement.autocomplete='off';searchInputElement.parentElement.classList.add('position-relative');searchInputElement.parentElement.insertAdjacentHTML('beforeend','<div class="suggestionResults" style="display: none;"></div>');let timeoutId;let suggestionResults=searchInputElement.parentElement.querySelector('.suggestionResults');searchInputElement.addEventListener('input',()=>{if(timeoutId){clearTimeout(timeoutId);}
332if(searchInputElement.value){suggestionResults.style.display='block';suggestionResults.textContent='Loading results...';timeoutId=setTimeout(()=>{fetch(`/umbraco/api/Search/${endpoint}?`+new URLSearchParams({searchTerm:searchInputElement.value})).then(response=>response.json()).then((json)=>{suggestionResults.innerHTML='';if(json.length){json.forEach(item=>suggestionResults.insertAdjacentHTML('beforeend',`<div class="suggestionResult">${item}</div>`));[...suggestionResults.getElementsByClassName('suggestionResult')].forEac
332h(suggestionResult=>suggestionResult.addEventListener('click',()=>{searchInputElement.value=suggestionResult.textContent;searchInputElement.focus();}));}
333else{suggestionResults.textContent='No results found';}});},SuggestionsStallTimer);}
334else{suggestionResults.style.display='none';}});searchInputElement.addEventListener('blur',()=>{if(timeoutId){clearTimeout(timeoutId);}
335setTimeout(()=>suggestionResults.style.display='none',200);});}
336async function createCartData(cart){let localData=JSON.parse(localStorage.getItem('existingBookings')||'[]');const eventCodes=localData.map(data=>data.eventCode);let events=[];try{if(eventCodes.length!==0){const response=await Common.Api.GetEventsByEventCodes(eventCodes);if(response.ok){const eventsData=await response.json();if(Array.isArray(eventsData)){events=eventsData.map(eventData=>new Common.Models.Event(eventData));events=events.filter(event=>event.title!=="Event not found");localData=localData.filter(data=>events.some(event=>event.eventCode===data.eventCode));localStorage.setItem('existingBookings',JSON.stringify(localData));}}}}
337catch(error){console.log(error);}
338events.forEach(event=>{let cartItem=new Models.CartItem({EventCode:event.eventCode,Name:event.title,Attendees:[],BeginDate:event.beginDateTime,EndDate:event.endD
338ateTime,});const localEventData=localData.find(data=>data.eventCode===event.eventCode);for(let i=0;i<localEventData.attendeesNumber;i++){let attendee=new Models.CartItemAttendee({Id:`attendee${i}`});cartItem.attendees.push(attendee);}
339const existingCartItem=cart.cartItems.find(item=>item.eventCode===cartItem.eventCode);if(existingCartItem){cartItem.attendees.forEach(newAttendee=>{existingCartItem.attendees.push(newAttendee);});}
340else{cart.cartItems.push(cartItem);}});return cart;}
341domNavSearchXxl.addEventListener('click',toggleNavbarSearch);domFrmNavbarSearchBar.addEventListener('submit',e=>{e.preventDefault();performSearch(domFrmNavbarSearchBarInput.value);});domFrmNavbarSearchBarInput.addEventListener('blur',checkNavbarSearchFocus);domFrmNavbarSearchBarSubmit.addEventListener('blur',checkNavbarSearchFocus);domFrmNavbarSearchBarSubmit.addEventListener('mousedown',e=>{e.preventDefault();});domFrmNavbarSearchBar.parentElement.addEventListener('shown.bs.collapse',()=>{domFrmNavbarSearchBarInput.focus();});domFrmOffcanvasSearch.addEventListener('submit',e=>{e.preventDefault();performSearch(domFrmOffcanvasSearch.querySelector('input').value);});domFrmModalSearch.addEventListener('submit',e=>{e.preventDefault();performSearch(domFrmModalSearch.querySelector('input').value);});domSearchModal.addEventListener('shown.bs.modal',event=>{domModalSearchInput.focus();});domFrmOffcanvasSearch.parentElement.addEventListener('shown.bs.collapse',()=>{domFrmOffcanvasSearchInput.focus();});if(domCartLozenge&&domCartDetails){domCartLozenge.addEventListener('mouseenter',()=>{domCartDetails.style.display='block';});domCartLozenge.addEventListener('mouseleave',()=>{domCartDetails.style.display='none';});}
342domCartTitle.addEventListener('click',()=>{Common.Functions.RedirectToLoginPage(`/cart`);});if(Common.CmsLoggedIn&&!isApiTokenValid){if(domLogOutSubmit){domLogOutSubmit.click();}}
343else if(!Common.CmsLoggedIn&&isApiTokenValid){Common.Functions.SetApiToken(null);location.reload();}
344const domFrmEnquiry=document.getElementById('frmEnquiry');if(domFrmEnquiry){const attrDataBsUrl='data-bs-url';const domFrmEnquirySubject=document.getElementById('frmEnquirySubject');const domFrmTxtEnquiryName=document.getElementById('frmTxtEnquiryName');const domFrmTxtEnquiryEmail=document.getElementById('frmTxtEnquiryEmail');const domFrmTxtEnquiryPhone=document.getElementById('frmTxtEnquiryPhone');const domFrmTxtEnquiryMessage=document.getElementById('frmTxtEnquiryMessage');const domFrmBtnEnquirySubmit=document.getElementById('frmBtnEnquirySubmit');const domPreferredEnquiryContactMethod=document.getElementsByName('frmPreferredEnquiryContactMethod');function getPreferredEnquiryContactMethod(){for(let i=0;i<domPreferredEnquiryContactMethod.length;i++){if(domPreferredEnquiryContactMethod[i].checked){return domPreferredEnquiryContactMethod[i].value;}}
345return'Email';}
346function updateEnquiryPhoneRequiredState(){var _a,_b;const preferred=getPreferredEnquiryContactMethod();if(preferred==='Phone'){domFrmTxtEnquiryPhone.required=true;(_a=domFrmTxtEnquiryPhone.parentElement)===null||_a===void 0?void 0:_a.classList.add('required');}
347else{domFrmTxtEnquiryPhone.required=false;(_b=domFrmTxtEnquiryPhone.parentElement)===null||_b===void 0?void 0:_b.classList.remove('required');}}
348for(let i=0;i<domPreferredEnquiryContactMethod.length;i++){domPreferredEnquiryContactMethod[i].addEventListener('change',updateEnquiryPhoneRequiredState);}
349updateEnquiryPhoneRequiredState();domFrmEnquiry.addEventListener('submit',()=>{const dataBsUrl=domFrmBtnEnquirySubmit.getAttribute(attrDataBsUrl);let pageUrl;if(dataBsUrl){if(dataBsUrl.startsWith('/')){pageUrl=window.location.origin+dataBsUrl;}
350else{pageUrl=dataBsUrl;}}
351else{pageUrl=window.location.href;}
352updateEnquiryPhoneRequiredState();if(grecaptcha.getResponse(widgetId4)==""){return;}
353if(domFrmEnquiry.checkValidity()){domFrmBtnEnquirySubmit.value='Submitting...';domFrmBtnEnquirySubmit.disabled=true;var request=Common.Api.MakeAnEnquiry({GrecaptchaToken:grecaptcha.getResponse(widgetId4),Subject:domFrmEnquirySubject?domFrmEnquirySubject.value:null,Name:domFrmTxtEnquiryName.value.trim(),Email:domFrmTxtEnquiryEmail.value.trim(),Phone:domFrmTxtEnquiryPhone.value.trim(),Enquiry:domFrmTxtEnquiryMessage.value.trim(),PreferredContactMethod:getPreferredEnquiryContactMethod(),Url:pageUrl});Common.Functions.AwaitHttpRequests([request],()=>{if(Common.Functions.HttpStatusIsSuccess(request.status)){domFrmBtnEnquirySubmit.value='Submitted';}
354else{domFrmBtnEnquirySubmit.value='An error occurred';domFrmBtnEnquirySubmit.classList.add('btn-danger');}});}});if(domEnquiryModal){domEnquiryModal.addEventListener('show.bs.modal',(event)=>{var callingButton=event.relatedTarget;var url=callingButton.getAttribute(attrDataBsUrl);if(url){domFrmBtnEnquirySubmit.setAttribute(attrDataBsUrl,url);}});}}
355const domFrmBooking=document.getElementById('frmBooking');if(domFrmBooking){const attrDataBsUrl='data-bs-url';const domFrmTxtBookingName=document.getElementById('frmTxtBookingName');const domFrmTxtBookingCompany=document.getElementById('frmTxtBookingCompany');const domFrmTxtBookingEmail=document.getElementById('frmTxtBookingEmail');const domFrmTxtBookingPhone=document.getElementById('frmTxtBookingPhone');const domFrmTxtBookingTables=document.getElementById('frmTxtBookingTables');const domFrmTxtBookingMessage=document.getElementById('frmTxtBookingMessage');const domFrmBtnBookingSubmit=document.getElementById('frmBtnBookingSubmit');domFrmBooking.addEventListener('submit',()=>{const dataBsUrl=domFrmBtnBookingSubmit.getAttribute(attrDataBsUrl);let pageUrl;if(dataBsUrl){if(dataBsUrl.startsWith('/')){pageUrl=window.location.origin+dataBsUrl;}
356else{pageUrl=dataBsUrl;}}
357else{pageUrl=window.location.href;}
358if(grecaptcha.getResponse(widgetId3)==""){return;}
359if(domFrmBooking.checkValidity()){domFrmBtnBookingSubmit.value='Submitting...';domFrmBtnBookingSubmit.disabled=true;var request=Common.Api.TableBooking({GrecaptchaToken:grecaptcha.getResponse(widgetId3),Name:domFrmTxtBookingName.value.trim(),Company:domFrmTxtBookingCompany.value.trim(),Email:domFrmTxtBookingEmail.value.trim(),Phone:domFrmTxtBookingPhone.value.trim(),TableNumber:domFrmTxtBookingTables.value.trim(),Enquiry:domFrmTxtBookingMessage.value.trim(),Url:pageUrl});Common.Functions.AwaitHttpRequests([request],()=>{if(Common.Functions.HttpStatusIsSuccess(request.status)){domFrmBtnBookingSubmit.value='Submitted';}
360else{domFrmBtnBookingSubmit.value='An error occurred';domFrmBtnBookingSubmit.classList.add('btn-danger');}});}});if(domBookingModal){domBookingModal.addEventListener('show.bs.modal',(event)=>{var callingButton=event.relatedTarget;var url=callingButton.getAttribute(attrDataBsUrl);if(url){domFrmBtnBookingSubmit.setAttribute(attrDataBsUrl,url);}});}}
361const domFormSubscribeNewsletter=document.getElementById('FormSubscribeNewsletter');if(domFormSubscribeNewsletter){domFormSubscribeNewsletter.addEventListener('submit',()=>{if(domFormSubscribeNewsletter.checkValidity()){const domSubscribeEmail=document.getElementById('SubscribeEmail');const domSubscribeFirstName=document.getElementById('SubscribeFirstName');const domSubscribeLastName=document.getElementById('SubscribeLastName');const domSubscribeButton=document.getElementById('SubscribeButton');const domFormSubscribeError=document.getElementById('FormSubscribeError');const domFormSubscribeNewsletterComplete=document.getElementById('FormSubscribeNewsletterComplete');domSubscribeButton.disabled=true;const email=domSubscribeEmail.value.trim();
361const firstName=domSubscribeFirstName.value.trim();const lastName=domSubscribeLastName.value.trim();var request=Common.Api.RegisterForNewsletter(email,firstName,lastName);Common.Functions.AwaitHttpRequests([request],()=>{if(Common.Functions.HttpStatusIsSuccess(request.status)){GoogleTagManager.Events.NewsletterSubscriptionSuccess(()=>{Hide(domFormSubscribeNewsletter);Unhide(domFormSubscribeNewsletterComplete);});}
362else{if(request.status===409){Hide(domFormSubscribeNewsletter);Unhide(domFormSubscribeNewsletterComplete);}
363else{Unhide(domFormSubscribeError);domSubscribeButton.disabled=false;}}});}});}
364initialiseCharCounters();Cart.setCart();[...document.getElementsByClassName('allSuggestions')].forEach(element=>setUpSuggestionsSearch(element,'AllSuggestions'));[...document.getElementsByClassName('courseSuggestions')].forEach(element=>setUpSuggestionsSearch(element,'CourseSuggestions'));[...document.getElementsByClassName('eventSuggestions')].forEach(element=>setUpSuggestionsSearch(element,'EventSuggestions'));[...document.getElementsByClassName('qualificationSuggestions')].forEach(element=>setUpSuggestionsSearch(element,'QualificationSuggestions'));})(NewAimwaTemplate||(NewAimwaTemplate={}));function TemplateLoadRecaptchas(){const captcha3Element=document.getElementById('captcha3');const captcha4Element=document.getElementById('captcha4');if(captcha3Element&&!captcha3Element.hasAttribute('data-recaptcha-rendered')){widgetId3=grecaptcha.render(captcha3Element,{'sitekey':'6LcD9ygrAAAAAKsYxu-sq_YuwhB2hRlXdSt0RHV6',});captcha3Element.setAttribute('data-recaptcha-rendered','true');}
365if(captcha4Element&&!captcha4Element.hasAttribute('data-recaptcha-rendered')){widgetId4=grecaptcha.render(captcha4Element,{'sitekey':'6LcD9ygrAAAAAKsYxu-sq_YuwhB2hRlXdSt0RHV6',});captcha4Element.setAttribute('data-recaptcha-rendered','true');}};;
366'use strict';var NewAimwaHome;(function(NewAimwaHome){const ClassExpandedSearch='expandedSearch';const domHomeHeroBanner=document.getElementById('HomeHeroBanner');const domHomeHeroOverlay=document.getElementById('HomeHeroOverlay');const domHeroBannerImages=document.getElementById('HeroBannerImages');const domHomeHeroBack=document.getElementById('HomeHeroBack');const domTabsExplore=document.getElementById('TabsExplore');const domTabsExploreEverything=document.getElementById('TabsExploreEverything');const domFrmSearchCourses=document.getElementById('FrmSearchCourses');const domCoursesSearchTerm=document.getElementById('CoursesSearchTerm');const domCoursesSearchLocation=document.getElementById('CoursesSearchLocation');const domCoursesSearchCalendarBtn=document.getElementById('CoursesSearchCalendarBtn');const domFrmSearchQualifications=document.getElementById('FrmSearchQualifications');const domQualificationsSearchTerm=document.getElementById('QualificationsSearchTerm');const domQualificationsSearchCategory=document.getElementById('QualificationsSearchCategory');const domFrmSearchEvents=document.getElementById('FrmSearchEvents');const domEventsSearchTerm=document.getElementById('EventsSearchTerm');const domEventsSearchCategory=document.getElementById('EventsSearchCategory');const domEventsSearchCalendarBtn=document.getElementById('EventsSearchCalendarBtn');const domFrmSearchEverything=document.getElementById('FrmSearchEverything');const domEverythingSearchTerm=document.getElementById('EverythingSearchTerm');const domTestimonialsContainer=document.getElementById('HomeTestimonials');const domTestimonialsSlider=document.getElementById('HomeTestimonialsSlider');const heroLinks=document.querySelectorAll('.hero-link');const collapseHomeHeroBack=new bootstrap.Collapse(domHomeHeroBack.parentElement,{toggle:false});const collapseTabsExplore=new bootstrap.Collapse(domTabsExplore.parentElement,{toggle:false});const tabExploreEverything=new bootstrap.Tab(domTabsExploreEverything);function updateSearchUI(){if(domHomeHeroBanner.classList.contains(ClassExpandedSearch)){collapseHomeHeroBack.show();collapseTabsExplore.show();heroLinks.forEach(link=>{link.removeAttribute('href');});}
367else{collapseHomeHeroBack.hide();collapseTabsExplore.hide();setTimeout(()=>{heroLinks.forEach(link=>{link.setAttribute('href',link.getAttribute('data-original-href'));});},500);}}
368function expandSearch(){domHomeHeroBanner.classList.add(ClassExpandedSearch);updateSearchUI();}
369function collapseSearch(){domHomeHeroBanner.classList.remove(ClassExpandedSearch);tabExploreEverything.show();updateSearchUI();}
370domHomeHeroBack.addEventListener('click',collapseSearch);domHomeHeroOverlay.addEventListener('click',collapseSearch);domEverythingSearchTerm.addEventListener('focus',expandSearch);domFrmSearchCourses.addEventListener('submit',e=>{e.preventDefault();if(domFrmSearchCourses.checkValidity()){window.location.href='/courses/find-a-course/?'+new URLSearchParams({q:domCoursesSearchTerm.value,where:domCoursesSearchLocation.value});}});domFrmSearchQualifications.addEventListener('submit',e=>{e.preventDefault();if(domFrmSearchQualifications.checkValidity()){window.location.href='/qualifications/find-a-qualification/?'+new URLSearchParams({q:domQualificationsSearchTerm.value,category:domQualificationsSearchCategory.value,});}});domCoursesSearchCalendarBtn.addEventListener('click',e=>{e.preventDefault();window.location.href='/calendar';});domFrmSearchEvents.addEventListener('submit',e=>{e.preventDefault();if(domFrmSearchEvents.checkValidity()){window.location.href='/events/?'+new URLSearchParams({q:domEventsSearchTerm.value,category:domEventsSearchCategory.value,});}});domEventsSearchCalendarBtn.addEventListener('click',e=>{e.preventDefault();window.location.href='/calendar';});domFrmSearchEverything.addEventListener('submit',e=>{e.preventDefault();if(domFrmSearchEverything.checkValidity()){window.location.href='/search?'+new URLSearchParams({q:domEverythingSearchTerm.value,});}});updateSearchUI();if(domTestimonialsSlider){tns({autoplay:true,autoplayButtonOutput:false,autoplayHoverPause:true,center:true,container:domTestimonialsSlider,controls:false,prevButton:domTestimonialsContainer.querySelector('.prevArrow'),nextButton:domTestimonialsContainer.querySelector('.nextArrow'),edgePadding:16,gutter:16,items:1,nav:false,responsive:{576:{items:2},992:{controls:true,items:3},1200:{items:4},1400:{items:5}}});}
371if(domHeroBannerImages){tns({autoplay:true,autoplayButtonOutput:false,autoplayHoverPause:true,container:domHeroBannerImages,controls:false,mouseDrag:true,slideBy:'page',swipeAngle:false,speed:400,autoplayTimeout:10000,nav:true,navPosition:'bottom',items:1,center:true,edgePadding:0,gutter:0,responsive:{576:{items:1},992:{items:1},1200:{items:1}}});}})(NewAimwaHome||(NewAimwaHome={}));;;
372const domSliderContainer=document.querySelectorAll('.carouselContainer');
372domSliderContainer.forEach(slider=>{var tinySlider=tns({container:slider.querySelector('.slider'),items:1,lazyload:true,navContainer:slider.querySelector('.carouselIndicators .sliderNav'),autoplay:false,autoplayTimeout:6000,autoplayButtonOutput:false,controls:false,controlsContainer:'.sliderNav'});let intervalId;let currentIndex;let sliderInfo=tinySlider.getInfo();currentIndex=sliderInfo.displayIndex-1;timerFunction(tinySlider,sliderInfo);tinySlider.events.on('transitionStart',transitionInfo=>{clearInterval(intervalId);const lastIndicator=transitionInfo.navContainer.querySelector('[data-nav="'+currentIndex+'"]');const verTimer=lastIndicator.querySelector("button .verTimer span");if(verTimer!==null){verTimer.style.height=0;}
373lastIndicator.querySelector("button .horTimer span").style.width=0;currentIndex=transitionInfo.displayIndex-1;timerFunction(tinySlider,sliderInfo);});function timerFunction(tinySlider,info){const currentIndicator=info.navContainer.querySelector('[data-nav="'+currentIndex+'"]');const verTimer=currentIndicator.querySelector("button .verTimer span");const horTimer=currentIndicator.querySelector("button .horTimer span");let i=0;intervalId=setInterval(()=>{i++;if(verTimer!==null){verTimer.style.height=i+"%";}
374horTimer.style.width=i+"%";if(i>100){tinySlider.goTo('next');}},60);}});;;

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.