",{"class":"py-2"});if(e===0&&sf)h.append(' <\/time><\/button>');else{let f=t.year+"-"+(t.month+1<10?"0"+(t.month+1):t.month+1)+"-"+(r<10?"0"+r:r),u=n("",{type:"button","class":"mx-auto flex size-8 items-center justify-center rounded-full text-gray-400 opacity-50 hover:bg-gray-200 date-button"});u.append(n("",{datetime:f,text:r}));t.year===i.getFullYear()&&t.month===i.getMonth()&&r===i.getDate()?u.addClass("border border-[3px] border-primary"):u.addClass("text-gray-900");h.append(u);r++}u.append(h)}if(r>f)break}h(t)}function i(t,i){let e=n("#UnoGlCalH6b25fffa");e.text(r[t.month]+" "+t.year);let u=n("#UnoGlCalBtnPrv4dca4c56");f(t,i)?(u.prop("disabled",!0),u.addClass("opacity-50 cursor-not-allowed")):(u.prop("disabled",!1),u.removeClass("opacity-50 cursor-not-allowed"))}function o(t){let i=n("#UnoGlCalOl97e4b157");i.empty();i.html(` `);n.ajax({url:"https://cas.netalive.global/golive/api/calendar/day",method:"POST",data:JSON.stringify({SelectedDate:t,Calendar:"4518bb40-b559-4fe3-863c-8f1a34bcfbd7"}),dataType:"json",contentType:"application/json"}).done(function(t){let i=n("#UnoGlCalOl97e4b157");if(i.empty(),!t.items||t.items.length===0){i.append("Keine Termine verfügbar.Wählen Sie bitte einen anderen Tag aus.<\/li>");return}t.items.forEach(function(t){let f=n("",{"class":"group flex items-center gap-x-4 rounded-xl px-4 py-2 focus-within:bg-gray-100 hover:bg-gray-100 cursor-pointer border border-white border-[3px]","data-calid":t.id}),o=n("",{"class":"size-10 flex-none rounded-full bg-primary text-white flex items-center justify-center font-medium",text:t.avatar});f.append(o);let e=n("",{"class":"flex-auto"});e.append(n("",{"class":"text-gray-900",text:t.title}));let r=n("",{"class":"mt-0.5"});r.append(n("",{datetime:t.start,text:u(t.start)}));r.append(" - ");r.append(n("",{datetime:t.end,text:u(t.end)}));e.append(r);f.append(e);i.append(f)})}).fail(function(){n("section ol").html('Fehler beim Laden.<\/li>')})}function s(u,e){let c=n(".flex.items-center button"),s=n("#UnoGlCalBtnPrv4dca4c56"),h=n("#UnoGlCalBtnNxt110e7c60");s.on("click",function(){f(u,e)||(u.month--,u.month<0&&(u.month=11,u.year--),i(u,e),t(u,e))});h.on("click",function(){u.month++;u.month>11&&(u.month=0,u.year++);i(u,e);t(u,e)});n(".mt-2.grid").on("click",".date-button",function(){let t=n(this).find("time").attr("datetime");n(".date-button").removeClass("bg-primary text-white font-semibold");n(this).addClass("bg-primary text-white font-semibold");let u=n("section h2"),i=new Date(t),f=i.getDate()+". "+r[i.getMonth()]+" "+i.getFullYear();u.html("Verfügbare Termine am ").append(n("",{datetime:t,text:f}));o(t)})}function h(t){let i=t.year,r=(t.month+1).toString().padStart(2,"0");n.ajax({url:"https://cas.netalive.global/golive/api/calendar/availability",type:"POST",contentType:"application/json",data:JSON.stringify({SelectedDate:i+"-"+r+"-01",Calendar:"4518bb40-b559-4fe3-863c-8f1a34bcfbd7"}),dataType:"json"}).done(function(t){let i=t.days||[],r=new Set(i);n("#UnoGlCalGrid16952f2b .date-button").each(function(){let t=n(this).find("time").attr("datetime");if(r.has(t))n(this).removeClass("text-gray-400 opacity-50 cursor-not-allowed").addClass("text-gray-900").on("click");else n(this).removeClass("text-gray-900").addClass("text-gray-400 opacity-50 cursor-not-allowed").off("click")})})}var r=["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];n(document).ready(function(){let r=new Date,u={month:r.getMonth(),year:r.getFullYear()};i(u,r);t(u,r);s(u,r);let f=e(r),o=n(".date-button");o.each(function(){let t=n(this).find("time").attr("datetime");if(t>=f)return n(this).trigger("click"),!1});n("#UnoGlCalOl97e4b157").on("click","li[data-calid]",function(){let t=n(this).data("calid");n("#OnboardingAppointment").val(t);n("li[data-calid]").each(function(){n(this).removeClass("border-primary");n(this).addClass("border-white")});n(this).removeClass("border-white");n(this).addClass("border-primary")})})}(jQuery)