1var start_time_checking_index;function wpbc_is_date_has_only_working_time_limits_for_dots(date_bookings_obj,child_resources_arr){var has_working_time_limits=false;var has_real_time_limits=false;var resource_day_obj;var time_details_obj;var time_details;var source_type;if((!date_bookings_obj)||(null===child_resources_arr)){return false;} 2if((date_bookings_obj['summary'])&&(date_bookings_obj['summary']['status_for_bookings'])&&(''!==date_bookings_obj['summary']['status_for_bookings'])){return false;} 3for(var i=0;i<child_resources_arr.length;i++){resource_day_obj=date_bookings_obj[child_resources_arr[i]];if(!resource_day_obj){continue;} 4time_details_obj=resource_day_obj['__booked__times__details'];if(!time_details_obj){if((resource_day_obj.booked_time_slots)&&(resource_day_obj.booked_time_slots.merged_seconds)&&(resource_day_obj.booked_time_slots.merged_seconds.length>0)){has_real_time_limits=true;} 5continue;} 6for(var time_key in time_details_obj){if(!time_details_obj.hasOwnProperty(time_key)){continue;} 7time_details=time_details_obj[time_key];source_type=(time_details&&('undefined'!==typeof(time_details['source_type'])))?time_details['source_type']:'booking';if('working_time'===source_type){has_working_time_limits=true;}else{has_real_time_limits=true;}}} 8return(has_working_time_limits&&!has_real_time_limits);} 9function wpbc_show_date_info_top(param_calendar_id,my_thisDateTime){var resource_id=parseInt(param_calendar_id.replace("calendar_booking",''));if(isNaN(resource_id)){return'';} 10var child_resources_arr=wpbc_clone_obj(_wpbc.booking__get_param_value(resource_id,'resources_id_arr__in_dates'));var sql_date=wpbc__get__sql_class_date(new Date(my_thisDateTime));var date_bookings_obj=_wpbc.bookings_in_calendar__get_for_date(resource_id,sql_date);if(wpbc_is_date_has_only_working_time_limits_for_dots(date_bookings_obj,child_resources_arr)){return'';} 11var child_resource_id;var merged_seconds;var dots_count=0;var dots_in__resources=[];if(child_resources_arr!==null){for(child_resource_id of child_resources_arr){if(false!==date_bookings_obj){merged_seconds=date_bookings_obj[child_resource_id].booked_time_slots.merged_seconds;}else{merged_seconds=[];} 12if(0===merged_seconds.length){return'';} 13for(var i=0;i<merged_seconds.length;i++){if(!wpbc_is_this_timeslot__full_day_booked(merged_seconds[i])){dots_count++;}} 14dots_in__resources.push(dots_count);dots_count=0;}} 15var dots_count_max=Math.max.apply(Math,dots_in__resources);var dot_content='';for(var d=0;d<dots_count_max;d++){dot_content+='·';} 16dot_content=(''!==dot_content)?'<div class="wpbc_time_dots">'+dot_content+'</div>':'';return dot_content;} 17function wpbc_show_date_info_bottom(param_calendar_id,my_thisDateTime){var bottom_hint_arr=[];if(typeof(wpbc_show_day_cost_in_date_bottom)=='function'){var cost_hint=wpbc_show_day_cost_in_date_bottom(param_calendar_id,my_thisDateTime);if(''!==cost_hint){bottom_hint_arr.push(wpbc_show_day_cost_in_date_bottom(param_calendar_id,my_thisDateTime));}} 18var availability=wpbc_get_in_date_availability_hint(param_calendar_id,my_thisDateTime) 19if(''!==availability){bottom_hint_arr.push(availability);} 20var bottom_hint=bottom_hint_arr.join('');return bottom_hint;} 21function wpbc_get_in_date_availability_hint(param_calendar_id,my_thisDateTime){var resource_id=parseInt(param_calendar_id.replace("calendar_booking",''));var sql_date=wpbc__get__sql_class_date(new Date(my_thisDateTime));var hint__in_day__availability='';var get_for_date_obj=_wpbc.bookings_in_calendar__get_for_date(resource_id,sql_date);if(false!==get_for_date_obj){if((undefined!=get_for_date_obj['summary'])&&(undefined!=get_for_date_obj['summary'].hint__in_day__availability)){hint__in_day__availability=get_for_date_obj['summary'].hint__in_day__availability;}} 22return hint__in_day__availability;} 23jQuery(window).on('scroll',function(event){if('function'===typeof(wpbc_tippy)){wpbc_tippy.hideAll();}});function wpbc_is_time_field_in_booking_form(resource_id,form_elements){var count=form_elements.length;var start_time=false;var end_time=false;var duration=false;var element;for(var i=0;i<count;i++){element=form_elements[i];if(jQuery(element).closest('.booking_form_garbage').length){continue;} 24if((element.name!=undefined)&&(element.name.indexOf('hint')!==-1)){var my_element=element.name;if(my_element.indexOf('rangetime')!==-1){return true;} 25if((my_element.indexOf('durationtime')!==-1)){duration=element.value;} 26if(my_element.indexOf('starttime')!==-1){start_time=element.value;} 27if(my_element.indexOf('endtime')!==-1){end_time=element.value;}}} 28if((duration!==false)&&(start_time!==false)){return true;} 29if((start_time!==false)&&(end_time!==false)){return true;} 30return false;}
31function wpbc_is_change_over_enabled_for_resource(resource_id){if(('undefined'!==typeof resource_id)&&(null!==resource_id)){var resource_change_over=_wpbc.calendar__get_param_value(resource_id,'is_enabled_change_over');if(''!==resource_change_over){return(true===resource_change_over)||('true'===resource_change_over);}} 32return true===_wpbc.get_other_param('is_enabled_change_over');} 33function wpbc_is_time_in_the_past_for_today(myTime,sort_date_array,resource_id){var allow_past_context=_wpbc.get_other_param('this_page_allow_past');var edit_booking_hash_context=_wpbc.get_other_param('this_page_booking_hash');if(('1'===String(allow_past_context))||(1===allow_past_context)||(true===allow_past_context)||(''!==String(edit_booking_hash_context||''))||(location.href.indexOf('booking_hash')>-1)||(location.href.indexOf('allow_past')>-1)){return false;} 34if(true===wpbc_is_change_over_enabled_for_resource(resource_id)){return false;} 35var date_to_check=sort_date_array[0];if(parseInt(date_to_check[0])<parseInt(_wpbc.get_other_param('today_arr')[0])){return true;} 36if((parseInt(date_to_check[0])==parseInt(_wpbc.get_other_param('today_arr')[0]))&&(parseInt(date_to_check[1])<parseInt(_wpbc.get_other_param('today_arr')[1]))){return true;} 37if((parseInt(date_to_check[0])==parseInt(_wpbc.get_other_param('today_arr')[0]))&&(parseInt(date_to_check[1])==parseInt(_wpbc.get_other_param('today_arr')[1]))&&(parseInt(date_to_check[2])<parseInt(_wpbc.get_other_param('today_arr')[2]))){return true;} 38if((parseInt(date_to_check[0])==parseInt(_wpbc.get_other_param('today_arr')[0]))&&(parseInt(date_to_check[1])==parseInt(_wpbc.get_other_param('today_arr')[1]))&&(parseInt(date_to_check[2])==parseInt(_wpbc.get_other_param('today_arr')[2]))){var mytime_value=myTime.split(":");mytime_value=parseInt(mytime_value[0])*60+parseInt(mytime_value[1]);var current_time_value=parseInt(_wpbc.get_other_param('today_arr')[3])*60+parseInt(_wpbc.get_other_param('today_arr')[4]);if(current_time_value>mytime_value){return true;}} 39return false;} 40function wpbc_is_valid_time_string(time_str){if(typeof time_str!=='string'){return false;} 41const str=time_str.trim();if(str===''){return false;} 42const match=str.match(/^(\d{1,2}):(\d{2})(?:\s*([AaPp][Mm]))?$/);if(!match){return false;} 43const hour=Number(match[1]);const minute=Number(match[2]);const ampm=match[3]?match[3].toUpperCase():null;if(!Number.isInteger(hour)||!Number.isInteger(minute)){return false;} 44if(minute<0||minute>59){return false;} 45if(ampm){return hour>=1&&hour<=12;} 46if(hour<0||hour>24){return false;} 47if(hour===24&&minute!==0){return false;} 48return true;} 49function wpbc_is_this_time_selection_not_available(resource_id,form_elements){if((location.href.indexOf('page=wpbc')>0)&&(location.href.indexOf('tab=add-booking')>0)){return false;} 50var count=form_elements.length;var start_time=false;var end_time=false;var duration=false;var element;var element_start=false;var element_end=false;var element_duration=false;var element_rangetime=false;for(var i=0;i<count;i++){element=form_elements[i];if(jQuery(element).closest('.booking_form_garbage').length){continue;} 51if('1'===String(jQuery(element).attr('data-wpbc-booking-submit-ignore')||'')){continue;} 52if((element.name!=undefined)&&(element.name.indexOf('hint')===-1)){var my_element=element.name;if(my_element.indexOf('rangetime')!==-1){if(element.value==''){var notice_message_id=wpbc_front_end__show_message__warning(element,_wpbc.get_message('message_check_required'),'text');return true;} 53var my_rangetime=element.value.split('-');if(my_rangetime.length>1){start_time=my_rangetime[0].replace(/(^\s+)|(\s+$)/g,"");end_time=my_rangetime[1].replace(/(^\s+)|(\s+$)/g,"");element_rangetime=element;}} 54if((my_element.indexOf('durationtime')!==-1)){duration=element.value;element_duration=element;} 55if(my_element.indexOf('starttime')!==-1){start_time=element.value;element_start=element;} 56if(my_element.indexOf('endtime')!==-1){end_time=element.value;element_end=element;}}} 57if((duration!==false)&&(start_time!==false)){var mylocalstarttime=start_time.split(':');var d=new Date(1980,1,1,mylocalstarttime[0],mylocalstarttime[1],0);var my_duration=duration.split(':');my_duration=my_duration[0]*60*60*1000+my_duration[1]*60*1000;d.setTime(d.getTime()+my_duration);var my_hours=d.getHours();if(my_hours<10)my_hours='0'+(my_hours+'');var my_minutes=d.getMinutes();if(my_minutes<10)my_minutes='0'+(my_minutes+'');end_time=(my_hours+'')+':'+(my_minutes+'');
57if(end_time=='00:00')end_time='23:59';} 58if((start_time===false)||(end_time===false)){return false;}else{var valid_time=true;if((start_time=='')||(end_time==''))valid_time=false;if(!wpbc_is_valid_time_string(start_time))valid_time=false;if(!wpbc_is_valid_time_string(end_time))valid_time=false;if(valid_time===true) 59if((typeof(checkRecurentTimeInside)=='function')&&(_wpbc.get_other_param('is_enabled_booking_recurrent_time')==true)){valid_time=checkRecurentTimeInside([start_time,end_time],resource_id);}else{if(typeof(checkTimeInside)=='function'){valid_time=checkTimeInside(start_time,true,resource_id);} 60if(valid_time===true){if(typeof(checkTimeInside)=='function'){valid_time=checkTimeInside(end_time,false,resource_id);}}} 61if(valid_time!==true){if((wpbc_is_change_over_enabled_for_resource(resource_id))&&(element_start!==false)&&(element_end!==false)){wpbc_front_end__show_message__warning('#booking_form_div'+resource_id+' .bk_calendar_frame',_wpbc.get_message('message_check_no_selected_dates'),'text');} 62if(element_rangetime!==false){wpbc_front_end__show_message__warning_under_element(element_rangetime,_wpbc.get_message('message_error_range_time'),'text');} 63if(element_duration!==false){wpbc_front_end__show_message__warning_under_element(element_duration,_wpbc.get_message('message_error_duration_time'),'text');} 64if(element_start!==false){wpbc_front_end__show_message__warning_under_element(element_start,_wpbc.get_message('message_error_start_time'),'text');} 65if(element_end!==false){wpbc_front_end__show_message__warning_under_element(element_end,_wpbc.get_message('message_error_end_time'),'text');} 66return true;}else{return false;}}} 67function checkTimeInside(mytime,is_start_time,bk_type){var my_dates_str=document.getElementById('date_booking'+bk_type).value;if(my_dates_str.indexOf(' - ')!=0){my_dates_str=my_dates_str.replace(' - ',', ');} 68return checkTimeInsideProcess(mytime,is_start_time,bk_type,my_dates_str);} 69function checkRecurentTimeInside(my_rangetime,bk_type){var valid_time=true;var my_dates_str=document.getElementById('date_booking'+bk_type).value;var date_array=my_dates_str.split(", ");if(date_array.length==2){if(date_array[0]==date_array[1]){date_array=[date_array[0]];}} 70var temp_date_str='';for(var i=0;i<date_array.length;i++){temp_date_str=date_array[i];if(checkTimeInsideProcess(my_rangetime[0],true,bk_type,temp_date_str)==false)valid_time=false;if(checkTimeInsideProcess(my_rangetime[1],false,bk_type,temp_date_str)==false)valid_time=false;} 71return valid_time;} 72function checkTimeInsideProcess(mytime,is_start_time,bk_type,my_dates_str){var i,h,s,m;var date_array=my_dates_str.split(',');date_array=date_array.map(function(s){return s.trim();});if(date_array.length==2){if(date_array[0]==date_array[1]){date_array=[date_array[0]];}} 73var temp_elemnt;var td_class;var sort_date_array=[];var work_date_array=[];var times_array=[];var is_check_for_time;for(var i=0;i<date_array.length;i++){temp_elemnt=date_array[i].split(".");sort_date_array[i]=[temp_elemnt[2],temp_elemnt[1]+'',temp_elemnt[0]+''];} 74sort_date_array.sort();for(i=0;i<sort_date_array.length;i++){sort_date_array[i]=[parseInt(sort_date_array[i][0]*1),parseInt(sort_date_array[i][1]*1),parseInt(sort_date_array[i][2]*1)];} 75if(is_start_time){if(wpbc_is_time_in_the_past_for_today(mytime,sort_date_array,bk_type)){return false;}} 76work_date_array=sort_date_array;for(var j=0;j<work_date_array.length;j++){td_class=work_date_array[j][1]+'-'+work_date_array[j][2]+'-'+work_date_array[j][0];if((j==0)||(j==(work_date_array.length-1)))is_check_for_time=true;else is_check_for_time=false;} 77if(is_start_time)work_date_array=sort_date_array[0];else work_date_array=sort_date_array[sort_date_array.length-1];td_class=work_date_array[1]+'-'+work_date_array[2]+'-'+work_date_array[0];times_array.sort();var times_in_day=[];var times_in_day_interval_marks=[];for(i=0;i<times_array.length;i++){s=times_array[i][2];if((s==2)&&(i==0)){times_in_day[times_in_day.length]=0;times_in_day_interval_marks[times_in_day_interval_marks.length]=1;} 78times_in_day[times_in_day.length]=times_array[i][0]*60+parseInt(times_array[i][1]);times_in_day_interval_marks[times_in_day_interval_marks.length]=s;if((s==1)&&(i==(times_array.length-1))){times_in_day[times_in_day.length]=(24*60);times_in_day_interval_marks[times_in_day_interval_marks.length]=2;}} 79var mytime_value=mytime.split(":");mytime_value=mytime_value[0]*60+parseInt(mytime_value[1]);var start_i=0;if(start_time_checking_index!=undefined) 80if(start_time_checking_index[0]!=undefined) 81if((!is_start_time)&&(sort_date_array.length==1)){start_i=start_time_checking_index[0];} 82i=start_i;for(i=start_i;i<times_in_day.length;i++){times_in_day[i]=parseInt(times_in_day[i]);mytime_value=parseInt(mytime_value);if(is_start_time){if(mytime_value>times_in_day[i]){}
82else if(mytime_value==times_in_day[i]){if(times_in_day_interval_marks[i]==1){return false;}else{if((i+1)<=(times_in_day.length-1)){if(times_in_day[i+1]<=mytime_value)return false;else{if(sort_date_array.length>1) 83if((i+1)<=(times_in_day.length-1))return false;start_time_checking_index=[i,td_class,mytime_value];return true;}} 84if(sort_date_array.length>1) 85if((i+1)<=(times_in_day.length-1))return false;start_time_checking_index=[i,td_class,mytime_value];return true;}}else if(mytime_value<times_in_day[i]){if(times_in_day_interval_marks[i]==2){return false;}else{if(sort_date_array.length>1) 86if((i+1)<=(times_in_day.length-1))return false;start_time_checking_index=[i,td_class,mytime_value];return true;}}}else{if(sort_date_array.length==1){if(start_time_checking_index!=undefined) 87if(start_time_checking_index[2]!=undefined) 88if((start_time_checking_index[2]==times_in_day[i])&&(times_in_day_interval_marks[i]==2)){}else if(times_in_day[i]<mytime_value)return false;else{if(start_time_checking_index[2]>=mytime_value)return false;return true;}}else{if(times_in_day[i]<mytime_value)return false;else return true;}}} 89if(is_start_time)start_time_checking_index=[i,td_class,mytime_value];else{if(start_time_checking_index!=undefined) 90if(start_time_checking_index[2]!=undefined) 91if((sort_date_array.length==1)&&(start_time_checking_index[2]>=mytime_value))return false;} 92return true;}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.