Viewing File: /home/maglabs/riadlooma2/wp-content/themes/homey/js/homey-ajax.min.js
jQuery(document).ready(function($){"use strict";function disable_hourlystart_and_end(){var t,e,a,s,i;""!=$("#hourly_check_inn").val()&&($("span").removeClass("already-booked"),t=$("#post_already_bookd_dates").find("span"),e=$(".start_hour").find(".text"),a=$(".end_hour").find(".text"),s=(s=(s=homey_date_format.replace("mm","M")).replace("dd","D")).replace("yy","Y"),i=moment($("#hourly_check_inn").val(),s).format("D-M-Y"),$(e).each(function(e,t){$(t).closest("li").removeClass("disabled")}),$(a).each(function(e,t){$(t).closest("li").removeClass("disabled")}),$(e).each(function(e,a){var s="";-1<$(a).text().indexOf(":")&&(s=(s=(s=$(a).text()).replace(" am","")).replace(" pm",""),s=i+" "+s+":00",$(t).each(function(e,t){t=$(t).data("datetime"),t=moment(t,"DD/MM/YYYY HH:mm:ss").diff(moment(s,"DD/MM/YYYY HH:mm:ss"));0==moment.duration(t)&&($(a).addClass("already-booked"),$(a).closest("li").addClass("disabled"))}))}),$(a).each(function(e,a){var s="";-1<$(a).text().indexOf(":")&&(s=(s=(s=$(a).text()).replace(" am","")).replace(" pm",""),s=i+" "+s+":00",$(t).each(function(e,t){t=$(t).data("datetime"),t=moment(t,"DD/MM/YYYY HH:mm:ss").diff(moment(s,"DD/MM/YYYY HH:mm:ss"));0==moment.duration(t)&&($(a).addClass("already-booked"),$(a).closest("li").addClass("disabled"))}))})),prev_date=$("#hourly_check_inn").val()}var ajaxurl,login_redirect_type,login_redirect,is_singular_listing,is_singular_experience,paypal_connecting,login_sending,process_loader_spinner,currency_updating_msg,homey_date_format,userID,homey_reCaptcha,processing_text,already_login_text,is_listing_detail,booked_hours_array,pending_hours_array,booking_start_hour,booking_end_hour,homey_min_book_days,is_tansparent,retina_logo,retina_logo_splash,retina_logo_mobile,retina_logo_mobile_splash,no_more_listings,no_more_experiences,allow_additional_guests,allowed_guests_num,num_additional_guests,agree_term_text,choose_gateway_text,success_icon,calendar_link,exp_calendar_link,focusedInput_2,allowed_guests_plus_additional,compare_url,add_compare,remove_compare,compare_limit,homey_booking_type,homey_is_rtl,homey_is_rtl,homey_is_mobile,homey_window_width,homey_processing_modal,homey_processing_modal_close,homey_timeStamp_2,currencySwitcherList,listings_module_section,experiences_module_section,compare_for_ajax,compare_exp_for_ajax,homey_paypal_payment,homey_paypal_exp_payment,listing_review_ajax,experience_review_ajax,homey_convert_date,homey_calculate_booking_cost,homey_calculate_exp_booking_cost,homey_calculate_hourly_booking_cost,check_booking_availability_on_date_change,check_exp_availability_on_date_change,check_booking_availability_on_hour_change,numClicks,fromTimestamp_2,toTimestamp_2,homey_booking_dates,setInBetween_2,homey_calculate_price_checkin,homey_calculate_price_checkout,single_listing_guests,experience_id,numClicks,fromTimestamp_2,toTimestamp_2,homey_calculate_exp_price_checkout,homey_experiences_booking_dates,single_experience_guests,homey_hourly_availability_calendar,prev_date,homey_booking_paypal_payment,homey_exp_booking_paypal_payment,homey_hourly_booking_paypal_payment,homey_instance_booking_paypal_payment,homey_instance_exp_booking_paypal_payment,homey_hourly_instance_booking_paypal_payment,is_no_login_user_reg,renter_message,first_name,last_name,phone,renter_message,homey_login,homey_register,homey_login_via_facebook,homey_login_via_yahoo,homey_login_via_google,homey_message_notifications,homey_booking_notification,extra_options,temp_opt,check_in_date,check_in_date,start_hour,end_hour,guests,listing_id,security;function save_booking_details(e,t,a,s,i,r,o){var n=$("input[name='_wp_http_referer']").val();void 0!==n&&(o=n.split("?")[0]+"?arrive="+e+"&depart="+t+"&guest="+a+"&adult_guest="+i+"&child_guest="+r+"&guest_message="+s+"&new_reser_request_user_email="+o,$("input[name='_wp_http_referer']").val(o))}function save_hourl_booking_details(e,t,a,s,i,r,o){var n=$("input[name='_wp_http_referer']").val();void 0!==n&&(i=n.split("?")[0]+"?arrive="+e+"&start="+t+"&end="+a+"&guest="+s+"&adult_guest="+r+"&child_guest="+o+"&guest_message="+i,$("input[name='_wp_http_referer']").val(i))}function save_exp_booking_details(e,t,a,s,i){var r=$("input[name='_wp_http_referer']").val();void 0!==r&&(a=r.split("?")[0]+"?arrive="+e+"&guest="+t+"&adult_guest="+s+"&child_guest="+i+"&guest_message="+a,$("input[name='_wp_http_referer']").val(a))}"undefined"!=typeof HOMEY_ajax_vars&&(ajaxurl=HOMEY_ajax_vars.admin_url+"admin-ajax.php",login_redirect_type=HOMEY_ajax_vars.redirect_type,login_redirect=HOMEY_ajax_vars.login_redirect,is_singular_listing=HOMEY_ajax_vars.is_singular_listing,is_singular_experience=HOMEY_ajax_vars.is_singular_experience,paypal_connecting=HOMEY_ajax_vars.paypal_connecting,login_sending=HOMEY_ajax_vars.login_loading,process_loader_spinner=HOMEY_ajax_vars.process_loader_spinner,currency_updating_msg=HOMEY_ajax_vars.currency_updating_msg,homey_date_format=HOMEY_ajax_vars.homey_date_format,userID=HOMEY_ajax_vars.user_id,homey_reCaptcha=HOMEY_ajax_vars.homey_reCaptcha,processing_text=HOMEY_ajax_vars.processing_text,already_login_text=HOMEY_ajax_vars.already_login_text,is_listing_detail=HOMEY_ajax_vars.is_listing_detail,booked_hours_array=HOMEY_ajax_vars.booked_hours_array,pending_hours_array=HOMEY_ajax_vars.pending_hours_array,booking_start_hour=HOMEY_ajax_vars.booking_start_hour,booking_end_hour=HOMEY_ajax_vars.booking_end_hour,homey_min_book_days=HOMEY_ajax_vars.homey_min_book_days,""!==booked_hours_array&&0!==booked_hours_array.length&&(booked_hours_array=JSON.parse(booked_hours_array)),""!==pending_hours_array&&0!==pending_hours_array.length&&(pending_hours_array=JSON.parse(pending_hours_array)),is_tansparent=HOMEY_ajax_vars.homey_tansparent,retina_logo=HOMEY_ajax_vars.retina_logo,retina_logo_splash=HOMEY_ajax_vars.retina_logo_splash,retina_logo_mobile=HOMEY_ajax_vars.retina_logo_mobile,retina_logo_mobile_splash=HOMEY_ajax_vars.retina_logo_mobile_splash,no_more_listings=HOMEY_ajax_vars.no_more_listings,no_more_experiences=HOMEY_ajax_vars.no_more_experiences,allow_additional_guests=HOMEY_ajax_vars.allow_additional_guests,allowed_guests_num=HOMEY_ajax_vars.allowed_guests_num,num_additional_guests=HOMEY_ajax_vars.num_additional_guests,agree_term_text=HOMEY_ajax_vars.agree_term_text,choose_gateway_text=HOMEY_ajax_vars.choose_gateway_text,success_icon=HOMEY_ajax_vars.success_icon,calendar_link=HOMEY_ajax_vars.calendar_link,exp_calendar_link=HOMEY_ajax_vars.exp_calendar_link,focusedInput_2=null,allowed_guests_plus_additional=parseInt(allowed_guests_num)+parseInt(num_additional_guests),compare_url=HOMEY_ajax_vars.compare_url,add_compare=HOMEY_ajax_vars.add_compare,remove_compare=HOMEY_ajax_vars.remove_compare,compare_limit=HOMEY_ajax_vars.compare_limit,homey_booking_type=HOMEY_ajax_vars.homey_booking_type,homey_is_rtl=HOMEY_ajax_vars.homey_is_rtl,homey_is_rtl="yes"==homey_is_rtl,homey_is_mobile=!1,/Android|webOS|iPhone|iPad|iPod|tablet|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(homey_is_mobile=!0),homey_window_width=$(window).width(),homey_processing_modal=function(e){e='<div class="modal fade" id="homey_modal" tabindex="-1" role="dialog" aria-labelledby="homeyModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-body homey_messages_modal">'+e+"</div></div></div></div></div>";$("body").append(e),$("#homey_modal").modal()},homey_processing_modal_close=function(){$("#homey_modal").modal("hide")},homey_timeStamp_2=function(e){e=e.split("-"),e=e[1]+"/"+e[0]+"/"+e[2];return new Date(e).getTime()},2==window.devicePixelRatio&&(is_tansparent?(""!=retina_logo_splash&&$(".transparent-header .homey_logo img").attr("src",retina_logo_splash),""!=retina_logo_mobile_splash&&$(".mobile-logo img").attr("src",retina_logo_mobile_splash)):(""!=retina_logo&&$(".homey_logo img").attr("src",retina_logo),""!=retina_logo_mobile&&$(".mobile-logo img").attr("src",retina_logo_mobile))),currencySwitcherList=$("#homey-currency-switcher-list"),0<currencySwitcherList.length&&$("#homey-currency-switcher-list > li").on("click",function(e){e.stopPropagation(),currencySwitcherList.slideUp(200);var selectedCurrencyCode=$(this).data("currency-code");selectedCurrencyCode&&($(".homey-selected-currency span").html(selectedCurrencyCode),homey_processing_modal('<i class="'+process_loader_spinner+'"></i> '+currency_updating_msg),$.ajax({url:ajaxurl,dataType:"JSON",method:"POST",data:{action:"homey_currency_converter",currency_to_converter:selectedCurrencyCode},success:function(e){var t;e.success?-1!==(t=jQuery(document).find("input[name='_wp_http_referer']").val()).indexOf("?")?window.location.href=t+"&n="+(new Date).getTime():window.location.href=t+"?n="+(new Date).getTime():console.log(e)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}}))}),$(".homey-currency-switcher").on("change",function(e){var selectedCurrencyCode=$(this).val();selectedCurrencyCode&&(homey_processing_modal('<i class="'+process_loader_spinner+'"></i> '+currency_updating_msg),$.ajax({url:ajaxurl,dataType:"JSON",method:"POST",data:{action:"homey_currency_converter",currency_to_converter:selectedCurrencyCode},success:function(e){e.success?window.location.reload():console.log(e)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}}))}),listings_module_section=$("#listings_module_section"),0<listings_module_section.length&&$("body").on("click",".homey-loadmore a",function(e){e.preventDefault();var $this=$(this),$wrap=$this.closest("#listings_module_section").find("#module_listings"),limit=$this.data("limit"),paged=$this.data("paged"),style=$this.data("style"),type=$this.data("type"),roomtype=$this.data("roomtype"),country=$this.data("country"),state=$this.data("state"),city=$this.data("city"),area=$this.data("area"),featured=$this.data("featured"),offset=$this.data("offset"),sortby=$this.data("sortby"),booking_type=$this.data("booking_type"),author=$this.data("author"),authorid=$this.data("authorid");$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_loadmore_listings",limit:limit,paged:paged,style:style,type:type,roomtype:roomtype,country:country,state:state,city:city,area:area,featured:featured,sort_by:sortby,offset:offset,booking_type:booking_type,author:author,authorid:authorid},beforeSend:function(){$this.find("i").css("display","inline-block")},success:function(e){"no_result"!=e?($wrap.append(e),$this.data("paged",paged+1),homey_init_add_favorite(ajaxurl,userID,is_singular_listing),homey_init_remove_favorite(ajaxurl,userID,is_singular_listing),compare_for_ajax()):$this.closest("#listings_module_section").find(".homey-loadmore").text(no_more_listings)},complete:function(){$this.find("i").css("display","none")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})}),experiences_module_section=$("#experiences_module_section"),0<experiences_module_section.length&&$("body").on("click",".homey-loadmore a",function(e){e.preventDefault();var $this=$(this),$wrap=$this.closest("#experiences_module_section").find("#module_experiences"),limit=$this.data("limit"),paged=$this.data("paged"),style=$this.data("style"),type=$this.data("type"),roomtype=$this.data("roomtype"),country=$this.data("country"),state=$this.data("state"),city=$this.data("city"),area=$this.data("area"),featured=$this.data("featured"),offset=$this.data("offset"),sortby=$this.data("sortby"),booking_type=$this.data("booking_type"),author=$this.data("author"),authorid=$this.data("authorid");$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_loadmore_experiences",limit:limit,paged:paged,style:style,type:type,roomtype:roomtype,country:country,state:state,city:city,area:area,featured:featured,sort_by:sortby,offset:offset,booking_type:booking_type,author:author,authorid:authorid},beforeSend:function(){$this.find("i").css("display","inline-block")},success:function(e){"no_result"!=e?($wrap.append(e),$this.data("paged",paged+1),homey_init_add_exp_favorite(ajaxurl,userID,is_singular_experience),homey_init_remove_exp_favorite(ajaxurl,userID,is_singular_experience),compare_exp_for_ajax()):$this.closest("#experiences_module_section").find(".homey-loadmore").text(no_more_experiences)},complete:function(){$this.find("i").css("display","none")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})}),homey_init_add_favorite(ajaxurl,userID,is_singular_listing),homey_init_remove_favorite(ajaxurl,userID,is_singular_listing),homey_init_add_exp_favorite(ajaxurl,userID,is_singular_experience),homey_init_remove_exp_favorite(ajaxurl,userID,is_singular_experience),compare_for_ajax=function(){var e=homeyGetCookie("homey_compare_listings");add_to_compare(compare_url,add_compare,remove_compare,compare_limit,e,4),remove_from_compare(e,add_compare,remove_compare)},compare_exp_for_ajax=function(){var e=homeyGetCookie("homey_compare_experiences");add_to_compare_exp(compare_url,add_compare,remove_compare,compare_limit,e,4),remove_from_compare_exp(e,add_compare,remove_compare)},$("#homey_complete_order").on("click",function(e){var t,a;e.preventDefault(),t=$("input[name='homey_payment_type']:checked").val(),a=$("input[name='is_upgrade']").val(),e=$("#listing_id").val(),"paypal"==t?(homey_processing_modal(paypal_connecting),homey_paypal_payment(e,a)):"stripe"==t&&$(this).parents(".dashboard-area").find(".homey_stripe_simple button").trigger("click")}),$("#homey_complete_order_exp").on("click",function(e){var t,a;e.preventDefault(),t=$("input[name='homey_payment_type']:checked").val(),a=$("input[name='is_upgrade']").val(),e=$("#experience_id").val(),"paypal"==t?(homey_processing_modal(paypal_connecting),homey_paypal_exp_payment(e,a)):"stripe"==t&&$(this).parents(".dashboard-area").find(".homey_stripe_simple button").trigger("click")}),homey_paypal_payment=function(listing_id,is_upgrade){$.ajax({type:"post",url:ajaxurl,data:{action:"homey_listing_paypal_payment",listing_id:listing_id,is_upgrade:is_upgrade},success:function(e){window.location.href=e},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},homey_paypal_exp_payment=function(experience_id,is_upgrade){$.ajax({type:"post",url:ajaxurl,data:{action:"homey_experience_paypal_payment",experience_id:experience_id,is_upgrade:is_upgrade},success:function(e){window.location.href=e},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},0<$("#add_review").length&&$("#add_review").on("click",function(e){e.preventDefault();var $this=$(this),rating=$("#rating").val(),review_action=$("#review_action").val(),review_content=$("#review_content").val(),review_reservation_id=$("#review_reservation_id").val(),security=$("#review-security").val(),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_add_review",rating:rating,review_action:review_action,review_content:review_content,review_reservation_id:review_reservation_id,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?($this.attr("disabled",!0),window.location.reload()):parentDIV.find(".dashboard-area").prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-hide="alert" aria-label="Close"><i class="homey-icon homey-icon-close"></i></button>'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),0<$("#add_guest_review").length&&$("#add_guest_review").on("click",function(e){e.preventDefault();var $this=$(this),rating=$("#rating").val(),review_action=$("#review_guest_action").val(),review_content=$("#review_content").val(),review_guest_reservation_id=$("#review_guest_reservation_id").val(),security=$("#review-security").val(),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_add_guest_review",rating:rating,review_action:review_action,review_content:review_content,review_guest_reservation_id:review_guest_reservation_id,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?($this.attr("disabled",!0),window.location.reload()):parentDIV.find(".dashboard-area").prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-hide="alert" aria-label="Close"><i class="homey-icon homey-icon-close"></i></button>'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),listing_review_ajax=function(sortby,listing_id,paged){var review_container=$("#homey_reviews");$.ajax({type:"post",url:ajaxurl,data:{action:"homey_ajax_review",sortby:sortby,listing_id:listing_id,paged:paged},beforeSend:function(){},success:function(e){review_container.empty(),review_container.html(e)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){}})},0<$("#sort_review").length&&$("#sort_review").on("change",function(){var e=$(this).val(),t=$("#review_listing_id").val(),a=$("#review_paged").val();listing_review_ajax(e,t,a)}),0<$("#review_next").length&&$("#review_next").on("click",function(e){e.preventDefault(),$("#review_prev").removeAttr("disabled");var t=$("#page_sort").val(),a=$("#total_pages").val(),s=$("#review_listing_id").val(),e=$("#review_paged").val(),e=Number(e)+1;$("#review_paged").val(e),e==a&&$(this).attr("disabled",!0),listing_review_ajax(t,s,e)}),0<$("#review_prev").length&&$("#review_prev").on("click",function(e){e.preventDefault(),$("#review_next").removeAttr("disabled");var t=$("#page_sort").val(),a=$("#review_listing_id").val(),e=$("#review_paged").val(),e=Number(e)-1;$("#review_paged").val(e),e<=1&&$(this).attr("disabled",!0),listing_review_ajax(t,a,e)}),0<$("#add_exp_review").length&&$("#add_exp_review").on("click",function(e){e.preventDefault();var $this=$(this),rating=$("#rating").val(),review_action=$("#review_action").val(),review_content=$("#review_content").val(),review_reservation_id=$("#review_reservation_id").val(),security=$("#review-security").val(),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_add_exp_review",rating:rating,review_action:review_action,review_content:review_content,review_reservation_id:review_reservation_id,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?($this.attr("disabled",!0),window.location.reload()):parentDIV.find(".dashboard-area").prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-hide="alert" aria-label="Close"><i class="homey-icon homey-icon-close"></i></button>'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),0<$("#add_guest_exp_review").length&&$("#add_guest_exp_review").on("click",function(e){e.preventDefault();var $this=$(this),rating=$("#rating").val(),review_action=$("#review_guest_action").val(),review_content=$("#review_content").val(),review_guest_reservation_id=$("#review_guest_reservation_id").val(),security=$("#review-security").val(),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_add_guest_exp_review",rating:rating,review_action:review_action,review_content:review_content,review_guest_reservation_id:review_guest_reservation_id,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?($this.attr("disabled",!0),window.location.reload()):parentDIV.find(".dashboard-area").prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-hide="alert" aria-label="Close"><i class="homey-icon homey-icon-close"></i></button>'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),experience_review_ajax=function(sortby,experience_id,paged){var review_container=$("#homey_reviews");$.ajax({type:"post",url:ajaxurl,data:{action:"homey_ajax_exp_review",sortby:sortby,experience_id:experience_id,paged:paged},beforeSend:function(){},success:function(e){review_container.empty(),review_container.html(e)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){}})},0<$("#sort_exp_review").length&&$("#sort_exp_review").on("change",function(){var e=$(this).val(),t=$("#review_experience_id").val(),a=$("#review_paged").val();experience_review_ajax(e,t,a)}),0<$("#review_exp_next").length&&$("#review_exp_next").on("click",function(e){e.preventDefault(),$("#review_prev").removeAttr("disabled");var t=$("#page_sort").val(),a=$("#total_pages").val(),e=($("#review_experience_id").val(),$("#review_paged").val()),e=Number(e)+1;$("#review_paged").val(e),e==a&&$(this).attr("disabled",!0),experience_review_ajax(t,listing_id,e)}),0<$("#review_exp_prev").length&&$("#review_exp_prev").on("click",function(e){e.preventDefault(),$("#review_next").removeAttr("disabled");var t=$("#page_sort").val(),a=$("#review_experience_id").val(),e=$("#review_paged").val(),e=Number(e)-1;$("#review_paged").val(e),e<=1&&$(this).attr("disabled",!0),experience_review_ajax(t,a,e)}),homey_convert_date=function(e){if(""==e)return"";var t=homey_date_format.toUpperCase().replace("YY","YYYY");return moment(e,t).format("YYYY-MM-DD")},homey_calculate_booking_cost=function(check_in_date,check_out_date,guests,listing_id,security,extra_options){var $this=$(this),notify=$(".homey_notification");notify.find(".notify").remove(),""!==check_in_date&&""!==check_out_date?$.ajax({type:"post",url:ajaxurl,data:{action:"homey_calculate_booking_cost",check_in_date:check_in_date,check_out_date:check_out_date,guests:guests,extra_options:extra_options,listing_id:listing_id,security:security},beforeSend:function(){$("#homey_booking_cost, .payment-list").empty(),$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>'),notify.find(".homey_preloader").show()},success:function(e){$("#homey_booking_cost, .payment-list").empty().html(e)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner),notify.find(".homey_preloader").hide()}}):$("#homey_booking_cost, .payment-list").empty()},homey_calculate_exp_booking_cost=function(check_in_date,guests,experience_id,security,extra_options){var $this=$(this),notify=$(".homey_notification");notify.find(".notify").remove(),""!==check_in_date?$.ajax({type:"post",url:ajaxurl,data:{action:"homey_calculate_exp_booking_cost",check_in_date:check_in_date,guests:guests,extra_options:extra_options,experience_id:experience_id,security:security},beforeSend:function(){$("#homey_booking_cost, .payment-list").empty(),$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>'),notify.find(".homey_preloader").show()},success:function(e){$("#homey_booking_cost, .payment-list").empty().html(e)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner),notify.find(".homey_preloader").hide()}}):$("#homey_booking_cost, .payment-list").empty()},homey_calculate_hourly_booking_cost=function(check_in_date,start_hour,end_hour,guests,listing_id,security,extra_options){var $this=$(this),notify=$(".homey_notification");notify.find(".notify").remove(),""!==check_in_date&&""!==start_hour&&""!==end_hour?$.ajax({type:"post",url:ajaxurl,data:{action:"homey_calculate_hourly_booking_cost",check_in_date:check_in_date,start_hour:start_hour,end_hour:end_hour,guests:guests,extra_options:extra_options,listing_id:listing_id,security:security},beforeSend:function(){$("#homey_booking_cost, .payment-list").empty(),$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>'),notify.find(".homey_preloader").show()},success:function(e){$("#homey_booking_cost, .payment-list").empty().html(e)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner),notify.find(".homey_preloader").hide()}}):$("#homey_booking_cost, .payment-list").empty()},check_booking_availability_on_date_change=function(check_in_date,check_out_date,listing_id,security){var $this=$(this),notify=$(".homey_notification");notify.find(".notify").remove(),$(".homey_extra_price input").each(function(){$(this).prop("checked",!1)}),$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"check_booking_availability_on_date_change",check_in_date:check_in_date,check_out_date:check_out_date,listing_id:listing_id,security:security},beforeSend:function(){$("#homey_booking_cost, .payment-list").empty(),notify.find(".homey_preloader").show()},success:function(e){e.success?($("#request_for_reservation, #request_for_reservation_mobile").removeAttr("disabled"),$("#instance_reservation, #instance_reservation_mobile").removeAttr("disabled"),notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>")):(notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>"),$("#request_for_reservation, #request_for_reservation_mobile").attr("disabled",!0),$("#instance_reservation, #instance_reservation_mobile").attr("disabled",!0))},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){notify.find(".homey_preloader").hide()}})},check_exp_availability_on_date_change=function(check_in_date,experience_id,security){var $this=$(this),exp_guests=$("input[name='exp_guests']").val(),notify=$(".homey_notification");notify.find(".notify").remove(),$(".homey_exp_extra_price input").each(function(){$(this).prop("checked",!1)}),$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"check_exp_availability_on_date_change",check_in_date:check_in_date,experience_id:experience_id,exp_guests:exp_guests,security:security},beforeSend:function(){$("#homey_booking_cost, .payment-list").empty(),notify.find(".homey_preloader").show()},success:function(e){e.success?($("#request_for_reservation, #request_for_reservation_mobile").removeAttr("disabled"),$("#instance_reservation, #instance_reservation_mobile").removeAttr("disabled"),notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>")):(notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>"),$("#request_for_reservation, #request_for_reservation_mobile").attr("disabled",!0),$("#instance_reservation, #instance_reservation_mobile").attr("disabled",!0))},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){notify.find(".homey_preloader").hide()}})},check_booking_availability_on_hour_change=function(check_in_date,start_hour,end_hour,listing_id,security){var $this=$(this),notify=$(".homey_notification");notify.find(".notify").remove(),$(".homey_extra_price input").each(function(){$(this).prop("checked",!1)});var visitortimezone_gmt=$("#visitortimezone").val(),prettyDateTime=$("#prettyDateTime").val();$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"check_booking_availability_on_hour_change",check_in_date:check_in_date,start_hour:start_hour,end_hour:end_hour,listing_id:listing_id,security:security,visitortimezone_gmt:visitortimezone_gmt,prettyDateTime:prettyDateTime},beforeSend:function(){$("#homey_booking_cost, .payment-list").empty(),notify.find(".homey_preloader").show()},success:function(e){e.success?($("#request_hourly_reservation, #request_hourly_reservation_mobile").removeAttr("disabled"),$("#instance_hourly_reservation, #instance_hourly_reservation_mobile").removeAttr("disabled"),notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>")):(notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>"),$("#request_hourly_reservation, #request_hourly_reservation_mobile").attr("disabled",!0),$("#instance_hourly_reservation, #instance_hourly_reservation_mobile").attr("disabled",!0))},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){notify.find(".homey_preloader").hide()}})},$("#single-listing-date-range input").on("focus",function(){$(".single-listing-booking-calendar-js").css("display","block"),$(".single-listing-booking-calendar-js").addClass("arrive_active"),$(".single-form-guests-js").css("display","none"),focusedInput_2=$(this).attr("name"),$(".single-listing-booking-calendar-js").removeClass("arrive_active depart_active").addClass(focusedInput_2+"_active")}),$(".single-guests-js input").on("focus",function(){$(this).prev("label").css("display","block"),$(this).addClass("on-focus"),$(".single-form-guests-js").css("display","block")}),$(".exp-single-guests-js input").on("focus",function(){$(this).prev("label").css("display","block"),$(this).addClass("on-focus"),$(".exp-single-form-guests-js").css("display","block")}),numClicks=0,toTimestamp_2=0,homey_booking_dates=function(){$(".single-listing-booking-calendar-js ul li").on("click",function(){console.log(" ln 1139");var e=$(this);if(e.show(),(e.hasClass("past-day")||e.hasClass("homey-not-available-for-booking"))&&!e.hasClass("reservation_start"))return!1;numClicks+=1;var t,a=e.data("formatted-date"),s=e.data("timestamp");"depart"==focusedInput_2&&fromTimestamp_2<s&&($(".single-listing-calendar-wrap ul").find("li.to-day").removeClass("selected").siblings().removeClass("to-day in-between"),numClicks=2),1==numClicks?(fromTimestamp_2=s,$(".single-listing-calendar-wrap ul li").removeClass("to-day from-day selected in-between"),e.addClass("from-day selected"),$(".single-listing-booking-calendar-js").removeClass("arrive_active").addClass("depart_active"),$('input[name="arrive"]').val(a),$('input[name="depart"]').val(""),"per_hour"!=homey_booking_type&&homey_calculate_price_checkin()):2==numClicks&&(toTimestamp_2=s,e.addClass("to-day selected"),$(".single-listing-booking-calendar-js").removeClass("depart_active").addClass("arrive_active"),t=$('input[name="arrive"]').val(),t=homey_timeStamp_2(t),homey_timeStamp_2(a)<=t&&"per_day_date"!=homey_booking_type?(fromTimestamp_2=s,toTimestamp_2=0,$(".single-listing-calendar-wrap ul li").removeClass("to-day from-day selected in-between"),e.addClass("from-day selected"),$(".single-listing-booking-calendar-js").removeClass("arrive_active").addClass("depart_active"),$('input[name="arrive"]').val(a),numClicks=1):(setInBetween_2(fromTimestamp_2,toTimestamp_2),$('input[name="depart"]').val(a),$("#single-booking-search-calendar, #single-overlay-booking-search-calendar").hide(),"per_hour"!=homey_booking_type&&homey_calculate_price_checkout())),2==numClicks&&(numClicks=0)})},"per_hour"!=homey_booking_type&&(homey_booking_dates(),$(".single-listing-calendar-wrap ul li").on("hover",function(){var e=$(this).data("timestamp");1==numClicks&&setInBetween_2(fromTimestamp_2,e)}),setInBetween_2=function(t,a){$(".single-listing-calendar-wrap ul li").removeClass("in-between").filter(function(){var e=$(this).data("timestamp");return t<e&&e<a}).addClass("in-between")},homey_calculate_price_checkin=function(){var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$('input[name="depart"]').val(),t=homey_convert_date(t),a=$('input[name="guests"]').val(),s=$("#listing_id").val(),i=$("#reservation-security").val();homey_calculate_booking_cost(e,t,a,s,i)},"yes"==is_singular_listing&&homey_calculate_price_checkin(),homey_calculate_price_checkout=function(){var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$('input[name="depart"]').val(),t=homey_convert_date(t),a=$('input[name="guests"]').val(),s=$("#listing_id").val(),i=$("#reservation-security").val();homey_calculate_booking_cost(e,t,a,s,i),check_booking_availability_on_date_change(e,t,s,i)},$(".apply_guests").on("click",function(){var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$('input[name="depart"]').val(),t=homey_convert_date(t),a=$('input[name="guests"]').val(),s=$("#listing_id").val(),i=$("#reservation-security").val();homey_calculate_booking_cost(e,t,a,s,i),check_booking_availability_on_date_change(e,t,s,i)}),$(".homey_extra_price input").on("click",function(){var s,i=[];$(".homey_extra_price input").each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),s=e+"|"+t+"|"+a,i.push(s))});var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$('input[name="depart"]').val(),t=homey_convert_date(t),a=$('input[name="guests"]').val(),r=$("#listing_id").val(),o=$("#reservation-security").val();homey_calculate_booking_cost(e,t,a,r,o,i)})),"per_hour"==homey_booking_type&&($(".hourly-js-desktop ul li").on("click",function(){var e=$(this),t=e.data("formatted-date");$('input[name="arrive"]').val(t),$(".single-listing-hourly-calendar-wrap ul li").removeClass("selected"),e.addClass("selected"),$("#single-booking-search-calendar, #single-overlay-booking-search-calendar").hide();var a=$('input[name="arrive"]').val(),a=homey_convert_date(a),s=$('select[name="start_hour"]').val(),i=$('select[name="end_hour"]').val(),r=$('input[name="guests"]').val(),t=$("#listing_id").val(),e=$("#reservation-security").val();homey_calculate_hourly_booking_cost(a,s,i,r,t,e),""!==a&&""!==s&&""!==i&&check_booking_availability_on_hour_change(a,s,i,t,e)}),$("#start_hour").on("change",function(){var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$('select[name="start_hour"]').val(),a=$('select[name="end_hour"]').val(),s=$('input[name="guests"]').val(),i=$("#listing_id").val(),r=$("#reservation-security").val();homey_calculate_hourly_booking_cost(e,t,a,s,i,r),""!==e&&""!==t&&""!==a&&check_booking_availability_on_hour_change(e,t,a,i,r)}),$("#end_hour").on("change",function(){var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$('select[name="start_hour"]').val(),a=$('select[name="end_hour"]').val(),s=$('input[name="guests"]').val(),i=$("#listing_id").val(),r=$("#reservation-security").val();homey_calculate_hourly_booking_cost(e,t,a,s,i,r),check_booking_availability_on_hour_change(e,t,a,i,r)}),$(".hourly-js-mobile ul li").on("click",function(){var e=$(this),t=e.data("formatted-date");$('input[name="arrive"]').val(t),$(".single-listing-hourly-calendar-wrap ul li").removeClass("selected"),e.addClass("selected"),$("#single-booking-search-calendar, #single-overlay-booking-search-calendar").hide();var a=$('input[name="arrive"]').val(),a=homey_convert_date(a),s=$("#start_hour_overlay").val(),i=$("#end_hour_overlay").val(),r=$('input[name="guests"]').val(),t=$("#listing_id").val(),e=$("#reservation-security").val();homey_calculate_hourly_booking_cost(a,s,i,r,t,e),""!==a&&""!==s&&""!==i&&check_booking_availability_on_hour_change(a,s,i,t,e)}),$("#start_hour_overlay").on("change",function(){var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$("#start_hour_overlay").val(),a=$("#end_hour_overlay").val(),s=$('input[name="guests"]').val(),i=$("#listing_id").val(),r=$("#reservation-security").val();homey_calculate_hourly_booking_cost(e,t,a,s,i,r),""!==e&&""!==t&&""!==a&&check_booking_availability_on_hour_change(e,t,a,i,r)}),$("#end_hour_overlay").on("change",function(){var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$("#start_hour_overlay").val(),a=$("#end_hour_overlay").val(),s=$('input[name="guests"]').val(),i=$("#listing_id").val(),r=$("#reservation-security").val();homey_calculate_hourly_booking_cost(e,t,a,s,i,r),check_booking_availability_on_hour_change(e,t,a,i,r)}),$(".apply_guests").on("click",function(){var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$('select[name="start_hour"]').val(),a=$('select[name="end_hour"]').val(),s=$('input[name="guests"]').val(),i=$("#listing_id").val(),r=$("#reservation-security").val();homey_calculate_hourly_booking_cost(e,t,a,s,i,r),check_booking_availability_on_hour_change(e,t,a,i,r)}),$("#apply_guests_hourly").on("click",function(){var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$("#start_hour_overlay").val(),a=$("#end_hour_overlay").val(),s=$('input[name="guests"]').val(),i=$("#listing_id").val(),r=$("#reservation-security").val();homey_calculate_hourly_booking_cost(e,t,a,s,i,r),check_booking_availability_on_hour_change(e,t,a,i,r)}),$(".homey_extra_price input").on("click",function(){var s,e,t,a,i,r,o=[],n=$(".homey_extra_price input");$("#overlay-booking-module").hasClass("open")&&(n=$("#overlay-booking-module").find(".homey_extra_price input")),$(n).each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),s=e+"|"+t+"|"+a,o.push(s))}),n=$("#overlay-booking-module").hasClass("open")?(e=$("#overlay-booking-module").find('input[name="arrive"]').val(),t=$("#overlay-booking-module").find('select[name="start_hour"]').val(),a=$("#overlay-booking-module").find('select[name="end_hour"]').val(),i=$("#overlay-booking-module").find('input[name="guests"]').val(),r=$("#overlay-booking-module").find("#listing_id").val(),$("#overlay-booking-module").find("#reservation-security").val()):(e=$('input[name="arrive"]').val(),t=$('select[name="start_hour"]').val(),a=$('select[name="end_hour"]').val(),i=$('input[name="guests"]').val(),r=$("#listing_id").val(),$("#reservation-security").val()),e=homey_convert_date(e),homey_calculate_hourly_booking_cost(e,t,a,i,r,n,o)})),single_listing_guests=function(){$(".adult_plus").on("click",function(e){e.preventDefault();parseInt($('input[name="guests"]').val());var t=parseInt($('input[name="adult_guest"]').val()),e=parseInt($('input[name="child_guest"]').val());t++,$(".homey_adult").text(t),$('input[name="adult_guest"]').val(t);e=t+e;("yes"!=allow_additional_guests&&e==allowed_guests_num||"yes"==allow_additional_guests&&e==allowed_guests_plus_additional&&""!==num_additional_guests)&&($(".adult_plus").attr("disabled",!0),$(".child_plus").attr("disabled",!0)),$('input[name="guests"]').val(e)}),$(".adult_minus").on("click",function(e){e.preventDefault();parseInt($('input[name="guests"]').val());var t=parseInt($('input[name="adult_guest"]').val()),e=parseInt($('input[name="child_guest"]').val());0!=t&&(t--,$(".homey_adult").text(t),$('input[name="adult_guest"]').val(t),e=t+e,$('input[name="guests"]').val(e),$(".adult_plus").removeAttr("disabled"),$(".child_plus").removeAttr("disabled"))}),$(".child_plus").on("click",function(e){e.preventDefault();parseInt($('input[name="guests"]').val());var t=parseInt($('input[name="child_guest"]').val()),e=parseInt($('input[name="adult_guest"]').val());t++,$(".homey_child").text(t),$('input[name="child_guest"]').val(t);e=t+e;("yes"!=allow_additional_guests&&e==allowed_guests_num||"yes"==allow_additional_guests&&e==allowed_guests_plus_additional&&""!==num_additional_guests)&&($(".adult_plus").attr("disabled",!0),$(".child_plus").attr("disabled",!0)),$('input[name="guests"]').val(e)}),$(".child_minus").on("click",function(e){e.preventDefault();parseInt($('input[name="guests"]').val());var t=parseInt($('input[name="child_guest"]').val()),e=parseInt($('input[name="adult_guest"]').val());0!=t&&(t--,$(".homey_child").text(t),$('input[name="child_guest"]').val(t),e=t+e,$('input[name="guests"]').val(e),$(".adult_plus").removeAttr("disabled"),$(".child_plus").removeAttr("disabled"))})},single_listing_guests(),experience_id=$("#experience_id").val(),is_singular_experience&&($("#single-experience-date-range input").on("focus",function(){var e=$("#single-experience-date-range").find(".single-experience-booking-calendar-js"),t=$("#single-experience-date-range").find(".single-experience-main-calendar-js");void 0!==e&&(console.log("withinnnn..."),$(e).css("display","block"),$(e).addClass("arrive_active"),$(".single-form-guests-js").css("display","none"),focusedInput_2=$(this).attr("name"),$(e).removeClass("arrive_active depart_active").addClass(focusedInput_2+"_active")),void 0!==t&&(console.log("not withinnnn..."),$(t).css("display","block"),$(t).addClass("arrive_active"),$(".single-form-guests-js").css("display","none"),focusedInput_2=$(this).attr("name"),$(t).removeClass("arrive_active depart_active").addClass(focusedInput_2+"_active"))}),$("#mob-single-experience-date-range input").on("focus",function(){var e=$("#mob-single-experience-date-range").find(".single-experience-booking-calendar-js"),t=$("#mob-single-experience-date-range").find(".single-experience-main-calendar-js");void 0!==e&&($(e).css("display","block"),$(e).addClass("arrive_active"),$(".single-form-guests-js").css("display","none"),focusedInput_2=$(this).attr("name"),$(e).removeClass("arrive_active depart_active").addClass(focusedInput_2+"_active")),void 0!==t&&($(t).css("display","block"),$(t).addClass("arrive_active"),$(".single-form-guests-js").css("display","none"),focusedInput_2=$(this).attr("name"),$(t).removeClass("arrive_active depart_active").addClass(focusedInput_2+"_active"))}),$(".single-guests-js input").on("focus",function(){$(this).prev("label").css("display","block"),$(this).addClass("on-focus"),$(".single-form-guests-js").css("display","block")}),numClicks=0,toTimestamp_2=0,homey_calculate_exp_price_checkout=function(){var s,i=[];$(".homey_exp_extra_price input").each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),s=e+"|"+t+"|"+a,i.push(s))});var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$('input[name="exp_guests"]').val(),a=$("#experience_id").val(),r=$("#reservation-security").val();homey_calculate_exp_booking_cost(e,t,a,r,i),check_exp_availability_on_date_change(e,a,r)},homey_experiences_booking_dates=function(){$(".single-experience-booking-calendar-js ul li").on("click",function(){var e=$(this);if(e.show(),(e.hasClass("past-day")||e.hasClass("homey-not-available-for-booking"))&&!e.hasClass("reservation_start"))return!1;numClicks=2;var t=e.data("formatted-date"),a=e.data("timestamp"),s=e.data("availableSlotsInfo");console.log(" oooo "+s),$("#available_slots_by_date_text").text(""),$("#available_slots_by_date_text").text(s),toTimestamp_2=a,e.addClass("to-day selected"),$(".single-experience-booking-calendar-js").removeClass("depart_active").addClass("arrive_active");e=$('input[name="arrive"]').val(),e=homey_timeStamp_2(e);$('input[name="arrive"]').val(t);t=$('input[name="exp_guests"]').val();$("#single-booking-search-calendar, #single-overlay-booking-search-calendar").hide(),0<t&&homey_calculate_exp_price_checkout()})},homey_experiences_booking_dates(),$(".apply_exp_guests").on("click",function(){var s,i=[];$(".homey_exp_extra_price input").each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),s=e+"|"+t+"|"+a,i.push(s))});var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$('input[name="depart"]').val(),t=homey_convert_date(t),a=$('input[name="exp_guests"]').val(),r=$("#experience_id").val(),t=$("#reservation-security").val();homey_calculate_exp_booking_cost(e,a,r,t,i),check_exp_availability_on_date_change(e,r,t,i)}),$(".homey_exp_extra_price input").on("click",function(){var s,i=[];$(".homey_extra_price input").each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),s=e+"|"+t+"|"+a,i.push(s))});var e=$('input[name="arrive"]').val(),e=homey_convert_date(e),t=$('input[name="depart"]').val(),t=homey_convert_date(t),a=$('input[name="exp_guests"]').val(),r=$("#experience_id").val(),o=$("#reservation-security").val();homey_calculate_booking_cost(e,t,a,r,o,i)})),single_experience_guests=function(){$(".exp_adult_plus").on("click",function(e){e.preventDefault();parseInt($('input[name="exp_guests"]').val());var t=parseInt($('input[name="exp_adult_guest"]').val()),e=parseInt($('input[name="exp_child_guest"]').val());t++,$(".exp_homey_adult").text(t),$('input[name="exp_adult_guest"]').val(t);e=t+e;("yes"!=allow_additional_guests&&e==allowed_guests_num||"yes"==allow_additional_guests&&e==allowed_guests_plus_additional&&""!==num_additional_guests)&&($(".exp_adult_plus").attr("disabled",!0),$(".exp_child_plus").attr("disabled",!0)),$('input[name="exp_guests"]').val(e)}),$(".exp_adult_minus").on("click",function(e){e.preventDefault();parseInt($('input[name="exp_guests"]').val());var t=parseInt($('input[name="exp_adult_guest"]').val()),e=parseInt($('input[name="exp_child_guest"]').val());0!=t&&(t--,$(".exp_homey_adult").text(t),$('input[name="exp_adult_guest"]').val(t),e=t+e,$('input[name="exp_guests"]').val(e),$(".exp_adult_plus").removeAttr("disabled"),$(".exp_child_plus").removeAttr("disabled"))}),$(".exp_child_plus").on("click",function(e){e.preventDefault();parseInt($('input[name="exp_guests"]').val());var t=parseInt($('input[name="exp_child_guest"]').val()),e=parseInt($('input[name="exp_adult_guest"]').val());t++,$(".exp_homey_child").text(t),$('input[name="exp_child_guest"]').val(t);e=t+e;("yes"!=allow_additional_guests&&e==allowed_guests_num||"yes"==allow_additional_guests&&e==allowed_guests_plus_additional&&""!==num_additional_guests)&&($(".exp_adult_plus").attr("disabled",!0),$(".exp_child_plus").attr("disabled",!0)),$('input[name="exp_guests"]').val(e)}),$(".exp_child_minus").on("click",function(e){e.preventDefault();parseInt($('input[name="exp_guests"]').val());var t=parseInt($('input[name="exp_child_guest"]').val()),e=parseInt($('input[name="exp_adult_guest"]').val());0!=t&&(t--,$(".exp_homey_child").text(t),$('input[name="exp_child_guest"]').val(t),e=t+e,$('input[name="exp_guests"]').val(e),$(".exp_adult_plus").removeAttr("disabled"),$(".exp_child_plus").removeAttr("disabled"))})},single_experience_guests(),$("#request_for_reservation, #request_for_reservation_mobile").on("click",function(e){e.preventDefault();var $this=$(this),extra_options=[],temp_opt,check_in_date=$('input[name="arrive"]').val(),check_in_date=homey_convert_date(check_in_date),check_out_date=$('input[name="depart"]').val(),check_out_date=homey_convert_date(check_out_date),guest_message=$('textarea[name="guest_message"]').val();""==guest_message&&(guest_message=$("#overlay-booking-module").find('textarea[name="guest_message"]').val());var guests=$('input[name="guests"]').val(),adult_guest=$('input[name="adult_guest"]').val(),child_guest=$('input[name="child_guest"]').val(),listing_id=$("#listing_id").val(),new_reser_request_user_email=$("#new_reser_request_user_email").val();""==new_reser_request_user_email&&(new_reser_request_user_email=$("#overlay-booking-module").find("#new_reser_request_user_email").val());var security=$("#reservation-security").val(),notify=$this.parents(".homey_notification");notify.find(".notify").remove(),save_booking_details($('input[name="arrive"]').val(),$('input[name="depart"]').val(),guests,guest_message,adult_guest,child_guest,new_reser_request_user_email),$(".homey_extra_price input").each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),temp_opt="",temp_opt=(temp_opt=(temp_opt=e)+"|"+t)+"|"+a,extra_options.push(temp_opt))}),$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_add_reservation",check_in_date:check_in_date,check_out_date:check_out_date,guests:guests,listing_id:listing_id,extra_options:extra_options,guest_message:guest_message,new_reser_request_user_email:new_reser_request_user_email,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?($(".check_in_date, .check_out_date").val(""),notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>")):notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#request_for_exp_reservation, #request_for_exp_reservation_mobile").on("click",function(e){e.preventDefault();var $this=$(this),extra_options=[],temp_opt,check_in_date=$('input[name="arrive"]').val(),check_in_date=homey_convert_date(check_in_date),guest_message=$('textarea[name="exp_guest_message"]').val(),guests=$('input[name="exp_guests"]').val(),adult_guest=$('input[name="exp_adult_guest"]').val(),child_guest=$('input[name="exp_child_guest"]').val(),experience_id=$("#experience_id").val(),new_reser_exp_request_user_email=$("#new_reser_exp_request_user_email").val();""==new_reser_exp_request_user_email&&(new_reser_exp_request_user_email=$("#overlay-booking-module").find("#new_reser_exp_request_user_email").val());var security=$("#reservation-security").val(),notify=$this.parents(".homey_notification");notify.find(".notify").remove(),save_exp_booking_details($('input[name="arrive"]').val(),guests,guest_message,adult_guest,child_guest,new_reser_exp_request_user_email),$(".homey_exp_extra_price input").each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),temp_opt="",temp_opt=(temp_opt=(temp_opt=e)+"|"+t)+"|"+a,extra_options.push(temp_opt))}),$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_add_exp_reservation",check_in_date:check_in_date,guests:guests,experience_id:experience_id,extra_options:extra_options,guest_message:guest_message,new_reser_exp_request_user_email:new_reser_exp_request_user_email,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?($(".check_in_date, .check_out_date").val(""),notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>")):notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#request_hourly_reservation").on("click",function(e){e.preventDefault();var $this=$(this),check_in_date=$('input[name="arrive"]').val(),check_in_date=homey_convert_date(check_in_date),guest_message=$('textarea[name="guest_message"]').val();""==guest_message&&(guest_message=$("#overlay-booking-module").find('textarea[name="guest_message"]').val());var start_hour=$('select[name="start_hour"]').val(),end_hour=$('select[name="end_hour"]').val(),guests=$('input[name="guests"]').val(),listing_id=$("#listing_id").val(),new_reser_request_user_email=$("#new_reser_request_user_email").val(),security=$("#reservation-security").val(),notify=$this.parents(".homey_notification");notify.find(".notify").remove();var extra_options=[],temp_opt;$(".homey_extra_price input").each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),temp_opt="",temp_opt=(temp_opt=(temp_opt=e)+"|"+t)+"|"+a,extra_options.push(temp_opt))}),$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_add_hourly_reservation",check_in_date:check_in_date,start_hour:start_hour,end_hour:end_hour,guests:guests,extra_options:extra_options,guest_message:guest_message,listing_id:listing_id,new_reser_request_user_email:new_reser_request_user_email,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?($(".check_in_date, .check_out_date").val(""),notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>")):notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#request_hourly_reservation_mobile").on("click",function(e){e.preventDefault();var $this=$(this),check_in_date=$('input[name="arrive"]').val(),check_in_date=homey_convert_date(check_in_date),guest_message=$('textarea[name="guest_message"]').val();""==guest_message&&(guest_message=$("#overlay-booking-module").find('textarea[name="guest_message"]').val());var start_hour=$("#start_hour_overlay").val(),end_hour=$("#end_hour_overlay").val(),guests=$('input[name="guests"]').val(),listing_id=$("#listing_id").val(),new_reser_request_user_email=$("#overlay-booking-module").find("#new_reser_request_user_email").val(),security=$("#reservation-security").val(),notify=$this.parents(".homey_notification");notify.find(".notify").remove();var extra_options=[],temp_opt;$(".homey_extra_price input").each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),temp_opt="",temp_opt=(temp_opt=(temp_opt=e)+"|"+t)+"|"+a,extra_options.push(temp_opt))}),$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_add_hourly_reservation",check_in_date:check_in_date,start_hour:start_hour,end_hour:end_hour,guests:guests,extra_options:extra_options,guest_message:guest_message,listing_id:listing_id,new_reser_request_user_email:new_reser_request_user_email,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?($(".check_in_date, .check_out_date").val(""),notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>")):notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#reserve_period_host").on("click",function(e){e.preventDefault();var $this=$(this),check_in_date=$("#period_start_date").val(),check_out_date=$("#period_end_date").val(),listing_id=$("#period_listing_id").val(),period_note=$("#period_note").val(),security=$("#period-security").val(),notify=$(".homey_notification");notify.find(".notify").remove(),$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_reserve_period_host",check_in_date:check_in_date,check_out_date:check_out_date,period_note:period_note,listing_id:listing_id,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?(notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>"),window.location.href=calendar_link):notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#reserve_exp_period_host").on("click",function(e){e.preventDefault();var $this=$(this),check_in_date=$("#period_start_date").val(),check_out_date=$("#period_end_date").val(),experience_id=$("#period_experience_id").val(),period_note=$("#period_note").val(),security=$("#period-security").val(),notify=$(".homey_notification");notify.find(".notify").remove(),$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_reserve_exp_period_host",check_in_date:check_in_date,check_out_date:check_out_date,period_note:period_note,experience_id:experience_id,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?(notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>"),window.location.href=exp_calendar_link):notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),homey_hourly_availability_calendar=function(){var e,t,a,s,i=new Date,r=[],o=[],n="<div id='html_booked_info' style='display:none;'>";for(e in booked_hours_array)booked_hours_array.hasOwnProperty(e)&&""!==e&&((t=[]).title=HOMEY_ajax_vars.hc_reserved_label,t.start=moment.unix(e).utc().format(),t.end=moment.unix(booked_hours_array[e]).utc().format(),t.editable=!1,t.color="#fdd2d2",t.textColor="#444444",n+="<span data-start-hours='"+moment.unix(e).utc().format("h:mm")+"' data-end-hours='"+moment.unix(booked_hours_array[e]).utc().format("h:mm")+"' data-date='"+moment.unix(e).utc().format("D-M-Y")+"'></span>",r.push(t));for(a in n+="</div>",$("body").append(n),pending_hours_array)pending_hours_array.hasOwnProperty(a)&&""!==a&&((s=[]).title=HOMEY_ajax_vars.hc_pending_label,s.start=moment.unix(a).utc().format(),s.end=moment.unix(pending_hours_array[a]).utc().format(),s.editable=!1,s.color="#ffeedb",s.textColor="#333333",o.push(s));var _=$.merge(r,o),l=document.getElementById("homey_hourly_calendar");new FullCalendar.Calendar(l,{locale:HOMEY_ajax_vars.homey_current_lang,timeZone:HOMEY_ajax_vars.homey_timezone,plugins:["timeGrid"],defaultView:"timeGridWeek",slotDuration:"00:30:00",minTime:booking_start_hour,maxTime:booking_end_hour,events:_,defaultDate:i,selectHelper:!0,selectOverlap:!1,footer:!1,nowIndicator:!0,allDayText:HOMEY_ajax_vars.hc_hours_label,weekNumbers:!1,weekNumbersWithinDays:!0,weekNumberCalculation:"ISO",editable:!1,eventLimit:!0,unselectAuto:!1,isRTL:homey_is_rtl,buttonText:{today:HOMEY_ajax_vars.hc_today_label}}).render()},"per_hour"==homey_booking_type&&"yes"==is_listing_detail&&0<$("#homey_hourly_calendar").length&&homey_hourly_availability_calendar(),prev_date=$("#hourly_check_inn").val(),setInterval(function(){prev_date!=$("#hourly_check_inn").val()&&disable_hourlystart_and_end()},500),$("#instance_reservation, #instance_reservation_mobile").on("click",function(e){e.preventDefault();var extra_options=[],temp_opt,$this=$(this),check_in_date=$('input[name="arrive"]').val(),check_in_date=homey_convert_date(check_in_date),check_out_date=$('input[name="depart"]').val(),check_out_date=homey_convert_date(check_out_date),guests=$('input[name="guests"]').val(),adult_guest=$('input[name="adult_guest"]').val(),child_guest=$('input[name="child_guest"]').val(),guest_message=$('textarea[name="guest_message"]').val();""==guest_message&&(guest_message=$("#overlay-booking-module").find('textarea[name="guest_message"]').val());var listing_id=$("#listing_id").val(),security=$("#reservation-security").val(),notify=$this.parents(".homey_notification");notify.find(".notify").remove(),save_booking_details($('input[name="arrive"]').val(),$('input[name="depart"]').val(),guests,guest_message,adult_guest,child_guest),$(".homey_extra_price input").each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),temp_opt="",temp_opt=(temp_opt=(temp_opt=e)+"|"+t)+"|"+a,extra_options.push(temp_opt))}),$.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"homey_instance_booking",check_in_date:check_in_date,check_out_date:check_out_date,guests:guests,adult_guest:adult_guest,child_guest:child_guest,extra_options:extra_options,guest_message:guest_message,listing_id:listing_id,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?($(".check_in_date, .check_out_date").val(""),notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>"),window.location.href=e.instance_url):notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#instance_hourly_reservation, #instance_hourly_reservation_mobile").on("click",function(e){e.preventDefault();var $this=$(this),start_hour,end_hour,check_in_date=$('input[name="arrive"]').val(),check_in_date=homey_convert_date(check_in_date),start_hour=$('select[name="start_hour"]').val(),end_hour=$('select[name="end_hour"]').val(),guests=$('input[name="guests"]').val(),adult_guest=$('input[name="adult_guest"]').val(),child_guest=$('input[name="child_guest"]').val(),guest_message=$('textarea[name="guest_message"]').val();""==guest_message&&(guest_message=$("#overlay-booking-module").find('textarea[name="guest_message"]').val());var listing_id=$("#listing_id").val(),security=$("#reservation-security").val(),notify=$this.parents(".homey_notification");notify.find(".notify").remove(),save_hourl_booking_details($('input[name="arrive"]').val(),start_hour,end_hour,guests,guest_message,adult_guest,child_guest),(homey_is_mobile||homey_window_width<991)&&(start_hour=$("#start_hour_overlay").val(),end_hour=$("#end_hour_overlay").val());var extra_options=[],temp_opt;$(".homey_extra_price input").each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),temp_opt="",temp_opt=(temp_opt=(temp_opt=e)+"|"+t)+"|"+a,extra_options.push(temp_opt))}),$.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"homey_instance_hourly_booking",check_in_date:check_in_date,start_hour:start_hour,end_hour:end_hour,guests:guests,extra_options:extra_options,listing_id:listing_id,guest_message:guest_message,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?($(".check_in_date, .start_hour, .end_hour").val(""),notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>"),window.location.href=e.instance_url):notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#instance_exp_reservation, #instance_exp_reservation_mobile").on("click",function(e){e.preventDefault();var $this=$(this),check_in_date=$('input[name="arrive"]').val(),check_in_date=homey_convert_date(check_in_date),guests=$('input[name="exp_guests"]').val(),adult_guest=$('input[name="exp_adult_guest"]').val(),child_guest=$('input[name="exp_child_guest"]').val(),guest_message=$('textarea[name="exp_guest_message"]').val(),experience_id=$("#experience_id").val(),security=$("#reservation-security").val(),notify=$this.parents(".homey_notification");notify.find(".notify").remove(),save_exp_booking_details($('input[name="arrive"]').val(),guests,guest_message,adult_guest,child_guest),(homey_is_mobile||homey_window_width<991)&&(start_hour=$("#start_hour_overlay").val(),end_hour=$("#end_hour_overlay").val());var extra_options=[],temp_opt;$(".homey_exp_extra_price input").each(function(){var e,t,a;$(this).is(":checked")&&(e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type"),temp_opt="",temp_opt=(temp_opt=(temp_opt=e)+"|"+t)+"|"+a,extra_options.push(temp_opt))}),$.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"homey_instant_exp_booking",check_in_date:check_in_date,guests:guests,extra_options:extra_options,experience_id:experience_id,guest_message:guest_message,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?($(".check_in_date").val(""),notify.prepend('<div class="notify text-success text-center btn-success-outlined btn btn-full-width">'+e.message+"</div>"),window.location.href=e.instance_url):notify.prepend('<div class="notify text-danger text-center btn-danger-outlined btn btn-full-width">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$(".confirm-reservation").on("click",function(e){e.preventDefault();var $this=$(this),reservation_id=$this.data("reservation_id"),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_confirm_reservation",reservation_id:reservation_id},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?(parentDIV.find(".dashboard-area").prepend(e.message),$this.remove()):parentDIV.find(".dashboard-area").prepend(e.message)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$(".confirm-offsite-reservation").on("click",function(e){e.preventDefault();var $this=$(this),reservation_id=$this.data("reservation_id"),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_confirm_offsite_reservation",reservation_id:reservation_id},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?(parentDIV.find(".dashboard-area").prepend(e.message),$this.remove()):parentDIV.find(".dashboard-area").prepend(e.message)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#guest_paid_button").on("click",function(e){e.preventDefault();var $this=$(this),parentDIV=$this.parents(".user-dashboard-right"),reservation_id=$("#reservation_id").val();$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_guest_made_payment",reservation_id:reservation_id},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?(parentDIV.find(".dashboard-area").prepend(e.message),$this.remove()):parentDIV.find(".dashboard-area").prepend(e.message)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#decline").on("click",function(e){e.preventDefault();var $this=$(this),reservation_id=$("#reservationID").val(),reason=$("#reason22").val(),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_decline_reservation",reservation_id:reservation_id,reason:reason},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?($this.attr("disabled",!0),window.location.reload()):parentDIV.find(".dashboard-area").prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-hide="alert" aria-label="Close"><i class="homey-icon homey-icon-close"></i></button>'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#decline_hourly").on("click",function(e){e.preventDefault();var $this=$(this),reservation_id=$("#reservationID").val(),reason=$("#reason").val(),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_decline_hourly_reservation",reservation_id:reservation_id,reason:reason},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?($this.attr("disabled",!0),window.location.reload()):parentDIV.find(".dashboard-area").prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-hide="alert" aria-label="Close"><i class="homey-icon homey-icon-close"></i></button>'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#decline-reservation-btn").click(function(){console.log("..this that.."),$("html, body").animate({scrollTop:$("#decline-reservation").offset().top+150},"slow")}),$("#cancel-reservation-btn").click(function(){console.log("..this that.."),$("html, body").animate({scrollTop:$("#cancel-reservation").offset().top+150},"slow")}),$("#cancelled").on("click",function(e){e.preventDefault();var $this=$(this),reservation_id=$("#reservationID").val(),reason=$("#reason").val(),host_cancel=$("#host_cancel").val(),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_cancelled_reservation",reservation_id:reservation_id,host_cancel:host_cancel,reason:reason},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?($this.attr("disabled",!0),window.location.reload()):parentDIV.find(".dashboard-area").prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-hide="alert" aria-label="Close"><i class="homey-icon homey-icon-close"></i></button>'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#cancelled_hourly").on("click",function(e){e.preventDefault();var $this=$(this),reservation_id=$("#reservationID").val(),reason=$("#reason").val(),host_cancel=$("#host_cancel").val(),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_cancelled_hourly_reservation",reservation_id:reservation_id,host_cancel:host_cancel,reason:reason},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?($this.attr("disabled",!0),window.location.reload()):parentDIV.find(".dashboard-area").prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-hide="alert" aria-label="Close"><i class="homey-icon homey-icon-close"></i></button>'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$(".confirm-exp-reservation").on("click",function(e){e.preventDefault();var $this=$(this),reservation_id=$this.data("reservation_id"),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_confirm_exp_reservation",reservation_id:reservation_id},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?(parentDIV.find(".dashboard-area").prepend(e.message),$this.remove()):parentDIV.find(".dashboard-area").prepend(e.message)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#guest_paid_exp_button").on("click",function(e){e.preventDefault();var $this=$(this),parentDIV=$this.parents(".user-dashboard-right"),reservation_id=$("#reservation_id").val();$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_guest_made_payment",reservation_id:reservation_id},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?(parentDIV.find(".dashboard-area").prepend(e.message),$this.remove()):parentDIV.find(".dashboard-area").prepend(e.message)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#exp-decline").on("click",function(e){e.preventDefault();var $this=$(this),reservation_id=$("#reservationID").val(),reason=$("#reason22").val(),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_decline_reservation",reservation_id:reservation_id,reason:reason},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?($this.attr("disabled",!0),window.location.reload()):parentDIV.find(".dashboard-area").prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-hide="alert" aria-label="Close"><i class="homey-icon homey-icon-close"></i></button>'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("#decline-exp-reservation-btn").click(function(){$("html, body").animate({scrollTop:$("#decline-reservation").offset().top+150},"slow")}),$("#cancel-exp-reservation-btn").click(function(){$("html, body").animate({scrollTop:$("#cancel-reservation").offset().top+150},"slow")}),$("#exp-cancelled").on("click",function(e){e.preventDefault();var $this=$(this),reservation_id=$("#reservationID").val(),reason=$("#reason").val(),host_cancel=$("#host_cancel").val(),parentDIV=$this.parents(".user-dashboard-right");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_cancelled_reservation",reservation_id:reservation_id,host_cancel:host_cancel,reason:reason},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){parentDIV.find(".alert").remove(),e.success?($this.attr("disabled",!0),window.location.reload()):parentDIV.find(".dashboard-area").prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-hide="alert" aria-label="Close"><i class="homey-icon homey-icon-close"></i></button>'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),homey_booking_paypal_payment=function($this,reservation_id,security){$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_booking_paypal_payment",reservation_id:reservation_id,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>'),$("#homey_notify").html('<div class="alert alert-success alert-dismissible" role="alert">'+paypal_connecting+"</div>")},success:function(e){e.success?window.location.href=e.payment_execute_url:$("#homey_notify").html('<div class="alert alert-danger alert-dismissible" role="alert">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},homey_exp_booking_paypal_payment=function($this,reservation_id,security){$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_exp_booking_paypal_payment",reservation_id:reservation_id,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>'),$("#homey_notify").html('<div class="alert alert-success alert-dismissible" role="alert">'+paypal_connecting+"</div>")},success:function(e){e.success?window.location.href=e.payment_execute_url:$("#homey_notify").html('<div class="alert alert-danger alert-dismissible" role="alert">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},homey_hourly_booking_paypal_payment=function($this,reservation_id,security){$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_hourly_booking_paypal_payment",reservation_id:reservation_id,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>'),$("#homey_notify").html('<div class="alert alert-success alert-dismissible" role="alert">'+paypal_connecting+"</div>")},success:function(e){e.success?window.location.href=e.payment_execute_url:$("#homey_notify").html('<div class="alert alert-danger alert-dismissible" role="alert">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},$("#make_booking_payment").on("click",function(e){e.preventDefault();var t=$(this),a=$("#reservation_id").val(),s=$("#checkout-security").val(),e=$("input[name='payment_gateway']:checked").val();null==e&&$("#homey_notify").html('<div class="alert alert-danger alert-dismissible" role="alert">'+choose_gateway_text+"</div>"),"paypal"===e?homey_booking_paypal_payment(t,a,s):"stripe"===e&&($(this).parents(".dashboard-area").find(".homey_stripe_simple button").trigger("click"),$("#homey_notify").html(""))}),$("#make_exp_booking_payment").on("click",function(e){e.preventDefault();var t=$(this),a=$("#reservation_id").val(),s=$("#checkout-security").val(),e=$("input[name='payment_gateway']:checked").val();null==e&&$("#homey_notify").html('<div class="alert alert-danger alert-dismissible" role="alert">'+choose_gateway_text+"</div>"),"paypal"===e?homey_exp_booking_paypal_payment(t,a,s):"stripe"===e&&($(this).parents(".dashboard-area").find(".homey_stripe_simple button").trigger("click"),$("#homey_notify").html(""))}),$("#make_hourly_booking_payment").on("click",function(e){e.preventDefault();var t=$(this),a=$("#reservation_id").val(),s=$("#checkout-security").val(),e=$("input[name='payment_gateway']:checked").val();null==e&&$("#homey_notify").html('<div class="alert alert-danger alert-dismissible" role="alert">'+choose_gateway_text+"</div>"),"paypal"===e?homey_hourly_booking_paypal_payment(t,a,s):"stripe"===e&&($(this).parents(".dashboard-area").find(".homey_stripe_simple button").trigger("click"),$("#homey_notify").html(""))}),homey_instance_booking_paypal_payment=function($this,check_in,check_out,guests,extra_options,listing_id,renter_message,security,reservor_name,reservor_phone){$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_instance_booking_paypal_payment",check_in:check_in,check_out:check_out,guests:guests,extra_options:extra_options,listing_id:listing_id,renter_message:renter_message,security:security,reservor_name:reservor_name,reservor_phone:reservor_phone},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>'),$("#instance_noti").html('<div class="alert alert-success alert-dismissible" role="alert">'+paypal_connecting+"</div>")},success:function(e){e.success?window.location.href=e.payment_execute_url:$("#instance_noti").html('<div class="alert alert-danger alert-dismissible" role="alert">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},homey_instance_exp_booking_paypal_payment=function($this,check_in,guests,extra_options,experience_id,renter_message,security,reservor_name,reservor_phone){$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_instance_exp_booking_paypal_payment",check_in:check_in,guests:guests,extra_options:extra_options,experience_id:experience_id,renter_message:renter_message,security:security,reservor_name:reservor_name,reservor_phone:reservor_phone},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>'),$("#instance_noti").html('<div class="alert alert-success alert-dismissible" role="alert">'+paypal_connecting+"</div>")},success:function(e){e.success?window.location.href=e.payment_execute_url:$("#instance_noti").html('<div class="alert alert-danger alert-dismissible" role="alert">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},homey_hourly_instance_booking_paypal_payment=function($this,check_in,check_in_hour,check_out_hour,start_hour,end_hour,guests,extra_options,listing_id,renter_message,security){$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_hourly_instance_booking_paypal_payment",check_in:check_in,check_in_hour:check_in_hour,check_out_hour:check_out_hour,start_hour:start_hour,end_hour:end_hour,guests:guests,extra_options:extra_options,listing_id:listing_id,renter_message:renter_message,security:security},beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>'),$("#instance_noti").html('<div class="alert alert-success alert-dismissible" role="alert">'+paypal_connecting+"</div>")},success:function(e){e.success?window.location.href=e.payment_execute_url:$("#instance_noti").html('<div class="alert alert-danger alert-dismissible" role="alert">'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},$("#make_instance_booking_payment").on("click",function(e){e.preventDefault();var s,t=$(this),a=$("#check_in_date").val(),i=$("#check_out_date").val(),r=$("#guests").val(),o=$("#listing_id").val(),n=$("#renter_message").val(),_=$("#checkout-security").val(),l=$("#first-name").val()+" "+$("#last-name").val(),c=$("#phone").val(),d=[];$(".homey_extra_price").each(function(){var e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type");s=e+"|"+t+"|"+a,d.push(s)}),$("#instance_noti").empty();e=$("input[name='payment_gateway']:checked").val();null==e&&$("#instance_noti").html('<div class="alert alert-danger alert-dismissible" role="alert">'+choose_gateway_text+"</div>"),"paypal"===e?homey_instance_booking_paypal_payment(t,a,i,r,d,o,n,_,l,c):"stripe"===e&&$(this).parents("form").find(".homey_stripe_simple button").trigger("click")}),$("#make_instance_exp_booking_payment").on("click",function(e){e.preventDefault();var s,t=$(this),a=$("#check_in_date").val(),i=$("#guests").val(),r=$("#experience_id").val(),o=$("#renter_message").val(),n=$("#checkout-security").val(),_=$("#first-name").val()+" "+$("#last-name").val(),l=$("#phone").val(),c=[];$(".homey_extra_price").each(function(){var e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type");s=e+"|"+t+"|"+a,c.push(s)}),$("#instance_noti").empty();e=$("input[name='payment_gateway']:checked").val();null==e&&$("#instance_noti").html('<div class="alert alert-danger alert-dismissible" role="alert">'+choose_gateway_text+"</div>"),"paypal"===e?homey_instance_exp_booking_paypal_payment(t,a,i,c,r,o,n,_,l):"stripe"===e&&$(this).parents("form").find(".homey_stripe_simple button").trigger("click")}),$("#make_hourly_instance_booking_payment").on("click",function(e){e.preventDefault();var s,t=$(this),a=$("#check_in_date").val(),i=$("#check_in_hour").val(),r=$("#check_out_hour").val(),o=$("#start_hour").val(),n=$("#end_hour").val(),_=$("#guests").val(),l=$("#listing_id").val(),c=$("#renter_message").val(),d=$("#checkout-security").val(),u=[];$(".homey_extra_price").each(function(){var e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type");s=e+"|"+t+"|"+a,u.push(s)}),$("#instance_noti").empty();e=$("input[name='payment_gateway']:checked").val();null==e&&$("#instance_noti").html('<div class="alert alert-danger alert-dismissible" role="alert">'+choose_gateway_text+"</div>"),"paypal"===e?homey_hourly_instance_booking_paypal_payment(t,a,i,r,o,n,_,u,l,c,d):"stripe"===e&&$(this).parents("form").find(".homey_stripe_simple button").trigger("click")}),is_no_login_user_reg=$(".homey-booking-block-body-1").find("#email").val(),void 0!==is_no_login_user_reg&&""!=is_no_login_user_reg&&($(".homey-booking-block-title-2").removeClass("inactive mb-0"),$(".homey-booking-block-body-2").slideDown("slow"),$(".homey-booking-block-title-1").addClass("mb-0"),$(".homey-booking-block-body-1").slideUp("slow"),$(".homey-booking-block-title-1 .text-success, .homey-booking-block-title-1 .edit-booking-form").removeClass("hidden"),$(".homey-booking-block-title-1 .text-success, .homey-booking-block-title-1 .edit-booking-form").show(),renter_message=$("#renter_message").val(),$("#guest_message").val(renter_message)),first_name=$("#first-name").val(),last_name=$("#last-name").val(),phone=$("#phone").val(),renter_message=$("#renter_message").val(),""!=first_name&&""!=last_name&&""!=phone&&($(".homey-booking-block-title-2").removeClass("inactive mb-0"),$(".homey-booking-block-body-2").slideDown("slow"),$(".homey-booking-block-title-1").addClass("mb-0"),$(".homey-booking-block-body-1").slideUp("slow"),$(".homey-booking-block-title-1 .text-success, .homey-booking-block-title-1 .edit-booking-form").removeClass("hidden"),$(".homey-booking-block-title-1 .text-success, .homey-booking-block-title-1 .edit-booking-form").show(),$("#guest_message").val(renter_message)),$("button.homey-booking-step-1").on("click",function(e){e.preventDefault();var $this=$(this),first_name=$("#first-name").val(),last_name=$("#last-name").val(),email=$("#email").val();void 0===email&&(email="");var phone=$("#phone").val(),renter_message=$("#renter_message").val(),action_name="homey_instance_step_1";void 0!==$("#is-experience-step-1")&&(action_name="homey_exp_instance_step_1"),$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:action_name,first_name:first_name,last_name:last_name,email:email,phone:phone},beforeSend:function(){$this.children("i").remove(),$(".homey-booking-block-body-1 .continue-block-button p.error").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){""!=email&&($(".homey-booking-block-title-2, .homey-booking-block-title-3").remove(),document.location.reload(!0)),e.success?($(".homey-booking-block-title-2").removeClass("inactive mb-0"),$(".homey-booking-block-body-2").slideDown("slow"),$(".homey-booking-block-title-1").addClass("mb-0"),$(".homey-booking-block-body-1").slideUp("slow"),$(".homey-booking-block-title-1 .text-success, .homey-booking-block-title-1 .edit-booking-form").removeClass("hidden"),$(".homey-booking-block-title-1 .text-success, .homey-booking-block-title-1 .edit-booking-form").show(),$("#guest_message").val(renter_message)):$(".homey-booking-block-body-1 .continue-block-button").prepend('<p class="error text-danger"><i class="homey-icon homey-icon-close"></i> '+e.message+"</p>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner)}})}),$("button.homey-booking-step-2").on("click",function(e){e.preventDefault();e=$("input[name='agreement']:checked").val();$(".homey-booking-block-body-2 .continue-block-button p.error").remove(),null!=e?($(".homey-booking-block-title-3").removeClass("inactive mb-0"),$(".homey-booking-block-body-3").slideDown("slow"),$(".homey-booking-block-title-2").addClass("mb-0"),$(".homey-booking-block-body-2").slideUp("slow"),$(".homey-booking-block-title-2 .text-success, .homey-booking-block-title-2 .edit-booking-form").removeClass("hidden"),$(".homey-booking-block-title-2 .text-success, .homey-booking-block-title-2 .edit-booking-form").show()):$(".homey-booking-block-body-2 .continue-block-button").prepend('<p class="error text-danger"><i class="homey-icon homey-icon-close"></i> '+agree_term_text+"</p>")}),$(".homey-booking-block-title-1 .edit-booking-form").on("click",function(e){e.preventDefault(),$(".homey-booking-block-title-2, .homey-booking-block-title-3").addClass("mb-0"),$(".homey-booking-block-body-2, .homey-booking-block-body-3").slideUp("slow"),$(".homey-booking-block-title-1").removeClass("mb-0"),$(".homey-booking-block-body-1").slideDown("slow")}),$(".homey-booking-block-title-2 .edit-booking-form").on("click",function(e){e.preventDefault(),$(".homey-booking-block-title-1, .homey-booking-block-title-3").addClass("mb-0"),$(".homey-booking-block-body-1, .homey-booking-block-body-3").slideUp("slow"),$(".homey-booking-block-title-2").removeClass("mb-0"),$(".homey-booking-block-body-2").slideDown("slow")}),$(".contact_listing_host").on("click",function(e){e.preventDefault();var $this=$(this),$host_contact_wrap=$this.parents(".host-contact-wrap"),$form=$this.parents("form"),$messages=$host_contact_wrap.find(".homey_contact_messages");$.ajax({url:ajaxurl,data:$form.serialize(),method:$form.attr("method"),dataType:"JSON",beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?($messages.empty().append(e.msg),$form.find("input").val(""),$form.find("textarea").val("")):($messages.empty().append(e.msg),$this.children("i").removeClass(process_loader_spinner)),1==homey_reCaptcha&&homeyReCaptchaReset()},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner),$this.children("i").addClass(success_icon)}})}),$(".contact_experience_host").on("click",function(e){e.preventDefault();var $this=$(this),$host_contact_wrap=$this.parents(".host-contact-wrap"),$form=$this.parents("form"),$messages=$host_contact_wrap.find(".homey_contact_messages");$.ajax({url:ajaxurl,data:$form.serialize(),method:$form.attr("method"),dataType:"JSON",beforeSend:function(){$this.children("i").remove(),$this.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?($messages.empty().append(e.msg),$form.find("input").val(""),$form.find("textarea").val("")):($messages.empty().append(e.msg),$this.children("i").removeClass(process_loader_spinner)),1==homey_reCaptcha&&homeyReCaptchaReset()},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.children("i").removeClass(process_loader_spinner),$this.children("i").addClass(success_icon)}})}),$("#host_detail_contact").on("click",function(e){e.preventDefault();var current_element=$(this),$this=$(this),$form=$this.parents("form");$.ajax({type:"post",url:ajaxurl,data:$form.serialize(),method:$form.attr("method"),dataType:"JSON",beforeSend:function(){current_element.children("i").remove(),current_element.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){current_element.children("i").removeClass(process_loader_spinner),e.success?($("#form_messages").empty().append(e.msg),current_element.children("i").addClass(success_icon)):$("#form_messages").empty().append(e.msg),1==homey_reCaptcha&&homeyReCaptchaReset()},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})}),0<$(".homey-print").length&&$(".homey-print").on("click",function(e){var listingID,printWindow;e.preventDefault(),listingID=$(this).attr("data-listing-id"),printWindow=window.open("","Print Me","width=850 ,height=842"),$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_create_print",listing_id:listingID},success:function(e){printWindow.document.write(e),printWindow.document.close(),printWindow.focus()},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})}),0<$(".homey-print-experience").length&&$(".homey-print-experience").on("click",function(e){var experienceID,printWindow;e.preventDefault(),experienceID=$(this).attr("data-experience-id"),printWindow=window.open("","Print Me","width=850 ,height=842"),$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_create_experience_print",experience_id:experienceID},success:function(e){printWindow.document.write(e),printWindow.document.close(),printWindow.focus()},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})}),$(".homey_login_button").on("click",function(e){e.preventDefault();e=$(this);homey_login(e)}),$(".homey-register-button").on("click",function(e){e.preventDefault();e=$(this);homey_register(e)}),homey_login=function(current){var $form=current.parents("form"),$messages=$(".homey_login_messages"),$reservation_login_required=$("#reservation_login_required").val();$.ajax({type:"post",url:ajaxurl,dataType:"json",data:$form.serialize(),beforeSend:function(){$messages.empty().append('<p class="success text-success"> '+login_sending+"</p>"),jQuery(current).children("i").remove(),jQuery(current).prepend('<i class=" homey-icon homey-icon-loading-half fa-spinner"></i>')},success:function(e){if(e.success){$messages.empty().append('<p class="success text-success"><i class="homey-icon homey-icon-check-circle-1"></i> '+e.msg+"</p>");var t=jQuery(document).find("input[name='_wp_http_referer']").val();return 1==$reservation_login_required?(window.location.href=t,!1):("/"!=t&&"same_page"==login_redirect_type?-1!==t.indexOf("?")?window.location.href=t+"&n="+(new Date).getTime():window.location.href=t+"?n="+(new Date).getTime():"same_page"==login_redirect_type?window.location.reload(!0):-1!==t.indexOf("?")?window.location.href=login_redirect+"&n="+(new Date).getTime():window.location.href=login_redirect+"?n="+(new Date).getTime(),!1)}jQuery(current).children("i").remove(),$messages.empty().append('<p class="error text-danger"><i class="homey-icon homey-icon-close"></i> '+e.msg+"</p>"),1==homey_reCaptcha&&homeyReCaptchaReset()},error:function(xhr,status,error){jQuery(current).children("i").remove(),$messages.empty().append('<p class="error text-danger"><i class="homey-icon homey-icon-close"></i>'+HOMEY_ajax_vars.homey_login_register_msg_text+"</p>");var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},homey_register=function(currnt){var $form=currnt.parents("form"),$messages=$(".homey_register_messages");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:$form.serialize(),beforeSend:function(){$messages.empty().append('<p class="success text-success"> '+login_sending+"</p>"),jQuery(currnt).children("i").remove(),jQuery(currnt).prepend('<i class=" homey-icon homey-icon-loading-half fa-spinner"></i>')},success:function(e){e.success?($messages.empty().append('<p class="success text-success"><i class="homey-icon homey-icon-check-circle-1"></i> '+e.msg+"</p>"),$(".homey_login_messages").empty().append('<p class="success text-success"><i class="homey-icon homey-icon-check-circle-1"></i> '+e.msg+"</p>"),$("#modal-register").modal("hide"),$("#modal-login").modal("show")):(jQuery(currnt).children("i").remove(),$messages.empty().append('<p class="error text-danger"><i class="homey-icon homey-icon-close"></i> '+e.msg+"</p>")),1==homey_reCaptcha&&homeyReCaptchaReset(),1==homey_reCaptcha&&homeyReCaptchaReset()},error:function(xhr,status,error){jQuery(currnt).children("i").remove();var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},$("#homey_forgetpass").on("click",function(e){e.preventDefault();var user_login=$("#user_login_forgot").val(),security=$("#homey_resetpassword_security").val();$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_reset_password",user_login:user_login,security:security},beforeSend:function(){$("#homey_msg_reset").empty().append('<p class="success text-success"> '+login_sending+"</p>")},success:function(e){e.success?$("#homey_msg_reset").empty().append('<p class="success text-success"><i class="homey-icon homey-icon-check-circle-1"></i> '+e.msg+"</p>"):$("#homey_msg_reset").empty().append('<p class="error text-danger"><i class="homey-icon homey-icon-close"></i> '+e.msg+"</p>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})}),0<$("#homey_reset_password").length&&$("#homey_reset_password").on("click",function(e){e.preventDefault();var t=$(this),a=$('input[name="rp_login"]').val(),s=$('input[name="rp_key"]').val(),i=$('input[name="new_password"]').val(),e=$('input[name="homey_resetpassword_security"]').val();$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_reset_password_2",rq_login:a,password:i,rp_key:s,security:e},beforeSend:function(){t.children("i").remove(),t.prepend('<i class=" '+process_loader_spinner+'"></i>')},success:function(e){e.success?($("#password_reset_msgs, .homey_login_messages").empty().append('<p class="success text-success"><i class="homey-icon homey-icon-check-circle-1"></i> '+e.msg+"</p>"),$("#new_password").val(""),$("#modal-login").modal("show")):$("#password_reset_msgs").empty().append('<p class="error text-danger"><i class="homey-icon homey-icon-close"></i> '+e.msg+"</p>")},error:function(e){},complete:function(){t.children("i").removeClass(process_loader_spinner)}})}),$(".homey-facebook-login").on("click",function(){var e=$(this);homey_login_via_facebook(e)}),homey_login_via_facebook=function(current){var $form=current.parents("form"),$messages=$(".homey_login_messages");$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_facebook_login_oauth"},beforeSend:function(){$messages.empty().append('<p class="success text-success"> '+login_sending+"</p>")},success:function(e){window.location.href=e},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},$(".homey-yahoo-login").on("click",function(){var e=$(this);homey_login_via_yahoo(e)}),homey_login_via_yahoo=function(current){var $form=current.parents("form"),$messages=$(".homey_login_messages");$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_yahoo_login"},beforeSend:function(){$messages.empty().append('<p class="success text-success"> '+login_sending+"</p>")},success:function(e){window.location.href=e},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},$(".homey-google-login").on("click",function(){var e=$(this);homey_login_via_google(e)}),homey_login_via_google=function(current){var $form=current.parents("form"),$messages=$(".homey_login_messages");$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_google_login_oauth"},beforeSend:function(){$messages.empty().append('<p class="success text-success"> '+login_sending+"</p>")},success:function(e){window.location.href=e},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},homey_message_notifications=function(){$.ajax({url:ajaxurl,data:{action:"homey_chcek_messages_notifications"},method:"POST",dataType:"JSON",beforeSend:function(){},success:function(e){e.success&&(e.notification?($(".user-alert").show(),$(".msg-alert").show()):($(".user-alert").hide(),$(".msg-alert").hide()))}})},homey_booking_notification=function(){$.ajax({url:ajaxurl,data:{action:"homey_booking_notification"},method:"POST",dataType:"JSON",beforeSend:function(){},success:function(e){e.success&&(0!=e.notification?$(".new-booking-alert").show():$(".new-booking-alert").hide())}})},$(document).ready(function(){homey_message_notifications(),0!=parseInt(userID,10)&&setInterval(function(){homey_message_notifications()},6e4),homey_booking_notification(),0!=parseInt(userID,10)&&setInterval(function(){homey_booking_notification()},6e4)}),$(".btn_extra_expense").on("click",function(e){e.preventDefault();$("#resrv_id").val()}),$(".homey-woocommerce-featured-pay").on("click",function(e){e.preventDefault();var t=$(this).data("listid"),a=$(this).data("featured");homey_processing_modal(processing_text),$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_featured_woo_pay",listing_id:t,is_featured:a},success:function(e){0!=e.success?(e=HOMEY_ajax_vars.woo_checkout_url+"?listing_id="+t+"&is_featured="+a,window.location.href=e):$("#homey_modal").modal("hide")},error:function(e){}})}),$(".homey-woocommerce-featured-pay-exp").on("click",function(e){e.preventDefault();var t=$(this).data("experienceId"),a=$(this).data("featured");homey_processing_modal(processing_text),$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_featured_woo_pay_exp",experience_id:t,is_featured:a},success:function(e){0!=e.success?(e=HOMEY_ajax_vars.woo_checkout_url+"?experience_id="+t+"&is_featured="+a,window.location.href=e):$("#homey_modal").modal("hide")},error:function(e){}})}),$(".homey-woo-reservation-pay").on("click",function(e){e.preventDefault();var t=$(this).data("reservation_id");homey_processing_modal(processing_text),$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_reservation_woo_pay",reservation_id:t},success:function(e){0!=e.success?(e=HOMEY_ajax_vars.woo_checkout_url+"?reservation_id="+t,window.location.href=e):$("#homey_modal").modal("hide")},error:function(e){}})}),$(".homey-woo-exp-reservation-pay").on("click",function(e){e.preventDefault();var t=$(this).data("reservation_id");homey_processing_modal(processing_text),$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_reservation_woo_exp_pay",reservation_id:t},success:function(e){0!=e.success?(e=HOMEY_ajax_vars.woo_checkout_url+"?reservation_id="+t,window.location.href=e):$("#homey_modal").modal("hide")},error:function(e){}})}),$("#make_woocommerce_instant_experience_payment").on("click",function(e){e.preventDefault(),homey_processing_modal(processing_text);$(this);var s,t=$("#check_in_date").val(),a=$("#guests").val(),i=$("#experience_id").val(),r=$("#renter_message").val(),o=($("#checkout-security").val(),[]);$(".homey_extra_price").each(function(){var e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type");s=e+"|"+t+"|"+a,o.push(s)}),$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_instant_reservation_woo_exp_pay",check_in:t,guests:a,extra_options:o,experience_id:i,renter_message:r},success:function(e){0!=e.success?(e=HOMEY_ajax_vars.woo_checkout_url+"?check_in="+t+"&guests="+a+"&extra_options[]="+o+"&experience_id="+i+"&renter_message="+r,console.log(e),window.location.href=e):$("#homey_modal").modal("hide")},error:function(e){}})}),$("#make_woocommerce_instant_booking_payment").on("click",function(e){e.preventDefault(),homey_processing_modal(processing_text);$(this);var s,t=$("#check_in_date").val(),a=$("#check_out_date").val(),i=$("#guests").val(),r=$("#listing_id").val(),o=$("#renter_message").val(),n=($("#checkout-security").val(),[]);$(".homey_extra_price").each(function(){var e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type");s=e+"|"+t+"|"+a,n.push(s)}),$.ajax({type:"POST",url:ajaxurl,data:{action:"homey_instant_reservation_woo_pay",check_in:t,check_out:a,guests:i,extra_options:n,listing_id:r,renter_message:o},success:function(e){0!=e.success?(e=HOMEY_ajax_vars.woo_checkout_url+"?check_in="+t+"&check_out="+a+"&guests="+i+"&extra_options[]="+n+"&listing_id="+r+"&renter_message="+o,window.location.href=e):$("#homey_modal").modal("hide")},error:function(e){}})}),$("#make_hourly_woocommerce_instant_booking_payment").on("click",function(e){e.preventDefault(),homey_processing_modal(processing_text);var $this=$(this),check_in=$("#check_in_date").val(),check_in_hour=$("#check_in_hour").val(),check_out_hour=$("#check_out_hour").val(),start_hour=$("#start_hour").val(),end_hour=$("#end_hour").val(),guests=$("#guests").val(),listing_id=$("#listing_id").val(),renter_message=$("#renter_message").val(),security=$("#checkout-security").val(),extra_options=[],temp_opt;$(".homey_extra_price").each(function(){var e=$(this).data("name"),t=$(this).data("price"),a=$(this).data("type");temp_opt="",temp_opt=(temp_opt=(temp_opt=e)+"|"+t)+"|"+a,extra_options.push(temp_opt)}),$("#instance_noti").empty(),$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_instant_hourly_reservation_woo_pay",check_in:check_in,check_in_hour:check_in_hour,check_out_hour:check_out_hour,start_hour:start_hour,end_hour:end_hour,guests:guests,extra_options:extra_options,listing_id:listing_id,renter_message:renter_message,security:security},success:function(e){0!=e.success?(e=HOMEY_ajax_vars.woo_checkout_url+"?start_hour="+start_hour+"&end_hour="+end_hour+"&check_in="+check_in+"&check_in_hour="+check_in_hour+"&check_out_hour="+check_out_hour+"&guests="+guests+"&extra_options[]="+extra_options+"&listing_id="+listing_id+"&renter_message="+renter_message,window.location.href=e):$("#homey_modal").modal("hide")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})}),0<$("#has_social_account").data("hasSocialAccount")&&($("#modal-login").modal("show"),$(".homey_login_messages").empty().append('<p class="error text-danger"><i class="homey-icon homey-icon-close"></i>'+already_login_text+"</p>"))),jQuery("body").hasClass("single-listing")&&(extra_options=[],jQuery(".homey_extra_price input").each(function(){var e,t,a;jQuery(this).is(":checked")&&(e=jQuery(this).data("name"),t=jQuery(this).data("price"),a=jQuery(this).data("type"),temp_opt="",temp_opt=(temp_opt=(temp_opt=e)+"|"+t)+"|"+a,extra_options.push(temp_opt))}),check_in_date=jQuery('input[name="arrive"]').val(),check_in_date=homey_convert_date(check_in_date),start_hour=jQuery('select[name="start_hour"]').val(),end_hour=jQuery('select[name="end_hour"]').val(),guests=jQuery('input[name="guests"]').val(),listing_id=jQuery("#listing_id").val(),security=jQuery("#reservation-security").val(),void 0!==start_hour&&void 0!==end_hour&&homey_calculate_hourly_booking_cost(check_in_date,start_hour,end_hour,guests,listing_id,security,extra_options)),jQuery("#place_order").click(function(){jQuery("html, body").animate({scrollTop:jQuery(".woocommerce-info").offset().top},"slow")}),jQuery(".approve_listing").click(function(){var listing_id=jQuery(this).data("approval-listing-id");jQuery(this).text("..."),$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"homey_approve_listing",listing_id:listing_id},success:function(e){0!=e.success&&window.location.reload()},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})});var payment_gateway=$(".homey_check_gateway:checked").val();function select_payment_gateway(e){"stripe"==e?($("#without_stripe").hide(),$("#stripe_main_wrap").show(),$(".payment-buttons").css("display","none")):($("#without_stripe").show(),$("#stripe_main_wrap").hide(),$(".payment-buttons").css("display","block"))}$(".homey_check_gateway").on("click",function(){select_payment_gateway($(this).val())}),void 0!==payment_gateway&&select_payment_gateway(payment_gateway)});
Back to Directory
File Manager