<\/div>').html(r.format("h:mm a")),e,f,o,s;l.append(u);e=i.Id;u.click(function(){bookingDate=moment(currentDate,"DD/MM/YYYY",!0);bookingDate.hour(r.hour()).minute(r.minute()).second(0).millisecond(0);practitionerId=e;$(".practice-practitioners .selected").removeClass("selected");$(this).addClass("selected");$(this).closest(".practitioner").addClass("selected");var n=$("#therapies option:selected").text(),t=n.split("-").pop();$(".footer-total-amount").html(t);$(".footer-book").removeClass("disabled")});practitionerId&&bookingDate&&(f=moment(currentDate,"DD/MM/YYYY",!0),f.hour(r.hour()).minute(r.minute()).second(0).millisecond(0),practitionerId==i.Id&&bookingDate.utc().format()==f.utc().format()&&(bookingDate=moment(currentDate,"DD/MM/YYYY",!0),bookingDate.hour(r.hour()).minute(r.minute()).second(0).millisecond(0),$(".practice-practitioners .selected").removeClass("selected"),u.addClass("selected"),u.closest(".practitioner").addClass("selected"),o=$("#therapies option:selected").text(),s=o.split("-").pop(),$(".footer-total-amount").html(s),$(".footer-book").removeClass("disabled")))})}},error:function(){},complete:function(){removeSpinner()}})}function getPotentialClinic(){var n=$(".practice-practitioners");n.empty();$(".clarity-message").hide();$(".practice-therapies").hide();$(".practice-info").hide();$(".map-date").hide();$(".practice-footer").hide();$(".footer-book").addClass("disabled");$("#therapies").addClass("therapy-selected");n.html(`
This clinic is unfortunely not using our platform yet, If you enter your info below, we will let them know you tried to book them on our platform.
If they join us, we will give you a discount on your next appointment!
`)}function potCust(){var n=document.getElementById("invitationCustomerName"),t=document.getElementById("invitationCustomerEmail");n.value!==""&&t.value!==""?$(".footer-book").removeClass("disabled"):$(".footer-book").addClass("disabled")}function sendInvitation(){var n=$(".practice-practitioners"),t=$("#invitationCustomerName").val(),i=$("#invitationCustomerEmail").val(),r=$("#invitationCustomMessage").val();$.ajax({cache:!1,type:"GET",url:"/InvitationEmail/RegisterInvitationEmail",data:{CustomMessage:r,Name:t,Email:i,PotentialClinicId:potentialClinicId},success:function(){},error:function(){},complete:function(){n.html(`
Your message was sent successfully!
Keep an eye on your emails for a discount code once the clinic joins our platform.
Thanks for supporting our up and coming platform!
`)}})}function flyToTherapy(n){var t=n.CoordinateX,i=n.CoordinateY;map.flyTo({center:[i,t],zoom:12})}var currentDate="",currentPrice=0,currentDistance=0,therapyTypeId=0,vendorId=0,productId=0,bookingDate=null,practitionerId=0,spinnerCount=0,categoryImageUrl="",potentialClinicId=0,myCircle,currentMarkers,accesToken,mapStyle,map;$(".at-banner__close").on("click",function(){$(this).parent().remove()});$(document).ready(function(){var n,t,i;performance.navigation.type==2&&($("#datepicker").val(""),$("#Distance").val(""),$("#Price").val(""),$("#TherapyType").prop("selectedIndex",0),$("#PractitionerName").val(""),$("#ClinicName").val(""));localStorage.removeItem("id");$.ajax({type:"GET",url:"/Maps/EmptyCustomerShoppingCart",success:function(){},error:function(){}});$.ajax({cache:!1,type:"GET",url:"/Maps/GetAllPractitionersNames",success:function(n){$("#PractitionerName").autocomplete({source:function(t,i){var r=$.ui.autocomplete.filter(n,t.term);$.ajax({cache:!1,type:"GET",url:"/CustomerFavorites/AllCustomerFavoritePractitionersNames",success:function(n){n==null?i(r):(r=n.concat(r),i(r))},error:function(){}})}})},error:function(){}});$.ajax({cache:!1,type:"GET",url:"/Maps/GetCustomerGeo",beforeSend:function(){addSpinner()},success:function(n){var t=n.CustomerAddress;t!=null&&t.CoordinateX!=null&&t.CoordinateY!=null&&map.flyTo({center:[t.CoordinateY,t.CoordinateX],zoom:10,essential:!0})},error:function(){alert("error")},complete:function(){removeSpinner()}});$("#TherapyType").on("change",function(){var n=this.value;$.ajax({cache:!1,type:"GET",url:"/Maps/GetAllClinicsNames",data:{id:n},success:function(n){$("#ClinicName").autocomplete({source:function(t,i){var r=$.ui.autocomplete.filter(n,t.term);$.ajax({cache:!1,type:"GET",url:"/CustomerFavorites/AllCustomerFavoriteClinicsNames",success:function(n){n==null?i(r):(r=n.concat(r),i(r))},error:function(){}})}})},error:function(){}})});if($("#datepicker").datepicker({dateFormat:"dd/mm/yy",minDate:new Date}),$("#currentDatepicker").datepicker({showOn:"button",buttonText:"Select Date",dateFormat:"dd/mm/yy",minDate:new Date,onSelect:function(n){currentDate=n;$(this).datepicker("option","buttonText",n);$(".current-date").addClass("date-selected");validatePreNextDate();getPractitioners()}}),$("#search-therapy").bind("click",function(){vendorId=0;productId=0;practitionerId=0;bookingDate=null;searchTherapies()}),$(".previous-date").bind("click",function(){setPrevNextDate(!0)}),$(".next-date").bind("click",function(){setPrevNextDate(!1)}),$("#map").bind("click",function(n){$(n.target).closest(".mapboxgl-popup-content").length===0&&$(n.target).closest(".marker").length===0&&removeTherapyPopUps()}),$("#therapies").change(function(){getPractitioners()}),$(".back-links").bind("click",function(){$(".map-practice").hasClass("map-mode")?($(".map-practice").removeClass("map-mode practitioners-mode"),$(".map-practice").addClass("search-mode")):$(".map-practice").hasClass("practitioners-mode")&&($(".map-practice").removeClass("practitioners-mode"),$(".map-practice").addClass("search-mode"));map.resize()}),n=null,t=window.localStorage.getItem("gowell-bookInfo"),t)if(n=JSON.parse(t),i=Math.floor(((new Date).getTime()-n.time)/6e4),i>=4)window.localStorage.removeItem("gowell-bookInfo");else{currentDate=n.date;currentPrice=n.price;currentDistance=n.distance;therapyTypeId=n.therapyTypeId;vendorId=n.vendorId;productId=n.productId;bookingDate=moment(n.bookingDate);practitionerId=n.practitionerId;var r=n.practitionerName,u=n.ClinicName,f=n.PostCode;$("#TherapyType").val(therapyTypeId);currentDate&&($("#datepicker").datepicker("setDate",currentDate),$("#currentDatepicker").datepicker("option","buttonText",currentDate),validatePreNextDate());currentPrice&&$("#Price").val(currentPrice);currentDistance&&$("#Distance").val(currentDistance);$("#PractitionerName").val(r);$("#ClinicName").val(u);$("#Post-Code").val(f);window.localStorage.removeItem("gowell-bookInfo")}$(".footer-book").bind("click",function(){var n=$("#book-appointment"),t={date:currentDate,price:currentPrice,distance:currentDistance,therapyTypeId:therapyTypeId,vendorId:vendorId,productId:productId,bookingDate:bookingDate.utc().format(),practitionerId:practitionerId,practitionerName:$("#PractitionerName").val(),ClinicName:$("#ClinicName").val(),PostCode:$("#Post-Code").val(),time:(new Date).getTime()};window.localStorage.setItem("gowell-bookInfo",JSON.stringify(t));n.show()})});currentMarkers=[];"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});accesToken="pk.eyJ1IjoicGhpbGJvb2thbGxpbCIsImEiOiJja21maGt4dWwydDM5MnhzOXgwdjJqem0yIn0.cbNUMcOav1yyvBU6FouEIg";mapStyle="styles/mapbox/streets-v11";mapboxgl.accessToken=accesToken;var centerX="-33.88475084790591",centerY="151.10146060961224",mapZoom=10;map=new mapboxgl.Map({container:"map",style:"mapbox://"+mapStyle,center:[centerY,centerX],zoom:mapZoom,interactive:isTouchDevice()?!1:!0});map.scrollZoom.disable();map.on("load",function(){})