var module_50288254680=void $(document).ready((function(){const allParticipants=[],fairRecords=[],connectRecords=[],priorityRecords=[],allSubjects=[],schoolSubjects={},buildInstitution=function(participant){if(-1===$.inArray(participant.institution_id,allParticipants)){let logoContent,nameContent;allParticipants.push(participant.institution_id),$.inArray(participant.institution_id,fairRecords),$.inArray(participant.institution_id,connectRecords),participant.logo&&(logoContent=-1!==participant.logo.indexOf("http")?'<img src="'+participant.logo+'" alt="'+participant.name+'" loading="lazy">':'<img src="https://'+participant.logo+'" alt="'+participant.name+'" loading="lazy">'),nameContent=participant.name,-1!==window.location.href.indexOf("topmba")&&(participant.topmba_node_id||participant.topuniversities_node_id)?(participant.logo&&(logoContent=participant.topmba_node_id?0===participant.logo.indexOf("files")?'<a href="https://www.topmba.com/node/'+participant.topmba_node_id+'" target="_blank" class="participating-school-click"><img src="https://'+participant.logo+'" alt="'+participant.name+'" loading="lazy"></a>':'<a href="https://www.topmba.com/node/'+participant.topmba_node_id+'" target="_blank" class="participating-school-click"><img src="'+participant.logo+'" alt="'+participant.name+'" loading="lazy"></a>':0===participant.logo.indexOf("files")?`<a href="https://www.topuniversities.com/node/${participant.topuniversities_node_id}" target="_blank" class="participating-school-click"><img src="https://${participant.logo}" alt="${participant.name}" loading="lazy"></a>`:`<a href="https://www.topuniversities.com/node/${participant.topuniversities_node_id}" target="_blank" class="participating-school-click"><img src="${participant.logo}" alt="${participant.name}" loading="lazy"></a>`),participant.topmba_node_id?nameContent='<a href="https://www.topmba.com/node/'+participant.topmba_node_id+'" target="_blank" class="participating-school-click" style="text-decoration:none;border-bottom:0px">'+participant.name+"</a>":participant.topuniversities_node_id&&(nameContent='<a href="https://www.topuniversities.com/node/'+participant.topuniversities_node_id+'" target="_blank"  class="participating-school-click" style="text-decoration:none;border-bottom:0px">'+participant.name+"</a>")):-1!==window.location.href.indexOf("topuni")&&(participant.topuniversities_node_id||participant.topmba_node_id)&&(participant.logo&&(logoContent=participant.topuniversities_node_id?0===participant.logo.indexOf("files")?`<a href="https://www.topuniversities.com/node/${participant.topuniversities_node_id}" target="_blank" class="participating-school-click"><img src="https://${participant.logo}" alt="${participant.name}" loading="lazy"></a>`:`<a href="https://www.topuniversities.com/node/${participant.topuniversities_node_id}" target="_blank" class="participating-school-click"><img src="${participant.logo}" alt="${participant.name}" loading="lazy"></a>`:0===participant.logo.indexOf("files")?'<a href="https://www.topmba.com/node/'+participant.topmba_node_id+'" target="_blank" class="participating-school-click"><img src="https://'+participant.logo+'" alt="'+participant.name+'" loading="lazy"></a>':'<a href="https://www.topmba.com/node/'+participant.topmba_node_id+'" target="_blank" class="participating-school-click"><img src="'+participant.logo+'" alt="'+participant.name+'" loading="lazy"></a>'),participant.topuniversities_node_id?nameContent='<a href="https://www.topuniversities.com/node/'+participant.topuniversities_node_id+'" target="_blank"  class="participating-school-click" style="text-decoration:none;border-bottom:0px">'+participant.name+"</a>":participant.topmba_node_id&&(nameContent='<a href="https://www.topmba.com/node/'+participant.topmba_node_id+'" target="_blank" class="participating-school-click" style="text-decoration:none;border-bottom:0px">'+participant.name+"</a>"));var cardHtml=`<div class="cards__card allSubjects subjectID${participant.institution_id}"><div class="qs-card default withShadow fullWidth"><div class="body addFlexBox addLogoGap `+styles_background_colour+" "+styles_text_colour+'" '+cardStyle+'><div class="card_logo_div">'+(participant.logo?logoContent:"")+'</div><div class="card_name_div"><div class="name-div"><p>'+nameContent+'</p></div><div><p class="text-light">'+participant.country+"</p></div>";-1!==$.inArray(participant.institution_id,fairRecords)&&(cardHtml+=`<div class="pill-div addDesktopTopmargin pillShow" style="flex-grow: 1;flex-direction: row;display: flex;gap: 5px;display:none"><div class="pill networking padding small roundPill pill-mobile" style="line-height:10px;font-size:8pt;padding:8px;">\n                                            ${networking_text_lower} <i class="fa-light fa-users margin-l-10"></i>\n                                        </div></div>`),-1!==$.inArray(participant.institution_id,connectRecords)&&(cardHtml+=`<div class="pill-div addDesktopTopmargin pillShow" style="flex-grow: 1;flex-direction: row;display: flex;gap: 5px;display:none"><div class="pill personal padding small roundPill pill-mobile" style="line-height:10px;font-size:8pt;padding:8px;">\n                                            ${personal_meeting_text_lower} <i class="fa-light fa-handshake margin-l-10"></i>\n                                        </div></div>`),cardHtml+="</div></div></div>",$("#participating-universities-area").append(cardHtml),$("#participating-universities-area-all").append(cardHtml),-1!==$.inArray(participant.institution_id,fairRecords)&&$("#participating-universities-area-fair").append(cardHtml),-1!==$.inArray(participant.institution_id,connectRecords)&&$("#participating-universities-area-connect").append(cardHtml)}};$.each(allEvents,(function(index,event){event.associations.p_institution_collection__event_booking_landing_page_priority&&event.associations.p_institution_collection__event_booking_landing_page_priority.items&&$.each(event.associations.p_institution_collection__event_booking_landing_page_priority.items,(function(index,participant){priorityRecords.push(participant.institution_id)})),event.associations.p_institution_collection__event_booking&&event.associations.p_institution_collection__event_booking.items&&$.each(event.associations.p_institution_collection__event_booking.items,(function(index,participant){"Connect MBA"==event.tour_name||"Connect Masters"==event.tour_name||"QS Connect MBA"==event.tour_name||"QS Connect Masters"==event.tour_name?connectRecords.push(participant.institution_id):fairRecords.push(participant.institution_id)}))})),fairRecords.length>0&&connectRecords.length>0&&$(".participantButtonDiv").show(),$.each(allEvents,(function(index,event){event.associations.p_institution_collection__event_booking_landing_page_priority&&event.associations.p_institution_collection__event_booking_landing_page_priority.items&&$.each(event.associations.p_institution_collection__event_booking_landing_page_priority.items,(function(index,participant){buildInstitution(participant)})),event.associations.p_institution_collection__event_booking&&event.associations.p_institution_collection__event_booking.items&&$.each(event.associations.p_institution_collection__event_booking.items,(function(index,participant){buildInstitution(participant)}))})),$("#show-all-participating-institutions").show(),$(document).on("click","#show-all-participating-institutions",(function(event){$(".FAIRPARTICIPANT").hide(),$(".CONNECTPARTICIPANT").hide(),$(".ALLPARTICIPANTS").hide(),$(".SHOWALLPARTICIPANTS").show(),$("#show-all-participating-institutions").hide()})),$(document).on("click",".participantButton",(function(event){let el=$(this).data().id;$(".allSubjects").show(),$(".SHOWALLPARTICIPANTS").hide(),$(".ALLPARTICIPANTS").hide(),$(".FAIRPARTICIPANT").hide(),$(".CONNECTPARTICIPANT").hide(),$(".removeSubjectFilter").hide(),$("#subjectDropdown").val("ALL"),$(`.${el}`).show(),$(".participantButton").removeClass("selected"),$(".pillShow").hide(),$(this).addClass("selected"),"FAIRPARTICIPANT"==el||"CONNECTPARTICIPANT"==el?$("#show-all-participating-institutions").hide():$("#show-all-participating-institutions").show(),"ALLPARTICIPANTSFILTERED"==el&&$(".ALLPARTICIPANTSBUTTON").addClass("selected")})),function(){let options={items:3,loop:!0,margin:30,dots:!0,nav:!1,autoplay:!0,autoplayTimeout:3e3,autoplayHoverPause:!0,responsive:{0:{items:1,dots:!1,margin:0},768:{items:2,dots:!1,margin:0},992:{items:3}}};$("#participating-universities-area").owlCarousel(options),$("#participating-universities-area-fair").owlCarousel(options),$("#participating-universities-area-connect").owlCarousel(options)}(),function(){const alleventIds=[];return eventDataDayOne.forEach((data=>{0!=data&&alleventIds.push(data.event_id)})),new Promise((resolve=>{let xhr=new XMLHttpRequest;xhr.open("POST","https://apiv3.qs.com/api/virtual-candidates/1.0/getSubjectMatrix"),xhr.setRequestHeader("Content-type","application/json");let data={};data=null!=alleventIds[1]?{event_id:alleventIds,memberSubjects:[],schoolsOfInterest:[],multiple:!0}:{event_id:alleventIds[0],memberSubjects:[],schoolsOfInterest:[]};let final_data=JSON.stringify(data);xhr.onreadystatechange=function(){if(4==xhr.readyState&&200==xhr.status){const data=JSON.parse(xhr.response);console.log("data",data),resolve(data)}else(4==xhr.readyState&&400==xhr.status||4==xhr.readyState&&403==xhr.status||4==xhr.readyState&&404==xhr.status)&&console.log("There was an error receiving agenda data")},xhr.send(final_data)}))}().then((res=>{if(res.success){const subjectsData=res.subjects;for(const[key,value]of Object.entries(subjectsData)){const subjectLevel=value.subjects.ug.length>0?"ug":"pg";value.subjects[subjectLevel].forEach((individualSubjects=>{schoolSubjects[`sub${individualSubjects.id}`]||(schoolSubjects[`sub${individualSubjects.id}`]=[],allSubjects.push(individualSubjects)),schoolSubjects[`sub${individualSubjects.id}`].push(value.coreId)}))}}const sortedSubjects=allSubjects.sort(((a,b)=>{const titleA=a.title.toUpperCase(),titleB=b.title.toUpperCase();return titleA<titleB?-1:titleA>titleB?1:0}));if(sortedSubjects){const dropdown=$("#subjectDropdown");$.each(sortedSubjects,(function(index,item){const title=item.title,id=item.id,option=$("<option>").val(id).text(title);dropdown.append(option)})),$(".subjectsButtonDiv").show()}})),$("#subjectDropdown").on("change",(function(e){const el=$(this),val=el.val(),valText=el.find("option:selected").text();console.log(valText),$(".SHOWALLPARTICIPANTS").hide(),$(".ALLPARTICIPANTS").hide(),$(".FAIRPARTICIPANT").hide(),$(".CONNECTPARTICIPANT").hide(),$(".allSubjects").hide(),$(".participantButton").removeClass("selected"),$(".ALLPARTICIPANTSBUTTON").addClass("selected"),"ALL"==val?($(".allSubjects").show(),$(".removeSubjectFilter").hide(),$(".pillShow").hide()):(schoolSubjects[`sub${val}`].forEach((id=>{$(`.subjectID${id}`).show()})),$(".removeSubjectFilter").show(),$(".pillShow").show(),(window._hsq=window._hsq||[]).push(["trackCustomBehavioralEvent",{name:"pe25874232_subject_selected___participating_schools_lp_cp",properties:{event_tour_name:eventDataDayOne[0].tour_name,event_season_name:`${eventDataDayOne[0].season_name} ${eventDataDayOne[0].season_year}`,event_region:eventDataDayOne[0].region,event_city:eventDataDayOne[0].city,event_id:eventDataDayOne[0].event_id,subject_selected:valText}}])),$(".SHOWALLPARTICIPANTS").show(),$("#show-all-participating-institutions").hide()})),"Occured"!=showLapsedButton&&"Occured"!=showLapsedButtonTwo||$(".participatingSchoolViewable").hide()}));