var booked_load_calendar_date_booking_options,
booked_appt_form_options,
bookedNewAppointment;
;(function($, window, document, undefined){
var $win=$(window);
$.fn.spin.presets.booked={
lines: 10,
length: 7,
width: 5,
radius: 11,
corners: 1,
rotate: 0,
direction: 1,
color: '#555',
speed: 1,
trail: 60,
shadow: false,
hwaccel: false,
className: 'booked-spinner',
zIndex: 2e9,
top: '50%',
left: '50%'
}
$.fn.spin.presets.booked_top={
lines: 11,
length: 10,
width: 6,
radius: 15,
corners: 1,
rotate: 0,
scale: 0.5,
direction: 1,
color: '#aaaaaa',
speed: 1,
trail: 60,
shadow: false,
hwaccel: false,
className: 'booked-spinner booked-spinner-top',
zIndex: 2e9,
top: '15px',
left: '50%'
}
$.fn.spin.presets.booked_white={
lines: 13,
length: 11,
width: 5,
radius: 18,
scale: 1,
corners: 1,
rotate: 0,
direction: 1,
color: '#fff',
speed: 1,
trail: 60,
shadow: false,
hwaccel: false,
className: 'booked-spinner booked-white',
zIndex: 2e9,
top: '50%',
left: '50%'
}
$win.on('resize', function(){
adjust_calendar_boxes();
resize_booked_modal();
});
$win.on('load', function(){
BookedTabs.Init();
var ajaxRequests=[];
adjust_calendar_boxes();
$('.booked-calendar-wrap').each(function(){
var thisCalendar=$(this);
var calendar_month=thisCalendar.find('div.booked-calendar').attr('data-calendar-date');
thisCalendar.attr('data-default',calendar_month);
init_tooltips(thisCalendar);
});
$('.booked-list-view').each(function(){
var thisList=$(this);
var list_date=thisList.find('.booked-appt-list').attr('data-list-date');
thisList.attr('data-default',list_date);
});
bookedRemoveEmptyTRs();
init_appt_list_date_picker();
$('.booked_calendar_chooser').change(function(e){
e.preventDefault();
var $selector=$(this),
thisIsCalendar=$selector.parents('.booked-calendarSwitcher').hasClass('calendar');
if(!thisIsCalendar){
var thisCalendarWrap=$selector.parents('.booked-calendar-shortcode-wrap').find('.booked-list-view'),
thisDefaultDate=thisCalendarWrap.attr('data-default'),
thisIsCalendar=$selector.parents('.booked-calendarSwitcher').hasClass('calendar');
if(typeof thisDefaultDate=='undefined'){ thisDefaultDate=false; }
thisCalendarWrap.addClass('booked-loading');
var args={
'action':'booked_appointment_list_date',
'nonce':booked_js_vars.nonce,
'date':thisDefaultDate,
'calendar_id':$selector.val()
};
$(document).trigger("booked-before-loading-appointment-list-booking-options");
thisCalendarWrap.spin('booked_top');
$.ajax({
url: booked_js_vars.ajax_url,
type: 'post',
data: args,
success: function(html){
thisCalendarWrap.html(html);
init_appt_list_date_picker();
setTimeout(function(){
thisCalendarWrap.removeClass('booked-loading');
},1);
}});
}else{
var thisCalendarWrap=$selector.parents('.booked-calendar-shortcode-wrap').find('.booked-calendar-wrap'),
thisDefaultDate=thisCalendarWrap.attr('data-default');
if(typeof thisDefaultDate=='undefined'){ thisDefaultDate=false; }
var args={
'action':'booked_calendar_month',
'nonce':booked_js_vars.nonce,
'gotoMonth':thisDefaultDate,
'calendar_id':$selector.val()
};
savingState(true,thisCalendarWrap);
$.ajax({
url: booked_js_vars.ajax_url,
type: 'post',
data: args,
success: function(html){
thisCalendarWrap.html(html);
adjust_calendar_boxes();
bookedRemoveEmptyTRs();
init_tooltips(thisCalendarWrap);
$(window).trigger('booked-load-calendar', args, $selector);
}});
}
return false;
});
$('body').on('click', '.booked-calendar-wrap .page-right, .booked-calendar-wrap .page-left, .booked-calendar-wrap .monthName a', function(e){
e.preventDefault();
var $button=$(this),
gotoMonth=$button.attr('data-goto'),
thisCalendarWrap=$button.parents('.booked-calendar-wrap'),
thisCalendarDefault=thisCalendarWrap.attr('data-default'),
calendar_id=$button.parents('div.booked-calendar').attr('data-calendar-id');
if(typeof thisCalendarDefault=='undefined'){ thisCalendarDefault=false; }
var args={
'action':'booked_calendar_month',
'nonce':booked_js_vars.nonce,
'gotoMonth':gotoMonth,
'calendar_id':calendar_id,
'force_default':thisCalendarDefault
};
savingState(true,thisCalendarWrap);
$.ajax({
url: booked_js_vars.ajax_url,
type: 'post',
data: args,
success: function(html){
thisCalendarWrap.html(html);
adjust_calendar_boxes();
bookedRemoveEmptyTRs();
init_tooltips(thisCalendarWrap);
$(window).trigger('booked-load-calendar', args, $button);
}});
return false;
});
$('body').on('click', '.booked-calendar-wrap .bc-row.week .bc-col', function(e){
e.preventDefault();
var $thisDate=$(this),
booked_calendar_table=$thisDate.parents('div.booked-calendar'),
$thisRow=$thisDate.parent(),
date=$thisDate.attr('data-date'),
calendar_id=booked_calendar_table.attr('data-calendar-id'),
colspanSetting=$thisRow.find('.bc-col').length;
if(!calendar_id){ calendar_id=0; }
if($thisDate.hasClass('blur')||$thisDate.hasClass('booked')&&!booked_js_vars.publicAppointments||$thisDate.hasClass('prev-date')){
}else if($thisDate.hasClass('active')){
$thisDate.removeClass('active');
$('.bc-row.entryBlock').remove();
var calendarHeight=booked_calendar_table.height();
booked_calendar_table.parent().height(calendarHeight);
}else{
$('.bc-row.week .bc-col').removeClass('active');
$thisDate.addClass('active');
$('.bc-row.entryBlock').remove();
$thisRow.after('<div class="bc-row entryBlock booked-loading"><div class="bc-col"></div></div>');
$('.bc-row.entryBlock').find('.bc-col').spin('booked');
booked_load_calendar_date_booking_options={'action':'booked_calendar_date','nonce': booked_js_vars.nonce,'date':date,'calendar_id':calendar_id};
$(document).trigger("booked-before-loading-calendar-booking-options");
var calendarHeight=booked_calendar_table.height();
booked_calendar_table.parent().height(calendarHeight);
$.ajax({
url: booked_js_vars.ajax_url,
type: 'post',
data: booked_load_calendar_date_booking_options,
success: function(html){
$('.bc-row.entryBlock').find('.bc-col').html(html);
$('.bc-row.entryBlock').removeClass('booked-loading');
$('.bc-row.entryBlock').find('.booked-appt-list').fadeIn(300);
$('.bc-row.entryBlock').find('.booked-appt-list').addClass('shown');
adjust_calendar_boxes();
}});
}
return;
});
$('body').on('click', '.booked-list-view .booked-list-view-date-prev, .booked-list-view .booked-list-view-date-next', function(e){
e.preventDefault();
var $thisLink=$(this),
date=$thisLink.attr('data-date'),
thisList=$thisLink.parents('.booked-list-view'),
defaultDate=thisList.attr('data-default'),
calendar_id=$thisLink.parents('.booked-list-view-nav').attr('data-calendar-id');
if(typeof defaultDate=='undefined'){ defaultDate=false; }
if(!calendar_id){ calendar_id=0; }
thisList.addClass('booked-loading');
var booked_load_list_view_date_booking_options={
'action':'booked_appointment_list_date',
'nonce':booked_js_vars.nonce,
'date':date,
'calendar_id':calendar_id,
'force_default':defaultDate
};
$(document).trigger("booked-before-loading-appointment-list-booking-options");
thisList.spin('booked_top');
$.ajax({
url: booked_js_vars.ajax_url,
type: 'post',
data: booked_load_list_view_date_booking_options,
success: function(html){
thisList.html(html);
init_appt_list_date_picker();
setTimeout(function(){
thisList.removeClass('booked-loading');
},1);
}});
return false;
});
bookedNewAppointment=function(e){
e.preventDefault();
var $button=$(this),
title=$button.attr('data-title'),
timeslot=$button.attr('data-timeslot'),
date=$button.attr('data-date'),
calendar_id=$button.attr('data-calendar-id'),
$thisTimeslot=$button.parents('.timeslot'),
is_list_view=$button.parents('.booked-calendar-wrap').hasClass('booked-list-view');
if(typeof is_list_view!='undefined'&&is_list_view){
var new_calendar_id=$button.parents('.booked-list-view').find('.booked-list-view-nav').attr('data-calendar-id');
}else{
var new_calendar_id=$button.parents('div.booked-calendar').attr('data-calendar-id');
}
calendar_id=new_calendar_id ? new_calendar_id:calendar_id;
booked_appt_form_options={'action':'booked_new_appointment_form','nonce': booked_js_vars.nonce,'date':date,'timeslot':timeslot,'calendar_id':calendar_id,'title':title};
$(document).trigger("booked-before-loading-booking-form");
create_booked_modal();
setTimeout(function(){
$.ajax({
url: booked_js_vars.ajax_url,
type: 'post',
data: booked_appt_form_options,
success: function(html){
$('.bm-window').html(html);
var bookedModal=$('.booked-modal');
var bmWindow=bookedModal.find('.bm-window');
bmWindow.css({'visibility':'hidden'});
bookedModal.removeClass('bm-loading');
$(document).trigger("booked-on-new-app");
resize_booked_modal();
bmWindow.hide();
$('.booked-modal .bm-overlay').find('.booked-spinner').remove();
setTimeout(function(){
bmWindow.css({'visibility':'visible'});
bmWindow.show();
},50);
}});
},100);
return false;
}
$('body').on('click', '.booked-calendar-wrap button.new-appt', bookedNewAppointment);
var profileTabs=$('.booked-tabs');
if(!profileTabs.find('li.active').length){
profileTabs.find('li:first-child').addClass("active");
}
if(profileTabs.length){
$('.booked-tab-content').hide();
var activeTab=profileTabs.find('.active > a').attr('href');
activeTab=activeTab.split('#');
activeTab=activeTab[1];
$('#profile-'+activeTab).show();
profileTabs.find('li > a').on('click', function(e){
e.preventDefault();
$('.booked-tab-content').hide();
profileTabs.find('li').removeClass('active');
$(this).parent().addClass('active');
var activeTab=$(this).attr('href');
activeTab=activeTab.split('#');
activeTab=activeTab[1];
$('#profile-'+activeTab).show();
return false;
});
}
$('body').on('click', '.booked-profile-appt-list .booked-show-cf', function(e){
e.preventDefault();
var hiddenBlock=$(this).parent().find('.cf-meta-values-hidden');
if(hiddenBlock.is(':visible')){
hiddenBlock.hide();
$(this).removeClass('booked-cf-active');
}else{
hiddenBlock.show();
$(this).addClass('booked-cf-active');
}
return false;
});
if($('#loginform').length){
$('#loginform input[type="submit"]').on('click',function(e){
if($('#loginform input[name="log"]').val()&&$('#loginform input[name="pwd"]').val()){
$('#loginform .booked-custom-error').hide();
}else{
if($('#loginform').parents('.booked-form-wrap').length){
e.preventDefault();
$('#loginform').parents('.booked-form-wrap').find('.booked-custom-error').fadeOut(200).fadeIn(200);
}}
});
}
if($('#profile-forgot').length){
$('#profile-forgot input[type="submit"]').on('click',function(e){
if($('#profile-forgot input[name="user_login"]').val()){
$('#profile-forgot .booked-custom-error').hide();
}else{
e.preventDefault();
$('#profile-forgot').find('.booked-custom-error').fadeOut(200).fadeIn(200);
}});
}
if($('.booked-upload-wrap').length){
$('.booked-upload-wrap input[type=file]').on('change',function(){
var fileName=$(this).val();
$(this).parent().find('span').html(fileName);
$(this).parent().addClass('hasFile');
});
}
$('body').on('click', '.booked-profile-appt-list .appt-block .cancel', function(e){
e.preventDefault();
var $button=$(this),
$thisParent=$button.parents('.appt-block'),
appt_id=$thisParent.attr('data-appt-id');
confirm_delete=confirm(booked_js_vars.i18n_confirm_appt_delete);
if(confirm_delete==true){
var currentApptCount=parseInt($('.booked-profile-appt-list').find('h4').find('span.count').html());
currentApptCount=parseInt(currentApptCount - 1);
if(currentApptCount < 1){
$('.booked-profile-appt-list').find('h4').find('span.count').html('0');
$('.no-appts-message').slideDown('fast');
}else{
$('.booked-profile-appt-list').find('h4').find('span.count').html(currentApptCount);
}
$('.appt-block').animate({'opacity':0.4},0);
$thisParent.slideUp('fast',function(){
$(this).remove();
});
$.ajax({
'url':booked_js_vars.ajax_url,
'method':'post',
'data':{
'action':'booked_cancel_appt',
'nonce':booked_js_vars.nonce,
'appt_id':appt_id
},
success: function(data){
$('.appt-block').animate({'opacity':1},150);
}});
}
return false;
});
$('body').on('touchstart click','.bm-overlay, .bm-window .close, .booked-form .cancel',function(e){
e.preventDefault();
close_booked_modal();
return false;
});
$('body')
.on('focusin', '.booked-form input', function(){
if(this.title==this.value){
$(this).addClass('hasContent');
this.value='';
}}).on('focusout', '.booked-form input', function(){
if(this.value===''){
$(this).removeClass('hasContent');
this.value=this.title;
}});
$('body').on('change','.booked-form input',function(){
var condition=$(this).attr('data-condition'),
thisVal=$(this).val();
if(condition&&$('.condition-block').length){
$('.condition-block.'+condition).hide();
$('#condition-'+thisVal).fadeIn(200);
resize_booked_modal();
}});
$('body').on('submit','form#ajaxlogin', function(e){
e.preventDefault();
$('form#ajaxlogin p.status').show().html('<i class="fa-solid fa-circle-notch fa-spin"></i>&nbsp;&nbsp;&nbsp;' + booked_js_vars.i18n_please_wait);
resize_booked_modal();
var $this=$(this),
date=$this.data('date'),
title=$this.data('title'),
timeslot=$this.data('timeslot'),
calendar_id=$this.data('calendar-id');
$.ajax({
type:'post',
url:booked_js_vars.ajax_url,
data:$('form#ajaxlogin').serialize(),
success:function(data){
if(data=='success'){
close_booked_modal();
var $button=$('<button data-title="' + title + '" data-timeslot="' + timeslot + '" data-date="' + date + '" data-calendar-id="' + calendar_id + '"></button>');
$button.on('click', window.bookedNewAppointment);
$button.triggerHandler('click');
$button.unbind('click', window.bookedNewAppointment);
$button.detach();
}else{
$('form#ajaxlogin p.status').show().html('<i class="fa-solid fa-triangle-exclamation" style="color:#E35656"></i>&nbsp;&nbsp;&nbsp;' + booked_js_vars.i18n_wrong_username_pass);
resize_booked_modal();
}}
});
e.preventDefault();
});
$('body').on('click','.booked-forgot-password',function(e){
e.preventDefault();
$('#ajaxlogin').hide();
$('#ajaxforgot').show();
resize_booked_modal();
});
$('body').on('click','.booked-forgot-goback',function(e){
e.preventDefault();
$('#ajaxlogin').show();
$('#ajaxforgot').hide();
resize_booked_modal();
});
$('body').on('submit','form#ajaxforgot', function(e){
e.preventDefault();
$('form#ajaxforgot p.status').show().html('<i class="fa-solid fa-circle-notch fa-spin"></i>&nbsp;&nbsp;&nbsp;' + booked_js_vars.i18n_please_wait);
resize_booked_modal();
var $this=$(this);
$.ajax({
type:'post',
url:booked_js_vars.ajax_url,
data:$('form#ajaxforgot').serialize(),
success:function(data){
if(data=='success'){
e.preventDefault();
$('#ajaxlogin').show();
$('#ajaxforgot').hide();
$('form#ajaxlogin p.status').show().html('<i class="fa-solid fa-check" style="color:#56c477"></i>&nbsp;&nbsp;&nbsp;' + booked_js_vars.i18n_password_reset);
resize_booked_modal();
}else{
$('form#ajaxforgot p.status').show().html('<i class="fa-solid fa-triangle-exclamation" style="color:#E35656"></i>&nbsp;&nbsp;&nbsp;' + booked_js_vars.i18n_password_reset_error);
resize_booked_modal();
}}
});
e.preventDefault();
});
$('body').on('click','.booked-form input#submit-request-appointment',function(e){
$('form#newAppointmentForm p.status').show().html('<i class="fa-solid fa-circle-notch fa-spin"></i>&nbsp;&nbsp;&nbsp;' + booked_js_vars.i18n_please_wait);
resize_booked_modal();
e.preventDefault();
var customerType=$('#newAppointmentForm input[name=customer_type]').val(),
customerID=$('#newAppointmentForm input[name=user_id]').val(),
name=$('#newAppointmentForm input[name=booked_appt_name]').val(),
surname=$('#newAppointmentForm input[name=booked_appt_surname]').val(),
surnameActive=$('#newAppointmentForm input[name=booked_appt_surname]').length,
guest_name=$('#newAppointmentForm input[name=guest_name]').val(),
guest_surname=$('#newAppointmentForm input[name=guest_surname]').val(),
guest_surnameActive=$('#newAppointmentForm input[name=guest_surname]').length,
guest_email=$('#newAppointmentForm input[name=guest_email]').val(),
guest_emailActive=$('#newAppointmentForm input[name=guest_email]').length,
email=$('#newAppointmentForm input[name=booked_appt_email]').val(),
password=$('#newAppointmentForm input[name=booked_appt_password]').val(),
showRequiredError=false,
ajaxRequests=[];
$(this).parents('.booked-form').find('input,textarea,select').each(function(i,field){
var required=$(this).attr('required');
if(required&&$(field).attr('type')=='hidden'){
var fieldParts=$(field).attr('name');
fieldParts=fieldParts.split('---');
fieldName=fieldParts[0];
fieldNumber=fieldParts[1].split('___');
fieldNumber=fieldNumber[0];
if(fieldName=='radio-buttons-label'){
var radioValue=false;
$('input:radio[name="single-radio-button---'+fieldNumber+'[]"]:checked').each(function(){
if($(this).val()){
radioValue=$(this).val();
}});
if(!radioValue){
showRequiredError=true;
}}else if(fieldName=='checkboxes-label'){
var checkboxValue=false;
$('input:checkbox[name="single-checkbox---'+fieldNumber+'[]"]:checked').each(function(){
if($(this).val()){
checkboxValue=$(this).val();
}});
if(!checkboxValue){
showRequiredError=true;
}}
}else if(required&&$(field).attr('type')!='hidden'&&$(field).val()==''){
showRequiredError=true;
}});
if(showRequiredError){
$('form#newAppointmentForm p.status').show().html('<i class="fa-solid fa-triangle-exclamation" style="color:#E35656"></i>&nbsp;&nbsp;&nbsp;' + booked_js_vars.i18n_fill_out_required_fields);
resize_booked_modal();
return false;
}
if(customerType=='new'&&!name||customerType=='new'&&surnameActive&&!surname||customerType=='new'&&!email||customerType=='new'&&!password){
$('form#newAppointmentForm p.status').show().html('<i class="fa-solid fa-triangle-exclamation" style="color:#E35656"></i>&nbsp;&nbsp;&nbsp;' + booked_js_vars.i18n_appt_required_fields);
resize_booked_modal();
return false;
}
if(customerType=='guest'&&!guest_name||customerType=='guest'&&guest_emailActive&&!guest_email||customerType=='guest'&&guest_surnameActive&&!guest_surname){
$('form#newAppointmentForm p.status').show().html('<i class="fa-solid fa-triangle-exclamation" style="color:#E35656"></i>&nbsp;&nbsp;&nbsp;' + booked_js_vars.i18n_appt_required_fields_guest);
resize_booked_modal();
return false;
}
if(customerType=='current'&&customerID ||
customerType=='guest'&&guest_name&&!guest_surnameActive&&!guest_emailActive ||
customerType=='guest'&&guest_name&&guest_surnameActive&&guest_surname&&!guest_emailActive ||
customerType=='guest'&&guest_name&&guest_emailActive&&guest_email&&!guest_surnameActive ||
customerType=='guest'&&guest_name&&guest_emailActive&&guest_email&&guest_surnameActive&&guest_surname){
SubmitRequestAppointment.currentUserOrGuest();
}
if(customerType=='new'&&name&&email&&password){
if(!surnameActive||surnameActive&&surname){
SubmitRequestAppointment.newUser();
}}
});
var SubmitRequestAppointment={
formSelector: '#newAppointmentForm',
formBtnRequestSelector: '.booked-form input#submit-request-appointment',
formStatusSelector: 'p.status',
formSubmitBtnSelector: '#submit-request-appointment',
apptContainerSelector: '.booked-appointment-details',
baseFields: 	[ 'guest_name','guest_surname','guest_email','action', 'customer_type', 'user_id' ],
apptFields: 	[ 'appoinment', 'calendar_id', 'title', 'date', 'timestamp', 'timeslot' ],
userFields: 	[ 'booked_appt_name','booked_appt_surname','booked_appt_email', 'booked_appt_password' ],
captchaFields: 	[ 'captcha_word', 'captcha_code' ],
currentApptIndex: false,
currentApptCounter: false,
hasAnyErrors: false,
currentUserOrGuest: function(){
var total_appts=SubmitRequestAppointment._totalAppts();
if(! total_appts){
return;
}
SubmitRequestAppointment._showLoadingMessage();
SubmitRequestAppointment._resetDefaultValues();
var data=SubmitRequestAppointment._getBaseData();
SubmitRequestAppointment.currentApptIndex=0;
SubmitRequestAppointment.currentApptCounter=1;
SubmitRequestAppointment._doRequestAppointment(data, total_appts);
},
newUser: function(){
var total_appts=SubmitRequestAppointment._totalAppts();
if(! total_appts){
return;
}
SubmitRequestAppointment._showLoadingMessage();
SubmitRequestAppointment._resetDefaultValues();
var data=SubmitRequestAppointment._getBaseData();
if(total_appts > 1){
var data_obj_with_no_reference=null;
data_obj_with_no_reference=$.extend(true, {}, data);
data_obj_with_no_reference=SubmitRequestAppointment._addUserRegistrationData(data_obj_with_no_reference);
SubmitRequestAppointment._requestUserRegistration(data_obj_with_no_reference);
data.customer_type='current';
}else{
data=SubmitRequestAppointment._addUserRegistrationData(data);
}
SubmitRequestAppointment.currentApptIndex=0;
SubmitRequestAppointment._doRequestAppointment(data, total_appts);
},
_doRequestAppointment: function(data, total_appts){
var appt_fields=SubmitRequestAppointment.apptFields;
if(SubmitRequestAppointment.currentApptIndex===0){
SubmitRequestAppointment._hideCancelBtn();
SubmitRequestAppointment._disableSubmitBtn();
SubmitRequestAppointment.hasAnyErrors=false;
}
var data_obj_with_no_reference=$.extend(true, {}, data);
for (var i=0; i < appt_fields.length; i++){
data_obj_with_no_reference[ appt_fields[i] ]=SubmitRequestAppointment._getFieldVal(appt_fields[i], SubmitRequestAppointment.currentApptIndex);
}
var calendar_id=SubmitRequestAppointment._getFieldVal('calendar_id', SubmitRequestAppointment.currentApptIndex);
data_obj_with_no_reference=SubmitRequestAppointment._addCustomFieldsData(data_obj_with_no_reference, calendar_id);
var $appt=SubmitRequestAppointment._getApptElement(SubmitRequestAppointment.currentApptIndex);
if(! $appt.hasClass('skip')){
$.ajax({
type:'post',
url:booked_js_vars.ajax_url,
data:data_obj_with_no_reference,
success:function(response){
SubmitRequestAppointment._requestAppointmentResponseHandler(response);
SubmitRequestAppointment.currentApptIndex++;
setTimeout(function(){
if(SubmitRequestAppointment.currentApptCounter===total_appts){
if(! SubmitRequestAppointment.hasAnyErrors){
SubmitRequestAppointment._onAfterRequestAppointment();
}else{
SubmitRequestAppointment._enableSubmitBtn();
SubmitRequestAppointment._showCancelBtn();
}}else{
SubmitRequestAppointment.currentApptCounter++;
SubmitRequestAppointment._doRequestAppointment(data, total_appts);
}}, 100);
}});
}else{
SubmitRequestAppointment.currentApptIndex++;
SubmitRequestAppointment.currentApptCounter++;
SubmitRequestAppointment._doRequestAppointment(data, total_appts, SubmitRequestAppointment.currentApptIndex);
}},
_totalAppts: function(){
return $(SubmitRequestAppointment.formSelector + ' input[name="appoinment[]"]').length;
},
_getBaseData: function(){
var data={},
fields=SubmitRequestAppointment.baseFields;
for(var i=0; i < fields.length; i++){
data[ fields[i] ]=SubmitRequestAppointment._getFieldVal(fields[i]);
}
data['nonce']=booked_js_vars.nonce;
data['is_fe_form']=true;
data['total_appts']=SubmitRequestAppointment._totalAppts();
return data;
},
_getFieldVal: function(field_name, field_index){
var field_name=typeof field_name==='undefined' ? '':field_name,
field_index=typeof field_index==='undefined' ? false:field_index,
selector=SubmitRequestAppointment.formSelector + ' ';
if(field_index===false){
selector +=' [name=' + field_name + ']';
return $(selector).val();
}
selector +=' [name="' + field_name + '[]"]';
return $(selector).eq(field_index).val();
},
_resetDefaultValues: function(){
$('.booked-form input').each(function(){
var thisVal=$(this).val(),
thisDefault=$(this).attr('title');
if(thisDefault==thisVal){
$(this).val('');
}});
},
_resetToDefaultValues: function(){
$('.booked-form input').each(function(){
var thisVal=$(this).val(),
thisDefault=$(this).attr('title');
if(! thisVal){
$(this).val(thisDefault);
}});
},
_addUserRegistrationData: function(data){
$.each(SubmitRequestAppointment.userFields, function(index, field_name){
data[ field_name ]=SubmitRequestAppointment._getFieldVal(field_name);
});
$.each(SubmitRequestAppointment.captchaFields, function(index, field_name){
var field_value=SubmitRequestAppointment._getFieldVal(field_name);
if(! field_value){
return;
}
data[ field_name ]=field_value;
});
return data;
},
_addCustomFieldsData: function(data, calendar_id){
var custom_fields_data=$('.cf-block [name]')
.filter(function(index){
var $this=$(this);
return parseInt($this.data('calendar-id'))===parseInt(calendar_id)&&$this.attr('name').match(/---\d+/g);
})
.each(function(index){
var $this=$(this),
name=$this.attr('name'),
value=$this.val(),
type=$this.attr('type');
if(! value){
return;
}
if(! name.match(/checkbox|radio+/g)){
data[ name ]=value;
return;
}
if(name.match(/radio+/g)&&$this.is(':checked')){
data[ name ]=value;
return;
}
if(! name.match(/radio+/g)&&typeof data[ name ]==='undefined'||! name.match(/radio+/g)&&data[ name ].constructor!==Array){
data[ name ]=[];
}
if(! $this.is(':checked')){
return;
}
data[ name ].push(value);
});
return data;
},
_requestUserRegistration: function(base_data, appt_index){
$.ajax({
type:'post',
url:booked_js_vars.ajax_url,
data:base_data,
async:false,
success:function(response){
SubmitRequestAppointment._requestUserRegistrationResponseHandler(response);
}});
},
_requestUserRegistrationResponseHandler: function(response){
var response_parts=response.split('###'),
data_result=response_parts[0].substr(response_parts[0].length - 5);
if(data_result==='error'){
return;
}},
_requestAppointment: function(response){
SubmitRequestAppointment._requestAppointmentResponseHandler(response);
},
_requestAppointmentResponseHandler: function(response){
var response_parts=response.split('###'),
data_result=response_parts[0].substr(response_parts[0].length - 5);
if(data_result==='error'){
SubmitRequestAppointment._requestAppointmentOnError(response_parts);
return;
}
SubmitRequestAppointment._requestAppointmentOnSuccess(response_parts);
},
_requestAppointmentOnError: function(response_parts){
var $apptEl=SubmitRequestAppointment._getApptElement();
$(document).trigger("booked-on-requested-appt-error",[$apptEl]);
SubmitRequestAppointment._highlightAppt();
SubmitRequestAppointment._setStatusMsg(response_parts[1]);
SubmitRequestAppointment.hasAnyErrors=true;
resize_booked_modal();
},
_requestAppointmentOnSuccess: function(response_parts){
var $apptEl=SubmitRequestAppointment._getApptElement();
$(document).trigger("booked-on-requested-appt-success",[$apptEl]);
SubmitRequestAppointment._unhighlightAppt();
},
_onAfterRequestAppointment: function(){
var redirectObj={ redirect:false };
var redirect=$(document).trigger("booked-on-requested-appointment",[redirectObj]);
if(redirectObj.redirect){
return;
}
if(booked_js_vars.profilePage){
window.location=booked_js_vars.profilePage;
return;
}
SubmitRequestAppointment._reloadApptsList();
SubmitRequestAppointment._reloadCalendarTable();
},
_setStatusMsg: function(msg){
var form_status_selector=SubmitRequestAppointment.formSelector + ' ' + SubmitRequestAppointment.formStatusSelector;
$(form_status_selector).show().html('<i class="fa-solid fa-triangle-exclamation" style="color:#E35656"></i>&nbsp;&nbsp;&nbsp;' + msg);
},
_getApptElement: function(appt_index){
var appt_index=typeof appt_index==='undefined' ? SubmitRequestAppointment.currentApptIndex:appt_index,
appt_cnt_selector=SubmitRequestAppointment.formSelector + ' ' + SubmitRequestAppointment.apptContainerSelector;
return $(appt_cnt_selector).eq(appt_index);
},
_highlightAppt: function(msg){
var $apptEl=SubmitRequestAppointment._getApptElement();
if(! $apptEl.length){
return;
}
$apptEl.addClass('has-error');
},
_unhighlightAppt: function(msg){
var $apptEl=SubmitRequestAppointment._getApptElement();
if(! $apptEl.length){
return;
}
$apptEl.removeClass('has-error').addClass('skip');
},
_enableSubmitBtn: function(){
var btn_selector=SubmitRequestAppointment.formSelector + ' ' + SubmitRequestAppointment.formSubmitBtnSelector;
$(btn_selector).attr('disabled', false);
},
_disableSubmitBtn: function(){
var btn_selector=SubmitRequestAppointment.formSelector + ' ' + SubmitRequestAppointment.formSubmitBtnSelector;
$(btn_selector).attr('disabled', true);
},
_showCancelBtn: function(){
$(SubmitRequestAppointment.formSelector).find('button.cancel').show();
},
_hideCancelBtn: function(){
$(SubmitRequestAppointment.formSelector).find('button.cancel').hide();
},
_showLoadingMessage: function(){
$('form#newAppointmentForm p.status').show().html('<i class="fa-solid fa-circle-notch fa-spin"></i>&nbsp;&nbsp;&nbsp;' + booked_js_vars.i18n_please_wait);
},
_reloadApptsList: function(){
if(! $('.booked-appt-list').length){
return;
}
$('.booked-appt-list').each(function(){
var $thisApptList=$(this),
date=$thisApptList.attr('data-list-date'),
thisList=$thisApptList.parents('.booked-list-view'),
defaultDate=thisList.attr('data-default'),
calendar_id=parseInt($thisApptList.find('.booked-list-view-nav').attr('data-calendar-id'))||0;
defaultDate=typeof defaultDate==='undefined' ? false:defaultDate;
calendar_id=calendar_id ? calendar_id:0;
thisList.addClass('booked-loading');
var booked_load_list_view_date_booking_options={
'action':'booked_appointment_list_date',
'nonce':booked_js_vars.nonce,
'date':date,
'calendar_id':calendar_id,
'force_default':defaultDate
};
$(document).trigger("booked-before-loading-appointment-list-booking-options");
thisList.spin('booked_top');
$.ajax({
url: booked_js_vars.ajax_url,
type: 'post',
data: booked_load_list_view_date_booking_options,
success: function(html){
thisList.html(html);
close_booked_modal();
init_appt_list_date_picker();
setTimeout(function(){
thisList.removeClass('booked-loading');
},1);
}});
});
},
_reloadCalendarTable: function(){
if(! $('.bc-col.active').length){
return;
}
var $activeTD=$('.bc-col.active'),
activeDate=$activeTD.attr('data-date'),
calendar_id=parseInt($activeTD.parents('table').data('calendar-id'))||0;
booked_load_calendar_date_booking_options={ 'action':'booked_calendar_date','nonce': booked_js_vars.nonce,'date':activeDate, 'calendar_id':calendar_id };
$(document).trigger("booked-before-loading-calendar-booking-options");
$.ajax({
url: booked_js_vars.ajax_url,
type: 'post',
data: booked_load_calendar_date_booking_options,
success: function(html){
$('.bc-row.entryBlock').find('.bc-col').html(html);
close_booked_modal();
$('.bc-row.entryBlock').removeClass('booked-loading');
$('.bc-row.entryBlock').find('.booked-appt-list').hide().fadeIn(300);
$('.bc-row.entryBlock').find('.booked-appt-list').addClass('shown');
adjust_calendar_boxes();
}});
}}
});
function bookedRemoveEmptyTRs(){
$('div.booked-calendar').find('.bc-row.week').each(function(){
if($(this).children().length==0){
$(this).remove();
}});
}
function savingState(show,limit_to){
show=typeof show!=='undefined' ? show:true;
limit_to=typeof limit_to!=='undefined' ? limit_to:false;
if(limit_to){
var $savingStateDIV=limit_to.find('li.active .savingState, .topSavingState.savingState, .calendarSavingState');
var $stuffToHide=limit_to.find('.monthName');
var $stuffToTransparent=limit_to.find('div.booked-calendar .bc-body');
}else{
var $savingStateDIV=$('li.active .savingState, .topSavingState.savingState, .calendarSavingState');
var $stuffToHide=$('.monthName');
var $stuffToTransparent=$('div.booked-calendar .bc-body');
}
if(show){
$savingStateDIV.fadeIn(200);
$stuffToHide.hide();
$stuffToTransparent.animate({'opacity':0.2},100);
}else{
$savingStateDIV.hide();
$stuffToHide.show();
$stuffToTransparent.animate({'opacity':1},0);
}}
$(document).ajaxStop(function(){
savingState(false);
});
function init_appt_list_date_picker(){
$('.booked_list_date_picker').each(function(){
var thisDatePicker=$(this);
var minDateVal=thisDatePicker.parents('.booked-appt-list').attr('data-min-date');
var maxDateVal=thisDatePicker.parents('.booked-appt-list').attr('data-max-date');
if(typeof minDateVal=='undefined'){ var minDateVal=thisDatePicker.attr('data-min-date'); }
thisDatePicker.datepicker({
dateFormat: 'yy-mm-dd',
minDate: minDateVal,
maxDate: maxDateVal,
showAnim: false,
beforeShow: function(input, inst){
$('#ui-datepicker-div').removeClass();
$('#ui-datepicker-div').addClass('booked_custom_date_picker');
},
onClose: function(dateText){
$('.booked_list_date_picker_trigger').removeClass('booked-dp-active');
},
onSelect: function(dateText){
var thisInput=$(this),
date=dateText,
thisList=thisInput.parents('.booked-list-view'),
defaultDate=thisList.attr('data-default'),
calendar_id=thisInput.parents('.booked-list-view-nav').attr('data-calendar-id');
if(typeof defaultDate=='undefined'){ defaultDate=false; }
if(!calendar_id){ calendar_id=0; }
thisList.addClass('booked-loading');
var booked_load_list_view_date_booking_options={
'action':'booked_appointment_list_date',
'nonce':booked_js_vars.nonce,
'date':date,
'calendar_id':calendar_id,
'force_default':defaultDate
};
$(document).trigger("booked-before-loading-appointment-list-booking-options");
thisList.spin('booked_top');
$.ajax({
url: booked_js_vars.ajax_url,
type: 'post',
data: booked_load_list_view_date_booking_options,
success: function(html){
thisList.html(html);
init_appt_list_date_picker();
setTimeout(function(){
thisList.removeClass('booked-loading');
},1);
}});
return false;
}});
});
$('body').on('click','.booked_list_date_picker_trigger',function(e){
e.preventDefault();
if(!$(this).hasClass('booked-dp-active')){
$(this).addClass('booked-dp-active');
$(this).parents('.booked-appt-list').find('.booked_list_date_picker').datepicker('show');
}});
}
var BookedTabs={
bookingModalSelector: '.booked-modal',
tabSelector: '.booked-tabs',
tabNavSelector: '.booked-tabs-nav span',
tabCntSelector: '.booked-tabs-cnt',
Init: function(){
$(document).on('click', this.tabNavSelector, this.tabsNav);
},
tabsNav: function(event){
event.preventDefault();
BookedTabs.switchToTab($(this));
BookedTabs.maybeResizeBookingModal();
},
switchToTab: function(tab_nav_item){
var $nav_item=tab_nav_item,
tab_cnt_class='.' + $nav_item.data('tab-cnt'),
$tabs_container=$nav_item.parents(BookedTabs.tabSelector);
$nav_item
.addClass('active')
.siblings()
.removeClass('active')
$tabs_container
.find(BookedTabs.tabCntSelector + ' ' + tab_cnt_class)
.addClass('active')
.siblings()
.removeClass('active');
},
maybeResizeBookingModal: function(){
if(! $(BookedTabs.bookingModalSelector).length){
return;
}
resize_booked_modal();
}}
})(jQuery, window, document);
function create_booked_modal(){
var windowHeight=jQuery(window).height();
var windowWidth=jQuery(window).width();
if(windowWidth > 720){
var maxModalHeight=windowHeight - 295;
}else{
var maxModalHeight=windowHeight;
}
jQuery('body input, body textarea, body select').blur();
jQuery('body').addClass('booked-noScroll');
jQuery('<div class="booked-modal bm-loading"><div class="bm-overlay"></div><div class="bm-window"><div style="height:100px"></div></div></div>').appendTo('body');
jQuery('.booked-modal .bm-overlay').spin('booked_white');
jQuery('.booked-modal .bm-window').css({'max-height':maxModalHeight+'px'});
}
var previousRealModalHeight=100;
function resize_booked_modal(){
var windowHeight=jQuery(window).height();
var windowWidth=jQuery(window).width();
var common43=43;
if(jQuery('.booked-modal .bm-window .booked-scrollable').length){
var realModalHeight=jQuery('.booked-modal .bm-window .booked-scrollable')[0].scrollHeight;
if(realModalHeight < 100){
realModalHeight=previousRealModalHeight;
}else{
previousRealModalHeight=realModalHeight;
}}else{
var realModalHeight=0;
}
var minimumWindowHeight=realModalHeight + common43 + common43;
var modalScrollableHeight=realModalHeight - common43;
var maxModalHeight;
var maxFormHeight;
if(windowHeight < minimumWindowHeight){
modalScrollableHeight=windowHeight - common43 - common43;
}else{
modalScrollableHeight=realModalHeight;
}
if(windowWidth > 720){
maxModalHeight=modalScrollableHeight - 25;
maxFormHeight=maxModalHeight - 15;
var modalNegMargin=(maxModalHeight + 78) / 2;
}else{
maxModalHeight=windowHeight - common43;
maxFormHeight=maxModalHeight - 60;
var modalNegMargin=(maxModalHeight) / 2;
}
jQuery('.booked-modal').css({'margin-top':'-'+modalNegMargin+'px'});
jQuery('.booked-modal .bm-window').css({'max-height':maxModalHeight+'px'});
jQuery('.booked-modal .bm-window .booked-scrollable').css({'max-height':maxFormHeight+'px'});
}
function close_booked_modal(){
var modal=jQuery('.booked-modal');
modal.fadeOut(200);
modal.addClass('bm-closing');
jQuery('body').removeClass('booked-noScroll');
setTimeout(function(){
modal.remove();
},300);
}
function init_tooltips(container){
jQuery('.tooltipster').tooltipster({
theme: 		'tooltipster-light',
animation:	'grow',
speed:		200,
delay: 		50,
offsetY:	-15
});
}
function adjust_calendar_boxes(){
jQuery('div.booked-calendar').each(function(){
var windowWidth=jQuery(window).width();
var smallCalendar=jQuery(this).parents('.booked-calendar-wrap').hasClass('small');
var boxesWidth=jQuery(this).find('.bc-body .bc-row.week .bc-col').width();
var calendarHeight=jQuery(this).height();
boxesHeight=boxesWidth * 1;
jQuery(this).find('.bc-body .bc-row.week .bc-col').height(boxesHeight);
jQuery(this).find('.bc-body .bc-row.week .bc-col .date').css('line-height',boxesHeight+'px');
jQuery(this).find('.bc-body .bc-row.week .bc-col .date .number').css('line-height',boxesHeight+'px');
if(smallCalendar||windowWidth < 720){
jQuery(this).find('.bc-body .bc-row.week .bc-col .date .number').css('line-height',boxesHeight+'px');
}else{
jQuery(this).find('.bc-body .bc-row.week .bc-col .date .number').css('line-height','');
}
var calendarHeight=jQuery(this).height();
jQuery(this).parent().height(calendarHeight);
});
};
var wpAjaxUrl='https://casanati.com/wp-admin/admin-ajax.php';var flBuilderUrl='https://casanati.com/wp-content/plugins/beaver-builder-lite-version/';var FLBuilderLayoutConfig={anchorLinkAnimations:{duration:1000,easing:'swing',offset:100},paths:{pluginUrl:'https://casanati.com/wp-content/plugins/beaver-builder-lite-version/',wpAjaxUrl:'https://casanati.com/wp-admin/admin-ajax.php'},breakpoints:{small:768,medium:992,large:1200},waypoint:{offset:80},emptyColWidth:'0%'};(function($){if(typeof FLBuilderLayout!='undefined'){return;}
FLBuilderLayout={init:function(){FLBuilderLayout._destroy();FLBuilderLayout._initClasses();FLBuilderLayout._initBackgrounds();FLBuilderLayout._initButtons();FLBuilderLayout._initRowShapeLayerHeight();if(0===$('.fl-builder-edit').length){FLBuilderLayout._initAnchorLinks();FLBuilderLayout._initHash();FLBuilderLayout._initForms();FLBuilderLayout._reorderMenu();}else{FLBuilderLayout._initNestedColsWidth();}
$('body').removeClass('fl-no-js');},refreshGalleries:function(element){var $element='undefined'==typeof element?$('body'):$(element),mfContent=$element.find('.fl-mosaicflow-content'),wmContent=$element.find('.fl-gallery'),mfObject=null;if(mfContent){mfObject=mfContent.data('mosaicflow');if(mfObject){mfObject.columns=$([]);mfObject.columnsHeights=[];mfContent.data('mosaicflow',mfObject);mfContent.mosaicflow('refill');}}
if(wmContent){wmContent.trigger('refreshWookmark');}},refreshGridLayout:function(element){var $element='undefined'==typeof element?$('body'):$(element),msnryContent=$element.find('.masonry');if(msnryContent.length){msnryContent.masonry('layout');}},reloadSlider:function(content){var $content='undefined'==typeof content?$('body'):$(content);if($content.find('.bx-viewport > div').length>0){$.each($content.find('.bx-viewport > div'),function(key,slider){setTimeout(function(){$(slider).data('bxSlider').reloadSlider();},100);});}},resizeAudio:function(element){var $element='undefined'==typeof element?$('body'):$(element),audioPlayers=$element.find('.wp-audio-shortcode.mejs-audio'),player=null,mejsPlayer=null,rail=null,railWidth=400;if(audioPlayers.length&&typeof mejs!=='undefined'){audioPlayers.each(function(){player=$(this);mejsPlayer=mejs.players[player.attr('id')];rail=player.find('.mejs-controls .mejs-time-rail');var innerMejs=player.find('.mejs-inner'),total=player.find('.mejs-controls .mejs-time-total');if(typeof mejsPlayer!=='undefined'){railWidth=Math.ceil(player.width()*0.8);if(innerMejs.length){rail.css('width',railWidth+'px!important');mejsPlayer.options.autosizeProgress=true;setTimeout(function(){mejsPlayer.setControlsSize();},50);player.find('.mejs-inner').css({visibility:'visible',height:'inherit'});}}});}},preloadAudio:function(element){var $element='undefined'==typeof element?$('body'):$(element),contentWrap=$element.closest('.fl-accordion-item'),audioPlayers=$element.find('.wp-audio-shortcode.mejs-audio');if(!contentWrap.hasClass('fl-accordion-item-active')&&audioPlayers.find('.mejs-inner').length){audioPlayers.find('.mejs-inner').css({visibility:'hidden',height:0});}},resizeSlideshow:function(){if(typeof YUI!=='undefined'){YUI().use('node-event-simulate',function(Y){Y.one(window).simulate("resize");});}},reloadGoogleMap:function(element){var $element='undefined'==typeof element?$('body'):$(element),googleMap=$element.find('iframe[src*="google.com/maps"]');if(googleMap.length){googleMap.attr('src',function(i,val){return val;});}},_destroy:function(){var win=$(window);win.off('scroll.fl-bg-parallax');win.off('resize.fl-bg-video');},_isTouch:function(){if(('ontouchstart'in window)||(window.DocumentTouch&&document instanceof DocumentTouch)){return true;}
return false;},_isMobile:function(){return/Mobile|Android|Silk\/|Kindle|BlackBerry|Opera Mini|Opera Mobi|webOS/i.test(navigator.userAgent);},_initClasses:function(){var body=$('body'),ua=navigator.userAgent;if(!body.hasClass('fl-builder-blocks-only')&&!body.hasClass('archive')&&$('.fl-builder-content-primary').length>0){body.addClass('fl-builder');}
if(FLBuilderLayout._isTouch()){body.addClass('fl-builder-touch');}
if(FLBuilderLayout._isMobile()){body.addClass('fl-builder-mobile');}
if($(window).width()<FLBuilderLayoutConfig.breakpoints.small){body.addClass('fl-builder-breakpoint-small');}
if($(window).width()>FLBuilderLayoutConfig.breakpoints.small&&$(window).width()<FLBuilderLayoutConfig.breakpoints.medium){body.addClass('fl-builder-breakpoint-medium');}
if($(window).width()>FLBuilderLayoutConfig.breakpoints.medium&&$(window).width()<FLBuilderLayoutConfig.breakpoints.large){body.addClass('fl-builder-breakpoint-large');}
if($(window).width()>FLBuilderLayoutConfig.breakpoints.large){body.addClass('fl-builder-breakpoint-default');}
if(ua.indexOf('Trident/7.0')>-1&&ua.indexOf('rv:11.0')>-1){body.addClass('fl-builder-ie-11');}},_initBackgrounds:function(){var win=$(window);if($('.fl-row-bg-parallax').length>0&&!FLBuilderLayout._isMobile()){FLBuilderLayout._scrollParallaxBackgrounds();FLBuilderLayout._initParallaxBackgrounds();win.on('resize.fl-bg-parallax',FLBuilderLayout._initParallaxBackgrounds);win.on('scroll.fl-bg-parallax',FLBuilderLayout._scrollParallaxBackgrounds);}
if($('.fl-bg-video').length>0){FLBuilderLayout._initBgVideos();FLBuilderLayout._resizeBgVideos();var resizeBGTimer=null;win.on('resize.fl-bg-video',function(e){clearTimeout(resizeBGTimer);resizeBGTimer=setTimeout(function(){FLBuilderLayout._resizeBgVideos(e);},100);});}},_initButtons:function(){$('a.fl-button[role="button"]').on('keydown',function(event){if(event.key==='Enter'||event.key===' '){event.preventDefault();$(this).trigger('click');}});},_initParallaxBackgrounds:function(){$('.fl-row-bg-parallax').each(FLBuilderLayout._initParallaxBackground);},_initParallaxBackground:function(){var row=$(this),content=row.find('> .fl-row-content-wrap'),winWidth=$(window).width(),screenSize='',imageSrc={default:'',medium:'',responsive:'',};imageSrc.default=row.data('parallax-image')||'';imageSrc.medium=row.data('parallax-image-medium')||imageSrc.default;imageSrc.responsive=row.data('parallax-image-responsive')||imageSrc.medium;if(winWidth>FLBuilderLayoutConfig.breakpoints.medium){screenSize='default';}else if(winWidth>FLBuilderLayoutConfig.breakpoints.small&&winWidth<=FLBuilderLayoutConfig.breakpoints.medium){screenSize='medium';}else if(winWidth<=FLBuilderLayoutConfig.breakpoints.small){screenSize='responsive';}
content.css('background-image','url('+imageSrc[screenSize]+')');row.data('current-image-loaded',screenSize);},_scrollParallaxBackgrounds:function(){$('.fl-row-bg-parallax').each(FLBuilderLayout._scrollParallaxBackground);},_scrollParallaxBackground:function(){var win=$(window),row=$(this),content=row.find('> .fl-row-content-wrap'),speed=row.data('parallax-speed'),offset=content.offset(),yPos=-((win.scrollTop()-offset.top)/ speed),initialOffset=(row.data('parallax-offset')!=null)?row.data('parallax-offset'):0,totalOffset=yPos-initialOffset;content.css('background-position','center '+totalOffset+'px');},_initBgVideos:function(){$('.fl-bg-video').each(FLBuilderLayout._initBgVideo);},_initBgVideo:function(){var wrap=$(this),width=wrap.data('width'),height=wrap.data('height'),mp4=wrap.data('mp4'),youtube=wrap.data('youtube'),vimeo=wrap.data('vimeo'),mp4Type=wrap.data('mp4-type'),webm=wrap.data('webm'),webmType=wrap.data('webm-type'),fallback=wrap.data('fallback'),loaded=wrap.data('loaded'),videoMobile=wrap.data('video-mobile'),playPauseButton=wrap.find('.fl-bg-video-play-pause-control'),fallbackTag='',videoTag=null,mp4Tag=null,webmTag=null;if(loaded){return;}
videoTag=$('<video autoplay loop muted playsinline></video>');if('undefined'!=typeof fallback&&''!=fallback){videoTag.attr('poster','data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7')
videoTag.css({backgroundImage:'url("'+fallback+'")',backgroundColor:'transparent',backgroundRepeat:'no-repeat',backgroundSize:'cover',backgroundPosition:'center center',})}
if('undefined'!=typeof mp4&&''!=mp4){mp4Tag=$('<source />');mp4Tag.attr('src',mp4);mp4Tag.attr('type',mp4Type);videoTag.append(mp4Tag);}
if('undefined'!=typeof webm&&''!=webm){webmTag=$('<source />');webmTag.attr('src',webm);webmTag.attr('type',webmType);videoTag.append(webmTag);}
if(!FLBuilderLayout._isMobile()||(FLBuilderLayout._isMobile()&&"yes"==videoMobile)){if('undefined'!=typeof youtube){FLBuilderLayout._initYoutubeBgVideo.apply(this);}
else if('undefined'!=typeof vimeo){FLBuilderLayout._initVimeoBgVideo.apply(this);}else{wrap.append(videoTag);if(playPauseButton.length>0){var video=videoTag[0];playPauseButton.on('click',{video:video},function(e){var video=e.data.video;if(video.paused){video.play();}else{video.pause();}});$(video).on('play playing',function(){playPauseButton.removeClass('fa-play').addClass('fa-pause');});$(video).on('pause ended waiting',function(){playPauseButton.removeClass('fa-pause').addClass('fa-play');});}}}else{videoTag.attr('src','')
wrap.append(videoTag);}
wrap.data('loaded',true);},_initYoutubeBgVideo:function(){var playerWrap=$(this),videoId=playerWrap.data('video-id'),videoPlayer=playerWrap.find('.fl-bg-video-player'),enableAudio=playerWrap.data('enable-audio'),audioButton=playerWrap.find('.fl-bg-video-audio'),playPauseButton=playerWrap.find('.fl-bg-video-play-pause-control'),startTime='undefined'!==typeof playerWrap.data('start')?playerWrap.data('start'):0,startTime='undefined'!==typeof playerWrap.data('t')&&startTime===0?playerWrap.data('t'):startTime,endTime='undefined'!==typeof playerWrap.data('end')?playerWrap.data('end'):0,loop='undefined'!==typeof playerWrap.data('loop')?playerWrap.data('loop'):1,stateCount=0,player,fallback_showing;if(videoId){fallback=playerWrap.data('fallback')||false
if(fallback){playerWrap.find('iframe').remove()
fallbackTag=$('<div></div>');fallbackTag.addClass('fl-bg-video-fallback');fallbackTag.css('background-image','url('+playerWrap.data('fallback')+')');fallbackTag.css('background-size','cover');fallbackTag.css('transition','background-image 1s')
playerWrap.append(fallbackTag);fallback_showing=true;}
FLBuilderLayout._onYoutubeApiReady(function(YT){setTimeout(function(){player=new YT.Player(videoPlayer[0],{videoId:videoId,events:{onReady:function(event){if("no"===enableAudio||FLBuilderLayout._isMobile()){event.target.mute();}
else if("yes"===enableAudio&&event.target.isMuted){event.target.unMute();}
playerWrap.data('YTPlayer',player);FLBuilderLayout._resizeYoutubeBgVideo.apply(playerWrap);event.target.playVideo();if(audioButton.length>0&&!FLBuilderLayout._isMobile()){audioButton.on('click',{button:audioButton,player:player},FLBuilderLayout._toggleBgVideoAudio);}
if(playPauseButton.length>0){playPauseButton.on('click',{player:player},function(e){var player=e.data.player;if(1===player.getPlayerState()){player.pauseVideo();}else{player.playVideo();}});}},onStateChange:function(event){if(event.data===1){if(fallback_showing){$('.fl-bg-video-fallback').css('background-image','url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)')}}
if(stateCount<4){stateCount++;}
if(stateCount>1&&-1===event.data&&"yes"===enableAudio){player.mute();player.playVideo();audioButton.show();}
if(event.data===YT.PlayerState.ENDED&&1===loop){if(startTime>0){player.seekTo(startTime);}else{player.playVideo();}}
if(event.data===YT.PlayerState.PLAYING){playPauseButton.removeClass('fa-play').addClass('fa-pause');}else if(event.data===YT.PlayerState.PAUSED){playPauseButton.removeClass('fa-pause').addClass('fa-play');}else if(event.data===YT.PlayerState.BUFFERING){playPauseButton.removeClass('fa-play').addClass('fa-pause');}else if(event.data===YT.PlayerState.CUED){playPauseButton.removeClass('fa-pause').addClass('fa-play');}else if(event.data===YT.PlayerState.ENDED){playPauseButton.removeClass('fa-pause').addClass('fa-play');}},onError:function(event){console.info('YT Error: '+event.data)
FLBuilderLayout._onErrorYoutubeVimeo(playerWrap)}},playerVars:{playsinline:FLBuilderLayout._isMobile()?1:0,controls:0,showinfo:0,rel:0,start:startTime,end:endTime,}});},1);});}},_onErrorYoutubeVimeo:function(playerWrap){fallback=playerWrap.data('fallback')||false
if(!fallback){return false;}
playerWrap.find('iframe').remove()
fallbackTag=$('<div></div>');fallbackTag.addClass('fl-bg-video-fallback');fallbackTag.css('background-image','url('+playerWrap.data('fallback')+')');playerWrap.append(fallbackTag);},_onYoutubeApiReady:function(callback){if(window.YT&&YT.loaded){callback(YT);}else{setTimeout(function(){FLBuilderLayout._onYoutubeApiReady(callback);},350);}},_initVimeoBgVideo:function(){var playerWrap=$(this),videoId=playerWrap.data('video-id'),videoHash=playerWrap.data('video-hash'),videoPlayer=playerWrap.find('.fl-bg-video-player'),enableAudio=playerWrap.data('enable-audio'),audioButton=playerWrap.find('.fl-bg-video-audio'),playPauseButton=playerWrap.find('.fl-bg-video-play-pause-control'),playerState='',player,width=playerWrap.outerWidth(),ua=navigator.userAgent;if(typeof Vimeo!=='undefined'&&videoId){const vimOptions={loop:true,title:false,portrait:false,background:true,autopause:false,muted:true,};if(videoHash.length){vimOptions.url=`https://player.vimeo.com/video/${ videoId }?h=${ videoHash }`;}else{vimOptions.id=videoId;}
player=new Vimeo.Player(videoPlayer[0],vimOptions);playerWrap.data('VMPlayer',player);if("no"===enableAudio){player.setVolume(0);}
else if("yes"===enableAudio){if(ua.indexOf("Safari")>-1||ua.indexOf("Chrome")>-1||ua.indexOf("Firefox")>-1){player.setVolume(0);audioButton.show();}else{player.setVolume(1);}}
player.play().catch(function(error){FLBuilderLayout._onErrorYoutubeVimeo(playerWrap)});if(audioButton.length>0){audioButton.on('click',{button:audioButton,player:player},FLBuilderLayout._toggleBgVideoAudio);}
player.on('play',function(){playerState='play';playPauseButton.removeClass('fa-play').addClass('fa-pause');});player.on('pause',function(){playerState='pause';playPauseButton.removeClass('fa-pause').addClass('fa-play');});player.on('ended',function(){playerState='ended';playPauseButton.removeClass('fa-pause').addClass('fa-play');});player.on('bufferstart',function(){playerState='bufferstart';playPauseButton.removeClass('fa-play').addClass('fa-pause');});if(playPauseButton.length>0){playPauseButton.on('click',{player:player},function(e){var player=e.data.player;if(playerState==='play'){player.pause();}else{player.play();}});}}},_toggleBgVideoAudio:function(e){var player=e.data.player,control=e.data.button.find('.fl-audio-control');if(control.hasClass('fa-volume-off')){control.removeClass('fa-volume-off').addClass('fa-volume-up');e.data.button.find('.fa-times').hide();if('function'===typeof player.unMute){player.unMute();}else{player.setVolume(1);}}else{control.removeClass('fa-volume-up').addClass('fa-volume-off');e.data.button.find('.fa-times').show();if('function'===typeof player.unMute){player.mute();}else{player.setVolume(0);}}},_videoBgSourceError:function(e){var source=$(e.target),wrap=source.closest('.fl-bg-video'),vid=wrap.find('video'),fallback=wrap.data('fallback'),fallbackTag='';source.remove();if(vid.find('source').length){return;}else if(''!==fallback){fallbackTag=$('<div></div>');fallbackTag.addClass('fl-bg-video-fallback');fallbackTag.css('background-image','url('+fallback+')');wrap.append(fallbackTag);vid.remove();}},_resizeBgVideos:function(){$('.fl-bg-video').each(function(){FLBuilderLayout._resizeBgVideo.apply(this);if($(this).parent().find('img').length>0){$(this).parent().imagesLoaded($.proxy(FLBuilderLayout._resizeBgVideo,this));}});},_resizeBgVideo:function(){if(0===$(this).find('video').length&&0===$(this).find('iframe').length){return;}
var wrap=$(this),wrapHeight=wrap.outerHeight(),wrapWidth=wrap.outerWidth(),vid=wrap.find('video'),vidHeight=wrap.data('height'),vidWidth=wrap.data('width'),newWidth=wrapWidth,newHeight=Math.round(vidHeight*wrapWidth/vidWidth),newLeft=0,newTop=0,iframe=wrap.find('iframe'),isRowFullHeight=$(this).closest('.fl-row-bg-video').hasClass('fl-row-full-height'),vidCSS={top:'50%',left:'50%',transform:'translate(-50%,-50%)',};if(vid.length){if(vidHeight===''||typeof vidHeight==='undefined'||vidWidth===''||typeof vidWidth==='undefined'){vid.css({'left':'0px','top':'0px','width':newWidth+'px'});vid.on('loadedmetadata',FLBuilderLayout._resizeOnLoadedMeta);return;}
if(!isRowFullHeight){if(newHeight<wrapHeight){newHeight=wrapHeight;newLeft=-((newWidth-wrapWidth)/ 2);newWidth=vidHeight?Math.round(vidWidth*wrapHeight/vidHeight):newWidth;}else{newTop=-((newHeight-wrapHeight)/2);}
vidCSS={left:newLeft+'px',top:newTop+'px',height:newHeight+'px',width:newWidth+'px',}}
vid.css(vidCSS);}
else if(iframe.length){if(typeof wrap.data('youtube')!=='undefined'){FLBuilderLayout._resizeYoutubeBgVideo.apply(this);}}},_resizeOnLoadedMeta:function(){var video=$(this),wrapHeight=video.parent().outerHeight(),wrapWidth=video.parent().outerWidth(),vidWidth=video[0].videoWidth,vidHeight=video[0].videoHeight,newHeight=Math.round(vidHeight*wrapWidth/vidWidth),newWidth=wrapWidth,newLeft=0,newTop=0;if(newHeight<wrapHeight){newHeight=wrapHeight;newWidth=Math.round(vidWidth*wrapHeight/vidHeight);newLeft=-((newWidth-wrapWidth)/2);}else{newTop=-((newHeight-wrapHeight)/2);}
video.parent().data('width',vidWidth);video.parent().data('height',vidHeight);video.css({'left':newLeft+'px','top':newTop+'px','width':newWidth+'px','height':newHeight+'px'});},_resizeYoutubeBgVideo:function(){var wrap=$(this),wrapWidth=wrap.outerWidth(),wrapHeight=wrap.outerHeight(),player=wrap.data('YTPlayer'),video=player?player.getIframe():null,aspectRatioSetting='16:9',aspectRatioArray=aspectRatioSetting.split(':'),aspectRatio=aspectRatioArray[0]/ aspectRatioArray[1],ratioWidth=wrapWidth / aspectRatio,ratioHeight=wrapHeight*aspectRatio,isWidthFixed=wrapWidth / wrapHeight>aspectRatio,width=isWidthFixed?wrapWidth:ratioHeight,height=isWidthFixed?ratioWidth:wrapHeight;if(video){$(video).width(width).height(height);}},_initHash:function(){var hash=window.location.hash.replace('#','').split('/').shift(),element=null,tabs=null,responsiveLabel=null,tabIndex=null,label=null;if(''!==hash){try{element=$('#'+hash);if(element.length>0){if(element.hasClass('fl-accordion-item')){setTimeout(function(){element.find('.fl-accordion-button').trigger('click');},100);}
if(element.hasClass('fl-tabs-panel')){setTimeout(function(){tabs=element.closest('.fl-tabs');responsiveLabel=element.find('.fl-tabs-panel-label');tabIndex=responsiveLabel.data('index');label=tabs.find('.fl-tabs-labels .fl-tabs-label[data-index='+tabIndex+']');label[0].click();FLBuilderLayout._scrollToElement(element);},100);}}}
catch(e){}}},_initAnchorLinks:function(){$('a, [role="link"]').each(FLBuilderLayout._initAnchorLink);},_initAnchorLink:function(){var link=$(this),href=link.data('url')?link.data('url'):link.attr('href'),target=link.data('url')?new URL(href,window.location.href):this,loc=window.location,id=null,element=null,flNode=false;if('undefined'!=typeof href&&href.indexOf('#')>-1&&link.closest('svg').length<1){if(loc.pathname.replace(/^\//,'')==target.pathname.replace(/^\//,'')&&loc.hostname==target.hostname){try{id=href.split('#').pop();if(!id){return;}
element=$('#'+id);if(element.length>0){flNode=element.hasClass('fl-row')||element.hasClass('fl-col')||element.hasClass('fl-module');if(!element.hasClass('fl-no-scroll')&&(link.hasClass('fl-scroll-link')||flNode)){$(link).on('click',FLBuilderLayout._scrollToElementOnLinkClick);}
if(element.hasClass('fl-accordion-item')){$(link).on('click',FLBuilderLayout._scrollToAccordionOnLinkClick);}
if(element.hasClass('fl-tabs-panel')){$(link).on('click',FLBuilderLayout._scrollToTabOnLinkClick);}}}
catch(e){}}}},_scrollToElementOnLinkClick:function(e,callback){var attribute=$(this).data('url')?$(this).data('url'):$(this).attr('href');var element=$('#'+attribute.split('#').pop());FLBuilderLayout._scrollToElement(element,callback);e.preventDefault();},_scrollToElement:function(element,callback){var config=FLBuilderLayoutConfig.anchorLinkAnimations,dest=0,win=$(window),doc=$(document);if(element.length>0){if('fixed'===element.css('position')||'fixed'===element.parent().css('position')){dest=element.position().top;}
else if(element.offset().top>doc.height()-win.height()){dest=doc.height()-win.height();}else{dest=element.offset().top-config.offset;}
$('html, body').stop(true).animate({scrollTop:dest},config.duration,config.easing,function(){if('undefined'!=typeof callback){callback();}
if(undefined!=element.attr('id')&&window.location.hash!=='#'+element.attr('id')){var firefox_version=window.navigator.userAgent.match(/Firefox\/(\d+)\./),firefox_version=firefox_version?parseInt(firefox_version[1],10):null;if(firefox_version!==null&&firefox_version<135){window.location.hash=element.attr('id');}else{if(history.pushState){history.pushState(null,null,'#'+element.attr('id'));}else{window.location.hash=element.attr('id');}}}});}},_scrollToAccordionOnLinkClick:function(e){var element=$('#'+$(this).attr('href').split('#').pop());if(element.length>0){var callback=function(){if(element){element.find('.fl-accordion-button').trigger('click');element=false;}};FLBuilderLayout._scrollToElementOnLinkClick.call(this,e,callback);}},_scrollToTabOnLinkClick:function(e){var element=$('#'+$(this).attr('href').split('#').pop()),tabs=null,label=null,responsiveLabel=null;if(element.length>0){tabs=element.closest('.fl-tabs');responsiveLabel=element.find('.fl-tabs-panel-label');tabIndex=responsiveLabel.data('index');label=tabs.find('.fl-tabs-labels .fl-tabs-label[data-index='+tabIndex+']');if(responsiveLabel.is(':visible')){var callback=function(){if(element){responsiveLabel.trigger($.Event('click',{which:1}));}};FLBuilderLayout._scrollToElementOnLinkClick.call(this,e,callback);}else{label[0].click();FLBuilderLayout._scrollToElement(element);}
e.preventDefault();}},_initForms:function(){if(!FLBuilderLayout._hasPlaceholderSupport){$('.fl-form-field input').each(FLBuilderLayout._initFormFieldPlaceholderFallback);}
$('.fl-form-field input').on('focus',FLBuilderLayout._clearFormFieldError);},_hasPlaceholderSupport:function(){var input=document.createElement('input');return'undefined'!=input.placeholder;},_initFormFieldPlaceholderFallback:function(){var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if('undefined'!=placeholder&&''===val){field.val(placeholder);field.on('focus',FLBuilderLayout._hideFormFieldPlaceholderFallback);field.on('blur',FLBuilderLayout._showFormFieldPlaceholderFallback);}},_hideFormFieldPlaceholderFallback:function(){var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if(val==placeholder){field.val('');}},_showFormFieldPlaceholderFallback:function(){var field=$(this),val=field.val(),placeholder=field.attr('placeholder');if(''===val){field.val(placeholder);}},_clearFormFieldError:function(){var field=$(this);field.removeAttr('aria-invalid');field.removeClass('fl-form-error');const message=field.attr('aria-describedby');message?$('#'+message).hide():field.siblings('.fl-form-error-message').hide();},_initRowShapeLayerHeight:function(){FLBuilderLayout._adjustRowShapeLayerHeight();$(window).on('resize',FLBuilderLayout._adjustRowShapeLayerHeight);},_initNestedColsWidth:function(){var nestedCols=$('.fl-col-has-cols');if(nestedCols.length<=0){return;}
$(nestedCols).each(function(index,col){if($(col).width()<=0){$(col).css('width',FLBuilderLayoutConfig.emptyColWidth);}});},_adjustRowShapeLayerHeight:function(){var rowShapeLayers=$('.fl-builder-shape-layer');$(rowShapeLayers).each(function(index){var rowShapeLayer=$(this),shape=$(rowShapeLayer).find('svg'),height=shape.height(),excludeShapes='.fl-builder-shape-circle, .fl-builder-shape-dot-cluster, .fl-builder-shape-topography, .fl-builder-shape-rect';if(!rowShapeLayer.is(excludeShapes)){$(shape).css('height',Math.ceil(height));}});},_string_to_slug:function(str){str=str.replace(/^\s+|\s+$/g,'');if('undefined'==typeof window._fl_string_to_slug_regex){regex=new RegExp('[^a-zA-Z0-9\'":() !.,-_|]','g');}else{regex=new RegExp('[^'+window._fl_string_to_slug_regex+'\'":\(\) !.,-_|\\\p{Letter}]','ug');}
str=str.replace(regex,'').replace(/\s+/g,' ');return str;},_reorderMenu:function(){if($('#wp-admin-bar-fl-builder-frontend-edit-link-default li').length>1){$('#wp-admin-bar-fl-builder-frontend-duplicate-link').appendTo('#wp-admin-bar-fl-builder-frontend-edit-link-default').css('padding-top','5px').css('border-top','2px solid #1D2125').css('margin-top','5px')}}};$(function(){FLBuilderLayout.init();});})(jQuery);(function($){if(typeof FLBuilderLayoutModules!=='undefined'){return;}
FLBuilderLayoutModules={init:function(){if(0===$('.fl-builder-edit').length){FLBuilderLayoutModules._initModuleAnimations();}},_initModuleAnimations:function(){if(typeof jQuery.fn.waypoint!=='undefined'){$('.fl-animation').each(function(){var node=$(this),nodeTop=node.offset().top,winHeight=$(window).height(),bodyHeight=$('body').height(),waypoint=FLBuilderLayoutConfig.waypoint,offset='80%';if(typeof waypoint.offset!==undefined){offset=FLBuilderLayoutConfig.waypoint.offset+'%';}
if(bodyHeight-nodeTop<winHeight*0.2){offset='100%';}
node.waypoint({offset:offset,handler:FLBuilderLayoutModules._doModuleAnimation});});}},_doModuleAnimation:function(){var module='undefined'==typeof this.element?$(this):$(this.element),delay=parseFloat(module.data('animation-delay')),duration=parseFloat(module.data('animation-duration'));if(!isNaN(duration)){module.css('animation-duration',duration+'s');}
if(!isNaN(delay)&&delay>0){setTimeout(function(){module.addClass('fl-animated');},delay*1000);}else{setTimeout(function(){module.addClass('fl-animated');},1);}}};$(function(){FLBuilderLayoutModules.init();});})(jQuery);
(()=>{var t={507:(t,e,r)=>{"use strict";r.d(e,{A:()=>A});var n=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var i=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var o=function(t,e){return function(r,o,s,c=10){const l=t[e];if(!i(r))return;if(!n(o))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof c)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:c,namespace:o};if(l[r]){const t=l[r].handlers;let e;for(e=t.length;e>0&&!(c>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),l.__current.forEach((t=>{t.name===r&&t.currentIndex>=e&&t.currentIndex++}))}else l[r]={handlers:[a],runs:0};"hookAdded"!==r&&t.doAction("hookAdded",r,o,s,c)}};var s=function(t,e,r=!1){return function(o,s){const c=t[e];if(!i(o))return;if(!r&&!n(s))return;if(!c[o])return 0;let l=0;if(r)l=c[o].handlers.length,c[o]={runs:c[o].runs,handlers:[]};else{const t=c[o].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),l++,c.__current.forEach((t=>{t.name===o&&t.currentIndex>=e&&t.currentIndex--})))}return"hookRemoved"!==o&&t.doAction("hookRemoved",o,s),l}};var c=function(t,e){return function(r,n){const i=t[e];return void 0!==n?r in i&&i[r].handlers.some((t=>t.namespace===n)):r in i}};var l=function(t,e,r,n){return function(i,...o){const s=t[e];s[i]||(s[i]={handlers:[],runs:0}),s[i].runs++;const c=s[i].handlers;if(!c||!c.length)return r?o[0]:void 0;const l={name:i,currentIndex:0};return(n?async function(){try{s.__current.add(l);let t=r?o[0]:void 0;for(;l.currentIndex<c.length;){const e=c[l.currentIndex];t=await e.callback.apply(null,o),r&&(o[0]=t),l.currentIndex++}return r?t:void 0}finally{s.__current.delete(l)}}:function(){try{s.__current.add(l);let t=r?o[0]:void 0;for(;l.currentIndex<c.length;){t=c[l.currentIndex].callback.apply(null,o),r&&(o[0]=t),l.currentIndex++}return r?t:void 0}finally{s.__current.delete(l)}})()}};var a=function(t,e){return function(){const r=t[e],n=Array.from(r.__current);return n.at(-1)?.name??null}};var d=function(t,e){return function(r){const n=t[e];return void 0===r?n.__current.size>0:Array.from(n.__current).some((t=>t.name===r))}};var u=function(t,e){return function(r){const n=t[e];if(i(r))return n[r]&&n[r].runs?n[r].runs:0}};class h{actions;filters;addAction;addFilter;removeAction;removeFilter;hasAction;hasFilter;removeAllActions;removeAllFilters;doAction;doActionAsync;applyFilters;applyFiltersAsync;currentAction;currentFilter;doingAction;doingFilter;didAction;didFilter;constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=o(this,"actions"),this.addFilter=o(this,"filters"),this.removeAction=s(this,"actions"),this.removeFilter=s(this,"filters"),this.hasAction=c(this,"actions"),this.hasFilter=c(this,"filters"),this.removeAllActions=s(this,"actions",!0),this.removeAllFilters=s(this,"filters",!0),this.doAction=l(this,"actions",!1,!1),this.doActionAsync=l(this,"actions",!1,!0),this.applyFilters=l(this,"filters",!0,!1),this.applyFiltersAsync=l(this,"filters",!0,!0),this.currentAction=a(this,"actions"),this.currentFilter=a(this,"filters"),this.doingAction=d(this,"actions"),this.doingFilter=d(this,"filters"),this.didAction=u(this,"actions"),this.didFilter=u(this,"filters")}}var A=function(){return new h}},8770:()=>{}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{actions:()=>x,addAction:()=>s,addFilter:()=>c,applyFilters:()=>m,applyFiltersAsync:()=>v,createHooks:()=>t.A,currentAction:()=>y,currentFilter:()=>F,defaultHooks:()=>o,didAction:()=>b,didFilter:()=>k,doAction:()=>f,doActionAsync:()=>p,doingAction:()=>_,doingFilter:()=>g,filters:()=>w,hasAction:()=>d,hasFilter:()=>u,removeAction:()=>l,removeAllActions:()=>h,removeAllFilters:()=>A,removeFilter:()=>a});var t=r(507),e=r(8770),i={};for(const t in e)["default","actions","addAction","addFilter","applyFilters","applyFiltersAsync","createHooks","currentAction","currentFilter","defaultHooks","didAction","didFilter","doAction","doActionAsync","doingAction","doingFilter","filters","hasAction","hasFilter","removeAction","removeAllActions","removeAllFilters","removeFilter"].indexOf(t)<0&&(i[t]=()=>e[t]);r.d(n,i);const o=(0,t.A)(),{addAction:s,addFilter:c,removeAction:l,removeFilter:a,hasAction:d,hasFilter:u,removeAllActions:h,removeAllFilters:A,doAction:f,doActionAsync:p,applyFilters:m,applyFiltersAsync:v,currentAction:y,currentFilter:F,doingAction:_,doingFilter:g,didAction:b,didFilter:k,actions:x,filters:w}=o})(),(window.wp=window.wp||{}).hooks=n})();
(()=>{"use strict";var t={d:(n,e)=>{for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{__:()=>F,_n:()=>L,_nx:()=>D,_x:()=>w,createI18n:()=>h,defaultI18n:()=>b,getLocaleData:()=>g,hasTranslation:()=>O,isRTL:()=>P,resetLocaleData:()=>x,setLocaleData:()=>v,sprintf:()=>l,subscribe:()=>m});var e,r,a,i,o=/%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;function l(t,...n){return function(t,...n){var e=0;return Array.isArray(n[0])&&(n=n[0]),t.replace(o,(function(){var t,r,a,i,o;return t=arguments[3],r=arguments[5],"%"===(i=arguments[9])?"%":("*"===(a=arguments[7])&&(a=n[e],e++),void 0===r?(void 0===t&&(t=e+1),e++,o=n[t-1]):n[0]&&"object"==typeof n[0]&&n[0].hasOwnProperty(r)&&(o=n[0][r]),"f"===i?o=parseFloat(o)||0:"d"===i&&(o=parseInt(o)||0),void 0!==a&&("f"===i?o=o.toFixed(a):"s"===i&&(o=o.substr(0,a))),null!=o?o:"")}))}(t,...n)}e={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},r=["(","?"],a={")":["("],":":["?","?:"]},i=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var s={"!":function(t){return!t},"*":function(t,n){return t*n},"/":function(t,n){return t/n},"%":function(t,n){return t%n},"+":function(t,n){return t+n},"-":function(t,n){return t-n},"<":function(t,n){return t<n},"<=":function(t,n){return t<=n},">":function(t,n){return t>n},">=":function(t,n){return t>=n},"==":function(t,n){return t===n},"!=":function(t,n){return t!==n},"&&":function(t,n){return t&&n},"||":function(t,n){return t||n},"?:":function(t,n,e){if(t)throw n;return e}};function u(t){var n=function(t){for(var n,o,l,s,u=[],d=[];n=t.match(i);){for(o=n[0],(l=t.substr(0,n.index).trim())&&u.push(l);s=d.pop();){if(a[o]){if(a[o][0]===s){o=a[o][1]||o;break}}else if(r.indexOf(s)>=0||e[s]<e[o]){d.push(s);break}u.push(s)}a[o]||d.push(o),t=t.substr(n.index+o.length)}return(t=t.trim())&&u.push(t),u.concat(d.reverse())}(t);return function(t){return function(t,n){var e,r,a,i,o,l,u=[];for(e=0;e<t.length;e++){if(o=t[e],i=s[o]){for(r=i.length,a=Array(r);r--;)a[r]=u.pop();try{l=i.apply(null,a)}catch(t){return t}}else l=n.hasOwnProperty(o)?n[o]:+o;u.push(l)}return u[0]}(n,t)}}var d={contextDelimiter:"",onMissingKey:null};function c(t,n){var e;for(e in this.data=t,this.pluralForms={},this.options={},d)this.options[e]=void 0!==n&&e in n?n[e]:d[e]}c.prototype.getPluralForm=function(t,n){var e,r,a,i=this.pluralForms[t];return i||("function"!=typeof(a=(e=this.data[t][""])["Plural-Forms"]||e["plural-forms"]||e.plural_forms)&&(r=function(t){var n,e,r;for(n=t.split(";"),e=0;e<n.length;e++)if(0===(r=n[e].trim()).indexOf("plural="))return r.substr(7)}(e["Plural-Forms"]||e["plural-forms"]||e.plural_forms),a=function(t){var n=u(t);return function(t){return+n({n:t})}}(r)),i=this.pluralForms[t]=a),i(n)},c.prototype.dcnpgettext=function(t,n,e,r,a){var i,o,l;return i=void 0===a?0:this.getPluralForm(t,a),o=e,n&&(o=n+this.options.contextDelimiter+e),(l=this.data[t][o])&&l[i]?l[i]:(this.options.onMissingKey&&this.options.onMissingKey(e,t),0===i?e:r)};const p={plural_forms:t=>1===t?0:1},f=/^i18n\.(n?gettext|has_translation)(_|$)/,h=(t,n,e)=>{const r=new c({}),a=new Set,i=()=>{a.forEach((t=>t()))},o=(t,n="default")=>{r.data[n]={...r.data[n],...t},r.data[n][""]={...p,...r.data[n]?.[""]},delete r.pluralForms[n]},l=(t,n)=>{o(t,n),i()},s=(t="default",n,e,a,i)=>(r.data[t]||o(void 0,t),r.dcnpgettext(t,n,e,a,i)),u=t=>t||"default",d=(t,n,r)=>{let a=s(r,n,t);return e?(a=e.applyFilters("i18n.gettext_with_context",a,t,n,r),e.applyFilters("i18n.gettext_with_context_"+u(r),a,t,n,r)):a};if(t&&l(t,n),e){const t=t=>{f.test(t)&&i()};e.addAction("hookAdded","core/i18n",t),e.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>r.data[t],setLocaleData:l,addLocaleData:(t,n="default")=>{r.data[n]={...r.data[n],...t,"":{...p,...r.data[n]?.[""],...t?.[""]}},delete r.pluralForms[n],i()},resetLocaleData:(t,n)=>{r.data={},r.pluralForms={},l(t,n)},subscribe:t=>(a.add(t),()=>a.delete(t)),__:(t,n)=>{let r=s(n,void 0,t);return e?(r=e.applyFilters("i18n.gettext",r,t,n),e.applyFilters("i18n.gettext_"+u(n),r,t,n)):r},_x:d,_n:(t,n,r,a)=>{let i=s(a,void 0,t,n,r);return e?(i=e.applyFilters("i18n.ngettext",i,t,n,r,a),e.applyFilters("i18n.ngettext_"+u(a),i,t,n,r,a)):i},_nx:(t,n,r,a,i)=>{let o=s(i,a,t,n,r);return e?(o=e.applyFilters("i18n.ngettext_with_context",o,t,n,r,a,i),e.applyFilters("i18n.ngettext_with_context_"+u(i),o,t,n,r,a,i)):o},isRTL:()=>"rtl"===d("ltr","text direction"),hasTranslation:(t,n,a)=>{const i=n?n+""+t:t;let o=!!r.data?.[a??"default"]?.[i];return e&&(o=e.applyFilters("i18n.has_translation",o,t,n,a),o=e.applyFilters("i18n.has_translation_"+u(a),o,t,n,a)),o}}},_=window.wp.hooks,y=h(void 0,void 0,_.defaultHooks);var b=y;const g=y.getLocaleData.bind(y),v=y.setLocaleData.bind(y),x=y.resetLocaleData.bind(y),m=y.subscribe.bind(y),F=y.__.bind(y),w=y._x.bind(y),L=y._n.bind(y),D=y._nx.bind(y),P=y.isRTL.bind(y),O=y.hasTranslation.bind(y);(window.wp=window.wp||{}).i18n=n})();