{"version":3,"sources":["../../lib/assets/javascripts/os-time.js","../../lib/assets/javascripts/os-shared.js","../../lib/assets/javascripts/os-notifications.js","../../lib/assets/javascripts/os-actions.js","../../lib/assets/javascripts/main_front.js","../../lib/assets/javascripts/os-payments-braintree.js","../../lib/assets/javascripts/os-payments-paypal.js"],"names":["latepoint_is_timeframe_in_periods","timeframe_start","timeframe_end","periods_arr","is_inside","arguments","length","undefined","i","period_start","period_end","buffer_before","buffer_after","period_info","split","parseFloat","latepoint_is_period_inside_another","latepoint_is_period_overlapping","period_one_start","period_one_end","period_two_start","period_two_end","latepoint_minutes_to_hours_preferably","time","army_clock","latepoint_is_army_clock","hours","Math","floor","minutes","latepoint_minutes_to_hours","latepoint_am_or_pm","latepoint_hours_and_minutes_to_minutes","hours_and_minutes","ampm","hours_and_minutes_arr","parseInt","latepoint_get_time_system","latepoint_helper","time_system","latepoint_minutes_to_hours_and_minutes","format","sprintf","latepoint_mask_timefield","$elem","jQuery","inputmask","mask","placeholder","latepoint_mask_phone","latepoint_is_phone_masking_enabled","latepoint_get_phone_format","phone_format","enable_phone_masking","latepoint_show_booking_end_time","show_booking_end_time","latepoint_init_form_masks","latepoint_get_paypal_payment_amount","$booking_form_wrapper","payment_portion","payment_amount","find","val","data","latepoint_add_notification","message","message_type","wrapper","append","remove","latepoint_generate_form_message_html","messages","status","message_html","Array","isArray","forEach","latepoint_clear_form_messages","$form","latepoint_show_data_in_lightbox","extra_classes","lightbox_css_classes","addClass","show_next_btn","removeClass","clear_service_sub_values","$item","closest","latepoint_update_summary_field","hide_next_btn","show_prev_btn","hide_prev_btn","latepoint_show_capacity_selector","max_capacity","text","latepoint_show_durations","latepoint_apply_coupon","$coupon_input","form_params","serialize","action","route_name","params","layout","return_format","ajax","type","dataType","url","ajaxurl","success","latepoint_show_message_inside_element","latepoint_reload_step","latepoint_coupon_removed","fadeOut","submit","latepoint_get_new_prev_payment_class","$payment_step","new_current_payment_step_class","new_prev_payment_step_class","latepoint_reset_password_from_booking_init","hide","on","html","show","field_name","value","$summary_holder","String","trim","hasClass","slideDown","fadeIn","slideUp","latepoint_password_changed_show_login","response","latepoint_hide_message_inside_element","prepend","latepoint_clear_step_vars","step_name","latepoint_set_payment_token_and_submit","token","$booking_form","document","ready","$","e","$this","this","confirm","location","reload","window","replace","before","after","func_name","alert","preventDefault","form_data","record_id","form_values_to_update","each","name","documentElement","body","animate","scrollTop","offset","top","OsPaymentsBraintree","button","braintree","client","create","authorization","braintree_paypal_client_auth","then","clientInstance","paypalCheckout","paypalCheckoutInstance","paypal","Button","render","style","label","size","shape","tagline","color","env","braintree_paypal_environment_name","payment","createPayment","flow","amount","currency","paypal_payment_currency","intent","onAuthorize","actions","tokenizePayment","payload","nonce","onCancel","onError","err","console","error","catch","zip","additionalData","hostedFieldsInstance","tokenize","tokenizeErr","code","details","invalidFields","key","field","braintree_tokenization_key","hostedFields","styles","input","font-size","font-family","body_font_family","font-weight",":focus","::placeholder",".valid",".invalid","fields","number","selector","cvv","expirationDate","OsPaymentsPaypal","Buttons","createOrder","order","purchase_units","currency_code","application_context","shipping_preference","onApprove","authorize","authorizationID","payments","authorizations","id","orderID","latepoint_register_stripe_card_elements","elements","element","event","latepoint_stripe_create_token","address_zip","latepoint_stripe","createToken","latepoint_stripe_elements_card_number","result","latepoint_init_stripe_form","Stripe","stripe_key","latepoint_stripe_elements","elementStyles","base","fontFamily","fontSize","fontWeight","elementClasses","focus","empty","invalid","classes","mount","latepoint_stripe_elements_card_expiry","latepoint_stripe_elements_card_cvc","latepoint_init_step","latepoint_init_step_selectable_items","latepoint_init_step_items_with_price","latepoint_init_step_datepicker","latepoint_init_step_contact","latepoint_init_step_agents","latepoint_init_step_services","latepoint_init_step_payment","latepoint_init_step_verify","latepoint_init_step_confirmation","day_timeslots","$day","service_duration","interval","work_start_minutes","work_end_minutes","total_work_minutes","available_minutes","toString","map","Number","day_minutes","$timeslots","prev_minutes","current_minutes","off_label","off_width","timeslot_class","includes","tick_html","timeslot_label","end_minutes","end_minutes_ampm","msg_not_available","os_init_timeslots","selected_timeslot_time","os_init_monthly_calendar_navigation","next_month_route_name","next","latepoint_calendar_set_month_label","$btn","$calendar_element","last","calendar_year","calendar_month","booking_info","target_date_string","location_id","agent_id","service_id","duration","total_attendies","latepoint_calendar_show_or_hide_prev_next_buttons","prev","$scrollable_wrapper","stop","scrollHeight","latepoint_init_paypal_button","$booking_form_element","is_braintree_paypal_active","create_paypal_button","is_paypal_native_active","latepoint_init_cc_form","is_braintree_active","init_cc_form","is_stripe_active","latepoint_format_price","which","current_payment_step_class","portion","off","latepoint_selectable_item_clicked","latepoint_priced_item_clicked","operator","latepoint_update_booking_component_price","latepoint_calculate_total_price","total_price","toFixed","item_type","item_type_class","price","summary_value","toggleClass","ids","get","trigger_next_or_show_next_button","currency_symbol_before","currency_symbol_after","add_value","current_value","new_value","max","min","trigger","$category_wrapper","$main_parent","parent","manual_next_step","latepoint_init_step_locations","account_nonse","password","password_confirmation","param","latepoint_init_customer_dashboard_login","$login_form_wrapper","FB","login","authResponse","accessToken","latepoint_step_content_change_start","latepoint_step_content_change_end","scope","googleUser","$login_form_wrappers","gapi","load","auth2","init","client_id","attr","cookiepolicy","attachClickHandler","getAuthResponse","id_token","latepoint_init_facebook_login","latepoint_init_google_login","customer_name","latepoint_validate_fields","email","new_content","replaceWith","setTimeout","$booking_form_wrappers","latepoint_change_step_desc","$step_progress","prevAll","nextAll","side_panel_desc","top_header_desc","latepoint_progress_prev","latepoint_progress_next","latepoint_next_step_description","latepoint_prev_step_description","$fields","is_valid","index","latepoint_init_booking_form","$select_box","timezone_name","is_timezone_selected","tzid","Intl","DateTimeFormat","resolvedOptions","timeZone","change","className","match","join","is_pre_last_step","is_last_step","css","demo_mode","create_token","current_step","$services_step","parents","cancel_booking_prompt","$booking_box","route","target","$tabs_wrapper","booking_button_route","restrictions","show_service_categories","show_locations","show_services","show_agents","selected_location","selected_agent","selected_service","selected_service_category","calendar_start_date","isEmptyObject","lightbox_class","step"],"mappings":"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,EAAMpF,KAAK,sBAAqBqY,EAAaO,iBAAmBxT,EAAMpF,KAAK,qBAC3EoF,EAAMpF,KAAK,+BAA8BqY,EAAaQ,0BAA4BzT,EAAMpF,KAAK,8BAC7FoF,EAAMpF,KAAK,yBAAwBqY,EAAaS,oBAAsB1T,EAAMpF,KAAK,wBAEhD,GAAjCkF,EAAE6T,cAAcV,KAAwB9V,EAAO8V,aAAeA,GAEjE,IAAIrY,EAAO,CAAEqC,OAAQ,uBAAwBC,WAAY2V,EAAO1V,OAAQA,EAAQC,OAAQ,OAAQC,cAAe,QAyB/G,OAxBA2C,EAAMjE,SAAS,cACf+D,EAAExC,KAAK,CACLC,KAAO,OACPC,SAAW,OACXC,IAAMtE,iBAAiBuE,QACvB9C,KAAOA,EACP+C,QAAS,SAAAA,EAAS/C,GAChB,GAAmB,YAAhBA,EAAKS,OAAqB,CAC3B,IAAIuY,EAAiB,GACY,OAA9B5T,EAAMpF,KAAK,kBAA0BgZ,GAAiB,2BACrB,OAAjC5T,EAAMpF,KAAK,qBAA6BgZ,GAAiB,8BAC5DhY,gCAAgChB,EAAKE,QAAS8Y,GAC9CtC,IACAlJ,EAAoBxN,EAAKiZ,MACzB/T,EAAE,QAAQ/D,SAAS,6BACnBiE,EAAM/D,YAAY,mBAGlB+D,EAAM/D,YAAY,kBAMjB,QApxCb,CA4xCKvC","sourcesContent":["function latepoint_is_timeframe_in_periods(timeframe_start, timeframe_end, periods_arr) {\n var is_inside = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n for (var i = 0; i < periods_arr.length; i++) {\n\n var period_start = 0;\n var period_end = 0;\n var buffer_before = 0;\n var buffer_after = 0;\n\n var period_info = periods_arr[i].split(':');\n if (period_info.length == 2) {\n period_start = period_info[0];\n period_end = period_info[1];\n } else {\n buffer_before = period_info[2];\n buffer_after = period_info[3];\n period_start = parseFloat(period_info[0]) - parseFloat(buffer_before);\n period_end = parseFloat(period_info[1]) + parseFloat(buffer_after);\n }\n if (is_inside) {\n if (latepoint_is_period_inside_another(timeframe_start, timeframe_end, period_start, period_end)) {\n return true;\n }\n } else {\n if (latepoint_is_period_overlapping(timeframe_start, timeframe_end, period_start, period_end)) {\n return true;\n }\n }\n };\n return false;\n}\n\nfunction latepoint_is_period_overlapping(period_one_start, period_one_end, period_two_start, period_two_end) {\n // https://stackoverflow.com/questions/325933/determine-whether-two-date-ranges-overlap/\n return period_one_start < period_two_end && period_two_start < period_one_end;\n}\nfunction latepoint_is_period_inside_another(period_one_start, period_one_end, period_two_start, period_two_end) {\n return period_one_start >= period_two_start && period_one_end <= period_two_end;\n}\n\n\n// Converts time in minutes to hours if possible, if minutes also exists - shows minutes too\nfunction latepoint_minutes_to_hours_preferably(time) {\n var army_clock = latepoint_is_army_clock();\n\n var hours = Math.floor(time / 60);\n if (!army_clock && hours > 12) hours = hours - 12;\n\n var minutes = time % 60;\n if(minutes > 0) hours = hours + ':' + minutes;\n return hours;\n}\n\n\nfunction latepoint_minutes_to_hours(time) {\n var army_clock = latepoint_is_army_clock();\n\n var hours = Math.floor(time / 60);\n if (!army_clock && hours > 12) hours = hours - 12;\n return hours;\n}\n\n\nfunction latepoint_am_or_pm(minutes) {\n if(latepoint_is_army_clock()) return '';\n return (minutes < 720) ? 'am' : 'pm';\n}\n\nfunction latepoint_hours_and_minutes_to_minutes(hours_and_minutes, ampm) {\n var hours_and_minutes_arr = hours_and_minutes.split(':');\n var hours = hours_and_minutes_arr[0];\n var minutes = hours_and_minutes_arr[1];\n if(ampm == \"pm\" && hours<12) hours = parseInt(hours)+12;\n if(ampm == \"am\" && hours==12) hours = 0;\n minutes = parseInt(minutes) + (hours * 60);\n return minutes;\n}\n\nfunction latepoint_get_time_system(){\n return latepoint_helper.time_system;\n}\n\nfunction latepoint_is_army_clock(){\n return (latepoint_get_time_system() == '24');\n}\n\nfunction latepoint_minutes_to_hours_and_minutes(time) {\n var army_clock = latepoint_is_army_clock();\n var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '%02d:%02d';\n\n var hours = Math.floor(time / 60);\n if(!army_clock && (hours > 12)) hours = hours - 12;\n var minutes = time % 60;\n return sprintf(format, hours, minutes);\n}\n","function latepoint_mask_timefield($elem){\n\tif(jQuery().inputmask){\n\t $elem.inputmask({\n\t 'mask': '99:99',\n\t 'placeholder': 'HH:MM'\n\t });\n\t}\n}\n\nfunction latepoint_mask_phone($elem){\n\tif(latepoint_is_phone_masking_enabled() && jQuery().inputmask) $elem.inputmask(latepoint_get_phone_format());\n}\n\n\nfunction latepoint_get_phone_format(){\n return latepoint_helper.phone_format;\n}\n\nfunction latepoint_is_phone_masking_enabled(){\n\treturn (latepoint_helper.enable_phone_masking == 'yes');\n}\n\nfunction latepoint_show_booking_end_time(){\n\treturn (latepoint_helper.show_booking_end_time == 'yes');\n}\n\nfunction latepoint_init_form_masks(){\n\tif(latepoint_is_phone_masking_enabled()) latepoint_mask_phone(jQuery('.os-mask-phone'));\n}\n\nfunction latepoint_get_paypal_payment_amount($booking_form_wrapper){\n\tvar payment_portion = $booking_form_wrapper.find('input[name=\"booking[payment_portion]\"]').val();\n\tvar payment_amount = (payment_portion == 'deposit') ? $booking_form_wrapper.find('.lp-paypal-btn-trigger').data('deposit-amount') : $booking_form_wrapper.find('.lp-paypal-btn-trigger').data('full-amount');\n\treturn payment_amount;\n}","function latepoint_add_notification(message, message_type = 'success'){\n\tvar wrapper = jQuery('body').find('.os-notifications');\n\tif(!wrapper.length){\n\t\tjQuery('body').append('
');\n\t\twrapper = jQuery('body').find('.os-notifications');\n\t}\n\tif(wrapper.find('.item').length > 0) wrapper.find('.item:first-child').remove();\n\twrapper.append('
' + message + '
');\n}","function latepoint_generate_form_message_html(messages, status){\n var message_html = '
';\n return message_html;\n}\n\nfunction latepoint_clear_form_messages($form){\n $form.find('.os-form-message-w').remove();\n}\n\nfunction latepoint_show_data_in_lightbox(message, extra_classes = ''){\n jQuery('.latepoint-lightbox-w').remove();\n var lightbox_css_classes = 'latepoint-lightbox-w latepoint-w ';\n if(extra_classes) lightbox_css_classes+= extra_classes;\n jQuery('body').append('
' + message + '
');\n jQuery('body').addClass('latepoint-lightbox-active');\n}\n\n\n\n// DOCUMENT READY\njQuery(document).ready(function( $ ) {\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /* \n Ajax buttons action\n */\n $('.latepoint').on('click', 'button[data-os-action], a[data-os-action], div[data-os-action], span[data-os-action]', function(e){\n var $this = $(this);\n if($this.data('os-prompt') && !confirm($this.data('os-prompt'))) return false;\n var params = $(this).data('os-params');\n if($(this).data('os-source-of-params')){\n params = $($(this).data('os-source-of-params')).find('select, input, textarea').serialize();\n }\n var return_format = $this.data('os-return-format') ? $this.data('os-return-format') : 'json'\n var data = { action: 'latepoint_route_call', route_name: $(this).data('os-action'), params: params, return_format: return_format } \n $this.addClass('os-loading');\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(response){\n if(response.status === \"success\"){\n if($this.data('os-output-target') == 'lightbox'){\n latepoint_show_data_in_lightbox(response.message, $this.data('os-lightbox-classes'));\n }else if($this.data('os-output-target') == 'side-panel'){\n $('.latepoint-side-panel-w').remove();\n $('body').append('
' + response.message + '
');\n }else if($this.data('os-success-action') == 'reload'){\n latepoint_add_notification(response.message);\n location.reload();\n return;\n }else if($this.data('os-success-action') == 'redirect'){\n if($this.data('os-redirect-to')){\n latepoint_add_notification(response.message);\n window.location.replace($this.data('os-redirect-to'));\n }else{\n window.location.replace(response.message); \n }\n return;\n }else if($this.data('os-output-target') && $($this.data('os-output-target')).length){\n if($this.data('os-output-target-do') == 'append'){\n $($this.data('os-output-target')).append(response.message);\n }else{\n $($this.data('os-output-target')).html(response.message);\n }\n }else{\n if($this.data('os-before-after') == 'before'){\n $this.before(response.message);\n }else if($this.data('os-before-after') == 'before'){\n $this.after(response.message);\n }else{\n latepoint_add_notification(response.message);\n }\n }\n if($this.data('os-after-call')){\n var func_name = $this.data('os-after-call');\n if($this.data('os-pass-this')){\n window[func_name]($this);\n }else if($this.data('os-pass-response')){\n window[func_name](response);\n }else{\n window[func_name]();\n }\n }\n $this.removeClass('os-loading');\n }else{\n $this.removeClass('os-loading');\n if($this.data('os-output-target') && $($this.data('os-output-target')).length){\n $($this.data('os-output-target')).prepend(latepoint_generate_form_message_html(response.message, 'error'));\n }else{\n alert(response.message);\n }\n }\n }\n });\n return false;\n });\n\n\n $('.latepoint').on('click', 'form[data-os-action] button[type=\"submit\"]', function(e){\n $(this).addClass('os-loading');\n });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /* \n Form ajax submit action\n */\n $('.latepoint').on('submit', 'form[data-os-action]', function(e){\n e.preventDefault(); // prevent native submit\n var $form = $(this);\n var form_data = $form.serialize();\n var data = { action: 'latepoint_route_call', route_name: $(this).data('os-action'), params: form_data, return_format: 'json' }\n $form.find('button[type=\"submit\"]').addClass('os-loading');\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(response){\n $form.find('button[type=\"submit\"].os-loading').removeClass('os-loading');\n latepoint_clear_form_messages($form);\n if(response.status === \"success\"){\n if($form.data('os-success-action') == 'reload'){\n latepoint_add_notification(response.message);\n location.reload();\n return;\n }else if($form.data('os-success-action') == 'redirect'){\n if($form.data('os-redirect-to')){\n latepoint_add_notification(response.message);\n window.location.replace($form.data('os-redirect-to'));\n }else{\n window.location.replace(response.message);\n }\n return;\n }else if($form.data('os-output-target') && $($form.data('os-output-target')).length){\n $($form.data('os-output-target')).html(response.message);\n }else{\n if(response.message == 'redirect'){\n window.location.replace(response.url);\n }else{\n latepoint_add_notification(response.message);\n $form.prepend(latepoint_generate_form_message_html(response.message, 'success'));\n }\n }\n if($form.data('os-record-id-holder') && response.record_id){\n $form.find('[name=\"' + $form.data('os-record-id-holder') + '\"]').val(response.record_id)\n }\n if($form.data('os-after-call')){\n var func_name = $form.data('os-after-call');\n if($form.data('os-pass-response')){\n window[func_name](response);\n }else{\n window[func_name]();\n }\n }\n if(response.form_values_to_update){\n $.each(response.form_values_to_update, function(name, value){\n $form.find('[name=\"'+ name +'\"]').val(value);\n });\n }\n $('button.os-loading').removeClass('os-loading');\n }else{\n $('button.os-loading').removeClass('os-loading');\n if($form.data('os-show-errors-as-notification')){\n latepoint_add_notification(response.message, 'error');\n }else{\n $form.prepend(latepoint_generate_form_message_html(response.message, 'error'));\n $([document.documentElement, document.body]).animate({\n scrollTop: ($form.find(\".os-form-message-w\").offset().top - 30)\n }, 200);\n }\n }\n }\n });\n return false;\n });\n});","// @codekit-prepend \"os-time.js\"\n// @codekit-prepend \"os-shared.js\"\n// @codekit-prepend \"os-notifications.js\";\n// @codekit-prepend \"os-actions.js\"\n// @codekit-prepend \"os-payments-braintree.js\"\n// @codekit-prepend \"os-payments-paypal.js\"\n\n\n function show_next_btn($booking_form_wrapper){\n $booking_form_wrapper.find('.latepoint-next-btn').removeClass('disabled');\n $booking_form_wrapper.removeClass('hidden-buttons');\n }\n\n function clear_service_sub_values($item){\n var $booking_form_wrapper = $item.closest('.latepoint-booking-form-element');\n latepoint_update_summary_field($booking_form_wrapper, 'duration', '');\n latepoint_update_summary_field($booking_form_wrapper, 'service-extras', '');\n latepoint_update_summary_field($booking_form_wrapper, 'total-attendies', '');\n $booking_form_wrapper.find('.latepoint_service_extras_price').val('');\n $booking_form_wrapper.find('.latepoint_service_extras_ids').val('');\n $booking_form_wrapper.find('.latepoint_duration').val('');\n $booking_form_wrapper.find('.latepoint_total_attendies').val(1);\n $booking_form_wrapper.find('.quantity-selector-input').val(1);\n }\n\n\n function hide_next_btn($booking_form_wrapper){\n $booking_form_wrapper.find('.latepoint-next-btn').addClass('disabled');\n if($booking_form_wrapper.find('.latepoint-prev-btn.disabled').length) $booking_form_wrapper.addClass('hidden-buttons');\n }\n\n\n function show_prev_btn($booking_form_wrapper){\n $booking_form_wrapper.find('.latepoint-prev-btn').removeClass('disabled');\n $booking_form_wrapper.removeClass('hidden-buttons');\n }\n\n function hide_prev_btn($booking_form_wrapper){\n $booking_form_wrapper.find('.latepoint-prev-btn').addClass('disabled');\n if($booking_form_wrapper.find('.latepoint-next-btn.disabled').length) $booking_form_wrapper.addClass('hidden-buttons');\n }\n\n\nfunction latepoint_show_capacity_selector($item){\n var $booking_form_wrapper = $item.closest('.latepoint-booking-form-element');\n var max_capacity = $item.data('max-capacity');\n $booking_form_wrapper.find('.sta-sub-label span').text(max_capacity);\n $booking_form_wrapper.find('.step-services-w').removeClass('selecting-service-duration');\n $booking_form_wrapper.find('.quantity-selector-w').data('max-capacity', max_capacity);\n $item.closest('.step-services-w').addClass('selecting-total-attendies');\n show_prev_btn($booking_form_wrapper);\n show_next_btn($booking_form_wrapper);\n}\n\n\nfunction latepoint_show_durations($item){\n var $booking_form_wrapper = $item.closest('.latepoint-booking-form-element');\n $item.closest('.step-services-w').addClass('selecting-service-duration');\n show_prev_btn($booking_form_wrapper);\n hide_next_btn($booking_form_wrapper);\n}\n\nfunction latepoint_apply_coupon($elem){\n var $booking_form_wrapper = $elem.closest('.latepoint-booking-form-element');\n\n var $coupon_input = $elem;\n $coupon_input.closest('.coupon-code-input-w').addClass('os-loading');\n var form_params = $booking_form_wrapper.find('.latepoint-form').serialize();\n var data = { action: 'latepoint_route_call', route_name: $elem.data('route'), params: form_params, layout: 'none', return_format: 'json' }\n jQuery.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n $coupon_input.closest('.coupon-code-input-w').removeClass('os-loading');\n if(data.status === \"success\"){\n latepoint_show_message_inside_element(data.message, $booking_form_wrapper.find('.latepoint-body'), 'success');\n latepoint_reload_step($booking_form_wrapper);\n }else{\n latepoint_show_message_inside_element(data.message, $booking_form_wrapper.find('.latepoint-body'), 'error');\n }\n }\n });\n}\n\nfunction latepoint_coupon_removed($elem){\n $elem.closest('.applied-coupon-code').fadeOut();\n var $booking_form_wrapper = $elem.closest('.latepoint-booking-form-element');\n latepoint_reload_step($booking_form_wrapper);\n}\n\nfunction latepoint_reload_step($booking_form_wrapper){\n\n $booking_form_wrapper.find('.latepoint_step_direction').val('specific');\n $booking_form_wrapper.find('.latepoint-form').submit();\n\n return false;\n}\n\n\nfunction latepoint_get_new_prev_payment_class($payment_step, new_current_payment_step_class){\n var new_prev_payment_step_class = '';\n switch(new_current_payment_step_class){\n case 'lp-show-pay-times':\n new_prev_payment_step_class = '';\n break;\n case 'lp-show-pay-methods':\n if($payment_step.find('.lp-payment-times-w').length){\n new_prev_payment_step_class = 'lp-show-pay-times';\n }else{\n new_prev_payment_step_class = latepoint_get_new_prev_payment_class($payment_step, 'lp-show-pay-times');\n }\n break;\n case 'lp-show-pay-portion-selection':\n if($payment_step.find('.lp-payment-methods-w').length){\n new_prev_payment_step_class = 'lp-show-pay-methods';\n }else{\n new_prev_payment_step_class = latepoint_get_new_prev_payment_class($payment_step, 'lp-show-pay-methods');\n }\n break;\n case 'lp-show-card':\n case 'lp-show-paypal':\n if($payment_step.find('.lp-payment-portion-selection-w').length){\n new_prev_payment_step_class = 'lp-show-pay-portion-selection';\n }else{\n new_prev_payment_step_class = latepoint_get_new_prev_payment_class($payment_step, 'lp-show-pay-portion-selection');\n }\n break;\n }\n return new_prev_payment_step_class;\n}\n\n\nfunction latepoint_reset_password_from_booking_init(){\n jQuery('.os-step-existing-customer-login-w').hide();\n jQuery('.os-password-reset-form-holder').on('click', '.password-reset-back-to-login', function(){\n jQuery('.os-password-reset-form-holder').html('');\n jQuery('.os-step-existing-customer-login-w').show();\n return false;\n });\n}\n\nfunction latepoint_update_summary_field($form, field_name, value){\n var $summary_holder = $form.closest('.latepoint-with-summary');\n if(!$summary_holder.length) return;\n value = String(value).trim();\n if(value){\n $form.find('.os-summary-value-'+field_name).text(value).closest('.os-summary-line').addClass('os-has-value');\n if($summary_holder.hasClass('latepoint-summary-is-open')){\n $form.find('.os-summary-line.os-has-value').slideDown(150);\n }else{\n $form.find('.os-summary-line.os-has-value').fadeIn(200);\n }\n $summary_holder.addClass('latepoint-summary-is-open');\n }else{\n $form.find('.os-summary-value-'+field_name).text('').closest('.os-summary-line').slideUp(150).removeClass('os-has-value');\n }\n}\n\nfunction latepoint_password_changed_show_login(response){\n jQuery('.os-step-existing-customer-login-w').show();\n jQuery('.os-password-reset-form-holder').html('');\n latepoint_show_message_inside_element(response.message, jQuery('.os-step-existing-customer-login-w'), 'success');\n}\n\nfunction latepoint_hide_message_inside_element($elem = jQuery('.latepoint-body')){\n if($elem.length && $elem.find('.latepoint-message').length){\n $elem.find('.latepoint-message').remove();\n }\n}\n\nfunction latepoint_show_message_inside_element(message, $elem = jQuery('.latepoint-body'), message_type = 'error'){\n if($elem.length){\n if($elem.find('.latepoint-message').length){\n $elem.find('.latepoint-message').removeClass('latepoint-message-success').removeClass('latepoint-message-error').addClass('latepoint-message-'+ message_type +'').html(message).show();\n }else{\n $elem.prepend('
' + message + '
');\n }\n }\n}\n\nfunction latepoint_clear_step_vars(step_name, $form){\n switch(step_name) {\n case 'locations':\n $form.find('input[name=\"booking[start_date]\"]').val('');\n break;\n case 'services':\n $form.find('input[name=\"booking[service_id]\"]').val('');\n break;\n case 'agents':\n $form.find('input[name=\"booking[agent_id]\"]').val('');\n break;\n case 'datepicker':\n $form.find('input[name=\"booking[start_date]\"]').val('');\n $form.find('input[name=\"booking[start_time]\"]').val('');\n break;\n }\n}\n\nfunction latepoint_set_payment_token_and_submit($booking_form_wrapper, token){\n $booking_form_wrapper.find('input[name=\"booking[payment_token]\"]').val(token);\n var $booking_form = $booking_form_wrapper.find('.latepoint-form');\n $booking_form.find('.latepoint_step_direction').val('next').submit();\n}\n\n( function( $ ) {\n \"use strict\";\n\n var latepoint_stripe;\n var latepoint_stripe_elements;\n var latepoint_stripe_elements_card_number;\n var latepoint_stripe_elements_card_expiry;\n var latepoint_stripe_elements_card_cvc;\n\n function latepoint_register_stripe_card_elements(elements) {\n\n // Listen for errors from each Element, and show error messages in the UI.\n elements.forEach(function(element) {\n element.on('change', function(event) {\n if (event.error) {\n latepoint_show_message_inside_element(event.error.message);\n } else {\n latepoint_hide_message_inside_element();\n }\n });\n });\n\n }\n\n\n function latepoint_stripe_create_token($booking_form_wrapper){\n // Gather additional customer data we may have collected in our form.\n var name = jQuery($booking_form_wrapper).find('#payment_name_on_card');\n var zip = jQuery($booking_form_wrapper).find('#payment_zip');\n var additionalData = {\n name: name ? name.value : undefined,\n address_zip: zip ? zip.value : undefined,\n };\n\n // Use Stripe.js to create a token. We only need to pass in one Element\n // from the Element group in order to create a token. We can also pass\n // in the additional customer data we collected in our form.\n latepoint_stripe.createToken(latepoint_stripe_elements_card_number, additionalData).then(function(result) {\n // Stop loading!\n // example.classList.remove('submitting');\n\n if (result.token) {\n // If we received a token, show the token ID.\n latepoint_set_payment_token_and_submit($booking_form_wrapper, result.token.id);\n } else {\n latepoint_show_message_inside_element(result.error.message);\n jQuery($booking_form_wrapper).find('.latepoint-next-btn').removeClass('os-loading');\n }\n });\n }\n\n\n function latepoint_init_stripe_form(){\n latepoint_stripe = Stripe(latepoint_helper.stripe_key);\n\n latepoint_stripe_elements = latepoint_stripe.elements();\n\n\n var elementStyles = {\n base: {\n fontFamily: latepoint_helper.body_font_family,\n fontSize: '14px',\n fontWeight: 500,\n color: '#ffffff',\n '::placeholder': {\n color: '#7d89b1',\n },\n }\n };\n\n var elementClasses = {\n focus: 'focused',\n empty: 'empty',\n invalid: 'invalid',\n };\n\n latepoint_stripe_elements_card_number = latepoint_stripe_elements.create('cardNumber', {\n style: elementStyles,\n classes: elementClasses,\n placeholder: jQuery('#payment_card_number').data('placeholder')\n });\n latepoint_stripe_elements_card_number.mount('#payment_card_number');\n\n latepoint_stripe_elements_card_expiry = latepoint_stripe_elements.create('cardExpiry', {\n style: elementStyles,\n classes: elementClasses,\n placeholder: jQuery('#payment_card_expiration').data('placeholder')\n });\n latepoint_stripe_elements_card_expiry.mount('#payment_card_expiration');\n\n latepoint_stripe_elements_card_cvc = latepoint_stripe_elements.create('cardCvc', {\n style: elementStyles,\n classes: elementClasses,\n placeholder: jQuery('#payment_card_cvc').data('placeholder')\n });\n latepoint_stripe_elements_card_cvc.mount('#payment_card_cvc');\n\n latepoint_register_stripe_card_elements([latepoint_stripe_elements_card_number, latepoint_stripe_elements_card_expiry, latepoint_stripe_elements_card_cvc]);\n }\n\n function latepoint_init_step(step_name, $booking_form_wrapper = false){\n latepoint_init_step_selectable_items();\n latepoint_init_step_items_with_price();\n switch(step_name){\n case 'datepicker':\n latepoint_init_step_datepicker();\n break;\n case 'contact':\n latepoint_init_step_contact();\n break;\n case 'agents':\n latepoint_init_step_agents();\n break;\n case 'locations':\n latepoint_init_step_locations();\n break;\n case 'services':\n latepoint_init_step_services()\n break;\n case 'payment':\n latepoint_init_step_payment($booking_form_wrapper)\n break;\n case 'verify':\n latepoint_init_step_verify($booking_form_wrapper)\n break;\n case 'confirmation':\n latepoint_init_step_confirmation()\n break;\n }\n }\n\n\n\n function day_timeslots($day){\n var $booking_form_wrapper = $day.closest('.latepoint-booking-form-element');\n $day.addClass('selected');\n\n var service_duration = $day.data('service-duration');\n var interval = $day.data('interval');\n var work_start_minutes = $day.data('work-start-time');\n var work_end_minutes = $day.data('work-end-time');\n var total_work_minutes = $day.data('total-work-minutes');\n var available_minutes = $day.data('available-minutes') ? $day.data('available-minutes').toString().split(',').map(Number) : false;\n var day_minutes = $day.data('day-minutes').toString().split(',').map(Number);\n\n var $timeslots = $booking_form_wrapper.find('.timeslots');\n $timeslots.html('');\n\n if(total_work_minutes > 0 && available_minutes.length && day_minutes.length){\n var prev_minutes = false;\n day_minutes.forEach(function(current_minutes){\n if((current_minutes + service_duration) > work_end_minutes) return;\n var ampm = latepoint_am_or_pm(current_minutes);\n if(prev_minutes !== false && ((current_minutes - prev_minutes) > service_duration)){\n // show interval that is off between two work periods\n var off_label = latepoint_minutes_to_hours_and_minutes(prev_minutes + service_duration)+' '+ latepoint_am_or_pm(prev_minutes + service_duration) + ' - ' + latepoint_minutes_to_hours_and_minutes(current_minutes)+' '+latepoint_am_or_pm(current_minutes);\n var off_width = (((current_minutes - prev_minutes - service_duration) / (total_work_minutes + service_duration)) * 100);\n $timeslots.append('
' + off_label + '
');\n }\n\n var timeslot_class = 'dp-timeslot';\n if(!available_minutes.includes(current_minutes)){\n timeslot_class+= ' is-booked';\n }\n var tick_html = '';\n if(((current_minutes % 60) == 0) || (interval >= 60)){\n timeslot_class+= ' with-tick';\n tick_html = ''+latepoint_minutes_to_hours_preferably(current_minutes)+''+' '+ampm+'';\n }\n var timeslot_label = latepoint_minutes_to_hours_and_minutes(current_minutes)+' '+ampm;\n if(latepoint_show_booking_end_time()){\n var end_minutes = current_minutes + service_duration;\n var end_minutes_ampm = latepoint_am_or_pm(end_minutes);\n timeslot_label+= ' - ' + latepoint_minutes_to_hours_and_minutes(end_minutes)+' '+end_minutes_ampm;\n }\n timeslot_label = timeslot_label.trim();\n $timeslots.append('
'+ timeslot_label +''+tick_html+'
');\n\n prev_minutes = current_minutes;\n });\n }else{\n // No working hours this day\n $timeslots.append('
' + latepoint_helper.msg_not_available + \"
\");\n }\n }\n\n\n\n\n function os_init_timeslots(){\n $('.dp-timeslot').on('click', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n if($(this).hasClass('is-booked') || $(this).hasClass('is-off')){\n // Show error message that you cant select a booked period\n }else{\n if($(this).hasClass('selected')){\n $(this).removeClass('selected');\n $(this).find('.dp-success-label').remove();\n $booking_form_wrapper.find('.latepoint_start_time').val('');\n hide_next_btn($booking_form_wrapper);\n latepoint_update_summary_field($booking_form_wrapper, 'time', '');\n }else{\n $booking_form_wrapper.find('.dp-timeslot.selected').removeClass('selected').find('.dp-success-label').remove();\n var selected_timeslot_time = $(this).find('.dp-label').html();\n $(this).addClass('selected').find('.dp-label').html('' + $booking_form_wrapper.find('.latepoint-form').data('selected-label') + '' + selected_timeslot_time);\n $booking_form_wrapper.find('.latepoint_start_time').val($(this).data('minutes'));\n show_next_btn($booking_form_wrapper);\n latepoint_update_summary_field($booking_form_wrapper, 'time', selected_timeslot_time);\n }\n }\n return false;\n });\n }\n\n function os_init_monthly_calendar_navigation(){\n $('.os-month-next-btn').on('click', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n var next_month_route_name = $(this).data('route');\n if($booking_form_wrapper.find('.os-monthly-calendar-days-w.active + .os-monthly-calendar-days-w').length){\n $booking_form_wrapper.find('.os-monthly-calendar-days-w.active').removeClass('active').next('.os-monthly-calendar-days-w').addClass('active');\n latepoint_calendar_set_month_label($booking_form_wrapper);\n }else{\n // TODO add condition to check maximum number months to call into the future\n if(true){\n var $btn = $(this);\n $btn.addClass('os-loading');\n var $calendar_element = $booking_form_wrapper.find('.os-monthly-calendar-days-w').last();\n var calendar_year = $calendar_element.data('calendar-year');\n var calendar_month = $calendar_element.data('calendar-month');\n if(calendar_month == 12){\n calendar_year = calendar_year + 1;\n calendar_month = 1;\n }else{\n calendar_month = calendar_month + 1;\n }\n var booking_info = { target_date_string: calendar_year + '-' + calendar_month + '-1', \n location_id: $booking_form_wrapper.find('.latepoint_location_id').val(), \n agent_id: $booking_form_wrapper.find('.latepoint_agent_id').val(), \n service_id: $booking_form_wrapper.find('.latepoint_service_id').val(),\n duration: $booking_form_wrapper.find('input[name=\"booking[duration]\"]').val(),\n total_attendies: $booking_form_wrapper.find('input[name=\"booking[total_attendies]\"]').val() };\n var data = { action: 'latepoint_route_call', route_name: next_month_route_name, params: booking_info, layout: 'none', return_format: 'json' }\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n $btn.removeClass('os-loading');\n if(data.status === \"success\"){\n $booking_form_wrapper.find('.os-months').append(data.message);\n $booking_form_wrapper.find('.os-monthly-calendar-days-w.active').removeClass('active').next('.os-monthly-calendar-days-w').addClass('active');\n latepoint_calendar_set_month_label($booking_form_wrapper);\n }else{\n // console.log(data.message);\n }\n }\n });\n }\n }\n latepoint_calendar_show_or_hide_prev_next_buttons($booking_form_wrapper);\n return false;\n });\n $('.os-month-prev-btn').on('click', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n if($booking_form_wrapper.find('.os-monthly-calendar-days-w.active').prev('.os-monthly-calendar-days-w').length){\n $booking_form_wrapper.find('.os-monthly-calendar-days-w.active').removeClass('active').prev('.os-monthly-calendar-days-w').addClass('active');\n latepoint_calendar_set_month_label($booking_form_wrapper);\n }\n latepoint_calendar_show_or_hide_prev_next_buttons($booking_form_wrapper);\n return false;\n });\n }\n\n function latepoint_calendar_set_month_label($booking_form_wrapper){\n $booking_form_wrapper.find('.os-current-month-label .current-year').text($booking_form_wrapper.find('.os-monthly-calendar-days-w.active').data('calendar-year'));\n $booking_form_wrapper.find('.os-current-month-label .current-month').text($booking_form_wrapper.find('.os-monthly-calendar-days-w.active').data('calendar-month-label'));\n }\n\n\n function latepoint_calendar_show_or_hide_prev_next_buttons($booking_form_wrapper){\n $booking_form_wrapper.find('.os-current-month-label .current-year').text($booking_form_wrapper.find('.os-monthly-calendar-days-w.active .os-monthly-calendar-days').data('calendar-year'));\n $booking_form_wrapper.find('.os-current-month-label .current-month').text($booking_form_wrapper.find('.os-monthly-calendar-days-w.active .os-monthly-calendar-days').data('calendar-month-label'));\n\n if($booking_form_wrapper.find('.os-monthly-calendar-days-w.active').prev('.os-monthly-calendar-days-w').length){\n $booking_form_wrapper.find('.os-month-prev-btn').removeClass('disabled');\n }else{\n $booking_form_wrapper.find('.os-month-prev-btn').addClass('disabled');\n }\n }\n\n\n function latepoint_init_step_datepicker(){\n os_init_timeslots();\n os_init_monthly_calendar_navigation();\n $('.os-months').on('click', '.os-day', function(){\n if($(this).hasClass('os-day-passed')) return false;\n if($(this).hasClass('os-not-in-allowed-period')) return false;\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n $booking_form_wrapper.find('.os-day.selected').removeClass('selected');\n day_timeslots($(this));\n os_init_timeslots();\n $('.times-header span').text($(this).data('nice-date'));\n $booking_form_wrapper.find('.time-selector-w').slideDown(200, function(){\n var $scrollable_wrapper = $booking_form_wrapper.find('.latepoint-body');\n $scrollable_wrapper.stop().animate({\n scrollTop: $scrollable_wrapper[0].scrollHeight\n }, 200);\n });\n $booking_form_wrapper.find('.latepoint_start_date').val($(this).data('date'));\n latepoint_update_summary_field($booking_form_wrapper, 'date', $(this).data('nice-date'));\n\n $booking_form_wrapper.find('.latepoint_start_time').val('');\n hide_next_btn($booking_form_wrapper);\n return false;\n });\n }\n\n function latepoint_init_paypal_button($booking_form_element){\n $booking_form_element.find('.lp-paypal-btn-trigger').html('');\n if(latepoint_helper.is_braintree_paypal_active){\n OsPaymentsBraintree.create_paypal_button($booking_form_element.find('.lp-paypal-btn-trigger')[0]);\n }\n if(latepoint_helper.is_paypal_native_active){\n OsPaymentsPaypal.create_paypal_button($booking_form_element.find('.lp-paypal-btn-trigger')[0]);\n }\n $('.lp-paypal-demo-mode-trigger').on('click', function(){\n $(this).closest('.latepoint-form').submit();\n });\n }\n\n\n function latepoint_init_cc_form($booking_form_element = false){\n if($booking_form_element){\n if(!$booking_form_element.find('.lp-card-w').length) return;\n }else{\n if(!$('.lp-card-w').length) return;\n }\n if(latepoint_helper.is_braintree_active){\n OsPaymentsBraintree.init_cc_form();\n }\n if(latepoint_helper.is_stripe_active){\n latepoint_init_stripe_form();\n }\n }\n\n function latepoint_init_step_verify($booking_form_element = false){\n if(!$booking_form_element) return;\n\n $booking_form_element.closest('.latepoint-summary-is-open').removeClass('latepoint-summary-is-open');\n }\n\n\n function latepoint_init_step_payment($booking_form_element = false){\n if($booking_form_element.find('.step-payment-w').data('full-amount') > 0){\n latepoint_update_summary_field($booking_form_element, 'price', latepoint_format_price($booking_form_element.find('.step-payment-w').data('full-amount')));\n }\n if($booking_form_element && ($booking_form_element.find('.step-payment-w').data('default-portion') == 'deposit')){\n $booking_form_element.find('input[name=\"booking[payment_portion]\"]').val('deposit');\n }\n latepoint_init_cc_form($booking_form_element);\n\n if($booking_form_element && ($booking_form_element.find('.step-payment-w').data('current-payment-step') == 'lp-show-paypal')){\n latepoint_init_paypal_button($booking_form_element);\n hide_next_btn($booking_form_element);\n }\n\n $('.latepoint-booking-form-element .coupon-code-input-submit').on('click', function(e){\n latepoint_apply_coupon($(this).closest('.coupon-code-input-w').find('.coupon-code-input'));\n return false;\n });\n\n $('.latepoint-booking-form-element input.coupon-code-input').on('keyup', function(e){\n if(e.which === 13){\n latepoint_apply_coupon($(this));\n return false;\n }\n });\n\n\n $('.latepoint-booking-form-element .coupon-code-trigger-w a').on('click', function(e){\n $(this).closest('.payment-total-info').addClass('entering-coupon').find('.coupon-code-input').focus();\n return false;\n });\n\n\n $('.latepoint-booking-form-element .lp-payment-trigger-locally').on('click', function(e){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n $booking_form_element.find('input[name=\"booking[payment_method]\"]').val($(this).data('method'));\n $booking_form_element.find('input[name=\"booking[payment_portion]\"]').val('');\n show_next_btn($booking_form_element);\n });\n\n $('.latepoint-booking-form-element .lp-payment-trigger-method-selector').on('click', function(e){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n var $payment_step = $booking_form_element.find('.step-payment-w');\n var current_payment_step_class = $payment_step.data('current-payment-step');\n var new_current_payment_step_class = 'lp-show-pay-methods';\n\n $payment_step.removeClass(current_payment_step_class)\n .addClass(new_current_payment_step_class)\n .data('current-payment-step', new_current_payment_step_class)\n .data('prev-payment-step', current_payment_step_class);\n hide_next_btn($booking_form_element);\n show_prev_btn($booking_form_element);\n return false;\n });\n\n $('.latepoint-booking-form-element .lp-payment-trigger-cc').on('click', function(e){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n $booking_form_element.find('input[name=\"booking[payment_method]\"]').val($(this).data('method'));\n\n var $payment_step = $booking_form_element.find('.step-payment-w');\n var current_payment_step_class = $payment_step.data('current-payment-step');\n var new_current_payment_step_class = 'lp-show-pay-portion-selection';\n\n if(!$booking_form_element.find('.lp-payment-portion-selection-w').length){\n // no deposits allowed\n new_current_payment_step_class = 'lp-show-card';\n show_next_btn($booking_form_element);\n }else{\n hide_next_btn($booking_form_element);\n }\n show_prev_btn($booking_form_element);\n $payment_step.removeClass(current_payment_step_class)\n .addClass(new_current_payment_step_class)\n .data('current-payment-step', new_current_payment_step_class)\n .data('prev-payment-step', current_payment_step_class);\n });\n\n $('.latepoint-booking-form-element .lp-payment-trigger-paypal').on('click', function(e){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n $booking_form_element.find('input[name=\"booking[payment_method]\"]').val($(this).data('method'));\n\n var $payment_step = $booking_form_element.find('.step-payment-w');\n var current_payment_step_class = $payment_step.data('current-payment-step');\n var new_current_payment_step_class = 'lp-show-pay-portion-selection';\n\n if(!$booking_form_element.find('.lp-payment-portion-selection-w').length){\n // no deposits allowed\n latepoint_init_paypal_button($booking_form_element);\n new_current_payment_step_class = 'lp-show-paypal';\n }\n\n $payment_step.removeClass(current_payment_step_class)\n .addClass(new_current_payment_step_class)\n .data('current-payment-step', new_current_payment_step_class)\n .data('prev-payment-step', current_payment_step_class);\n\n hide_next_btn($booking_form_element);\n show_prev_btn($booking_form_element);\n });\n\n $('.latepoint-booking-form-element .lp-trigger-payment-portion-selector').on('click', function(e){\n var $booking_form_element = $(this).closest('.latepoint-booking-form-element');\n var portion = jQuery(this).data('portion');\n $booking_form_element.find('input[name=\"booking[payment_portion]\"]').val(portion);\n if(portion == 'deposit'){\n $booking_form_element.find('.payment-total-info').addClass('paying-deposit');\n }else{\n $booking_form_element.find('.payment-total-info').removeClass('paying-deposit');\n }\n\n var $payment_step = $booking_form_element.find('.step-payment-w');\n var current_payment_step_class = $payment_step.data('current-payment-step');\n var new_current_payment_step_class = 'lp-show-card';\n \n if($booking_form_element.find('input[name=\"booking[payment_method]\"]').val() == 'card'){\n // card\n show_next_btn($booking_form_element);\n }else{\n // paypal\n latepoint_init_paypal_button($booking_form_element);\n new_current_payment_step_class = 'lp-show-paypal';\n hide_next_btn($booking_form_element);\n }\n show_prev_btn($booking_form_element);\n\n $payment_step.removeClass(current_payment_step_class)\n .addClass(new_current_payment_step_class)\n .data('current-payment-step', new_current_payment_step_class)\n .data('prev-payment-step', current_payment_step_class);\n });\n\n\n }\n\n\n function latepoint_init_step_selectable_items(){\n $('.os-selectable-items .os-selectable-item').off('click', latepoint_selectable_item_clicked);\n $('.os-selectable-items .os-selectable-item').on('click', latepoint_selectable_item_clicked);\n }\n\n function latepoint_init_step_items_with_price(){\n $('.os-selectable-items .os-priced-item').off('click', latepoint_priced_item_clicked);\n $('.os-selectable-items .os-priced-item').on('click', latepoint_priced_item_clicked);\n }\n\n function latepoint_priced_item_clicked(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n var operator = '=';\n if($(this).hasClass('os-allow-multiselect')){\n operator = ($(this).hasClass('selected')) ? '+' : '-';\n }\n latepoint_update_booking_component_price($(this).data('item-price'), $(this).data('priced-item-type'), $booking_form_wrapper, operator);\n return false;\n }\n\n function latepoint_calculate_total_price($booking_form_wrapper){\n var total_price = 0;\n $booking_form_wrapper.find('.latepoint-priced-component').each(function(){\n total_price+= Number($(this).val());\n });\n $booking_form_wrapper.find('.latepoint_total_price').val(total_price);\n if(total_price > 0){\n if($booking_form_wrapper.find('.latepoint_total_attendies').val() > 1) total_price = (total_price * $booking_form_wrapper.find('.latepoint_total_attendies').val()).toFixed(2);\n total_price = latepoint_format_price(total_price);\n latepoint_update_summary_field($booking_form_wrapper, 'price', total_price);\n }else{\n latepoint_update_summary_field($booking_form_wrapper, 'price', '');\n }\n }\n\n function latepoint_update_booking_component_price(amount, item_type, $booking_form_wrapper, operator){\n var item_type_class = '.latepoint_' + item_type + '_price';\n var price = Number($('.latepoint-priced-component' + item_type_class).val()) * 100;\n amount = Number(amount) * 100;\n if(operator == '='){\n price = amount;\n }else{\n price = (operator == '+') ? price + amount : price - amount;\n }\n price = price / 100;\n $('.latepoint-priced-component' + item_type_class).val(price);\n latepoint_calculate_total_price($booking_form_wrapper)\n }\n\n function latepoint_selectable_item_clicked(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n var summary_value = '';\n if($(this).hasClass('os-allow-multiselect')){\n $(this).toggleClass('selected');\n var ids = $(this).closest('.os-selectable-items').find('.os-selectable-item.selected').map(function(){ return $(this).data('item-id'); }).get();\n $booking_form_wrapper.find($(this).data('id-holder')).val(ids);\n summary_value = String($(this).closest('.os-selectable-items').find('.os-selectable-item.selected').map(function(){ return (' ' + $(this).data('summary-value')); }).get()).trim();\n show_next_btn($booking_form_wrapper);\n }else{\n $(this).closest('.os-selectable-items').find('.os-selectable-item.selected').removeClass('selected');\n $(this).addClass('selected');\n $booking_form_wrapper.find($(this).data('id-holder')).val($(this).data('item-id'));\n summary_value = $(this).data('summary-value');\n if($(this).data('os-call-func')){\n window[$(this).data('os-call-func')]($(this));\n }\n if($(this).data('activate-sub-step')){\n window[$(this).data('activate-sub-step')]($(this));\n }else{\n trigger_next_or_show_next_button($booking_form_wrapper);\n }\n }\n latepoint_update_summary_field($booking_form_wrapper, $(this).data('summary-field-name'), summary_value);\n }\n\n\n function latepoint_format_price(price){\n return latepoint_helper.currency_symbol_before + String(price) + latepoint_helper.currency_symbol_after;\n }\n\n\n function latepoint_init_step_services(){\n $('.quantity-selector-input').on('change', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n $booking_form_wrapper.find('.latepoint_total_attendies').val($(this).val());\n latepoint_update_summary_field($booking_form_wrapper, 'total-attendies', $(this).val());\n latepoint_calculate_total_price($booking_form_wrapper);\n });\n $('.quantity-selector').on('click', function(){\n var add_value = ($(this).hasClass('quantity-selector-plus')) ? 1 : -1;\n var max_capacity = $(this).closest('.quantity-selector-w').data('max-capacity');\n var current_value = $(this).closest('.quantity-selector-w').find('input.quantity-selector-input').val();\n var new_value = (Number(current_value) > 0) ? Math.max((Number(current_value) + add_value), 1) : 1;\n new_value = Math.min(Number(max_capacity), new_value);\n $(this).closest('.latepoint-booking-form-element').find('.latepoint_total_attendies').val(new_value);\n $(this).closest('.quantity-selector-w').find('input').val(new_value).trigger('change');\n return false;\n });\n $('.os-service-category-info').on('click', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n show_prev_btn($booking_form_wrapper);\n $(this).closest('.step-services-w').addClass('selecting-service-category');\n var $category_wrapper = $(this).closest('.os-service-category-w');\n var $main_parent = $(this).closest('.os-service-categories-main-parent');\n if($category_wrapper.hasClass('selected')){\n $category_wrapper.removeClass('selected');\n if($category_wrapper.parent().closest('.os-service-category-w').length){\n $category_wrapper.parent().closest('.os-service-category-w').addClass('selected');\n }else{\n $main_parent.removeClass('show-selected-only');\n }\n }else{\n $main_parent.find('.os-service-category-w.selected').removeClass('selected');\n $main_parent.addClass('show-selected-only');\n $category_wrapper.addClass('selected');\n }\n return false;\n });\n }\n\n\n function trigger_next_or_show_next_button($booking_form_wrapper){\n if(!latepoint_helper.manual_next_step || latepoint_helper.manual_next_step == 'off'){\n $booking_form_wrapper.find('.latepoint_step_direction').val('next');\n $booking_form_wrapper.find('.latepoint-form').submit();\n }else{\n show_next_btn($booking_form_wrapper);\n }\n }\n\n function latepoint_init_step_locations(){\n }\n\n function latepoint_init_step_agents(){\n $('.os-items .os-item-details-btn').on('click', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n var agent_id = $(this).data('agent-id');\n $booking_form_wrapper.find('.os-agent-bio-popup.active').removeClass('active');\n $booking_form_wrapper.find('#osAgentBioPopup' + agent_id).addClass('active');\n return false;\n });\n $('.os-agent-bio-close').on('click', function(){\n $(this).closest('.os-agent-bio-popup').removeClass('active');\n return false;\n });\n }\n\n\n function latepoint_init_step_confirmation(){\n\n $('.latepoint-booking-form-element').on('click', '.set-customer-password-btn', function(){\n var $btn = $(this);\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n\n $btn.addClass('os-loading');\n var params = { account_nonse: $('input[name=\"account_nonse\"]').val(), password: $('input[name=\"customer[password]\"]').val(), password_confirmation: $('input[name=\"customer[password_confirmation]\"]').val()}\n var data = { action: 'latepoint_route_call', route_name: $(this).data('btn-action'), params: $.param(params), layout: 'none', return_format: 'json' }\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n $btn.removeClass('os-loading');\n if(data.status === \"success\"){\n $booking_form_wrapper.find('.step-confirmation-set-password').html('').hide();\n $booking_form_wrapper.find('.confirmation-cabinet-info').show();\n }else{\n latepoint_show_message_inside_element(data.message, $booking_form_wrapper.find('.step-confirmation-set-password'), 'error');\n }\n }\n });\n return false;\n });\n\n $('.latepoint-booking-form-element').on('click', '.qr-show-trigger', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n $booking_form_wrapper.find('.qr-code-on-confirmation').addClass('show-vevent-qr-code');\n return false;\n });\n\n $('.latepoint-booking-form-element').on('click', '.show-set-password-fields', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n\n $booking_form_wrapper.find('.step-confirmation-set-password').show();\n $booking_form_wrapper.find('#customer_password').focus();\n $(this).closest('.info-box').hide();\n return false;\n });\n }\n\n\n function latepoint_init_customer_dashboard_login(){\n if($('.latepoint-login-form-w #facebook-signin-btn').length && $('.latepoint-login-form-w').length){\n $('.latepoint-login-form-w #facebook-signin-btn').on('click', function(){\n var $login_form_wrapper = $(this).closest('.latepoint-login-form-w');\n FB.login(function(response){\n if (response.status === 'connected' && response.authResponse) {\n var params = { token: response.authResponse.accessToken};\n var data = { action: 'latepoint_route_call', route_name: $login_form_wrapper.find('#facebook-signin-btn').data('login-action'), params: $.param(params), layout: 'none', return_format: 'json' };\n latepoint_step_content_change_start($login_form_wrapper);\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n location.reload();\n }else{\n latepoint_show_message_inside_element(data.message, $login_form_wrapper);\n latepoint_step_content_change_end(false, $login_form_wrapper);\n }\n }\n });\n } else {\n \n }\n }, {scope: 'public_profile,email'});\n });\n }\n\n if($('.latepoint-login-form-w #google-signin-btn').length && $('.latepoint-login-form-w').length){\n // INIT GOOGLE LOGIN\n var googleUser = {};\n\n var $login_form_wrappers = $('.latepoint-login-form-w');\n $login_form_wrappers.each(function(){\n var $login_form_wrapper = $(this);\n gapi.load('auth2', function(){\n // Retrieve the singleton for the GoogleAuth library and set up the client.\n var auth2 = gapi.auth2.init({\n client_id: $login_form_wrapper.find('meta[name=google-signin-client_id]').attr(\"content\"),\n cookiepolicy: 'single_host_origin',\n // Request scopes in addition to 'profile' and 'email'\n //scope: 'additional_scope'\n });\n\n auth2.attachClickHandler($login_form_wrapper.find('#google-signin-btn')[0], {},\n function(googleUser) {\n var params = { token: googleUser.getAuthResponse().id_token};\n var data = { action: 'latepoint_route_call', route_name: $login_form_wrapper.find('#google-signin-btn').data('login-action'), params: $.param(params), layout: 'none', return_format: 'json' };\n latepoint_step_content_change_start($login_form_wrapper);\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n location.reload();\n }else{\n latepoint_show_message_inside_element(data.message, $login_form_wrapper);\n latepoint_step_content_change_end(false, $login_form_wrapper);\n }\n }\n });\n }, function(error) {\n // console.log(JSON.stringify(error, undefined, 2));\n });\n });\n });\n }\n }\n\n\n function latepoint_init_step_contact(){\n latepoint_init_facebook_login();\n latepoint_init_google_login();\n latepoint_init_form_masks();\n\n $('.step-contact-w').each(function(){\n var customer_name = $(this).find('input[name=\"customer[first_name]\"]').val() + ' ' + $(this).find('input[name=\"customer[last_name]\"]').val();\n customer_name = customer_name.trim();\n latepoint_update_summary_field($(this).closest('.latepoint-booking-form-element'), 'customer', customer_name);\n });\n\n $('.step-contact-w').on('keyup', 'input[name=\"customer[first_name]\"], input[name=\"customer[last_name]\"]', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n latepoint_update_summary_field($booking_form_wrapper, 'customer', $booking_form_wrapper.find('input[name=\"customer[first_name]\"]').val() + ' ' + $booking_form_wrapper.find('input[name=\"customer[last_name]\"]').val());\n });\n\n $('.step-contact-w').on('keyup', '.os-form-control.required', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n if(latepoint_validate_fields($booking_form_wrapper.find('.step-contact-w .os-form-control.required'))){\n }else{\n }\n });\n\n // Init Logout button\n $('.step-customer-logout-btn').on('click', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n var data = { action: 'latepoint_route_call', route_name: $(this).data('btn-action'), layout: 'none', return_format: 'json' }\n latepoint_step_content_change_start($booking_form_wrapper);\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n latepoint_reload_step($booking_form_wrapper);\n }\n });\n return false;\n });\n\n // Init Login Existing Customer Button\n $('.step-login-existing-customer-btn').on('click', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n var params = { email: $booking_form_wrapper.find('.os-step-existing-customer-login-w input[name=\"customer_login[email]\"]').val(), password: $booking_form_wrapper.find('.os-step-existing-customer-login-w input[name=\"customer_login[password]\"]').val()}\n var data = { action: 'latepoint_route_call', route_name: $(this).data('btn-action'), params: $.param(params), layout: 'none', return_format: 'json' }\n latepoint_step_content_change_start($booking_form_wrapper);\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n latepoint_reload_step($booking_form_wrapper);\n }else{\n latepoint_show_message_inside_element(data.message, $booking_form_wrapper.find('.os-step-existing-customer-login-w'));\n latepoint_step_content_change_end(false, $booking_form_wrapper);\n }\n }\n });\n return false;\n });\n }\n\n function latepoint_step_content_change_start($booking_form_wrapper){\n $booking_form_wrapper.removeClass('step-content-loaded').addClass('step-content-loading');\n }\n\n // TODO\n function latepoint_step_content_change_end(new_content, $booking_form_wrapper){\n if(new_content) $booking_form_wrapper.find('.latepoint-body .latepoint-step-content').replaceWith(new_content);\n $booking_form_wrapper.removeClass('step-content-loading').addClass('step-content-mid-loading');\n setTimeout(function(){\n $booking_form_wrapper.removeClass('step-content-mid-loading').addClass('step-content-loaded');\n }, 50);\n }\n\n function latepoint_init_facebook_login(){\n if(!$('#facebook-signin-btn').length || !$('.latepoint-booking-form-element').length) return;\n $('#facebook-signin-btn').on('click', function(){\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n FB.login(function(response){\n if (response.status === 'connected' && response.authResponse) {\n var params = { token: response.authResponse.accessToken};\n var data = { action: 'latepoint_route_call', route_name: $booking_form_wrapper.find('#facebook-signin-btn').data('login-action'), params: $.param(params), layout: 'none', return_format: 'json' };\n latepoint_step_content_change_start($booking_form_wrapper);\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n latepoint_reload_step($booking_form_wrapper);\n }else{\n latepoint_show_message_inside_element(data.message, $booking_form_wrapper.find('.os-step-existing-customer-login-w '));\n latepoint_step_content_change_end(false, $booking_form_wrapper);\n }\n }\n });\n } else {\n \n }\n }, {scope: 'public_profile,email'});\n });\n }\n\n function latepoint_init_google_login(){\n if(!$('#google-signin-btn').length || !$('.latepoint-booking-form-element').length) return;\n var googleUser = {};\n\n var $booking_form_wrappers = $('.latepoint-booking-form-element');\n $booking_form_wrappers.each(function(){\n var $booking_form_wrapper = $(this);\n gapi.load('auth2', function(){\n // Retrieve the singleton for the GoogleAuth library and set up the client.\n var auth2 = gapi.auth2.init({\n client_id: $booking_form_wrapper.find('meta[name=google-signin-client_id]').attr(\"content\"),\n cookiepolicy: 'single_host_origin',\n // Request scopes in addition to 'profile' and 'email'\n //scope: 'additional_scope'\n });\n\n auth2.attachClickHandler($booking_form_wrapper.find('#google-signin-btn')[0], {},\n function(googleUser) {\n var params = { token: googleUser.getAuthResponse().id_token};\n var data = { action: 'latepoint_route_call', route_name: $booking_form_wrapper.find('#google-signin-btn').data('login-action'), params: $.param(params), layout: 'none', return_format: 'json' };\n latepoint_step_content_change_start($booking_form_wrapper);\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n latepoint_reload_step($booking_form_wrapper);\n }else{\n latepoint_show_message_inside_element(data.message, $booking_form_wrapper.find('.os-step-existing-customer-login-w '));\n latepoint_step_content_change_end(false, $booking_form_wrapper);\n }\n }\n });\n }, function(error) {\n // console.log(JSON.stringify(error, undefined, 2));\n });\n });\n });\n }\n\n function latepoint_change_step_desc($booking_form_wrapper, step_name){\n $booking_form_wrapper.removeClass('step-changed').addClass('step-changing');\n setTimeout(function(){\n // Progress bar\n var $step_progress = $booking_form_wrapper.find('.latepoint-progress li[data-step-name=\"' + step_name + '\"]');\n $step_progress.addClass('active').addClass('complete').prevAll().addClass('complete').removeClass('active');\n $step_progress.nextAll().removeClass('complete').removeClass('active');\n // Side panel\n var side_panel_desc = $booking_form_wrapper.find('.latepoint-step-desc-library[data-step-name=\"' + step_name + '\"]').html();\n $booking_form_wrapper.find('.latepoint-step-desc').html(side_panel_desc);\n\n // Top header\n var top_header_desc = $booking_form_wrapper.find('.os-heading-text-library[data-step-name=\"' + step_name + '\"]').html();\n $booking_form_wrapper.find('.os-heading-text').html(top_header_desc);\n setTimeout(function(){\n $booking_form_wrapper.removeClass('step-changing').addClass('step-changed');\n }, 50);\n }, 500);\n }\n\n\n function latepoint_progress_prev($booking_form_wrapper, step_name){\n var $step_progress = $booking_form_wrapper.find('.latepoint-progress li[data-step-name=\"' + step_name + '\"]');\n $step_progress.addClass('active').addClass('complete').prevAll().addClass('complete').removeClass('active');\n $step_progress.nextAll().removeClass('complete').removeClass('active');\n }\n\n\n function latepoint_progress_next($booking_form_wrapper, step_name){\n var $step_progress = $booking_form_wrapper.find('.latepoint-progress li[data-step-name=\"' + step_name + '\"]');\n $step_progress.addClass('active').addClass('complete').prevAll().addClass('complete').removeClass('active');\n $step_progress.nextAll().removeClass('complete').removeClass('active');\n }\n\n\n function latepoint_next_step_description($booking_form_wrapper, step_name){\n $booking_form_wrapper.removeClass('step-changed').addClass('step-changing');\n setTimeout(function(){\n $booking_form_wrapper.find('.latepoint-step-desc').html($booking_form_wrapper.find('.latepoint-step-desc-library.active').removeClass('active').next('.latepoint-step-desc-library').addClass('active').html());\n $booking_form_wrapper.find('.os-heading-text').html($booking_form_wrapper.find('.os-heading-text-library.active').removeClass('active').next('.os-heading-text-library').addClass('active').html());\n setTimeout(function(){\n $booking_form_wrapper.removeClass('step-changing').addClass('step-changed');\n }, 50);\n }, 500);\n }\n function latepoint_prev_step_description($booking_form_wrapper, step_name){\n $booking_form_wrapper.removeClass('step-changed').addClass('step-changing');\n setTimeout(function(){\n $booking_form_wrapper.find('.latepoint-step-desc').html($booking_form_wrapper.find('.latepoint-step-desc-library.active').removeClass('active').prev('.latepoint-step-desc-library').addClass('active').html());\n $booking_form_wrapper.find('.os-heading-text').html($booking_form_wrapper.find('.os-heading-text-library.active').removeClass('active').prev('.os-heading-text-library').addClass('active').html());\n setTimeout(function(){\n $booking_form_wrapper.removeClass('step-changing').addClass('step-changed');\n }, 50);\n }, 500);\n }\n\n\n function latepoint_validate_fields($fields){\n var is_valid = true;\n $fields.each(function(index){\n if($(this).val() == ''){\n is_valid = false;\n return false;\n }\n });\n return is_valid;\n }\n\n\n function latepoint_init_booking_form(){\n $('.latepoint-lightbox-close').on('click', function(){\n $('body').removeClass('latepoint-lightbox-active');\n $('.latepoint-lightbox-w').remove();\n return false;\n });\n\n\n $('.latepoint-customer-timezone-selector-w select').on('change', function(e){\n var $select_box = $(this);\n $select_box.closest('.latepoint-customer-timezone-selector-w').addClass('os-loading');\n var data = { action: 'latepoint_route_call', route_name: $(this).closest('.latepoint-customer-timezone-selector-w').data('route-name'), params: { timezone_name: $(this).val()}, layout: 'none', return_format: 'json'}\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n $select_box.closest('.latepoint-customer-timezone-selector-w').removeClass('os-loading');\n if(data.status === \"success\"){\n location.reload();\n }else{\n\n }\n }\n });\n });\n\n $('.latepoint-timezone-selector-w select').on('change', function(e){\n var $select_box = $(this);\n $select_box.closest('.latepoint-timezone-selector-w').addClass('os-loading');\n var data = { action: 'latepoint_route_call', route_name: $(this).closest('.latepoint-timezone-selector-w').data('route-name'), params: { timezone_name: $(this).val()}, layout: 'none', return_format: 'json'}\n var $booking_form_wrapper = $select_box.closest('.latepoint-booking-form-element');\n $booking_form_wrapper.removeClass('step-content-loaded').addClass('step-content-loading');\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n $select_box.closest('.latepoint-timezone-selector-w').removeClass('os-loading');\n $booking_form_wrapper.removeClass('step-content-loading');\n if(data.status === \"success\"){\n // reload datepicker if its the step\n if($select_box.closest('.latepoint-booking-form-element').hasClass('current-step-datepicker')){\n latepoint_reload_step($select_box.closest('.latepoint-booking-form-element'));\n }\n }else{\n\n }\n }\n });\n });\n\n if(!latepoint_helper.is_timezone_selected){\n const tzid = Intl.DateTimeFormat().resolvedOptions().timeZone;\n if(tzid){\n if(tzid != $('.latepoint-timezone-selector-w select').val()) $('.latepoint-timezone-selector-w select').val(tzid).change();\n }\n }\n\n $('.latepoint-booking-form-element .latepoint-form').on('submit', function(e){\n var $booking_form = $(this);\n var $booking_form_wrapper = $(this).closest('.latepoint-booking-form-element');\n e.preventDefault();\n var form_data = $booking_form.serialize();\n var data = { action: 'latepoint_route_call', route_name: $booking_form.data('route-name'), params: form_data, layout: 'none', return_format: 'json'}\n $booking_form_wrapper.removeClass('step-content-loaded').addClass('step-content-loading');\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n $booking_form_wrapper.find('.latepoint_current_step').val(data.step_name);\n $booking_form_wrapper.removeClass(function (index, className) { return (className.match (/(^|\\s)current-step-\\S+/g) || []).join(' '); }).addClass('current-step-' + data.step_name);\n setTimeout(function(){\n $booking_form_wrapper.removeClass('step-content-loading').addClass('step-content-mid-loading');\n $booking_form_wrapper.find('.latepoint-body').html(data.message);\n latepoint_init_step(data.step_name, $booking_form_wrapper);\n setTimeout(function(){\n $booking_form_wrapper.removeClass('step-content-mid-loading').addClass('step-content-loaded');\n $booking_form_wrapper.find('.latepoint-next-btn, .latepoint-prev-btn').removeClass('os-loading');\n }, 50);\n }, 500);\n\n if(data.is_pre_last_step){\n $booking_form_wrapper.find('.latepoint-next-btn span').text($booking_form_wrapper.find('.latepoint-next-btn').data('pre-last-step-label'));\n }else{\n $booking_form_wrapper.find('.latepoint-next-btn span').text($booking_form_wrapper.find('.latepoint-next-btn').data('label'));\n }\n if(data.is_last_step){\n $booking_form_wrapper.addClass('hidden-buttons').find('.latepoint-footer').remove();\n $booking_form_wrapper.find('.latepoint-progress').css( 'opacity', 0 );\n $booking_form_wrapper.closest('.latepoint-summary-is-open').removeClass('latepoint-summary-is-open');\n $booking_form_wrapper.addClass('is-final-step');\n }else{\n if(data.show_next_btn === true){\n show_next_btn($booking_form_wrapper);\n }else{\n hide_next_btn($booking_form_wrapper);\n }\n if(data.show_prev_btn === true){\n show_prev_btn($booking_form_wrapper);\n }else{\n hide_prev_btn($booking_form_wrapper);\n }\n }\n \n\n latepoint_change_step_desc($booking_form_wrapper, data.step_name);\n }else{\n $booking_form_wrapper.removeClass('step-content-loading').addClass('step-content-loaded');\n $booking_form_wrapper.find('.latepoint-next-btn, .latepoint-prev-btn').removeClass('os-loading');\n latepoint_show_message_inside_element(data.message, $booking_form_wrapper.find('.latepoint-body'));\n }\n $booking_form.find('.latepoint_step_direction').val('next');\n }\n });\n });\n\n \n\n $('.latepoint-booking-form-element').on('click', '.lp-option', function(){\n $(this).closest('.lp-options').find('.lp-option.selected').removeClass('selected');\n $(this).addClass('selected');\n });\n\n\n\n\n // Next Step button Click\n $('.latepoint-booking-form-element .latepoint-next-btn').on('click', function(e){\n if($(this).hasClass('disabled') || $(this).hasClass('os-loading')) return false;\n var $booking_form = $(this).closest('.latepoint-form');\n var $booking_form_wrapper = $booking_form.closest('.latepoint-booking-form-element');\n\n $booking_form.find('.latepoint_step_direction').val('next');\n if(($booking_form_wrapper.find('.latepoint_current_step').val() == 'payment') && ($booking_form_wrapper.find('input[name=\"booking[payment_method]\"]').val() == 'card') && !latepoint_helper.demo_mode){\n if(latepoint_helper.is_stripe_active){\n latepoint_stripe_create_token($booking_form_wrapper);\n }\n if(latepoint_helper.is_braintree_active){\n OsPaymentsBraintree.create_token($booking_form_wrapper);\n }\n }else{\n $booking_form.submit();\n }\n $(this).addClass('os-loading');\n return false;\n });\n\n\n // Previous Step button Click\n $('.latepoint-booking-form-element .latepoint-prev-btn').on('click', function(e){\n if($(this).hasClass('disabled') || $(this).hasClass('os-loading')) return false;\n var $booking_form = $(this).closest('.latepoint-form');\n var $booking_form_wrapper = $booking_form.closest('.latepoint-booking-form-element');\n\n var current_step = $booking_form.find('.latepoint_current_step').val();\n\n if(current_step == 'locations'){\n $booking_form_wrapper.find('.latepoint_location_id').val('');\n }\n if(current_step == 'agents'){\n $booking_form_wrapper.find('.latepoint_agent_id').val('');\n }\n if(current_step == 'payment'){\n var $payment_step = $booking_form_wrapper.find('.step-payment-w');\n if($payment_step.length){\n $payment_step.find('.lp-option.selected').removeClass('selected');\n var current_payment_step_class = $payment_step.data('current-payment-step');\n var new_current_payment_step_class = $payment_step.data('prev-payment-step');\n if(new_current_payment_step_class){\n var new_prev_payment_step_class = latepoint_get_new_prev_payment_class($payment_step, new_current_payment_step_class);\n $payment_step.removeClass(current_payment_step_class)\n .addClass(new_current_payment_step_class)\n .data('current-payment-step', new_current_payment_step_class)\n .data('prev-payment-step', new_prev_payment_step_class);\n hide_next_btn($booking_form_wrapper);\n return false;\n }\n }\n }\n if(current_step == 'services'){\n var $services_step = $booking_form_wrapper.find('.step-services-w');\n if($services_step.hasClass('selecting-service-duration')){\n $services_step.removeClass('selecting-service-duration');\n $services_step.find('.os-services > .os-item.selected').removeClass('selected');\n return false;\n }\n if($services_step.hasClass('selecting-total-attendies')){\n $services_step.removeClass('selecting-total-attendies');\n $services_step.find('.os-services > .os-item.selected').removeClass('selected');\n return false;\n }\n if($services_step.hasClass('selecting-service-category')){\n if($services_step.find('.os-service-category-w .os-service-category-w.selected').length){\n $services_step.find('.os-service-category-w .os-service-category-w.selected').parents('.os-service-category-w').addClass('selected').find('.os-service-category-w.selected').removeClass('selected');\n }else{\n $services_step.removeClass('selecting-service-category').find('.os-service-category-w.selected').removeClass('selected');\n $services_step.removeClass('selecting-service-category').find('.os-service-categories-holder.show-selected-only').removeClass('show-selected-only');\n }\n return false;\n }\n $booking_form_wrapper.find('.latepoint_service_id').val('');\n $booking_form_wrapper.find('input[name=\"booking[duration]\"]').val('');\n $booking_form_wrapper.find('input[name=\"booking[total_attendies]\"]').val('');\n }\n\n latepoint_clear_step_vars($booking_form.find('.latepoint_current_step').val(), $booking_form);\n $booking_form.find('.latepoint_step_direction').val('prev');\n $booking_form.submit();\n $booking_form.closest('.latepoint-with-summary').addClass('latepoint-summary-is-open');\n $(this).addClass('os-loading');\n return false;\n });\n }\n\n // DOCUMENT READY\n $( function() {\n\n latepoint_init_customer_dashboard_login();\n\n if($('.latepoint-booking-form-element').length){\n latepoint_init_booking_form();\n $('.latepoint-booking-form-element').each(function(){\n latepoint_init_step($(this).find('.latepoint_current_step').val());\n });\n }\n\n $('.latepoint-request-booking-cancellation').on('click', function(){\n if(!confirm(latepoint_helper.cancel_booking_prompt)) return false;\n var $this = $(this);\n var $booking_box = $this.closest('.customer-booking');\n\n var route = $(this).data('route');\n var params = {id: $booking_box.data('id')};\n\n var data = { action: 'latepoint_route_call', route_name: route, params: params, layout: 'none', return_format: 'json' }\n $this.addClass('os-loading');\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n location.reload();\n }else{\n $this.removeClass('os-loading');\n }\n }\n });\n return false;\n });\n\n\n $('body').on('click', '.os-step-tabs .os-step-tab', function(){\n $(this).closest('.os-step-tabs').find('.os-step-tab').removeClass('active');\n $(this).addClass('active');\n var target = $(this).data('target');\n $(this).closest('.os-step-tabs-w').find('.os-step-tab-content').hide();\n $(target).show();\n });\n\n $('body').on('keyup', '.os-form-group .os-form-control', function(){\n if($(this).val()){\n $(this).closest('.os-form-group').addClass('has-value');\n }else{\n $(this).closest('.os-form-group').removeClass('has-value');\n }\n });\n\n $('.latepoint-tab-triggers').on('click', '.latepoint-tab-trigger', function(){\n var $tabs_wrapper = $(this).closest('.latepoint-tabs-w')\n $tabs_wrapper.find('.latepoint-tab-trigger.active').removeClass('active');\n $tabs_wrapper.find('.latepoint-tab-content').removeClass('active');\n $(this).addClass('active');\n $tabs_wrapper.find('.latepoint-tab-content' + $(this).data('tab-target')).addClass('active');\n return false;\n });\n\n\n // Main Button to trigger lightbox opening\n $('.latepoint-book-button, .os_trigger_booking').on('click', function(){\n var $this = $(this);\n var route = latepoint_helper.booking_button_route;\n var params = {};\n var restrictions = {};\n if($this.data('show-service-categories')) restrictions.show_service_categories = $this.data('show-service-categories');\n if($this.data('show-locations')) restrictions.show_locations = $this.data('show-locations');\n if($this.data('show-services')) restrictions.show_services = $this.data('show-services');\n if($this.data('show-agents')) restrictions.show_agents = $this.data('show-agents');\n if($this.data('selected-location')) restrictions.selected_location = $this.data('selected-location');\n if($this.data('selected-agent')) restrictions.selected_agent = $this.data('selected-agent');\n if($this.data('selected-service')) restrictions.selected_service = $this.data('selected-service');\n if($this.data('selected-service-category')) restrictions.selected_service_category = $this.data('selected-service-category');\n if($this.data('calendar-start-date')) restrictions.calendar_start_date = $this.data('calendar-start-date');\n\n if($.isEmptyObject(restrictions) == false) params.restrictions = restrictions;\n\n var data = { action: 'latepoint_route_call', route_name: route, params: params, layout: 'none', return_format: 'json' }\n $this.addClass('os-loading');\n $.ajax({\n type : \"post\",\n dataType : \"json\",\n url : latepoint_helper.ajaxurl,\n data : data,\n success: function(data){\n if(data.status === \"success\"){\n var lightbox_class = '';\n if($this.data('hide-summary') != 'yes') lightbox_class+= ' latepoint-with-summary';\n if($this.data('hide-side-panel') == 'yes') lightbox_class+= ' latepoint-hide-side-panel';\n latepoint_show_data_in_lightbox(data.message, lightbox_class);\n latepoint_init_booking_form();\n latepoint_init_step(data.step);\n $('body').addClass('latepoint-lightbox-active');\n $this.removeClass('os-loading');\n \n }else{\n $this.removeClass('os-loading');\n // console.log(data.message);\n }\n }\n });\n\n return false;\n });\n\n\n\n });\n\n\n} )( jQuery );\n","class OsPaymentsBraintree {\n\n\n static create_paypal_button(button){\n \tlet $booking_form_wrapper = jQuery(button).closest('.latepoint-booking-form-element');\n \tvar payment_amount = latepoint_get_paypal_payment_amount($booking_form_wrapper);\n \t\n braintree.client.create({\n authorization: latepoint_helper.braintree_paypal_client_auth\n }).then(function (clientInstance) {\n // Create a PayPal Checkout component.\n return braintree.paypalCheckout.create({\n client: clientInstance\n });\n }).then(function (paypalCheckoutInstance) {\n // Set up PayPal with the checkout.js library\n return paypal.Button.render({\n \tstyle: {\n \t\tlabel: 'pay',\n \t\tsize: 'large',\n \t\tshape: 'rect',\n \t\ttagline: false,\n \t\tcolor: 'gold'\n \t},\n env: latepoint_helper.braintree_paypal_environment_name, // or 'sandbox'\n\n payment: function () {\n return paypalCheckoutInstance.createPayment({\n flow: 'checkout', // Required\n amount: payment_amount, // Required\n currency: latepoint_helper.paypal_payment_currency,\n intent: 'authorize' // Required\n // Your PayPal options here. For available options, see\n // http://braintree.github.io/braintree-web/current/PayPalCheckout.html#createPayment\n });\n },\n\n\n onAuthorize: function (data, actions) {\n return paypalCheckoutInstance.tokenizePayment(data)\n .then(function (payload) {\n\t\t\t latepoint_set_payment_token_and_submit($booking_form_wrapper, payload.nonce);\n });\n },\n\n onCancel: function (data) {\n // console.log('checkout.js payment cancelled', JSON.stringify(data, 0, 2));\n },\n\n onError: function (err) {\n console.error('checkout.js error', err);\n }\n }, button);\n }).then(function () {\n // The PayPal button will be rendered in an html element with the id\n // `paypal-button`. This function will be called when the PayPal button\n // is set up and ready to be used.\n }).catch(function (err) {\n console.error('Error!', err);\n // Handle component creation error\n });\n }\n\n\tstatic create_token($booking_form_wrapper){\n\t // Gather additional customer data we may have collected in our form.\n\t var name = jQuery($booking_form_wrapper).find('#payment_name_on_card');\n\t var zip = jQuery($booking_form_wrapper).find('#payment_zip');\n\t var additionalData = {\n\t name: name ? name.value : undefined,\n\t address_zip: zip ? zip.value : undefined,\n\t };\n\n\t OsPaymentsBraintree.hostedFieldsInstance.tokenize(function (tokenizeErr, payload) {\n\t if (tokenizeErr) {\n\t \tif(tokenizeErr.code == 'HOSTED_FIELDS_FIELDS_INVALID' && tokenizeErr.details.invalidFields){\n\t \t\tjQuery.each(tokenizeErr.details.invalidFields, function(key, field){\n\t \t\t\tjQuery(field).addClass('braintree-hosted-fields-invalid');\n\t \t\t});\n\t \t}\n\t latepoint_show_message_inside_element(tokenizeErr.message);\n\t jQuery($booking_form_wrapper).find('.latepoint-next-btn').removeClass('os-loading');\n\t }else{\n\t // If we received a token, show the token ID.\n latepoint_set_payment_token_and_submit($booking_form_wrapper, payload.nonce);\n\t }\n\t });\n\t}\n\n\n\n\n\tstatic init_cc_form(){\n\t\tbraintree.client.create({\n\t\t authorization: latepoint_helper.braintree_tokenization_key\n\t\t}, function(err, clientInstance) {\n\t\t if (err) {\n\t\t console.error(err);\n\t\t return;\n\t\t }\n\n\t\t braintree.hostedFields.create({\n\t\t client: clientInstance,\n\t\t styles: {\n\t\t 'input': {\n\t\t 'font-size': '14px',\n\t\t 'font-family': latepoint_helper.body_font_family,\n\t\t 'font-weight': '500',\n\t\t 'color': '#fff',\n\t\t },\n\t\t ':focus': {\n\t\t 'color': '#fff'\n\t\t },\n\t\t '::placeholder': {\n\t\t 'color': '#7d89b1'\n\t\t },\n\t\t '.valid': {\n\t\t 'color': '#fff'\n\t\t },\n\t\t '.invalid': {\n\t\t 'color': '#ff5a16'\n\t\t }\n\t\t },\n\t\t fields: {\n\t\t number: {\n\t\t selector: '#payment_card_number',\n\t\t placeholder: jQuery('#payment_card_number').data('placeholder')\n\t\t },\n\t\t cvv: {\n\t\t selector: '#payment_card_cvc',\n\t\t placeholder: jQuery('#payment_card_cvc').data('placeholder')\n\t\t },\n\t\t expirationDate: {\n\t\t selector: '#payment_card_expiration',\n\t\t placeholder: jQuery('#payment_card_expiration').data('placeholder')\n\t\t },\n\t\t }\n\t\t }, function(err, hostedFieldsInstance) {\n\t\t \tOsPaymentsBraintree.hostedFieldsInstance = hostedFieldsInstance;\n\t\t if (err) {\n\t\t console.error(err);\n\t\t return;\n\t\t }\n\t\t });\n\t\t});\n\t}\n}","class OsPaymentsPaypal {\n\n\n static create_paypal_button(button){\n \tlet $booking_form_wrapper = jQuery(button).closest('.latepoint-booking-form-element');\n \tvar payment_amount = latepoint_get_paypal_payment_amount($booking_form_wrapper);\n\n\t paypal.Buttons({\n\t createOrder: function(data, actions) {\n\t return actions.order.create({\n\t purchase_units: [{\n\t amount: {\n\t value: payment_amount,\n\t currency_code: latepoint_helper.paypal_payment_currency,\n\t },\n\t }],\n\t application_context: {\n\t\t shipping_preference: 'NO_SHIPPING'\n\t }\n\t });\n\t },\n\t onApprove: function(data, actions) {\n\n\t\t\t\tjQuery($booking_form_wrapper).removeClass('step-content-loaded').addClass('step-content-loading');\n\t // Authorize the transaction\n\t actions.order.authorize().then(function(authorization) {\n\n\t // Get the authorization id\n\t var authorizationID = authorization.purchase_units[0].payments.authorizations[0].id\n var orderID = data.orderID;\n\t latepoint_set_payment_token_and_submit($booking_form_wrapper, authorizationID);\n\t });\n\t }\n\t }).render(button);\n }\n}"]}