// source --> https://www.signal-wrapping.com/wp-content/plugins/WP_Estimation_Form/assets/js/lfb_form.min.js?ver=10.24 
!function($){"use strict";var lfb_lastStepID=0,lfb_lastSteps=new Array,lfb_plannedSteps,lfb_gmapMatrixService=!1,lfb_tld_selectionMode=!1,lfb_calendars=new Array,lfb_stripe,lfb_mapStyles=new Array;function touchHandler(event){var touch=event.changedTouches[0],simulatedEvent=document.createEvent("MouseEvent");simulatedEvent.initMouseEvent({touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"}[event.type],!0,!0,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,!1,!1,!1,!1,0,null),touch.target.dispatchEvent(simulatedEvent)}function initComboBox(){$.widget("custom.combobox",{_create:function(){this.wrapper=$("<span>").addClass("custom-combobox lfb_comboboxContainer").insertAfter(this.element),this.element.hide(),this._createAutocomplete(),this._createShowAllButton()},_createAutocomplete:function(){var selected=this.element.children(":selected"),value=selected.val()?selected.text():"";this.input=$("<input>").appendTo(this.wrapper).val(value).attr("title","").addClass("custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left form-control").autocomplete({classes:{"ui-autocomplete":"lfb_dropdownAutocompleteMenu"},delay:0,minLength:0,appendTo:$("#lfb_form"),source:this._source.bind(this),change:function(event,ui){$(this).closest(".lfb_itemBloc").find("select").trigger("change")},select:function(event,ui){$(this).closest(".lfb_itemBloc").find("select").trigger("change")},open:function(event,ui){$(".lfb_dropdownAutocompleteMenu").css({width:$(this).outerWidth()}),$(this).closest(".lfb_itemBloc").find(".fa-solid").addClass("fa-caret-up"),$(this).closest(".lfb_itemBloc").find(".fa-solid").removeClass("fa-caret-down")},close:function(event,ui){$(this).closest(".lfb_itemBloc").find(".fa-solid").removeClass("fa-caret-up"),$(this).closest(".lfb_itemBloc").find(".fa-solid").addClass("fa-caret-down")}}),this._on(this.input,{autocompleteselect:function(event,ui){ui.item.option.selected=!0,this._trigger("select",event,{item:ui.item.option})},autocompletechange:"_removeIfInvalid"})},_createShowAllButton:function(){var input=this.input,wasOpen=!1;$("<a>").attr("tabIndex",-1).attr("title","Show All Items").appendTo(this.wrapper).append('<i class="fa-solid fa-caret-down"></i>').removeClass("ui-corner-all").addClass("custom-combobox-toggle ui-corner-right lfb_dropdownAutocompleteBtn").on("mousedown",(function(){wasOpen=input.autocomplete("widget").is(":visible")})).on("click",(function(){input.trigger("focus"),wasOpen||input.autocomplete("search","")}))},_source:function(request,response){var matcher=new RegExp($.ui.autocomplete.escapeRegex(request.term),"i");response(this.element.children("option").map((function(){var text=$(this).text();if(this.value&&(!request.term||matcher.test(text)))return{label:text,value:text,option:this}})))},_removeIfInvalid:function(event,ui){if(!ui.item){var value=this.input.val(),valueLowerCase=value.toLowerCase(),valid=!1;this.element.children("option").each((function(){if($(this).text().toLowerCase()===valueLowerCase)return this.selected=valid=!0,!1})),valid||(this.input.val("").attr("title",value+" didn't match any item"),this.element.val(""),this.input.autocomplete("instance").term="")}},_destroy:function(){this.wrapper.remove(),this.element.show()}}),$("#lfb_form .lfb_combobox").combobox()}function lfb_initDocReady(){$(".lfb_dynamicHide").hide().removeClass("lfb_dynamicHide"),$("#lfb_form").length>0&&(document.location.href.indexOf("lfb_action=preview")>-1&&$("#lfb_form:not(.lfb_fullscreen)").remove(),initFlatUI(),window.Dropzone.autoDiscover=!1,lfb_initForms(),jQuery.each(lfb_forms,(function(){var form=this;lfb_checkItems(this.formID),lfb_initListeners(this.formID)})))}function lfb_initWinReady(){$("#lfb_form").length>0&&(lfb_onResize(),$(window).resize(lfb_onResize),$(window).on("popstate",(function(e){null!==e.originalEvent.state&&(e.preventDefault(),lfb_previousStep(lfb_forms[0].formID))}))),$(document).on("scroll",(function(){$("#lfb_form .lfb_datepicker").trigger("blur")})),$("body,html,#lfb_form").on("scroll",(function(){$("#lfb_form .lfb_datepicker").trigger("blur")})),$("#ajax-loading-screen").fadeOut(),$("#ajax-content-wrap >.container-wrap").css({opacity:1,display:"block"}),$("#lfb_form").on("lfb_getForm",(function(e,formID){return lfb_getForm(formID)})),$("#lfb_form").on("lfb_updatePrice",(function(e,formID){lfb_updatePrice(formID)})),$("#lfb_form").on("lfb_order",(function(e,formID){lfb_order(formID)})),$("#lfb_form").on("lfb_nextStep",(function(e,formID){lfb_nextStep(formID)})),$("#lfb_form").on("lfb_checkStepItemsValid",(function(e,stepID,formID){return lfb_checkStepItemsValid(stepID,formID)})),$("#lfb_form").on("lfb_changeStep",(function(e,stepID,formID){lfb_changeStep(stepID,formID)})),$("#lfb_form").on("lfb_getUrlVariablesByFormID",(function(e,formID){return lfb_getUrlVariablesByFormID(formID)})),$("#lfb_form").on("lfb_itemClick",(function(e,$item,action,formID){lfb_itemClick($($item),action,formID)})),$("#lfb_form").on("lfb_getVariableByID",(function(e,formID,variableID){const form=lfb_getForm(formID);return lfb_getVariableByID(form,variableID)})),$("#lfb_form").on("lfb_setVariableByID",(function(e,formID,variableID,value){const form=lfb_getForm(formID);var variable=lfb_getVariableByID(form,variableID);variable&&(variable.value=value)})),$("#lfb_form canvas.img").each((function(){$(this).parent().children("img").css("opacity",0),$(this).parent().children("img").show(),$(this).css({width:$(this).parent().children("img").get(0).width,height:$(this).parent().children("img").get(0).height}),$(this).parent().children("img").hide()})),jQuery.each(lfb_forms,(function(){var form=this;if(1==this.useCaptcha&&""!=this.recaptcha3Key&&$(".grecaptcha-badge").length>0&&0==$('#lfb_form.lfb_bootstraped[data-form="'+this.formID+'"] #finalSlide .grecaptcha-badge').length){var captchaImg=$(".grecaptcha-badge").clone();$('#lfb_form.lfb_bootstraped[data-form="'+this.formID+'"] #finalSlide .lfb_genContentSlide').append(captchaImg)}}))}function lfb_initMapStyles(){lfb_mapStyles.push({name:"default",styles:[]}),lfb_mapStyles.push({name:"aubergine",styles:[{elementType:"geometry",stylers:[{color:"#1d2c4d"}]},{elementType:"labels.text.fill",stylers:[{color:"#8ec3b9"}]},{elementType:"labels.text.stroke",stylers:[{color:"#1a3646"}]},{featureType:"administrative.country",elementType:"geometry.stroke",stylers:[{color:"#4b6878"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#64779e"}]},{featureType:"administrative.province",elementType:"geometry.stroke",stylers:[{color:"#4b6878"}]},{featureType:"landscape.man_made",elementType:"geometry.stroke",stylers:[{color:"#334e87"}]},{featureType:"landscape.natural",elementType:"geometry",stylers:[{color:"#023e58"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#283d6a"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#6f9ba5"}]},{featureType:"poi",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"poi.park",elementType:"geometry.fill",stylers:[{color:"#023e58"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#3C7680"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#304a7d"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#98a5be"}]},{featureType:"road",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#2c6675"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#255763"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#b0d5ce"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{color:"#023e58"}]},{featureType:"transit",elementType:"labels.text.fill",stylers:[{color:"#98a5be"}]},{featureType:"transit",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"transit.line",elementType:"geometry.fill",stylers:[{color:"#283d6a"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#3a4762"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#0e1626"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#4e6d70"}]}]}),lfb_mapStyles.push({name:"retro",styles:[{elementType:"geometry",stylers:[{color:"#ebe3cd"}]},{elementType:"labels.text.fill",stylers:[{color:"#523735"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f1e6"}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#c9b2a6"}]},{featureType:"administrative.land_parcel",elementType:"geometry.stroke",stylers:[{color:"#dcd2be"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#ae9e90"}]},{featureType:"landscape.natural",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#93817c"}]},{featureType:"poi.park",elementType:"geometry.fill",stylers:[{color:"#a5b076"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#447530"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#f5f1e6"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#fdfcf8"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#f8c967"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#e9bc62"}]},{featureType:"road.highway.controlled_access",elementType:"geometry",stylers:[{color:"#e98d58"}]},{featureType:"road.highway.controlled_access",elementType:"geometry.stroke",stylers:[{color:"#db8555"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#806b63"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"transit.line",elementType:"labels.text.fill",stylers:[{color:"#8f7d77"}]},{featureType:"transit.line",elementType:"labels.text.stroke",stylers:[{color:"#ebe3cd"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"water",elementType:"geometry.fill",stylers:[{color:"#b9d3c2"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#92998d"}]}]}),lfb_mapStyles.push({name:"night",styles:[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}]})}function lfb_clearFixedElements(){$("*:not(#lfb_bootstraped)").each((function(){0==$(this).closest("#lfb_bootstraped").length&&"static"!=$(this).css("position")&&$(this).css("position","static"),0==$(this).closest("#lfb_bootstraped").length&&$(this).css("will-change","unset")}))}function lfb_getForm(formID){for(var rep=!1,i=0;i<lfb_forms.length;i++)if(lfb_forms[i].formID==formID){rep=lfb_forms[i];break}return rep}function lfb_onResize(){if($("#lfb_form.lfb_fullscreen:not(.lfb_visualEditing)").css({minHeight:$(window).height()}),$(window).width()<=768){var stepDesHeight=0;$("#lfb_form .lfb_stepDescription").each((function(){$(this).css({top:$(this).closest(".lfb_genSlide").find(".lfb_stepTitle").height()+48})})),$("#lfb_form .lfb_genContent ").each((function(){var stepDesHeight=0;$(this).closest(".lfb_genSlide").find(".lfb_stepDescription").length>0&&(stepDesHeight=lfb_zeroIfNan($(this).closest(".lfb_genSlide").find(".lfb_stepDescription").height())),$(this).css({paddingTop:$(this).closest(".lfb_genSlide").find(".lfb_stepTitle").height()+stepDesHeight+90})}))}else $("#lfb_form .lfb_stepDescription").each((function(){$(this).css({top:$(this).closest(".lfb_genSlide").find(".lfb_stepTitle").height()+28})})),$("#lfb_form .lfb_genContent ").each((function(){var stepDesHeight=0;$(this).closest(".lfb_genSlide").find(".lfb_stepDescription").length>0&&(stepDesHeight=lfb_zeroIfNan($(this).closest(".lfb_genSlide").find(".lfb_stepDescription").height())),$(this).css({paddingTop:$(this).closest(".lfb_genSlide").find(".lfb_stepTitle").height()+stepDesHeight+70})}))}function lfb_updatePlannedSteps(formID){var startStepID=parseInt($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]  #lfb_mainPanel .lfb_genSlide[data-start="1"]').attr("data-stepid"));(lfb_plannedSteps=new Array).push(startStepID),lfb_plannedSteps=lfb_scanPlannedSteps(startStepID,formID)}function lfb_scanPlannedSteps(stepID,formID){var plannedSteps=new Array,potentialSteps=lfb_findPotentialsSteps(stepID,formID);return potentialSteps.length>0&&"final"!=potentialSteps[0]?(lfb_plannedSteps.push(potentialSteps[0]),lfb_scanPlannedSteps(potentialSteps[0],formID),lfb_plannedSteps):lfb_plannedSteps}function lfb_getStepQuantities(formID,stepID,itemID){var form=lfb_getForm(formID),quantities=0;if(jQuery.inArray(parseInt(stepID),lfb_lastSteps)>-1||stepID==form.step){var formContent,items=lfb_getFormContent(formID,!0,stepID)[2];jQuery.each(items,(function(){if(this.itemid!=itemID&&"row"!=this.type&&"column"!=this.type){var item=this;isNaN(this.quantity)?quantities++:quantities+=parseInt(this.quantity)}}))}return quantities}function lfb_getTotalQuantities(formID,stepID,itemID){var form=lfb_getForm(formID),formContent,items=lfb_getFormContent(formID,!0)[2],quantities=0,mustChkPosition=!0;(isNaN(stepID)||0==stepID)&&(mustChkPosition=!1);var chkStep=!1;return jQuery.each(items,(function(){if(this.itemid!=itemID){var item=this;mustChkPosition&&!chkStep&&this.stepid==stepID&&(chkStep=!0),chkStep&&this.stepid!=stepID||(isNaN(this.quantity)?quantities++:quantities+=parseInt(this.quantity))}})),quantities}function lfb_itemClick($item,action,formID){var form=lfb_getForm(formID),chkGrpReq=!1,$this=$item,isChecked=!1,deviceAgent,agentID;action&&($('#lfb_form[data-form="'+form.formID+'"] .quantityBtns').removeClass("open"),$('#lfb_form[data-form="'+form.formID+'"] .quantityBtns').fadeOut(250),navigator.userAgent.toLowerCase().match(/(iPad|iPhone|iPod)/i)&&($("body :not(.ui-slider-handle) > .tooltip").remove(),$("body > .tooltip").remove(),$('#lfb_form[data-form="'+form.formID+'"] > .tooltip').remove()));if(action&&$this.addClass("action"),action||!$this.is(".action")){if("zoom"!=form.imgIconStyle&&$this.find("span.icon_select").animate({bottom:160,opacity:0},200),$this.is(".checked"))if(action&&$this.data("required"));else{"zoom"==form.imgIconStyle?($this.delay(200).css("transition-delay","0.2s"),$this.find("span.icon_select").css("transition-delay","0s")):$this.css("transition-delay","0s");var unChkDelay=220;"zoom"==form.imgIconStyle&&(unChkDelay=0),$this.delay(unChkDelay).removeClass("checked"),"zoom"!=form.imgIconStyle?$this.delay(220).find("span.icon_select").removeClass("fa-check").addClass("fa-times"):$this.find("span.icon_select").css("transition-delay","0s"),$this.delay(400).css("transition-delay","0s"),$this.find(".icon_quantity").delay(300).fadeOut(200)}else if($this.css("transition-delay","0s"),0!=form.disableTipMobile&&lfb_is_touch_device()||$item.is('[data-type="slider"]')||$item.is(".lfb_button")||""!=form.imgTitlesStyle||$item.tooltip("show"),isChecked=!0,"zoom"==form.imgIconStyle&&$this.find("span.icon_select").css("transition-delay",".5s"),$this.is('[type="checkbox"][data-checkboxstyle="checkbox"]')||$this.delay(220).addClass("checked"),"zoom"!=form.imgIconStyle&&$this.delay(220).find("span.icon_select").removeClass("fa-times").addClass("fa-check"),$this.find(".quantityBtns").length>0&&!$this.is("[data-distanceqt]")&&($this.find(".icon_quantity").delay(300).fadeIn(200),$this.find(".quantityBtns").delay(500).addClass("open"),$this.find(".quantityBtns").delay(500).fadeIn("200"),$item.find(".lfb_sliderQt").length>0&&setTimeout((function(){lfb_updatePrice(form.formID,$item.attr("data-itemid"))}),50)),$this.data("urltarget")&&""!=$this.data("urltarget")){var method=$this.data("urltargetmode");"_self"!=method&&"_blank"!=method&&(method="_blank");var win=window.open($this.data("urltarget"),method);"null"!=typeof win&&null!=win&&win.focus()}"zoom"!=form.imgIconStyle&&$this.find("span.icon_select").delay(300).animate({bottom:0,opacity:1},200),action&&$this.data("group")&&($this.closest(".lfb_genSlide").find('div.lfb_selectable.checked[data-group="'+$this.data("group")+'"]:not([data-itemid="'+$this.attr("data-itemid")+'"])').each((function(){lfb_itemClick($(this),!1,formID),$(this).removeClass("checked")})),$this.closest(".lfb_genSlide").find('input[type=checkbox][data-group="'+$this.data("group")+'"]:checked:not([data-itemid="'+$this.attr("data-itemid")+'"])').trigger("click.auto"),$this.closest(".lfb_genSlide").find('a.lfb_button.checked[data-group="'+$this.data("group")+'"]:not([data-itemid="'+$this.attr("data-itemid")+'"])').each((function(){lfb_itemClick($(this),!1,formID),$(this).removeClass("checked")})),"1"==form.groupAutoClick&&$this.is(".checked")&&$this.closest(".lfb_genSlide").is("[data-required=true]")&&setTimeout((function(){0==$this.closest(".lfb_genSlide").find("[data-itemid]").not('[data-itemtype="separator"]').not(".lfb_richtext").not('[data-group="'+$this.data("group")+'"]').not(".lfb_disabled").length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .quantityBtns').length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .lfb_qtfield').length&&lfb_nextStep(form.formID)}),500)),setTimeout((function(){lfb_updatePrice(formID),$this.removeClass("action")}),420)}setTimeout((function(){$this.is('[data-usedistance="true"]')&&lfb_removeDistanceError($this.attr("data-itemid"),formID)}),200)}function lfb_nl2br(str,is_xhtml){var breakTag;return((str=str.replace(/\n\n/g,"\n"))+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+(is_xhtml||void 0===is_xhtml?"<br />":"<br>")+"$2")}function lfb_findGetParameter(parameterName){var result=null,tmp=[];return location.search.substr(1).split("&").forEach((function(item){(tmp=item.split("="))[0]===parameterName&&(result=decodeURIComponent(tmp[1]))})),result}function lfb_initForms(){jQuery.each(lfb_forms,(function(){var form=this;form.price=0,form.priceSingle=0,form.priceMax=0,form.step=0,form.gFormDesignCheck=0,form.timer_gFormSubmit=null,form.timer_gFormDesign=null,form.animationsSpeed*=1e3,form.reductionResult=0,form.reduction=0,form.discountCode="",form.discountCodeDisplayed=!1,form.initialPrice=parseFloat(form.initialPrice),form.contactSent=0,form.gravitySent=!1,form.shineFxIndex=0,form.subscriptionText=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(1)').html(),form.richtextsContent=new Array,form.emailSent=!1,form.autoStart=!1,form.urlVariables="",form.useRazorpay=!1,form.razorpayReady=!1,form.stripeToken="",form.itemsData=new Array,form.signature=!1,$('#lfb_form[data-form="'+form.formID+'"]').data("lfb_form",form),lfb_initVerificationCodeModal(form),setTimeout((function(){$('#lfb_form[data-form="'+form.formID+'"] [data-toggle="tooltip"][data-tooltiptext]:not([title])').each((function(){$(this).attr("title",$(this).attr("data-tooltiptext"))}))}),400);var darkBgColor=!1;if(form.stepsColorBackground){var c=form.stepsColorBackground.substring(1),rgb=parseInt(c,16),r,g,b,luma;.2126*(rgb>>16&255)+.7152*(rgb>>8&255)+.0722*(rgb>>0&255)<40&&(darkBgColor=!0)}darkBgColor&&$('#lfb_form[data-form="'+form.formID+'"]').addClass("lfb_darkStepBg"),$('#lfb_form[data-form="'+form.formID+'"] #lfb_btnStart').length>0&&$('#lfb_form[data-form="'+form.formID+'"] #lfb_btnStart').on("click",(function(){lfb_startFormIntro(form.formID)})),$('#lfb_form[data-form="'+form.formID+'"] #lfb_couponBtn').length>0&&$('#lfb_form[data-form="'+form.formID+'"] #lfb_couponBtn').on("click",(function(){lfb_applyCouponCode(form.formID)})),$('#lfb_form[data-form="'+form.formID+'"] a.lfb_btnSaveForm').length>0&&$('#lfb_form[data-form="'+form.formID+'"] a.lfb_btnSaveForm').on("click",(function(){lfb_saveForLater(form.formID)})),$('#lfb_form[data-form="'+form.formID+'"] a.lfb_btnFloatingSummary').length>0&&$('#lfb_form[data-form="'+form.formID+'"] a.lfb_btnFloatingSummary').on("click",(function(){lfb_toggleFloatingSummary(form.formID)})),$('#lfb_form[data-form="'+form.formID+'"]').is(".lfb_visualEditing")&&lfb_clearFixedElements(),$('#lfb_form[data-form="'+form.formID+'"]').is(".lfb_fullscreen")&&$('#lfb_form[data-form="'+form.formID+'"]').closest("#lfb_bootstraped").parents().css({position:"static",display:"block"}),1==form.useSignature&&(form.signature=$('#lfb_form[data-form="'+form.formID+'"] #lfb_signature').signature({thickness:4,guideline:!1,guidelineOffset:26,background:"#fff"}),$('#lfb_form[data-form="'+form.formID+'"] #lfb_resetSignature').on("click",(function(){form.signature.signature("clear")})),setTimeout((function(){$('#lfb_form[data-form="'+form.formID+'"] #lfb_signature canvas').attr("width",$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_signature').width()),$('#lfb_form[data-form="'+form.formID+'"] #lfb_signature canvas').css("width",$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_signature').width())}),500));for(var i=0;i<form.variables.length;i++)form.variables[i].value=form.variables.defaultValue;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnPayStripe').on("click",(function(){lfb_showWinStripePayment(form)})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_richtext[data-itemid]').each((function(){form.richtextsContent[$(this).attr("data-itemid").toString()]=$(this).html()})),setTimeout(()=>{$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-prefill]').each((function(){if($(this).attr("data-prefill").length>0){var value=lfb_findGetParameter($(this).attr("data-prefill"));null!==value&&$(this).val(value).trigger("change")}}))},200),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-tooltiptext][data-tooltipimg!=""]').each((function(){$(this).attr("data-tooltiptext",$(this).attr("data-tooltiptext")+"<br/><img src='"+$(this).attr("data-tooltipimg")+"' alt='"+$(this).attr("data-tooltiptext")+"'/>")})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-type="numberfield"]:not([value])').each((function(){var min=0;$(this).is("[min]")&&(min=parseInt($(this).attr("min"))),$(this).val(min)}));var formID=form.formID;1==form.save_to_cart?form.save_to_cart=!0:form.save_to_cart=!1,1==form.save_to_cart_edd?form.save_to_cart_edd=!0:form.save_to_cart_edd=!1,form.gravityFormID>0&&jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"get_currentRef",formID:formID},success:function(currentRef){form.current_ref=currentRef}});var calendarsToCheck=new Array;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]  #lfb_mainPanel .lfb_genSlide .lfb_timepicker').each((function(){$(this).timepicker({showMeridian:parseInt(form.timeModeAM),appendWidgetTo:'#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]'}),$(this).on("click",(function(){$(this).timepicker("showWidget")})),$(this).timepicker().on("changeTime.timepicker",(function(e){var minTime=$(this).attr("data-mintime"),maxTime=$(this).attr("data-maxtime");if(""!=minTime&&minTime.indexOf(":")>0){var minHour=parseInt(minTime.substr(0,minTime.indexOf(":"))),minMins=parseInt(minTime.substr(minTime.indexOf(":")+1,2));minTime.indexOf("PM")>0&&12!=minHour&&(minHour+=12);var hours=e.time.hours;"PM"==e.time.meridian&&(hours+=12),(hours<minHour||hours==minHour&&e.time.minutes<minMins)&&$(this).val("")}if(""!=maxTime&&maxTime.indexOf(":")>0){var maxHour=parseInt(maxTime.substr(0,maxTime.indexOf(":"))),maxMins=parseInt(maxTime.substr(maxTime.indexOf(":")+1,2));maxTime.indexOf("PM")>0&&12!=maxHour&&(maxHour+=12);var hours=e.time.hours;"PM"==e.time.meridian&&(hours+=12),(hours>maxHour||hours==maxHour&&e.time.minutes>maxMins)&&$(this).val("")}}))}));var dateFormat=lfb_forms[0].dateFormat,deviceAgent,agentID;dateFormat=dateFormat.replace(/\\\//g,"/"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]  #lfb_mainPanel .lfb_genSlide .lfb_datepicker:not(.lfb_datepickerReady)').each((function(){var minDate=new Date;if($(this).addClass("lfb_datepickerReady"),$(this).is('[data-allowpast="1"]')||$(this).is('[data-datetype="time"]'))minDate=null;else if($(this).is('[data-allowpast="0"]')&&parseInt($(this).attr("data-startdays"))>0){var nbDays=parseInt($(this).attr("data-startdays"));minDate.setDate(minDate.getDate()+nbDays)}var maxView="",daysWeekDisabled=new Array;$(this).is("[data-daysweek]")&&""!=$(this).attr("data-daysweek")&&jQuery.each($(this).attr("data-daysweek").split(","),(function(){daysWeekDisabled.push(parseInt(this))}));var datepickerData={daysOfWeekDisabled:daysWeekDisabled,language:form.datePickerLanguage,fontAwesome:!0,timeZone:"",startDate:minDate,showMeridian:parseInt(form.timeModeAM),container:".lfb_itemContainer_"+$(this).attr("data-itemid")},dateType=$(this).attr("data-datetype");"date"==dateType?(datepickerData.format=dateFormat,datepickerData.minView=2,minDate&&(minDate.setHours(0),minDate.setMinutes(0)),$(this).attr("data-disableminutes","0")):"time"==dateType?(1==parseInt(form.timeModeAM)?datepickerData.format="H:ii P":datepickerData.format="hh:ii",datepickerData.startView=1,$(this).is('[data-disableminutes="1"]')&&(datepickerData.minView=1,minDate&&minDate.setMinutes(0))):(1==parseInt(form.timeModeAM)?datepickerData.format=dateFormat+" H:ii P":datepickerData.format=dateFormat+" hh:ii",$(this).is('[data-disableminutes="1"]')&&(datepickerData.minView=1)),$(this).datetimepicker(datepickerData).on("show",(function(ev){$(this).data("lastdate",$(this).val()),$(this).val("")})).on("hide",(function(ev){""==$(this).val()&&""!=$(this).data("lastdate")&&$(this).val($(this).data("lastdate"))})).on("changeDay",(function(ev){$(this).val("");var day=moment.utc(ev.date).format("YYYY-MM-DD"),eventDuration=$(this).attr("data-eventduration"),eventDurationType=$(this).attr("data-eventdurationtype"),disabledHours=lfb_getDisabledHours($(this).attr("data-calendarid"),day,eventDuration,eventDurationType),dayWeek=ev.date.getDay();if($(this).attr("data-daysweek").indexOf(dayWeek.toString())>-1){disabledHours=new Array;for(var i=0;i<24;i++)disabledHours.push(parseInt(i))}$(this).data("date",day),$(this).datetimepicker("setHoursDisabled",disabledHours),$(this).addClass("checked");var form=lfb_getForm($(this).closest("#lfb_form").attr("data-form"));if($(this).is('[data-datetype="date"]')&&"1"==form.autocloseDatepicker){var $this=$(this);$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]  .datetimepicker').hide(),"1"==form.groupAutoClick&&$this.closest(".lfb_genSlide").is("[data-required=true]")&&setTimeout((function(){0==$this.closest(".lfb_genSlide").find("[data-itemid]").not('[data-itemid="'+$this.attr("data-itemid")+'"]').not('[data-itemtype="separator"]').not(".lfb_richtext").not('[data-group="'+$this.data("group")+'"]').not(".lfb_disabled").length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .quantityBtns').length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .lfb_qtfield').length&&lfb_nextStep(form.formID)}),500)}})).on("changeMinute",(function(ev){var $this=$(this);$(this).addClass("checked"),1==form.autocloseDatepicker&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]  .datetimepicker').hide(),"1"==form.groupAutoClick&&$this.closest(".lfb_genSlide").is("[data-required=true]")&&setTimeout((function(){0==$this.closest(".lfb_genSlide").find("[data-itemid]").not('[data-itemid="'+$this.attr("data-itemid")+'"]').not('[data-itemtype="separator"]').not(".lfb_richtext").not('[data-group="'+$this.data("group")+'"]').not(".lfb_disabled").length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .quantityBtns').length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .lfb_qtfield').length&&lfb_nextStep(form.formID)}),500))})).on("changeHour",(function(ev){var $this=$(this);if($(this).addClass("checked"),$(this).is('[data-datetype="dateTime"]')&&"1"==form.autocloseDatepicker&&$(this).is('[data-disableminutes="1"]')&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]  .datetimepicker').hide(),"1"==form.groupAutoClick&&$this.closest(".lfb_genSlide").is("[data-required=true]")&&setTimeout((function(){0==$this.closest(".lfb_genSlide").find("[data-itemid]").not('[data-itemid="'+$this.attr("data-itemid")+'"]').not('[data-itemtype="separator"]').not(".lfb_richtext").not('[data-group="'+$this.data("group")+'"]').not(".lfb_disabled").length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .quantityBtns').length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .lfb_qtfield').length&&lfb_nextStep(form.formID)}),500)),$(this).is('[data-datetype="time"]')&&$(this).is('[data-disableminutes="1"]')){var date=moment(ev.date).utc();date.subtract(moment(ev.date).minutes(),"minutes");var datepicker=this;setTimeout((function(){$(datepicker).datetimepicker("setDate",new Date(date.format("YYYY-MM-DD HH:00")))}),1),1==form.autocloseDatepicker&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]  .datetimepicker').hide(),"1"==form.groupAutoClick&&$this.closest(".lfb_genSlide").is("[data-required=true]")&&setTimeout((function(){0==$this.closest(".lfb_genSlide").find("[data-itemid]").not('[data-itemid="'+$this.attr("data-itemid")+'"]').not('[data-itemtype="separator"]').not(".lfb_richtext").not('[data-group="'+$this.data("group")+'"]').not(".lfb_disabled").length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .quantityBtns').length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .lfb_qtfield').length&&lfb_nextStep(form.formID)}),500))}else{var day=moment.utc(ev.date).format("YYYY-MM-DD"),hour=moment.utc(ev.date).format("HH"),eventDuration=$(this).attr("data-eventduration"),eventDurationType=$(this).attr("data-eventdurationtype"),disabledMinutes=lfb_getDisabledMinutes($(this).attr("data-calendarid"),day,hour,eventDuration,eventDurationType);if($(this).data("date",moment.utc(ev.date).format("YYYY-MM-DD HH:00")),$(this).is('[data-disableminutes="1"]')){var newDate=moment.utc(ev.date).format("YYYY-MM-DD HH:00");$(this).data("date",newDate),$(this).addClass("checked");var _this=this;setTimeout((function(){var date=moment(newDate);date.subtract(moment(date).minutes(),"minutes"),$(this).data("date",date.toDate()),$(_this).datetimepicker("setDate",new Date),$(_this).datetimepicker("setDate",date.toDate());var postText="";$(_this).val().indexOf("PM")>$(_this).val().indexOf(":")?postText=" PM":$(_this).val().indexOf("AM")>$(_this).val().indexOf(":")&&(postText=" AM"),$(_this).val($(_this).val().split(":")[0]+":00"+postText)}),50)}$(this).datetimepicker("setMinutesDisabled",disabledMinutes)}}));var _this=this;if($(this).closest(".form-group").next(".datetimepicker").find(".datetimepicker-hours thead tr:first-child th").on("click",(function(){var link=this;setTimeout((function(){var datepicker=$(link).closest(".datetimepicker").prev(".form-group").find(".lfb_datepicker"),date=$(_this).datetimepicker("getViewDate");datepicker.val("");var day=moment(date).format("YYYY-MM-DD"),eventDuration=datepicker.attr("data-eventduration"),eventDurationType=datepicker.attr("data-eventdurationtype"),disabledHours=lfb_getDisabledHours(datepicker.attr("data-calendarid"),day,eventDuration,eventDurationType);datepicker.data("date",day),datepicker.is("[data-daysweek]")&&void 0!==$(this).attr("data-daysweek")&&jQuery.each(datepicker.attr("data-daysweek").split(","),(function(){if(this==date.getDay()){disabledHours=new Array;for(var i=0;i<24;i++)disabledHours.push(i)}})),datepicker.datetimepicker("setHoursDisabled",disabledHours)}),10)})),"date"==dateType?$(this).on("show",(function(){$(".datetimepicker .table-condensed .prev").show(),$(".datetimepicker .table-condensed .switch").show(),$(".datetimepicker .table-condensed .next").show()})):"time"==dateType?$(this).on("show",(function(){$(".datetimepicker .table-condensed .prev").hide(),$(".datetimepicker .table-condensed .switch").hide(),$(".datetimepicker .table-condensed .next").hide()})):$(this).on("show",(function(){$(".datetimepicker .table-condensed .prev").show(),$(".datetimepicker .table-condensed .switch").show(),$(".datetimepicker .table-condensed .next").show()})),0!=$(this).attr("data-calendarid")&&parseInt($(this).attr("data-calendarid"))>0&&-1==jQuery.inArray($(this).attr("data-calendarid"),calendarsToCheck)&&calendarsToCheck.push($(this).attr("data-calendarid")),0==$(this).attr("placeholder").length&&0==$(this).val().length&&($(this).is('[data-disableminutes="1"]')||"0"!=$(this).attr("data-calendarid")||$(this).datetimepicker("setDate",new Date)),$(this).on("keypress",(function(e){e.preventDefault()})),!$(this).is('[data-mindatepicker="0"]')&&!$(this).is('[data-datetype="time"]')){var originalDatepicker=$(this),minDatepicker=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-itemid="'+$(this).attr("data-mindatepicker")+'"]');minDatepicker.on("changeDate",(function(){var currentDate=moment(originalDatepicker.datetimepicker("getDate")).format("YYYY-MM-DD HH:mm"),day,newDay=moment(minDatepicker.datetimepicker("getDate")).add(parseInt(originalDatepicker.attr("data-startdays")),"day");(newDay=newDay.add(parseInt(minDatepicker.attr("data-eventduration")),minDatepicker.attr("data-eventdurationtype"))).format("YYYY-MM-DD HH:mm")>currentDate&&originalDatepicker.datetimepicker("setDate",newDay.toDate())})),originalDatepicker.on("changeDate",(function(){var currentDate=moment(originalDatepicker.datetimepicker("getDate")).format("YYYY-MM-DD HH:mm"),day=moment(minDatepicker.datetimepicker("getDate")),newDay=moment(minDatepicker.datetimepicker("getDate")).add(parseInt(minDatepicker.attr("data-startdays")),"day");if((newDay=newDay.add(parseInt(minDatepicker.attr("data-eventduration")),minDatepicker.attr("data-eventdurationtype"))).format("YYYY-MM-DD HH:mm")>currentDate){var newDate=moment(originalDatepicker.datetimepicker("getDate")).subtract(parseInt(originalDatepicker.attr("data-startdays")),"day");newDate=newDate.subtract(parseInt(minDatepicker.attr("data-eventduration")),minDatepicker.attr("data-eventdurationtype")),minDatepicker.datetimepicker("setDate",newDate.toDate())}}))}})),calendarsToCheck.length>0&&lfb_getBusyDates(form.formID,calendarsToCheck),navigator.userAgent.toLowerCase().match(/(iPad|iPhone|iPod)/i)&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-flipfx="1"]').removeAttr("data-flipfx"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-emaillaststep="1"]')&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide .linkPrevious').addClass("lfb-hidden"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnOrder').addClass("lfb-hidden")),1==form.hideFinalbtn&&$('#lfb_form[data-form="'+form.formID+'"] #lfb_btnOrder').addClass("lfb-hidden"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .form-control').on("focus",(function(){0==form.disableTipMobile&&lfb_is_touch_device()&&$(this).tooltip("show")})).on("focusout",(function(){0==form.disableTipMobile&&lfb_is_touch_device()&&($("#lfb_form :not(.ui-slider-handle) > .tooltip").remove(),$("body > .tooltip").remove(),$('#lfb_form[data-form="'+form.formID+'"] > .tooltip').remove())})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide .lfb_genContent div.lfb_selectable span.icon_select.lfb_fxZoom').css({textShadow:"-2px 0px "+$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel').css("background-color")}),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is(".lfb_popup")&&!$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').closest("#lfb_bootstraped").parent().is("body")&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').closest("#lfb_bootstraped").detach().appendTo("body"),$('#lfb_form[data-form="'+form.formID+'"]').is(".lfb_fullscreen")&&$("html,body").css("overflow-y","hidden"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').attr("target","_self"),"undefined"!=typeof google&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_gmap').each((function(){$(this).css("height",$(this).attr("data-height"));var $item=$(this),centerMap={lat:0,lng:0},styles=lfb_getMapStyle($(this).attr("data-mapstyle")),map=new google.maps.Map(document.getElementById("lfb_mapCt_"+$item.attr("data-itemid")),{zoom:parseInt($item.attr("data-mapzoom")),controlSize:32,center:centerMap,styles:styles});if($(this).data("gmap",map),"marker"==$(this).attr("data-maptype")){var address=$item.attr("data-address"),geocoder;if(address.length>3)(new google.maps.Geocoder).geocode({address:address},(function(results,status){if(void 0!==results[0]){centerMap=results[0].geometry.location,map.setCenter(centerMap);var marker=new google.maps.Marker({position:results[0].geometry.location,map:map});$(this).data("mapMarker",marker)}}))}else if($(this).is("[data-itinerary]")){var directionRenderer=new google.maps.DirectionsRenderer;directionRenderer.setMap(map),$(this).data("directionRenderer",directionRenderer),lfb_updateGmapItinerary($(this),form.formID)}})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-lazy-src]').each((function(){$(this).parent().on("click",(function(e){lfb_itemClick($(this),!0,form.formID)}))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paymentMethodBtns').length>0&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paymentMethodBtns [data-payment="paypal"]').on("click",(function(e){e.preventDefault(),form.stripeToken="",form.useRazorpay=!1,$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_razorPayCt').slideUp(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnOrderPaypal').trigger("click")})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paymentMethodBtns [data-payment="razorpay"]').on("click",(function(){var isOK;lfb_checkStepItemsValid("final",form.formID)&&lfb_checkCaptcha(form,(function(){setTimeout((function(){$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is(".lfb_fullscreen")?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').animate({scrollTop:$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_razorPayCt').offset().top-(80+parseInt(lfb_getScrollTopMargin(form)))},2*form.animationsSpeed):$("body,html").animate({scrollTop:$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_razorPayCt').offset().top-(80+parseInt(lfb_getScrollTopMargin(form)))},2*form.animationsSpeed)}),350),lfb_lastSteps.length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel #lfb_razorPayCt .linkPrevious').fadeIn(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #btnOrderRazorpay').length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #btnOrderRazorpay').trigger("click")}))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paymentMethodBtns [data-payment="stripe"]').on("click",(function(){var isOK;form.useRazorpay=!1,form.useStripePayment=!0,$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_razorPayCt').slideUp(),lfb_checkStepItemsValid("final",form.formID)&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_captcha').length>0?jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_checkCaptcha",formID:formID,captcha:$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_captchaField').val()},success:function(rep){"1"==rep?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_captchaPanel').slideUp(100),lfb_showWinStripePayment(form)):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_captchaField').closest(".form-group").addClass("has-error")}}):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_captchaPanel').slideUp(100),lfb_showWinStripePayment(form)))}))),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #btnOrderRazorpay').on("click",(function(){form.useRazorpay=!0,lfb_order(formID)})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] input:not([type=checkbox])').on("change",(function(){lfb_updatePrice(formID,$(this).attr("data-itemid"))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] textarea').on("change",(function(){lfb_updatePrice(formID,$(this).attr("data-itemid"))})),1==form.enableShineFxBtn&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("a.btn-primary").append('<canvas class="lfb_shineCanvas"></canvas>'),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("a.btn-primary").on("mouseover",(function(){0==form.shineFxIndex&&lfb_shineBtn(formID,$(this).find(".lfb_shineCanvas"))}))),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_dropzone').each((function(){var maxSize=null;$(this).attr("data-maxfiles")>0&&(maxSize=$(this).attr("data-maxfiles"));var dropzone=$(this);$(this).dropzone({url:form.ajaxurl+"?form="+formID,paramName:"file",maxFilesize:$(this).attr("data-filesize"),maxFiles:maxSize,addRemoveLinks:!0,dictRemoveFile:"",dictCancelUpload:"",acceptedFiles:$(this).attr("data-allowedfiles"),dictDefaultMessage:form.filesUpload_text,dictFileTooBig:form.filesUploadSize_text,dictInvalidFileType:form.filesUploadType_text,dictMaxFilesExceeded:form.filesUploadLimit_text,init:function(){this.on("thumbnail",(function(file,dataUrl){var thumb=$(file.previewElement),fileName=file.name.replace(/\//g,"");fileName=(fileName=(fileName=(fileName=fileName.replace(/ /g,"_")).replace(/'/g,"_")).replace(/"/g,"_")).replace(/[^a-zA-Z0-9._-]/g,""),thumb.attr("data-file",fileName+"_"+dropzone.data("currentFileIndex"))})),this.on("sending",(function(file,xhr,formData){dropzone.closest(".lfb_genSlide").find(".lfb_btn-next").fadeOut(),dropzone.closest(".lfb_genSlide").find(".btn-primary").fadeOut(),formData.append("action","lfb_upload_form"),formData.append("formSession",$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-formsession")),formData.append("itemID",dropzone.attr("data-itemid"))})),this.on("complete",(function(file,xhr){0!=dropzone.find(".dz-preview:not(.dz-complete)").length&&0!=dropzone.find(".dz-preview").length||(dropzone.closest(".lfb_genSlide").find(".lfb_btn-next").fadeIn(),dropzone.closest(".lfb_genSlide").find(".btn-primary").fadeIn()),lfb_updatePrice(form.formID)})),this.on("success",(function(file,rep){var thumb=$(file.previewElement),fileName=file.name.replace(/\//g,"");if(fileName=(fileName=(fileName=(fileName=fileName.replace(/ /g,"_")).replace(/'/g,"_")).replace(/"/g,"_")).replace(/[^a-zA-Z0-9._-]/g,""),1==form.emailCustomerLinks){var reps=rep.split("||"),url=reps[0];thumb.attr("data-url",url),rep=reps[1]}void 0===rep||null==rep||"undefined"==rep?(thumb.addClass("dz-error"),thumb.find("[data-dz-errormessage]").html("There is an error, please try again")):thumb.attr("data-file",rep+"_"+fileName)})),this.on("removedfile",(function(file,xhr){lfb_updatePrice(form.formID)}))}})})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find(".lfb_rate").each((function(){var max=parseInt($(this).closest(".lfb_itemBloc").attr("data-max")),initialValue=parseInt($(this).closest(".lfb_itemBloc").attr("data-value"));isNaN(initialValue)&&(initialValue=5);var color="#bdc3c7";""!=$(this).closest(".lfb_itemBloc").attr("data-color")&&(color=$(this).closest(".lfb_itemBloc").attr("data-color")),-1==color.indexOf("#")&&(color="#"+color);var stepSize=$(this).closest(".lfb_itemBloc").attr("data-interval");$(this).rate({initial_value:initialValue,max_value:max,step_size:1,cursor:"pointer"}).on("change",(function(ev,data){$(this).closest(".lfb_itemBloc").addClass("checked"),$(this).closest(".lfb_itemBloc").addClass("lfb_changed"),lfb_updatePrice(formID,$(this).closest(".lfb_itemBloc").attr("data-itemid"))})).css({color:color})})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('.form-control[data-validation="mask"][data-mask]').each((function(){$(this).attr("data-mask").trim().length>0&&$(this).mask($(this).attr("data-mask"),{clearIfNotMatch:!0})})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('input[type="text"][data-itemid],textarea[data-itemid]').each((function(){$(this).attr("data-initialvalue",$(this).val())})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-itemid][data-type="slider"]').each((function(){var min=parseInt($(this).attr("data-min"));isNaN(min)&&(min=0);var max=parseInt($(this).attr("data-max"));0==max&&(max=30);var dataDefaultValue=parseFloat($(this).attr("data-value"));$(this).is("[data-qtdefault]")&&(dataDefaultValue=parseFloat($(this).attr("data-qtdefault")));var defaultValue=min;!isNaN(dataDefaultValue)&&dataDefaultValue>=min&&dataDefaultValue<=max&&(defaultValue=dataDefaultValue);var tooltip=$('<div class="tooltip bs-tooltip-top" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner">'+defaultValue+"</div></div>").css({position:"absolute",top:-55,left:-20,opacity:1}).hide(),step=1;$(this).is("[data-stepslider]")&&parseFloat($(this).attr("data-stepslider"))>0&&(step=parseFloat($(this).attr("data-stepslider")));var isRange="min";$(this).is(".lfb_range")&&(isRange=!0);var isDisabled=!1;if($(this).slider({min:min,max:max,value:defaultValue,step:step,range:isRange,disabled:!1,orientation:"horizontal",change:function(event,ui){lfb_isSelectionMode(form.formID)||(Number.isInteger(ui.value)?$(ui.handle).find(".tooltip-inner").html(lfb_formatPrice(ui.value,form.formID)):$(ui.handle).find(".tooltip-inner").html(ui.value),event.originalEvent&&lfb_updatePrice(formID,$(this).attr("data-itemid")))},start:function(event,ui){if(lfb_isSelectionMode(form.formID))return!1},slide:function(event,ui){if(lfb_isSelectionMode(form.formID))return!1;Number.isInteger(ui.value)?$(ui.handle).find(".tooltip-inner").html(lfb_formatPrice(ui.value,form.formID)):$(ui.handle).find(".tooltip-inner").html(ui.value);var _self=this;event.originalEvent&&(setTimeout((function(){lfb_updatePrice(formID,$(_self).attr("data-itemid")),$(_self).addClass("lfb_changed")}),30),$(ui.handle).find(".tooltip").show()),lfb_updatePrice(formID,$(_self).attr("data-itemid"))},stop:function(event,ui){if(Number.isInteger(ui.value)?$(ui.handle).find(".tooltip-inner").html(lfb_formatPrice(ui.value,form.formID)):$(ui.handle).find(".tooltip-inner").html(ui.value),lfb_updatePrice(formID,$(this).attr("data-itemid")),$(ui.handle).find(".tooltip").hide(),!0===isRange){var prefix="",sufix="";$(this).find(".ui-slider-range").is("[data-tooltipprefix]")&&(prefix=$(this).find(".ui-slider-range").attr("data-tooltipprefix")),$(this).find(".ui-slider-range").is("[data-tooltipsufix]")&&(sufix=$(this).find(".ui-slider-range").attr("data-tooltipsufix")),$(this).find(".ui-slider-range").attr("title",prefix+ui.values[0]+" - "+ui.values[1]+sufix),$(this).find(".ui-slider-range").attr("data-bs-original-title",prefix+ui.values[0]+" - "+ui.values[1]+sufix)}}}).find(".ui-slider-handle").append(tooltip).on("mouseenter",(function(){lfb_isSelectionMode(form.formID)||$(this).find(".tooltip").show()})).on("mouseleave",(function(){$(this).find(".tooltip").hide()})),!0===isRange){$(this).find(".ui-slider-range").attr("title",min+" - "+max).tooltip({html:!0,container:'#lfb_form[data-form="'+form.formID+'"]'});var _slider=$(this);$(this).find(".ui-slider-range").on("mouseenter",(function(){var prefix="",sufix="";$(this).is("[data-tooltipprefix]")&&(prefix=$(this).attr("data-tooltipprefix")),$(this).is("[data-tooltipsufix]")&&(sufix=$(this).attr("data-tooltipsufix")),$(this).attr("title",prefix+" "+_slider.slider("values")[0]+" - "+_slider.slider("values")[1]+sufix),$(this).attr("data-bs-original-title",prefix+" "+_slider.slider("values")[0]+" - "+_slider.slider("values")[1]+sufix)}))}})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_colorpicker').each((function(){var $this=$(this);$(this).prev(".lfb_colorPreview").on("click",(function(){lfb_isSelectionMode(form.formID)||$(this).next(".lfb_colorpicker").trigger("click")})),$(this).prev(".lfb_colorPreview").css({backgroundColor:form.colorA}),$(this).colpick({color:form.colorA,layout:"hex",onSubmit:function(){$("body > .colpick").fadeOut()},onChange:function(hsb,hex,rgb,el,bySetColor){$(el).val("#"+hex),$(el).prev(".lfb_colorPreview").css({backgroundColor:"#"+hex})}})})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('.lfb_colorPreview[data-urltarget],input[type="text"][data-itemid]:not(.lfb_colorpicker)[data-urltarget],textarea[data-itemid][data-urltarget],select[data-itemid][data-urltarget],input[type="number"][data-urltarget]').each((function(){$(this).on("click",(function(){if(!lfb_isSelectionMode(form.formID)){var win=window.open($(this).attr("data-urltarget"),"_blank");"null"!=typeof win&&null!=win&&win.focus()}}))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("[data-fieldtype]").each((function(){$(this).attr("name",$(this).attr("data-fieldtype"))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('[data-autocomplete="1"]').each((function(){var options={};"city"==$(this).attr("data-fieldtype")?options.types=["(cities)"]:"address"==$(this).attr("data-fieldtype")?$(this).closest(".lfb_genContent").find('[data-fieldtype="city"]').length>0&&(options.types=["address"]):"country"==$(this).attr("data-fieldtype")?options.types=["(regions)"]:"zip"==$(this).attr("data-fieldtype")&&(options.types=["(regions)"]);var autocomplete=new google.maps.places.Autocomplete($(this).get(0),options);autocomplete.field=$(this),"zip"==$(this).attr("data-fieldtype")?google.maps.event.addListener(autocomplete,"place_changed",(function(){for(var place=autocomplete.getPlace(),i=0;i<place.address_components.length;i++)for(var j=0;j<place.address_components[i].types.length;j++)"postal_code"==place.address_components[i].types[j]&&autocomplete.field.val(place.address_components[i].long_name)})):"country"==$(this).attr("data-fieldtype")&&google.maps.event.addListener(autocomplete,"place_changed",(function(){for(var place=autocomplete.getPlace(),i=0;i<place.address_components.length;i++)for(var j=0;j<place.address_components[i].types.length;j++)"country"==place.address_components[i].types[j]&&autocomplete.field.val(place.address_components[i].long_name)}))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]  #lfb_mainPanel .lfb_genSlide [data-group]').each((function(){var $this=$(this);"1"==form.groupAutoClick&&""!=$this.prop("data-group")&&$this.closest(".lfb_genSlide").is("[data-required=true]")&&0==$this.closest(".lfb_genSlide").find("[data-itemid]:not(.lfb_disabled)").not(".lfb_richtext").not('[data-group="'+$this.data("group")+'"]').not(".lfb_disabled").length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .quantityBtns').length&&0==$this.closest(".lfb_genSlide").find('[data-group="'+$this.data("group")+'"] .lfb_qtfield').length&&$this.closest(".lfb_genSlide").find(".lfb_btn-next").addClass("lfb-hidden")})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]  #lfb_mainPanel .lfb_genSlide div.lfb_selectable.prechecked,#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]  #lfb_mainPanel .lfb_genSlide a.lfb_button.prechecked,#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide input[type=checkbox][data-price].prechecked').each((function(){lfb_itemClick($(this),!1,formID)})),lfb_initPrice(formID),lfb_updatePrice(formID),lfb_initGform(formID),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').attr("target","_self"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .quantityBtns > a').on("click",(function(){lfb_isSelectionMode(form.formID)||("less"==$(this).attr("data-btn")?(void 0!==$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .quantityBtns > a[data-btn="more"]').data("incrementInterval")&&clearInterval($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .quantityBtns > a[data-btn="more"]').data("incrementInterval")),lfb_quantity_less(this,formID)):(void 0!==$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .quantityBtns > a[data-btn="less"]').data("incrementInterval")&&clearInterval($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .quantityBtns > a[data-btn="less"]').data("incrementInterval")),lfb_quantity_more(this,formID)))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .linkPrevious').on("click",(function(){lfb_isSelectionMode(form.formID)||lfb_previousStep(formID)})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_btn-next').on("click",(function(){lfb_isSelectionMode(form.formID)||lfb_nextStep(formID)})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnOrderPaypal').on("click",(function(){lfb_isSelectionMode(form.formID)||lfb_order(formID)})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide [data-toggle="switch"]').on("change",(function(){var fieldID;lfb_toggleField($(this).attr("data-fieldid"),formID)}));var chkGrav=!1;$(".gform_wrapper").each((function(){var gravID;$(this).attr("id").substr($(this).attr("id").lastIndexOf("_")+1,$(this).attr("id").length)==form.gravityFormID&&(chkGrav?$(this).remove():(chkGrav=!0,$(this).detach().insertAfter('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice')))})),setTimeout((function(){if($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide .gform_wrapper').length>1){var chkGravA=!1;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide .gform_wrapper').each((function(){chkGravA?$(this).remove():chkGravA=!0}))}}),500),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_qtfield').attr("type","number"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_qtfield').on("focusout",(function(){$(this).val().indexOf("-")>-1&&(!$(this).is("[min]")||$(this).attr("min").indexOf("-")<0)&&$(this).val(parseInt($(this).attr("min"))),parseFloat($(this).val())<parseInt($(this).attr("min"))&&$(this).val($(this).attr("min")),parseFloat($(this).val())>parseInt($(this).attr("max"))&&$(this).val($(this).attr("max")),lfb_updatePrice(form.formID),lfb_updateSummary(form.formID)})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] input[type="number"][data-itemid]').on("keydown",(function(event){return 69!=event.keyCode})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] input[type="number"][data-itemid]').on("focusin",(function(){0==$(this).val()&&$(this).val("")})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] input[type="number"][data-itemid]').on("keyup change",(function(){lfb_updatePrice(form.formID),lfb_updateSummary(form.formID)})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] input[type="number"][data-itemid]').on("focusout",(function(e){""==$(this).val()&&$(this).val(0),(0!=$(this).val()||$(this).is('[data-required="true"]'))&&($(this).val().indexOf("-")>-1&&(!$(this).is("[min]")||$(this).attr("min").indexOf("-")<0)&&$(this).val(parseInt($(this).attr("min"))),parseFloat($(this).val())<parseFloat($(this).attr("min"))&&$(this).val($(this).attr("min")),parseFloat($(this).val())>parseFloat($(this).attr("max"))&&$(this).val($(this).attr("max")),(""==$(this).val()||isNaN(parseInt($(this).val())))&&$(this).val(0),""!=$(this).val()&&($(this).is('[data-valueasqt="0"]')||$(this).val()>0)?$(this).addClass("checked"):$(this).removeClass("checked")),void 0!==e.originalEvent&&(lfb_updatePrice(form.formID),lfb_updateSummary(form.formID))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_sliderQt').each((function(){var min=parseInt($(this).closest(".quantityBtns").attr("data-min"));0==min&&(min=1);var tooltip=$('<div class="tooltip top" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner">'+min+"</div></div>").css({position:"absolute",top:-55,left:-20,opacity:1}).hide(),step=1;$(this).closest(".quantityBtns").is("[data-stepslider]")&&parseInt($(this).closest(".quantityBtns").attr("data-stepslider"))>0&&(step=parseInt($(this).closest(".quantityBtns").attr("data-stepslider")));var isDisabled=!1;$(this).slider({min:min,max:parseInt($(this).closest(".quantityBtns").attr("data-max")),value:parseInt($(this).closest(".quantityBtns").next(".icon_quantity").html()),orientation:"horizontal",range:"min",disabled:!1,step:step,change:function(event,ui){tooltip.find(".tooltip-inner").html(ui.value),$(this).closest(".quantityBtns").next(".icon_quantity").html(ui.value),event.originalEvent&&lfb_updatePrice(formID,$(this).attr("data-itemid"))},slide:function(event,ui){$(this).closest(".quantityBtns").next(".icon_quantity").html(ui.value),tooltip.find(".tooltip-inner").html(ui.value),event.originalEvent&&lfb_updatePrice(formID,$(this).attr("data-itemid"))}}).find(".ui-slider-handle").append(tooltip).on("mouseenter",(function(){tooltip.show()})).on("mouseleave",(function(){tooltip.hide()}))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is(".lfb_visualEditing")||lfb_loadStoredForm(form.formID),lfb_initRichTextValues(form.formID),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is(".lfb_visualEditing")||"0"==form.intro_enabled&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_btnFloatingSummary').css({display:"inline-block"}),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_btnSaveForm').css({display:"inline-block"}),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnStart,#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #startInfos').hide(),"2"!=form.showSteps?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice').fadeIn(500):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice').hide(),3==form.showSteps&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stepper').fadeIn(500),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel').fadeIn(form.animationsSpeed,(function(){form.autoStart||$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is(".lfb_visualEditing")||lfb_nextStep(form.formID)}))),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]  #lfb_loader').fadeOut()}))}function lfb_replaceAllBackSlash(targetStr){for(var index=targetStr.indexOf("\\");index>=0;)index=(targetStr=targetStr.replace("\\","")).indexOf("\\");return targetStr}function lfb_shineBtn(formID,$canvas){var form=lfb_getForm(formID);$canvas.attr({width:$canvas.width(),height:$canvas.height()}),$canvas.css({borderRadius:$canvas.parent().css("border-radius")});var ctx=$canvas.get(0).getContext("2d");ctx.clearRect(0,0,$canvas.width(),$canvas.height());var grd=ctx.createLinearGradient(0,0,$canvas.width(),$canvas.height());if(form.shineFxIndex+=.08,form.shineFxIndex>1)ctx.clearRect(0,0,$canvas.width(),$canvas.height()),form.shineFxIndex=0;else{var pos=form.shineFxIndex,prevPos=pos-.1;prevPos<0&&(prevPos=0);var nextPos=pos+.1;nextPos>1&&(nextPos=1),grd.addColorStop(0,"transparent"),grd.addColorStop(prevPos,"rgba(255,255,255,0)"),grd.addColorStop(pos,"rgba(255,255,255,0.3)"),grd.addColorStop(nextPos,"rgba(255,255,255,0)"),grd.addColorStop(1,"rgba(255,255,255,0)"),ctx.fillStyle=grd,ctx.fillRect(0,0,$canvas.width(),$canvas.height()),setTimeout((function(){lfb_shineBtn(formID,$canvas)}),30)}}function lfb_updateLayerImages(formID){var form=lfb_getForm(formID);$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_genSlide[data-stepid="'+form.step+'"] .lfb_layeredImage').each((function(){var stepID=$(this).closest(".lfb_genSlide").attr("data-stepid"),_stepID=parseInt(stepID);isNaN(_stepID)&&(_stepID=0);var lastAndCurrentSteps=JSON.parse(JSON.stringify(lfb_lastSteps));"final"!=form.step&&-1==jQuery.inArray(parseInt(form.step),lastAndCurrentSteps)?lastAndCurrentSteps.push(parseInt(form.step)):"final"==form.step&&lastAndCurrentSteps.push("final"),$(this).find("img:not(.lfb_baseLayer)").each((function(){var conditions=lfb_replaceAllBackSlash($(this).attr("data-showconditions"));if((conditions=conditions.replace(/'/g,'"')).length>0)try{var errors=lfb_checkConditions(conditions=JSON.parse(conditions),formID,_stepID),operator=$(this).attr("data-showconditionsoperator");"OR"==operator&&!errors.errorOR||"OR"!=operator&&!errors.error?$(this).fadeIn():$(this).fadeOut()}catch(e){$(this).fadeIn()}else $(this).fadeIn()}))}))}function lfb_updateShowSteps(formID){for(var i=0;i<lfb_plannedSteps.length;i++){var stepEl=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_genSlide[data-stepid="'+lfb_plannedSteps[i]+'"]');if(stepEl.is("[data-useshowconditions]")){var conditions=lfb_replaceAllBackSlash(stepEl.attr("data-showconditions"));if(""!=(conditions=conditions.replace(/'/g,'"')))try{var errors=lfb_checkConditions(conditions=JSON.parse(conditions),formID,parseInt(stepEl.attr("data-stepid"))),operator=stepEl.attr("data-showconditionsoperator");"OR"==operator&&!errors.errorOR||"OR"!=operator&&!errors.error?stepEl.is(".lfb_disabled")&&(stepEl.css({opacity:0}),stepEl.removeClass("lfb_disabled")):stepEl.is(".lfb_disabled")||stepEl.addClass("lfb_disabled")}catch(e){}}}$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_genSlide[data-useshowconditions]').each((function(){}))}function lfb_updateShowItems(formID){var form=lfb_getForm(formID),lastAndCurrentSteps=JSON.parse(JSON.stringify(lfb_lastSteps)),pricePreviousStep=0,singlePricePreviousStep=0;"final"!=form.step&&-1==jQuery.inArray(parseInt(form.step),lastAndCurrentSteps)?lastAndCurrentSteps.push(parseInt(form.step)):"final"==form.step&&lastAndCurrentSteps.push("final");for(var o=0;o<lastAndCurrentSteps.length;o++){var _stepID=lastAndCurrentSteps[o];$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_genSlide[data-stepid="'+_stepID+'"] [data-useshowconditions]').each((function(){var conditions=lfb_replaceAllBackSlash($(this).attr("data-showconditions"));if(""!=(conditions=conditions.replace(/'/g,'"')))try{var errors=lfb_checkConditions(conditions=JSON.parse(conditions),formID,_stepID),operator=$(this).attr("data-showconditionsoperator");"OR"==operator&&!errors.errorOR||"OR"!=operator&&!errors.error?($(this).is(".lfb_itemBloc")&&$(this).is(".lfb_disabled")||$(this).closest(".lfb_itemBloc").length>0&&$(this).closest(".lfb_itemBloc").is(".lfb_disabled"))&&($(this).removeClass("lfb_disabled"),$(this).closest(".lfb_itemBloc").removeClass("lfb_disabled"),$(this).stop().animate({opacity:1},300),$(this).is("input.prechecked")&&!$(this).is(":checked")&&lfb_itemClick($(this),!1,formID),$(this).is(".lfb_selectable.prechecked")&&!$(this).is(".checked")&&lfb_itemClick($(this),!1,formID),$(this).is(".lfb_button.prechecked")&&!$(this).is(".checked")&&lfb_itemClick($(this),!1,formID),($(this).is('input[type="text"]')||$(this).is("textarea"))&&$(this).is("[data-initialvalue]")&&$(this).val($(this).attr("data-initialvalue")),$(this).closest(".lfb_itemBloc").stop().fadeIn(100)):$(this).is(".lfb_disabled")||($(this).css({opacity:1}),$(this).is(":checked")&&lfb_itemClick($(this),!1,formID),$(this).is(".checked")&&lfb_itemClick($(this),!1,formID),$(this).is(".lfb_dropzone")&&$(this).find(".dz-preview").remove(),$(this).addClass("lfb_disabled"),$(this).closest(".lfb_itemBloc").addClass("lfb_disabled"),$(this).stop().animate({opacity:0},300),$(this).closest(".lfb_itemBloc").stop().fadeOut(300))}catch(e){}}))}$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]:not(.lfb_visualEditing) .lfb_genSlide.lfb_activeStep:not(#finalSlide) .lfb_row').each((function(){var row=$(this),chkColumns=!1;$(this).find(".lfb_column").each((function(){var chkItem=!1;$(this).find(".lfb_item:not(.lfb_disabled):not(.lfb-hidden)").length>0&&(chkItem=!0,chkColumns=!0),chkItem?$(this).removeClass("lfb-hidden"):$(this).addClass("lfb-hidden")})),$(this).children(".lfb_item:not(.lfb_disabled):not(.lfb-hidden)").length>0&&(chkColumns=!0),chkColumns?$(this).removeClass("lfb-hidden"):$(this).addClass("lfb-hidden")})),setTimeout((function(){lfb_resize(form)}),200)}function lfb_removeFile(formID,file){var form=lfb_getForm(formID);jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_removeFile",formSession:$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-formsession"),file:file}})}function lfb_disablesThemeScripts(){var scriptsCheck=!1;$("script").each((function(){if(scriptsCheck)if($(this).attr("src")&&$(this).attr("src").indexOf("WP_Helper_Creator")>0);else if($(this).attr("src")&&$(this).attr("src").indexOf("VisitorsTracker")>0);else if($(this).attr("src")&&$(this).attr("src").indexOf("WP_Visual_Chat")>0);else if($(this).attr("src")&&$(this).attr("src").indexOf("gravityforms")>0);else{var scriptCt;(this.innerText||this.textContent).indexOf("analytics")<0&&0==$(this).parents(".gform_wrapper").length&&$(this).attr("disabled","disabled")}$(this).attr("src")&&$(this).attr("src").indexOf("lfb_form")>0&&(scriptsCheck=!0)}))}function lfb_initGform(formID){var form=lfb_getForm(formID);form.gravityFormID>0&&(form.gravitySent=!1,form.gFormDesignCheck++,form.timer_gFormDesign&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide').delay(100).animate({opacity:1},1e3),$("#gform_wrapper_"+form.gravityFormID+" input[type=radio]").not('[data-toggle="radio"]').attr("data-toggle","radio"),$("#gform_wrapper_"+form.gravityFormID+"  .ginput_container input,#gform_wrapper_"+form.gravityFormID+"  .ginput_container select,#gform_wrapper_"+form.gravityFormID+" .ginput_container textarea").attr("title","control"),$("#gform_wrapper_"+form.gravityFormID+"  .ginput_container input,#gform_wrapper_"+form.gravityFormID+"  .ginput_container textarea, #gform_wrapper_"+form.gravityFormID+" .ginput_container select").not("[type=checkbox]").not("[type=radio]").not("[type=submit]").addClass("form-control"),$("#gform_wrapper_"+form.gravityFormID+"  .ginput_container").addClass("form-group"),$("#gform_wrapper_"+form.gravityFormID+"  .gform_button").attr("class","btn btn-wide btn-primary"),$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper input[type="radio"]:not(.ready)').each((function(){$(this).addClass("ready");var label=$("#gform_wrapper_"+form.gravityFormID+' .gform_wrapper label[for="'+$(this).attr("id")+'"]').html();$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').parent("li").css("display","inline-block"),$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').append($(this)),$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').addClass("radio"),$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').prepend('<span class="icons"><span class="first-icon far fa-square"></span><span class="second-icon far fa-check-square"></span></span>'),$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').parent("li").next().is("br")||$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').parent("li").after("<br/>"),$(this).is(":checked")&&$(this).trigger("click")})),$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper input[type="checkbox"]:not(.ready)').each((function(){$(this).addClass("ready");var label=$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').html();$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').parent("li").css("display","inline-block"),$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').append($(this)),$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').addClass("checkbox"),$(this).before('<span class="icons"><span class="first-icon far fa-square"></span><span class="second-icon far fa-check-square"></span></span>'),$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').parent("li").next().is("br")||$("#gform_wrapper_"+form.gravityFormID+'  .gform_wrapper label[for="'+$(this).attr("id")+'"]').parent("li").after("<br/>")})),$("#gform_wrapper_"+form.gravityFormID+"  .gform_wrapper label.checkbox").each((function(){$(this).find("[type=checkbox]").length>0&&$(this).find("[type=checkbox]").eq(1).remove(),$(this).find("[type=checkbox]").is(":checked")&&$(this).find("[type=checkbox]").trigger("click")})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm  #lfb_btnOrderPaypal').hide(),$(" #gform_submit_button_"+form.gravityFormID).on("click",(function(e){if(!lfb_isSelectionMode(form.formID)&&!form.gravitySent){form.gravitySent=!0,$(this).addClass("anim"),form.gFormDesignCheck=0,$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide').delay(1e3).animate({opacity:0},1e3);var $this=$(this);setTimeout((function(){form.timer_gFormDesign=setTimeout((function(){lfb_initGform(formID)}),2e3)}),1e3)}})))}function lfb_initPrice(formID){var form=lfb_getForm(formID);form.max_price>0?form.priceMax=form.max_price:($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide [data-price]').each((function(){var max;if($(this).data("price")&&$(this).data("price")>0)if($(this).find(".icon_quantity").length>0)max=(max=parseFloat($(this).find(".icon_quantity").html()))>10&&parseFloat($(this).data("price"))>100?10:max>30?30:parseFloat($(this).find(".quantityBtns").data("max")),"-"==$(this).data("operation")||"/"==$(this).data("operation")||(form.priceMax+=parseFloat($(this).data("price"))*max);else if($(this).find(".lfb_qtfield").length>0){var max;max=(max=parseFloat($(this).find(".lfb_qtfield").val()))>10&&parseFloat($(this).data("price"))>100?10:max>30?30:parseFloat($(this).find(".lfb_qtfield").attr("max").length>0)?parseFloat($(this).find(".lfb_qtfield").attr("max")):30,"-"==$(this).data("operation")||"/"==$(this).data("operation")||(form.priceMax+=parseFloat($(this).data("price"))*max)}else"+"==$(this).data("operation")&&(form.priceMax+=parseFloat($(this).data("price")))})),form.priceMax+=form.initialPrice,$(' #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide [data-price][data-operation="x"]').each((function(){if($(this).find(".icon_quantity").length>0)for(var i=0;i<parseFloat($(this).find(".icon_quantity").html());i++)form.priceMax=form.priceMax+form.priceMax*parseFloat($(this).data("price"))/100;else form.priceMax=form.priceMax+form.priceMax*parseFloat($(this).data("price"))/100})))}function initFlatUI(){$("#lfb_form.lfb_bootstraped .input-group").on("focus",".form-control",(function(){$(this).closest(".input-group, .form-group").addClass("focus")})).on("blur",".form-control",(function(){$(this).closest(".input-group, .form-group").removeClass("focus")})),$("#lfb_form.lfb_bootstraped .pagination").on("click","a",(function(){$(this).parent().siblings("li").removeClass("active").end().addClass("active")})),$("#lfb_form.lfb_bootstraped .btn-group").on("click","a",(function(){$(this).siblings().removeClass("active").end().addClass("active")})),$('#lfb_form.lfb_bootstraped [data-toggle="switch"][data-checkboxstyle="switch"]').wrap('<div class="switch"  data-on-label="<i class=\'fas fa-check\'></i>" data-off-label="<i class=\'fas fa-times\'></i>" />').parent().bootstrapSwitch(),$('#lfb_form.lfb_bootstraped [data-toggle="switch"][data-checkboxstyle="switch"]').on("change",(function(){$(this).is(":checked")||$(this).removeClass("checked")})),$("#lfb_form.lfb_bootstraped input[type=checkbox][data-urltarget]").each((function(){$(this).on("change",(function(){if(!lfb_isSelectionMode(0)&&$(this).is(":checked"))if($(this).is('[data-urltargetmode="_self"]'))document.location.href=$(this).attr("data-urltarget");else{var win=window.open($(this).attr("data-urltarget"),"_blank");"null"!=typeof win&&null!=win&&win.focus()}}))})),$("#lfb_form.lfb_bootstraped .lfb_selectpicker").length>0&&($("#lfb_form.lfb_bootstraped .lfb_selectpicker").selectpicker(),$("#lfb_form.lfb_bootstraped .lfb_selectpicker").each((function(){$(this).closest(".lfb_itemBloc").find(".btn-group.lfb_bootstrap-select").attr("data-originaltitle",$(this).attr("data-originaltitle")),$(this).closest(".lfb_itemBloc").find(".btn-group.lfb_bootstrap-select").attr("data-bs-original-title",$(this).attr("data-bs-original-title")),$(this).closest(".lfb_itemBloc").find(".btn-group.lfb_bootstrap-select").attr("data-tooltiptext",$(this).attr("data-tooltiptext")),$(this).closest(".lfb_itemBloc").find(".btn-group.lfb_bootstrap-select").attr("data-tooltipimg",$(this).attr("data-tooltipimg")),$(this).closest(".lfb_itemBloc").find(".btn-group.lfb_bootstrap-select").attr("data-toggle",$(this).attr("data-toggle")),$(this).closest(".lfb_itemBloc").find(".btn-group.lfb_bootstrap-select").attr("data-placement",$(this).attr("data-placement"))}))),$("#lfb_form .input-group-addon").on("click",(function(){$(this).next("input").trigger("focus")})),$("#lfb_form .form-control.lfb_customQtSelector").each((function(){const $container=$('<div class="lfb_numberFieldQtSelectorContainer"></div>');$(this).wrap($container);const btnLess=$('<a href="javascript:" class="lfb_numberFieldQtSelector" data-lfbdirection="-">-</a>');btnLess.insertBefore($(this));const btnPlus=$('<a href="javascript:" class="lfb_numberFieldQtSelector" data-lfbdirection="+">+</a>');btnPlus.insertAfter($(this)),btnPlus.on("click",(function(){var formID=$(this).closest("#lfb_form").attr("data-form");void 0!==btnLess.data("incrementInterval")&&clearInterval(btnLess.data("incrementInterval")),void 0!==btnPlus.data("incrementInterval")&&clearInterval(btnPlus.data("incrementInterval"));var newValue=parseFloat($(this).parent().find("input").val())+1;$(this).parent().find("input").attr("max")&&newValue>parseFloat($(this).parent().find("input").attr("max"))&&(newValue=parseFloat($(this).parent().find("input").attr("max"))),$(this).parent().find("input").attr("min")&&newValue<parseFloat($(this).parent().find("input").attr("min"))&&(newValue=parseFloat($(this).parent().find("input").attr("min"))),$(this).parent().find("input").val(newValue),lfb_updatePrice(formID)})),btnLess.on("click",(function(){var formID=$(this).closest("#lfb_form").attr("data-form");void 0!==btnLess.data("incrementInterval")&&clearInterval(btnLess.data("incrementInterval")),void 0!==btnPlus.data("incrementInterval")&&clearInterval(btnPlus.data("incrementInterval"));var newValue=parseFloat($(this).parent().find("input").val())-1;$(this).parent().find("input").attr("max")&&newValue>parseFloat($(this).parent().find("input").attr("max"))&&(newValue=parseFloat($(this).parent().find("input").attr("max"))),$(this).parent().find("input").attr("min")&&newValue<parseFloat($(this).parent().find("input").attr("min"))&&(newValue=parseFloat($(this).parent().find("input").attr("min"))),$(this).parent().find("input").val(newValue),lfb_updatePrice(formID)}))}))}function lfb_getItemDataFromItem(form,itemID){var itemData=!1,checkedItems=new Array,$itembloc=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_itemContainer_'+itemID),stepID=$itembloc.closest(".lfb_genSlide").attr("data-stepid"),$panel=$itembloc.closest(".lfb_genSlide"),showSummary=!0;if($itembloc.is(".lfb_disabled")){var itemID=$itembloc.find("[data-itemid]").attr("data-itemid");form.itemsData=jQuery.grep(form.itemsData,(function(exItem){return exItem.itemid!=itemID}))}else{if($itembloc.find("div.lfb_selectable.checked").length>0){var itemSelf=$itembloc.find("div.lfb_selectable.checked").get(0),quantityText="";$(itemSelf).is("[data-resqt]")&&$(itemSelf).data("resqt",$(itemSelf).attr("data-resqt")),$(itemSelf).is("[data-resprice]")&&$(itemSelf).data("resprice",$(itemSelf).attr("data-resprice")),!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1);var quantity=parseFloat($(itemSelf).data("resqt")),priceItem=parseFloat($(itemSelf).data("resprice"));0==quantity&&(quantity=1),quantity>1&&(quantityText=quantity+"x "),$(itemSelf).data("price")&&("+"==$(itemSelf).data("operation")?"left"==form.currencyPosition?priceItem=form.currency+priceItem:priceItem+=form.currency:"-"==$(itemSelf).data("operation")?"left"==form.currencyPosition?priceItem="-"+form.currency+priceItem:priceItem+="-"+form.currency:priceItem="/"==$(itemSelf).data("operation")?"-"+$(itemSelf).data("price")+"%":"+"+$(itemSelf).data("price")+"%");var itemPriceS=parseFloat($(itemSelf).data("resprice"));isNaN(itemPriceS)&&(itemPriceS=parseFloat($(itemSelf).data("price")));var isSinglePrice=!1;if($(itemSelf).is('[data-singleprice="true"]')&&(isSinglePrice=!0),$(itemSelf).is('[data-hidezeropricesum="true"]')&&0==itemPriceS&&(showSummary=!1),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)){checkedItems.push($(itemSelf).attr("data-itemid"));var label=$(itemSelf).attr("data-title");$(itemSelf).is("[data-bs-original-title]")&&$(itemSelf).is("[data-reducqt]")&&(label=$(itemSelf).attr("data-bs-original-title")),$(itemSelf).is("[data-originaltitle]")&&$(itemSelf).is('[data-showprice="1"]')&&(label=$(itemSelf).attr("data-originaltitle")),$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),itemData={label:label,type:$itembloc.attr("data-itemtype"),itemid:$(itemSelf).attr("data-itemid"),price:itemPriceS,quantity:quantity,step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary,isSinglePrice:isSinglePrice,image:$(itemSelf).find(".img").attr("src")}}}if($itembloc.find("a.lfb_button.checked").length>0){var itemSelf=$itembloc.find("a.lfb_button.checked").get(0),priceItem=parseFloat($(itemSelf).data("price"));if(!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1),$(itemSelf).data("price")){"+"==$(itemSelf).data("operation")?"left"==form.currencyPosition?priceItem=form.currency+priceItem:priceItem+=form.currency:"-"==$(itemSelf).data("operation")?"left"==form.currencyPosition?priceItem="-"+form.currency+priceItem:priceItem+="-"+form.currency:priceItem="/"==$(itemSelf).data("operation")?"-"+priceItem+"%":"+"+priceItem+"%";var title=$(itemSelf).attr("data-originaltitle");$(itemSelf).is("select")&&(title+=" ("+$(itemSelf).val()+")")}else{var title=$(itemSelf).attr("data-originaltitle");$(itemSelf).is("select")&&(title+=" : "+$(itemSelf).val())}var label=$(itemSelf).attr("data-title");$(itemSelf).is("[data-originaltitle]")&&$(itemSelf).is('[data-showprice="1"]')&&(label=$(itemSelf).attr("data-originaltitle")),$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),$(itemSelf).is("select")&&(label+=" : "+$(itemSelf).val());var isSinglePrice=!1;$(itemSelf).is('[data-singleprice="true"]')&&(isSinglePrice=!0),$(itemSelf).is('[data-hidezeropricesum="true"]')&&0==itemPriceS&&(showSummary=!1),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),price:parseFloat($(itemSelf).data("resprice")),quantity:1,step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary,isSinglePrice:isSinglePrice})}if($itembloc.find("input[type=checkbox]:checked").length>0){var itemSelf=$itembloc.find("input[type=checkbox]:checked").get(0),priceItem=parseFloat($(itemSelf).data("price"));if(!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1),$(itemSelf).data("price")){"+"==$(itemSelf).data("operation")?"left"==form.currencyPosition?priceItem=form.currency+priceItem:priceItem+=form.currency:"-"==$(itemSelf).data("operation")?"left"==form.currencyPosition?priceItem="-"+form.currency+priceItem:priceItem+="-"+form.currency:priceItem="/"==$(itemSelf).data("operation")?"-"+priceItem+"%":"+"+priceItem+"%";var title=$(itemSelf).attr("data-originaltitle");$(itemSelf).is("select")&&(title+=" ("+$(itemSelf).val()+")")}else{var title=$(itemSelf).attr("data-originaltitle");$(itemSelf).is("select")&&(title+=" : "+$(itemSelf).val())}var label=$(itemSelf).attr("data-title");$(itemSelf).is("[data-originaltitle]")&&$(itemSelf).is('[data-showprice="1"]')&&(label=$(itemSelf).attr("data-originaltitle")),$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),$(itemSelf).is("select")&&(label+=" : "+$(itemSelf).val());var isSinglePrice=!1;$(itemSelf).is('[data-singleprice="true"]')&&(isSinglePrice=!0),$(itemSelf).is('[data-hidezeropricesum="true"]')&&0==itemPriceS&&(showSummary=!1),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),price:parseFloat($(itemSelf).data("resprice")),quantity:1,step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary,isSinglePrice:isSinglePrice})}if($itembloc.is(".lfb_richtext")&&!$itembloc.is(".lfb_shortcode")){var itemSelf=$itembloc.get(0);!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:$(itemSelf).attr("data-title"),itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),value:$(itemSelf).html(),step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary})}if($itembloc.find('div[data-type="slider"][data-itemid].lfb_range').length>0){var itemSelf=$itembloc.find('div[data-type="slider"]').get(0);!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1);var minValue=parseFloat($(itemSelf).slider("values")[0]),maxValue=parseFloat($(itemSelf).slider("values")[1]),label=$(itemSelf).attr("data-title");$(itemSelf).is("[data-originaltitle]")&&$(itemSelf).is('[data-showprice="1"]')&&(label=$(itemSelf).attr("data-originaltitle")),$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),$(itemSelf).is('[data-hidezeropricesum="true"]')&&0==itemPriceS&&(showSummary=!1),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),price:0,quantity:0,step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary,isSinglePrice:!1,value:minValue+" - "+maxValue,minValue:minValue,maxValue:maxValue})}if($itembloc.find('div[data-type="slider"][data-itemid]:not(.lfb_range)').length>0){var itemSelf=$itembloc.find('div[data-type="slider"]').get(0),priceItem=parseFloat($(itemSelf).data("price")),quantity;if(!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1),0==(quantity=parseFloat($(itemSelf).slider("value")))&&(quantity=1),quantity>1&&(quantityText=quantity+"x "),$(itemSelf).data("price")){"+"==$(itemSelf).data("operation")?"left"==form.currencyPosition?priceItem=form.currency+priceItem:priceItem+=form.currency:"-"==$(itemSelf).data("operation")?"left"==form.currencyPosition?priceItem="-"+form.currency+priceItem:priceItem+="-"+form.currency:priceItem="/"==$(itemSelf).data("operation")?"-"+priceItem+"%":"+"+priceItem+"%";var title=$(itemSelf).attr("data-originaltitle");$(itemSelf).is("select")&&(title+=" ("+$(itemSelf).val()+")")}else{var title=$(itemSelf).attr("data-originaltitle");$(itemSelf).is("select")&&(title+=" : "+$(itemSelf).val())}var label=$(itemSelf).attr("data-title");$(itemSelf).is("[data-originaltitle]")&&$(itemSelf).is('[data-showprice="1"]')&&(label=$(itemSelf).attr("data-originaltitle")),$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),$(itemSelf).is("select")&&(label+=" : "+$(itemSelf).val());var isSinglePrice=!1;$(itemSelf).is('[data-singleprice="true"]')&&(isSinglePrice=!0),$(itemSelf).is('[data-hidezeropricesum="true"]')&&0==itemPriceS&&(showSummary=!1),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),price:parseFloat($(itemSelf).data("resprice")),quantity:parseFloat($(itemSelf).slider("value")),step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary,isSinglePrice:isSinglePrice})}if($itembloc.find("select[data-itemid]").length>0){var itemSelf=$itembloc.find("select[data-itemid]").get(0),priceItem=parseFloat($(itemSelf).data("price"));if(!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1),$(itemSelf).data("price")&&$(itemSelf).data("price")>0){"+"==$(itemSelf).data("operation")?"left"==form.currencyPosition?priceItem=form.currency+priceItem:priceItem+=form.currency:"-"==$(itemSelf).data("operation")?"left"==form.currencyPosition?priceItem="-"+form.currency+priceItem:priceItem+="-"+form.currency:priceItem="/"==$(itemSelf).data("operation")?"-"+priceItem+"%":"+"+priceItem+"%";var title=$(itemSelf).attr("data-originaltitle");$(itemSelf).is("select")&&(title+=" ("+$(itemSelf).val()+")")}else{var title=$(itemSelf).attr("data-originaltitle");$(itemSelf).is("select")&&(title+=" : "+$(itemSelf).val())}var label=$(itemSelf).attr("data-title");$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel"));var isSinglePrice=!1;$(itemSelf).is('[data-singleprice="true"]')&&(isSinglePrice=!0),$(itemSelf).is('[data-hidezeropricesum="true"]')&&0==itemPriceS&&(showSummary=!1);var valueSelect=$(itemSelf).val();null==valueSelect&&(valueSelect=""),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),price:parseFloat($(itemSelf).data("resprice")),value:valueSelect,quantity:1,step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary,isSinglePrice:isSinglePrice})}if($itembloc.find("input[type=file]").length>0){var itemSelf=$itembloc.find("input[type=file]").get(0);!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1);var label=$(itemSelf).data("title");$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),$(itemSelf).is('[data-hidezeropricesum="true"]')&&0==itemPriceS&&(showSummary=!1),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),value:$(itemSelf).val(),step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary,isFile:!0})}if($itembloc.find(".lfb_dropzone").length>0){var itemSelf=$itembloc.find(".lfb_dropzone").get(0);!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1);var filesValue="",filesValueG="",files=new Array;$(itemSelf).find(".dz-preview[data-file]:not(.dz-error)").each((function(){files.push($(this).attr("data-file").replace(/ /g,"_")),1==form.emailCustomerLinks?(filesValue+=' - <a href="'+$(this).attr("data-url")+'">'+$(this).attr("data-file").replace(/ /g,"_")+"</a><br/>",filesValueG+=" - "+$(this).attr("data-url")+"\n"):(filesValue+=' - <span class="lfb_file">'+$(this).attr("data-file").replace(/ /g,"_")+"</span><br/>",filesValueG+=" - "+$(this).attr("data-file").replace(/ /g,"_")+"\n")}));var label=$(itemSelf).data("title");$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),files.length>0&&($(itemSelf).is('[data-hidezeropricesum="true"]')&&0==itemPriceS&&(showSummary=!1),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),value:filesValue,step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary,isFile:!0,files:files}))}if($itembloc.find("input[type=text][data-itemid]:not(.lfb_colorpicker)").length>0){var itemSelf=$itembloc.find("input[type=text]:not(.lfb_colorpicker)").get(0);!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1);var label=$(itemSelf).data("title");$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),$(itemSelf).is('[data-hidezeropricesum="true"]')&&0==itemPriceS&&(showSummary=!1),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),value:$(itemSelf).val(),step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary})}if($itembloc.find("input[type=number][data-itemid]:not(.lfb_colorpicker)").length>0){var itemSelf=$itembloc.find("input[type=number]:not(.lfb_colorpicker)").get(0),quantity;!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1),quantityText=(quantity=parseFloat($(itemSelf).val()))+"x ";var fieldVal=$(itemSelf).val(),fieldQt=void 0,itemPriceS=void 0;$(itemSelf).is('[data-valueasqt="1"]')&&(fieldVal=void 0,fieldQt=parseFloat($(itemSelf).val()),itemPriceS=parseFloat($(itemSelf).data("resprice")),isNaN(itemPriceS)&&(itemPriceS=parseFloat($(itemSelf).data("price"))));var isSinglePrice=!1;$(itemSelf).is('[data-singleprice="true"]')&&(isSinglePrice=!0);var label=$(itemSelf).data("title");$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),$(itemSelf).is('[data-hidezeropricesum="true"]')&&0==itemPriceS&&(showSummary=!1),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),value:fieldVal,quantity:fieldQt,price:itemPriceS,step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary,isSinglePrice:isSinglePrice})}if($itembloc.find(".lfb_colorPreview").length>0){var itemSelf=$itembloc.find(".lfb_colorPreview").get(0);!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1);var label=$(itemSelf).data("title");$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),value:$(itemSelf).next(".lfb_colorpicker").val(),step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary})}if($itembloc.find("textarea").length>0){var itemSelf=$itembloc.find("textarea").get(0);!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1);var label=$(itemSelf).data("title");$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),value:lfb_nl2br($(itemSelf).val()),step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary})}if($itembloc.find(".lfb_rate").length>0){var itemSelf=$itembloc.get(0);!$panel.is('[data-showstepsum="0"]')&&$(itemSelf).is('[data-showinsummary="true"]')||(showSummary=!1);var label=$(itemSelf).data("title");$(itemSelf).is("[data-originallabel]")&&(label=$(itemSelf).attr("data-originallabel")),-1==jQuery.inArray($(itemSelf).attr("data-itemid"),checkedItems)&&(checkedItems.push($(itemSelf).attr("data-itemid")),itemData={label:label,itemid:$(itemSelf).attr("data-itemid"),type:$itembloc.attr("data-itemtype"),value:$itembloc.find(".lfb_rate").rate("getValue"),step:$panel.attr("data-title"),stepid:stepID,showInSummary:showSummary})}itemData&&($itembloc.find('[data-showprice="0"]').length>0?itemData.showPrice=!1:itemData.showPrice=!0)}return itemData}function lfb_updateItemData(form,itemID){for(var exItemData=!1,exItemIndex=-1,i=0;i<form.itemsData.length;i++)if(form.itemsData[i].itemid==itemID){exItemData=form.itemsData[i],exItemIndex=i;break}var $itembloc;if($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_itemContainer_'+itemID).is(".lfb_disabled"))exItemData&&(form.itemsData=jQuery.grep(form.itemsData,(function(exItem){return exItem.itemid!=itemID})));else{var itemData=lfb_getItemDataFromItem(form,itemID);exItemData?form.itemsData[exItemIndex]=itemData:form.itemsData.push(itemData)}}function lfb_getItemData(form,itemID){for(var rep=!1,i=0;i<form.itemsData.length;i++)if(form.itemsData[i].itemid==itemID){(rep=form.itemsData[i])&&rep.stepid==form.step&&(rep=lfb_getItemDataFromItem(form,itemID));break}return rep||(rep=lfb_getItemDataFromItem(form,itemID)),rep}function lfb_getFormContent(formID,useCurrent,onlyStepID){var form=lfb_getForm(formID),content="",contentGform="",totalTxt="",items=new Array;contentGform+="Ref : "+form.current_ref+" \n";var lastStepTitle="",cloneSteps=JSON.parse(JSON.stringify(lfb_lastSteps)),pattern;useCurrent&&"final"!=form.step&&cloneSteps.push(form.step),"final"==form.step&&cloneSteps.push("final"),void 0!==onlyStepID&&0!=onlyStepID&&(cloneSteps=new Array).push(onlyStepID);for(var checkedItems=new Array,o=0;o<cloneSteps.length;o++){var _stepID=cloneSteps[o],$panel=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+_stepID+'"]');if(("final"==$panel.attr("data-stepid")||jQuery.inArray(parseInt($panel.attr("data-stepid")),lfb_plannedSteps)>=0)&&!$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-title][data-stepid="'+_stepID+'"]').is(".lfb_disabled")){var stepID=$panel.attr("data-stepid");"final"!=stepID&&(stepID=parseInt(stepID)),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is('[data-sumhidesteps="1"]')||(content+="<br/><p><u><b>"+$panel.attr("data-title")+" :</b></u></p><br/>",contentGform+="\n\n---------"+$panel.attr("data-title")+" :---------\n");var stepsItemsData=new Array;$panel.find(".lfb_itemBloc:not(.lfb_disabled)").each((function(){var _itemID=0;if(_itemID=$(this).find("[data-itemid]").length>0?$(this).find("[data-itemid]").attr("data-itemid"):$(this).attr("data-itemid"),-1==checkedItems.indexOf(_itemID)){checkedItems.push(_itemID);var itemData=lfb_getItemData(form,_itemID);itemData&&(items.push(itemData),stepsItemsData.push(itemData))}}));for(var j=0;j<stepsItemsData.length;j++)if("richtext"!=stepsItemsData[j].type&&stepsItemsData[j].showInSummary&&void 0!==stepsItemsData[j].label)if(void 0!==stepsItemsData[j].price&&0!=stepsItemsData[j].price&&stepsItemsData[j].showPrice){var itemPrice=lfb_formatPrice(parseFloat(stepsItemsData[j].price).toFixed(2),formID)+form.currency;"left"==form.currencyPosition&&(itemPrice=form.currency+lfb_formatPrice(parseFloat(stepsItemsData[j].price).toFixed(2),formID)),void 0!==stepsItemsData[j].value?(content+="    - "+stepsItemsData[j].label+" : "+stepsItemsData[j].value+" ("+itemPrice+")<br/>",contentGform+=" - "+stepsItemsData[j].label+" : "+stepsItemsData[j].value+" ("+itemPrice+")\n"):void 0!==stepsItemsData[j].quantity&&stepsItemsData[j].quantity>1?(content+="    - "+stepsItemsData[j].label+" : "+stepsItemsData[j].quantity+" ("+itemPrice+")<br/>",contentGform+=" - "+stepsItemsData[j].label+" : "+stepsItemsData[j].quantity+" ("+itemPrice+")\n"):(content+="    - "+stepsItemsData[j].label+" : "+itemPrice+"<br/>",contentGform+=" - "+stepsItemsData[j].label+" : "+itemPrice+"\n")}else void 0!==stepsItemsData[j].value?""!=stepsItemsData[j].value&&(content+="    - "+stepsItemsData[j].label+" : "+stepsItemsData[j].value+"<br/>",contentGform+=" - "+stepsItemsData[j].label+" : "+stepsItemsData[j].value+"\n"):void 0!==stepsItemsData[j].quantity&&stepsItemsData[j].quantity>1?(content+="    - "+stepsItemsData[j].label+" : "+stepsItemsData[j].quantity+"<br/>",contentGform+=" - "+stepsItemsData[j].label+" : "+stepsItemsData[j].quantity+"\n"):(content+="    - "+stepsItemsData[j].label+"<br/>",contentGform+=" - "+stepsItemsData[j].label+"\n")}}if((!form.price||form.price<0)&&(form.price=0),/^\d+(\.\d{2})?$/.test(form.price)||(form.price=parseFloat(form.price).toFixed(2)),""!=form.discountCode)if(form.reductionResult>0){var reduction=parseFloat(form.reductionResult).toFixed(2)+form.currency;"left"==form.currencyPosition&&(reduction=form.currency+parseFloat(form.reductionResult).toFixed(2)),content+="<br/> Coupon : "+form.discountCode+" ("+reduction+")"}else content+="<br/> Coupon : "+form.discountCode;return"left"==form.currencyPosition?(totalTxt+=form.currency+lfb_formatPrice(parseFloat(form.price).toFixed(2),formID),contentGform+="\n\nTotal : "+form.currency+lfb_formatPrice(parseFloat(form.price).toFixed(2),formID)):(totalTxt+=lfb_formatPrice(parseFloat(form.price).toFixed(2),formID)+form.currency,contentGform+="\n\nTotal : "+lfb_formatPrice(parseFloat(form.price).toFixed(2),formID)+form.currency),new Array(content,totalTxt,items,contentGform)}function lfb_check_gform_response(formID){var form=lfb_getForm(formID);if($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #gforms_confirmation_message').length>0)if(clearInterval(form.timer_gFormSubmit),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').length>0&&form.price>0){var payPrice=form.price;if("percent"==form.payMode?payPrice=parseFloat(payPrice)*(parseFloat(form.percentToPay)/100):"fixed"==form.payMode&&(payPrice=parseFloat(form.fixedToPay)),payPrice=parseFloat(payPrice).toFixed(2),form.priceSingle>0){var payPriceSingle=form.priceSingle;"percent"==form.payMode?payPriceSingle=parseFloat(payPriceSingle)*(parseFloat(form.percentToPay)/100):"fixed"==form.payMode&&(payPriceSingle=parseFloat(form.fixedToPay)),0==$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=a1]').length&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').append('<input type="hidden" name="a1" value="0">'),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').append('<input type="hidden" name="p1" value="1">'),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').append('<input type="hidden" name="t1" value="M">')),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=a1]').val(payPriceSingle),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=p1]').val($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=p3]').val())}else $('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=a1]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=t1]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=p1]').remove();$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=amount]').val(payPrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=a3]').val(payPrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=item_number]').val(form.current_ref),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=item_name]').val($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=item_name]').val()+" - "+form.current_ref),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [type="submit"]').trigger("click")}else $('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .gfield_error').length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .gform_footer').show(),$("#finalText").html($("#gform_wrapper_"+form.gravityFormID+" .gforms_confirmation_message").html()),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide #gforms_confirmation_message').fadeIn(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide #lfb_summary').fadeOut(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide #lfb_couponContainer').fadeOut(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide #lfb_legalNoticeContent').fadeOut(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide .linkPrevious').fadeOut(),lfb_finalStep(formID)}function lfb_quantity_less(btn,formID){var $target=$(btn).parent().parent().find(".icon_quantity"),min=parseFloat($(btn).parent().data("min")),quantity=parseInt($target.html());quantity>1&&quantity>min&&(quantity--,$target.html(quantity),lfb_updatePrice(formID))}function lfb_quantity_more(btn,formID){var $target=$(btn).parent().parent().find(".icon_quantity"),max=parseFloat($(btn).parent().data("max")),quantity=parseFloat($target.html());(quantity<max||0==max)&&(quantity++,$target.html(quantity),lfb_updatePrice(formID))}function lfb_checkEmail(email){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)}function lfb_isIframe(){try{return window.self!==window.top}catch(e){return!0}}function lfb_cloneSummary(mode,formID){var form=lfb_getForm(formID),$summaryClone=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary').clone();const fieldsStyle=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').attr("data-stylefields");"table-row"!=$summaryClone.find("#lfb_summaryDiscountTr").css("display")&&$summaryClone.find("#lfb_summaryDiscountTr").remove(),$("body").is(".rtl")&&($summaryClone.css({textAlign:"right",direction:"rtl"}),$summaryClone.find("table").css({textAlign:"right",direction:"rtl"})),$summaryClone.addClass("lfb-hidden"),$summaryClone.uniqueId();var nbCols=4;return"1"==form.summary_showAllPricesEmail&&$summaryClone.find(".lfb_hidePrice").removeClass("lfb_hidePrice").removeClass("lfb-hidden"),$summaryClone.find("thead th").each((function(){$(this).is(".lfb-hidden")&&nbCols--})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary').after($summaryClone),$summaryClone.children("h4").remove(),$summaryClone.find("*:not(.lfb_value)").each((function(){$(this).css({fontSize:$(this).css("font-size"),padding:$(this).css("padding"),textAlign:$(this).css("text-align"),lineHeight:$(this).css("line-height")})})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table thead > tr > th:eq(1)').is(".lfb-hidden")&&($summaryClone.find("table thead > tr > th:eq(1)").remove(),$summaryClone.find("table tbody td.lfb_valueTd").remove()),$summaryClone.find("th.lfb_summaryStep").attr("align","center"),$summaryClone.find("table").attr("width","90%"),$summaryClone.find("table").css("width","90%"),$summaryClone.find("table").attr("border","1"),$summaryClone.find("table").attr("bordercolor",lfb_rgb2hex($summaryClone.find("table").css("border-color"))),$summaryClone.find("table").attr("style","width:90%;margin:0 auto;"),$summaryClone.find("thead td, thead th").each((function(){"glassmorphic"==fieldsStyle?($(this).attr("bgcolor",form.color_summaryTheadBg),$(this).css("background",form.color_summaryTheadBg),$(this).css("color",form.color_summaryTheadTxt),$(this).attr("color",form.color_summaryTheadTxt)):($(this).attr("bgcolor",lfb_rgb2hex($summaryClone.find("thead").css("background-color"))),$(this).css("background",lfb_rgb2hex($summaryClone.find("thead").css("background-color"))))})),$summaryClone.find("tbody th").each((function(){"glassmorphic"==fieldsStyle&&($(this).attr("bgcolor",form.color_summaryStepBg),$(this).css("color",form.color_summaryStepTxt),$(this).attr("color",form.color_summaryStepTxt))})),$summaryClone.find("th").each((function(){"glassmorphic"!=fieldsStyle&&$(this).attr("bgcolor",lfb_rgb2hex($(this).css("background-color")))})),$summaryClone.find("td").each((function(){"glassmorphic"==fieldsStyle?($(this).attr("bgcolor",form.color_summaryTbodyBg),$(this).css("color",form.color_summaryTbodyTxt),$(this).attr("color",form.color_summaryTbodyTxt)):$(this).attr("style").indexOf("background-color")>-1||$(this).attr("style").indexOf("background")>-1?$(this).attr("bgcolor",lfb_rgb2hex($(this).css("background-color"))):$(this).attr("bgcolor",lfb_rgb2hex($(this).closest("table").css("background-color")))})),"glassmorphic"==fieldsStyle?$summaryClone.find("td,th").each((function(){$(this).html('<span style="color: '+lfb_rgb2hex($(this).css("color"))+"; font-size: "+$(this).css("font-size")+'">'+$(this).html()+"</span>")})):$summaryClone.find("td,th").each((function(){$(this).attr("color",lfb_rgb2hex($(this).css("color"))),$(this).html('<span style="color: '+lfb_rgb2hex($(this).css("color"))+"; font-size: "+$(this).css("font-size")+'">'+$(this).html()+"</span>")})),$summaryClone.find("table .lfb-hidden").remove(),$summaryClone.find("table").attr("cellspacing","0"),$summaryClone.find("table").attr("cellpadding","8"),$summaryClone.find("table").attr("bgcolor","#FFFFFF"),$summaryClone.find("td,th").each((function(){$(this).attr("align",$(this).css("text-align")),$(this).css("padding",$(this).css("padding"))})),"1"==form.summary_showAllPricesEmail&&($summaryClone.find(".lfb_summaryStep").attr("colspan",nbCols),$summaryClone.find("#lfb_summaryDiscountTr>th:eq(0),#lfb_summaryTotalTr>th:eq(0)").attr("colspan",nbCols-1)),3==nbCols?($summaryClone.find("td:not(:first-child)").each((function(){$(this).attr("width","164")})),$summaryClone.find("th:not(:first-child)").each((function(){$(this).attr("width","164")})),$summaryClone.find("tr>td:first-child").each((function(){$(this).attr("width","340")})),$summaryClone.find("tr>th:first-child").each((function(){$(this).attr("width","340")}))):2==nbCols?($summaryClone.find("td:not(:first-child)").each((function(){$(this).attr("width","50%")})),$summaryClone.find("th:not(:first-child)").each((function(){$(this).attr("width","50%")})),$summaryClone.find("tr>td:first-child").each((function(){$(this).attr("width","50%")})),$summaryClone.find("tr>th:first-child").each((function(){$(this).attr("width","50%")}))):($summaryClone.find("td:not(:first-child)").each((function(){$(this).attr("width","103")})),$summaryClone.find("th:not(:first-child)").each((function(){$(this).attr("width","103")})),$summaryClone.find("tr>td:first-child").each((function(){$(this).attr("width","332")})),$summaryClone.find("tr>th:first-child").each((function(){$(this).attr("width","332")}))),$summaryClone.find("*:not(.lfb_value)").each((function(){var color=lfb_rgb2hex($(this).css("color"));$(this).css({color:""}),$(this).attr("style",$(this).attr("style")+";color:"+color),$(this).attr("style").length>0?$(this).attr("style",$(this).attr("style")+";color:"+color):$(this).attr("style","color:"+color)})),$summaryClone.find("[data-tldinit]").removeAttr("data-tldinit"),$summaryClone.find(".lfb_file").each((function(){$(this).removeAttr("style"),$(this).removeAttr("data-tldinit")})),$summaryClone.html('<div id="lfb_summaryCt" style="padding-top: 24px;padding-bottom: 24px; text-align: center;">'+$summaryClone.html()+"</div>"),$summaryClone}function lfb_getContactInformations(formID,useJson){var rep;if(useJson)var rep={email:"",phone:"",firstName:"",lastName:"",address:"",city:"",state:"",zip:"",country:"",job:"",phoneJob:"",url:"",company:""};else(rep=new Array).email="",rep.phone="",rep.firstName="",rep.lastName="",rep.address="",rep.city="",rep.state="",rep.zip="",rep.country="",rep.job="",rep.phoneJob="",rep.url="",rep.company="";$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="email"]').each((function(){$(this).val().length>0&&lfb_checkEmail($(this).val())&&(rep.email=$(this).val())}));var phone="";$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="phone"]').each((function(){$(this).val().length>3&&(rep.phone=$(this).val())}));var firstName="";$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="firstName"]').each((function(){$(this).val().length>0&&(rep.firstName=$(this).val())}));var lastName="";$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="lastName"]').each((function(){$(this).val().length>0&&(rep.lastName=$(this).val())}));var address="";$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="address"]').each((function(){$(this).val().length>0&&(rep.address=$(this).val())}));var city="";$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="city"]').each((function(){$(this).val().length>0&&(rep.city=$(this).val())}));var state="";return $('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="state"]').each((function(){$(this).val().length>0&&(rep.state=$(this).val())})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="zip"]').each((function(){$(this).val().length>0&&(rep.zip=$(this).val())})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="country"]').each((function(){$(this).val().length>0&&(rep.country=$(this).val())})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="job"]').each((function(){$(this).val().length>0&&(rep.job=$(this).val())})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="phoneJob"]').each((function(){$(this).val().length>0&&(rep.phoneJob=$(this).val())})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="url"]').each((function(){$(this).val().length>0&&(rep.url=$(this).val())})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="company"]').each((function(){$(this).val().length>0&&(rep.company=$(this).val())})),rep}function lfb_getUrlVariablesByFormID(formID){var form=lfb_getForm(formID),contentForm,urlVariables=lfb_getUrlVariables(formID,lfb_getFormContent(formID)[2],!0);return $('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').data("lfb_urlVariables",urlVariables),urlVariables}function lfb_getUrlVariables(formID,items){var form=lfb_getForm(formID),variablesText="",checkedVariables=new Array;jQuery.each(items,(function(){if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+this.itemid+'"]').length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+this.itemid+'"]');if($item.is('[data-urlvariable="1"]')){var value="0";"quantity"==$item.attr("data-sentattribute")?$item.is(".lfb_dropzone")?(value=(value=(value=(value="").replace(/<span class="lfb_file">/g,"")).replace(/<\/span>/g,"")).substr(3,value.length),1==form.emailCustomerLinks&&(value="",$item.find(".dz-success.dz-complete").each((function(){value+=$(this).attr("data-url")+","})),value.length>0&&(value=value.substr(0,value.length-1)))):void 0!==this.value?value=this.value.replace(/\+/g,"%2b"):void 0!==this.quantity&&(value=this.quantity):"title"==$item.attr("data-sentattribute")?value=$item.attr("data-originallabel"):void 0!==this.price&&(value=this.price);var title=$item.attr("data-variablename");title=title.length>0&&title.replace(/ /g,"").length>0?lfb_formatForUrl(title):lfb_formatForUrl(this.label),"string"==typeof value&&(value=value.replace(/<br\s*[\/]?>/gi,"\n")),-1==checkedVariables.indexOf(title)&&(checkedVariables.push(title),variablesText+="&"+encodeURIComponent(title)+"="+encodeURIComponent(value))}}}));for(var i=0;i<form.variables.length;i++)1==form.variables[i].sendAsGet&&void 0!==form.variables[i].value&&"function"==typeof form.variables[i].value.replace&&(variablesText+="&"+encodeURIComponent(lfb_formatForUrl(form.variables[i].title))+"="+encodeURIComponent(form.variables[i].value.replace(/\+/g,"%2b")));if(variablesText.length>0){if(variablesText="?"+variablesText.substr(1,variablesText.length),void 0!==form.orderRef){var refName=form.refVarName;variablesText+="&"+encodeURIComponent(refName)+"="+encodeURIComponent(form.orderRef)}""!=form.discountCode&&(variablesText+="&coupon="+encodeURIComponent(form.discountCode)+"&discount="+encodeURIComponent(form.reductionResult))}else if(void 0!==form.orderRef){var refName=form.refVarName;variablesText+="?"+encodeURIComponent(refName)+"="+encodeURIComponent(form.orderRef),""!=form.discountCode&&(variablesText+="&coupon="+encodeURIComponent(form.discountCode)+"&discount="+encodeURIComponent(form.reductionResult))}else""!=form.discountCode&&(variablesText+="?coupon="+encodeURIComponent(form.discountCode)+"&discount="+encodeURIComponent(form.reductionResult));return variablesText}function lfb_formatForUrl(text){return text=(text=text.replace(/ /g,"_")).replace(/[^\w\s]/gi,"")}function lfb_orderSend(formID,informations,email,fields){var form=lfb_getForm(formID),contentForm=lfb_getFormContent(formID),content=contentForm[0];content=content.replace(/<br\/>/g,"[n]");var totalTxt=contentForm[1],items=contentForm[2];form.urlVariables="",1==form.sendUrlVariables&&(form.urlVariables=lfb_getUrlVariables(formID,contentForm[2],!0)),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is("[data-subs]")&&(totalTxt+=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').attr("data-subs"));var usePaypalIpn=0,activatePaypal=!0;$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-activatePaypal="true"]:not(:checked):not(.checked)').each((function(){var cStepID=$(this).closest(".lfb_genSlide").attr("data-stepid");"final"!=cStepID&&(cStepID=parseInt(cStepID)),-1==jQuery.inArray(cStepID,lfb_lastSteps)||(activatePaypal=!1)})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').find('[data-dontactivatepaypal="true"].checked,[data-dontactivatepaypal="true"]:checked').length>0&&(activatePaypal=!1),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_paypalForm').is('[data-useipn="1"]')&&(usePaypalIpn=1);var $summaryClone=lfb_cloneSummary(!1,formID),summaryData=$summaryClone.html();$summaryClone.remove();var infosCt=lfb_getContactInformations(formID);email=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .emailField').val(),lfb_checkEmail(infosCt.email)&&(email=infosCt.email);var total=parseFloat(form.price),totalSub=0,subFrequency="",formTitle=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-formtitle");$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-isSubs="true"]')&&(total=parseFloat(form.priceSingle),totalSub=parseFloat(form.price),subFrequency=form.subscriptionText);var fieldsLast=new Array;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide input[type=text],#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide input[type=email], #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide textarea').each((function(){0==$(this).closest("#lfb_paypalForm").length&&fieldsLast.push({fieldID:$(this).prop("id").substr(6,9),value:lfb_nl2br($(this).val())})}));var activatePaypal=!0;$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-activatePaypal="true"]:not(:checked):not(.checked)').each((function(){var cStepID=$(this).closest(".lfb_genSlide").attr("data-stepid");"final"!=cStepID&&(cStepID=parseInt(cStepID)),-1==jQuery.inArray(cStepID,lfb_lastSteps)||(activatePaypal=!1)})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').find('[data-dontactivatepaypal="true"].checked,[data-dontactivatepaypal="true"]:checked').length>0&&(activatePaypal=!1);var captcha="";if("undefined"!=typeof ga)try{ga("set","page",location.pathname+"#Form+sent"),ga("send","pageview")}catch(e){}if("undefined"!=typeof gtag)try{gtag("event","page_view",{page_location:window.location.href,page_path:location.pathname+"#Form+sent",page_title:document.title+" Form sent"})}catch(e){}form.emailSent=!0,null!==localStorage.getItem("lfb_savedFormID")&&parseInt(localStorage.getItem("lfb_savedFormID"))==formID&&null!==localStorage.getItem("lfb_savedForm")&&(localStorage.removeItem("lfb_savedFormID"),localStorage.removeItem("lfb_formsession"),localStorage.removeItem("lfb_savedForm"),localStorage.removeItem("lfb_savedFormPastSteps"),localStorage.removeItem("lfb_savedFormStep")),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').fadeOut();var eventsData=new Array;$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_datepicker[data-calendarid!="0"][data-registerevent="1"]').each((function(){if(""!=$(this).val()){var eventData={};if(eventData.calendarID=parseInt($(this).attr("data-calendarid")),eventData.duration=parseInt($(this).attr("data-eventduration")),eventData.durationType=$(this).attr("data-eventdurationtype"),"mins"==eventData.durationType&&(eventData.durationType="minutes"),eventData.isBusy=parseInt($(this).attr("data-eventbusy")),eventData.categoryID=parseInt($(this).attr("data-eventcategory")),eventData.startDate=moment($(this).datetimepicker("getDate")).format("YYYY-MM-DD HH:mm"),eventData.endDate=moment($(this).datetimepicker("getDate")).add(eventData.duration,eventData.durationType).format("YYYY-MM-DD HH:mm"),eventData.title=$(this).attr("data-eventtitle"),"date"==$(this).attr("data-datetype")){var startDateMoment=moment($(this).datetimepicker("getDate"));eventData.startDate=startDateMoment.format("YYYY-MM-DD");var endDateMoment=moment($(this).datetimepicker("getDate")).add(eventData.duration,eventData.durationType);eventData.endDate=endDateMoment.format("YYYY-MM-DD"),eventData.startDate!=eventData.endDate&&24!=endDateMoment.diff(startDateMoment,"hours")||(eventData.fullDay=1)}else eventData.fullDay=0;if("1"==$(this).attr("data-useasdaterange")){var endDatepickerID=$(this).attr("data-enddaterangeid");$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+endDatepickerID+'"]').length>0&&(eventData.fullDay=0,"date"==$(this).attr("data-datetype")?eventData.endDate=moment($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+endDatepickerID+'"]').datetimepicker("getDate")).format("YYYY-MM-DD"):eventData.endDate=moment($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+endDatepickerID+'"]').datetimepicker("getDate")).format("YYYY-MM-DD HH:mm"))}eventsData.push(eventData)}})),void 0!==form.verifiedEmail&&form.verifiedEmail?email=form.verifiedEmail:form.verifiedEmail="";var signature="";1==form.useSignature&&(signature=form.signature.signature("toDataURL","image/png"));var $totalText=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice').clone(),totalIndexToRemove=-1;$totalText.find("span").each((function(i){"none"==$(this).css("display")&&(totalIndexToRemove=i)})),totalIndexToRemove>-1&&$totalText.children("span")[totalIndexToRemove].remove();var totalText=$totalText.text();jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"send_email",formID:form.formID,informations:informations,email:email,customerInfos:lfb_getContactInformations(form.formID,!0),summary:summaryData,stripeCustomerID:form.stripeCustomerID,stripeToken:form.stripeToken,stripeSrc:form.stripeSrc,totalTxt:totalTxt,email_toUser:form.email_toUser,usePaypalIpn:usePaypalIpn,discountCode:form.discountCode,formSession:$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_formSession').val(),totalText:totalText,total:total,totalSub:totalSub,subFrequency:subFrequency,formTitle:formTitle,contactSent:form.contactSent,contentTxt:content,items:items,fieldsLast:fieldsLast,activatePaypal:activatePaypal,captcha:form.captcha,useRtl:$("body").is(".rtl"),finalUrl:lfb_getRedirectionURL(form.formID),eventsData:JSON.stringify(eventsData),razorpayReady:form.razorpayReady,variables:JSON.stringify(form.variables),verifiedEmail:form.verifiedEmail,signature:signature,vatPrice:form.vatPrice,vatLabel:form.vatLabel,vatAmount:form.vatAmount},success:function(current_ref){var dontCallFinalStep=!1;if(form.orderRef=current_ref,1==form.sendUrlVariables&&(form.urlVariables=lfb_getUrlVariables(formID,contentForm[2])),"1"==form.enableZapier&&form.zapierWebHook.length>0){var dataVariables=lfb_getUrlVariables(formID,contentForm[2]);dataVariables.length>1&&(dontCallFinalStep=!0,dataVariables=dataVariables.substr(1,dataVariables.length),jQuery.ajax({url:form.zapierWebHook,type:"get",data:dataVariables,success:function(){lfb_finalStep(formID)},error:function(){lfb_finalStep(formID)}}))}if($summaryClone.remove(),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_loader').delay(1e3).fadeOut(),activatePaypal&&void 0===form.stripePaid&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').length>0&&(form.price>0||form.priceSingle>0)){var payPrice=form.price;if("percent"==form.payMode?payPrice=parseFloat(payPrice)*(parseFloat(form.percentToPay)/100):"fixed"==form.payMode&&(payPrice=parseFloat(form.fixedToPay)),payPrice=parseFloat(payPrice).toFixed(2),form.priceSingle>0){var payPriceSingle=form.priceSingle;"percent"==form.payMode?payPriceSingle=parseFloat(payPriceSingle)*(parseFloat(form.percentToPay)/100):"fixed"==form.payMode&&(payPriceSingle=parseFloat(form.fixedToPay)),payPriceSingle=parseFloat(payPriceSingle).toFixed(2),0==$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=a1]').length&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').append('<input type="hidden" name="a1" value="0"/>'),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').append('<input type="hidden" name="p1" value="1"/>'),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').append('<input type="hidden" name="t1" value="M"/>')),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=a1]').val(payPriceSingle),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=p1]').val($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=p3]').val()),payPrice<=0&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=cmd]').val("_xclick"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=a3]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=t3]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=p3]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=bn]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=no_note]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=src]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=a1]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=t1]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=p1]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').append('<input type="hidden" name="amount" value="'+payPriceSingle+'"/>'))}else $('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=a1]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=t1]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=p1]').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=amount]').val(payPrice);$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name="return"]').val(lfb_getRedirectionURL(formID));var redirUrl=lfb_getRedirectionURL(formID);""!=redirUrl&&"#"!=redirUrl&&" "!=redirUrl&&form.save_to_cart&&""!=form.cartPage&&(redirUrl=form.cartPage),""!=redirUrl&&"#"!=redirUrl&&" "!=redirUrl&&(""!=form.urlVariables&&redirUrl.indexOf("?")>-1&&form.urlVariables.replace("?","&"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_paypalForm input[name="return"]').val(redirUrl+form.urlVariables)),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=a3]').val(payPrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=custom]').val(current_ref),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=item_number]').val(current_ref),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=item_name]').val($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [name=item_name]').val()+" - "+current_ref),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm [type="submit"]').trigger("click")}if(activatePaypal&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').length>0&&(form.price>0||form.priceSingle>0)&&void 0===form.stripePaid||$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeForm').length>0&&form.price>0||form.save_to_cart||form.save_to_cart_edd||dontCallFinalStep||lfb_finalStep(formID),form.save_to_cart_edd){var products=new Array,lastAndCurrentSteps=JSON.parse(JSON.stringify(lfb_lastSteps));"final"!=form.step&&-1==jQuery.inArray(parseInt(form.step),lastAndCurrentSteps)?lastAndCurrentSteps.push(parseInt(form.step)):"final"==form.step&&-1==jQuery.inArray("final",lastAndCurrentSteps)&&lastAndCurrentSteps.push("final"),jQuery.each(lastAndCurrentSteps,(function(){var $panel;$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"]').find('div.lfb_selectable.checked:not(.lfb_disabled),a.lfb_button.checked:not(.lfb_disabled),input[type=checkbox]:checked:not(.lfb_disabled),[data-type="slider"]:not(.lfb_disabled)').each((function(){var quantity=1;parseInt($(this).data("resqt"))>0&&(quantity=parseInt($(this).data("resqt"))),$(this).is('[data-type="slider"]')&&(quantity=parseInt($(this).slider("value")),isNaN(parseInt($(this).find(".tooltip-inner").html()))||(quantity=parseInt($(this).find(".tooltip-inner").html()))),parseInt($(this).data("prodid"))>0&&products.push({quantity:quantity,product_id:parseInt($(this).data("prodid")),variation:parseInt($(this).data("eddvar"))})}))})),jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_cartdd_save",products:products},success:function(){lfb_finalStep(formID)}})}if(form.save_to_cart){var products=new Array,lastAndCurrentSteps=JSON.parse(JSON.stringify(lfb_lastSteps));"final"!=form.step&&-1==jQuery.inArray(parseInt(form.step),lastAndCurrentSteps)?lastAndCurrentSteps.push(parseInt(form.step)):"final"==form.step&&-1==jQuery.inArray("final",lastAndCurrentSteps)&&lastAndCurrentSteps.push("final"),jQuery.each(lastAndCurrentSteps,(function(){var $panel;$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"]').find('div.lfb_selectable.checked:not(.lfb_disabled),a.lfb_button.checked:not(.lfb_disabled),input[type=checkbox]:checked:not(.lfb_disabled),[data-type="numberfield"]:not(.lfb_disabled),[data-type="slider"]:not(.lfb_disabled),select[data-itemid]:not(.lfb_disabled)').each((function(){var quantity=1;if(parseInt($(this).data("resqt"))>0&&(quantity=parseInt($(this).data("resqt"))),$(this).is('[data-type="slider"]')&&(quantity=parseInt($(this).slider("value"))),$(this).is('[data-type="numberfield"]')&&(quantity=$(this).val()),parseInt($(this).data("prodid"))>0){var title=$(this).attr("data-originaltitle");$(this).is("[data-originallabel]")&&(title=$(this).attr("data-originallabel"));var productData={quantity:quantity,title:title,product_id:parseInt($(this).data("prodid")),variation:parseInt($(this).attr("data-woovar")),price:parseFloat($(this).data("resprice")/quantity).toFixed(2)};void 0!==$(this).data("imageProduct")&&""!=$(this).data("imageProduct")&&(productData.imageProduct=$(this).data("imageProduct")),products.push(productData)}}))})),jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_cart_save",formID:formID,ref:current_ref,emptyWooCart:form.emptyWooCart,products:products,contentTxt:content},success:function(){lfb_finalStep(formID)}})}}})}function lfb_checkLastStepFields(formID){var form=lfb_getForm(formID),isOK=!0;return $('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide input[type=text],#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide input[type=email], #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide textarea').each((function(){0==$(this).closest("#lfb_paypalForm").length&&($(this).is(".lfb_disabled")||($(this).attr("data-required")&&"true"==$(this).attr("data-required")&&$(this).val().length<1&&(isOK=!1,$(this).closest(".form-group").addClass("has-error"),$(this).is("#lfb_captchaField")||1!=form.disableScroll&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is(".lfb_fullscreen")||$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is(".lfb_popup")?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').animate({scrollTop:$(this).parent().offset().top-(80+parseInt(lfb_getScrollTopMargin(form)))},2*form.animationsSpeed):"1"==form.scrollTopPage?$("body,html").animate({scrollTop:0},2*form.animationsSpeed):$("body,html").animate({scrollTop:$(this).parent().offset().top-(80+parseInt(lfb_getScrollTopMargin(form)))},2*form.animationsSpeed))),$(this).is(".emailField")&&!lfb_checkEmail($(this).val())&&(isOK=!1,$(this).closest(".form-group").addClass("has-error"),1!=form.disableScroll&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is(".lfb_fullscreen")||$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is(".lfb_popup")?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').animate({scrollTop:$(this).parent().offset().top-(80+parseInt(lfb_getScrollTopMargin(form)))},2*form.animationsSpeed):"1"==form.scrollTopPage?$("body,html").animate({scrollTop:0},2*form.animationsSpeed):$("body,html").animate({scrollTop:$(this).parent().offset().top-(80+parseInt(lfb_getScrollTopMargin(form)))},2*form.animationsSpeed)))))})),isOK}function lfb_order(formID){var form=lfb_getForm(formID),isOK=!0,informations="",email="",fields=new Array;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide .form-group').removeClass("has-error"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide').find('.lfb_item input:not([type="checkbox"])[data-itemid],.lfb_item textarea[data-itemid],.lfb_item select[data-itemid]').each((function(){if(0==$(this).closest("#lfb_paypalForm").length)if($(this).is(".lfb_disabled"));else if($(this).is("#lfb_couponField"));else if($(this).is("#lfb_captchaField"));else{var dbpoints=":";$(this).closest(".lfb_item").find("label").html().lastIndexOf(":")==$(this).closest(".lfb_item").find("label").html().length-1&&(dbpoints=""),$("body").is(".rtl")?informations+='<p><b><span class="lfb_value">'+$(this).val()+"</span></b>"+dbpoints+" "+$(this).closest(".lfb_item").find("label").html()+"</p>":informations+="<p>"+$(this).closest(".lfb_item").find("label").html()+" "+dbpoints+' <b><span class="lfb_value">'+$(this).val()+"</span></b></p>"}})),isOK=lfb_checkStepItemsValid("final",formID),1==form.legalNoticeEnable&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_legalCheckbox').is(":checked")||($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_legalCheckbox').closest(".form-group").addClass("has-error"),isOK=!1)),1==isOK&&lfb_checkUserEmail(form)&&lfb_checkCaptcha(form,(function(){var emailField,email=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"] [data-fieldtype="email"][data-required="true"]').last().val();$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide').find("#lfb_btnOrder,.linkPrevious").fadeOut(250),lfb_uploadFiles(form.formID,informations,email,fields)}))}function lfb_getPreviousEnabledStep(formID,lastSteps){var rep=-1,stepID=lastSteps[lastSteps.length-1];return!$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]  #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').is(".lfb_disabled")&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_item:not(.lfb_row ):not(.lfb-hidden)').length>0||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_distanceError').length>0)?rep=stepID:(lastSteps.pop(),rep=lastSteps.length>0?lfb_getPreviousEnabledStep(formID,lastSteps):$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_genSlide[data-start="1"]').attr("data-stepid")),lfb_lastSteps=lastSteps,rep}function lfb_previousStep(formID){var form=lfb_getForm(formID),deviceAgent=navigator.userAgent.toLowerCase(),posTop=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]  #lfb_mainPanel').offset().top-100,agentID;1!=form.disableScroll&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is(".lfb_fullscreen")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is(".lfb_popup")?(posTop=0,form.intro_enabled>0&&(posTop=lfb_zeroIfNan($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #startInfos').height())+100),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').animate({scrollTop:posTop},250)):($("header").length>0&&lfb_isAnyParentFixed($("header"))&&(posTop-=lfb_zeroIfNan($("header").height())),posTop-=48+parseInt(lfb_getScrollTopMargin(form)),"1"==form.scrollTopPage?$("body,html").animate({scrollTop:0},2*form.animationsSpeed):$("body,html").animate({scrollTop:posTop},250))),deviceAgent.match(/(iPad|iPhone|iPod)/i)&&($("#lfb_form :not(.ui-slider-handle) > .tooltip").remove(),$("body > .tooltip").remove(),$('#lfb_form[data-form="'+form.formID+'"] > .tooltip').remove()),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_errorMsg').hide(),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find("a.lfb_button.checked:not(.prechecked)").each((function(){lfb_itemClick($(this),!1,formID)})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find("div.lfb_selectable.checked:not(.prechecked)").each((function(){lfb_itemClick($(this),!1,formID)})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find('input[data-toggle="switch"]:checked:not(.prechecked)').each((function(){$(this).trigger("click.auto")}));var chkCurrentStep=!1,lastStepID=0,lastStepIndex=0;jQuery.each(lfb_lastSteps,(function(i){var stepID=this;parseInt(this)==parseInt(form.step)&&(chkCurrentStep=!0),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"] .lfb_executed').removeClass("lfb_executed"),chkCurrentStep||($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"] .lfb_item:not(.lfb-hidden)').length>0||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"] .lfb_distanceError').length>0)&&!$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"]').is(".lfb_disabled")&&(lastStepID=this,lastStepIndex=i)})),lfb_lastSteps=jQuery.grep(lfb_lastSteps,(function(value,i){if(i<=lastStepIndex)return value})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide.lfb_activeStep').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+lastStepID+'"] .lfb_genContent').css("opacity",0),lfb_changeStep(lastStepID,formID)}function lfb_returnToStep(stepID,formID){var form=lfb_getForm(formID);if(stepID!=form.step){var deviceAgent,agentID;navigator.userAgent.toLowerCase().match(/(iPad|iPhone|iPod)/i)&&($("#lfb_form :not(.ui-slider-handle) > .tooltip").remove(),$("body > .tooltip").remove(),$('#lfb_form[data-form="'+form.formID+'"] > .tooltip').remove()),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_errorMsg').hide(),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find("a.lfb_button.checked:not(.prechecked)").each((function(){lfb_itemClick($(this),!1,formID)})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find("div.lfb_selectable.checked:not(.prechecked)").each((function(){lfb_itemClick($(this),!1,formID)})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find('input[data-toggle="switch"]:checked:not(.prechecked)').each((function(){$(this).trigger("click.auto")}));for(var stepIndex=lfb_lastSteps.indexOf(stepID),removedSteps=[],i=stepIndex+1;i<lfb_lastSteps.length;i++)removedSteps.push(lfb_lastSteps[i]);form.itemsData=jQuery.grep(form.itemsData,(function(value,i){if(-1==removedSteps.indexOf(parseInt(value.stepid)))return value})),lfb_lastSteps=jQuery.grep(lfb_lastSteps,(function(value,i){if(i<=stepIndex)return value})),lfb_changeStep(stepID,formID),setTimeout((function(){lfb_updateSummary(formID,!0)}),350),setTimeout((function(){lfb_updateStep(formID)}),2e3)}}function lfb_uploadFiles(formID,informations,email,fields){var mustSend=!0,form=lfb_getForm(formID);if(form.useRazorpay&&!form.razorpayReady){mustSend=!1;var singleCost=form.price,subCost=0;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-isSubs="true"]')&&(subCost=form.price,singleCost=0,form.priceSingle>0&&(singleCost=form.priceSingle)),jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_makeRazorPayment",formID:formID,singleCost:singleCost,subCost:subCost,ref:form.current_ref,email:email},success:function(rep){if(-1==rep.trim().indexOf("error")){var orderID=rep.trim(),customerName="",firstName="",lastName="",email=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .emailField').val();$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="firstName"]').length>0&&(firstName=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="firstName"]').val()),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="lastName"]').length>0&&(lastName=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-fieldtype="lastName"]').val()),customerName=firstName+" "+lastName;var options={key:form.razorpay_publishKey,name:form.title,description:"",image:form.razorpay_logoImg,handler:function(response){form.razorpayReady=!0,lfb_uploadFiles(formID,informations,email,fields)},prefill:{name:customerName,email:email},theme:{color:form.colorA}},rzp1;0==orderID.indexOf("sub_")?options.subscription_id=orderID:options.order_id=orderID,new Razorpay(options).open()}else alert(rep)}})}else $('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-emaillaststep="1"]')||(1!=form.disableScroll&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is(".lfb_fullscreen")?($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').css("overflow-y","hidden"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').animate({scrollTop:0},2*form.animationsSpeed)):"1"==form.scrollTopPage?$("body,html").animate({scrollTop:0},2*form.animationsSpeed):$("body,html").animate({scrollTop:$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').offset().top-(80+parseInt(lfb_getScrollTopMargin(form)))},2*form.animationsSpeed)),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnFloatingSummary').fadeOut(form.animationsSpeed),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary').fadeOut(form.animationsSpeed),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_loader').fadeIn(2*form.animationsSpeed),setTimeout((function(){$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel').fadeOut(2*form.animationsSpeed),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #startInfos').fadeOut(2*form.animationsSpeed),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #genPrice').fadeOut(2*form.animationsSpeed),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_stepper').fadeOut(2*form.animationsSpeed),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide').fadeOut(2*form.animationsSpeed),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_btn-next').fadeOut(form.animationsSpeed),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_btnNextContainer').fadeOut(form.animationsSpeed),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #finalText').css({opacity:0,display:"block"}),setTimeout((function(){1!=form.disableScroll&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is(".lfb_fullscreen")?$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').animate({scrollTop:0},2*form.animationsSpeed):"1"==form.scrollTopPage?$("body,html").animate({scrollTop:0},2*form.animationsSpeed):$("body,html").animate({scrollTop:$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').offset().top-(80+parseInt(lfb_getScrollTopMargin(form)))},2*form.animationsSpeed)),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #finalText').animate({opacity:1},2*form.animationsSpeed)}),4*form.animationsSpeed+50)}),2*form.animationsSpeed+50));mustSend&&lfb_orderSend(formID,informations,email,fields)}function lfb_isAnyParentFixed($el,rep){if(!rep)var rep=!1;try{$el.parent().length>0&&"fixed"==$el.parent().css("position")&&(rep=!0)}catch(e){}return!rep&&$el.parent().length>0&&(rep=lfb_isAnyParentFixed($el.parent(),rep)),rep}function lfb_is_touch_device(){return"ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0}function lfb_toggleFloatingSummary(formID){$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary').is(".lfb_open")?lfb_closeFloatingSummary(formID):lfb_showFloatingSummary(formID)}function lfb_closeFloatingSummary(formID){$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary').removeClass("lfb_open"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary').stop().slideUp()}function lfb_showFloatingSummary(formID){$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary').addClass("lfb_open"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary').stop().slideDown()}function lfb_updateOtherSummary(formID){$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemtype="summary"]').each((function(){var $summaryClone=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #finalSlide >.lfb_genContent > .lfb_genContentSlide  > #lfb_summary').first().clone();$summaryClone.removeAttr("id"),$summaryClone.removeClass("lfb-hidden"),$summaryClone.find("h3").html($(this).attr("data-title")),"1"==$(this).attr("data-hideinfo")&&($summaryClone.find(".lfb_valueTh").addClass("lfb-hidden"),$summaryClone.find(".lfb_valueTd").addClass("lfb-hidden"));var $item=$(this),nbCol=4;($summaryClone.find(".lfb_valueTh").is(".lfb-hidden")||"none"==$summaryClone.find(".lfb_valueTh").css("display"))&&nbCol--,$summaryClone.find("thead .lfb_quantityTh").is(".lfb-hidden")&&nbCol--,$summaryClone.find("thead .lfb_priceTh").is(".lfb-hidden")&&nbCol--,$summaryClone.find(".lfb_summaryStep").attr("colspan",nbCol),$summaryClone.find(".lfb_static [colspan]").attr("colspan",nbCol-1),$item.find(".lfb_summaryItemContent").html($summaryClone)}))}function lfb_updateFloatingSummary(formID){var form=lfb_getForm(formID);if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary').length>0){var $summaryClone=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary').clone(),useInfos=!1;"1"==form.floatSummary_showInfo&&(useInfos=!0),0==$summaryClone.find("tbody").children(":not(.lfb_static)").length&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary').is('[data-numberstep="1"]')?(lfb_closeFloatingSummary(formID),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnFloatingSummary:not(.disabled)').addClass("disabled")):($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnFloatingSummary').removeClass("disabled"),$summaryClone.find("h4").remove(),$summaryClone.attr("id","lfb_floatingSummaryContent"),$summaryClone.removeClass("lfb-hidden"),useInfos||$summaryClone.find(".lfb_valueTd,.lfb_valueTh").addClass("lfb-hidden"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary').is('[data-hideprices="1"]')&&($summaryClone.find(".lfb_priceTd,.lfb_priceTh").addClass("lfb-hidden"),$summaryClone.find("#lfb_summaryDiscountTr,#lfb_summaryTotalTr").addClass("lfb-hidden")),$summaryClone.find(".lfb_summaryStep").attr("colspan",$summaryClone.find("thead th:not(.lfb-hidden)").length),useInfos||$summaryClone.find("tr.lfb_noPriceRow").remove(),$summaryClone.find("#lfb_vatRow>th:eq(0),#lfb_summaryDiscountTr>th:eq(0),#lfb_summaryTotalTr>th:eq(0)").attr("colspan",$summaryClone.find("thead th:not(.lfb-hidden)").length-1),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary #lfb_floatingSummaryInner').html($summaryClone),$summaryClone.find(".lfb_summaryStep").on("click",(function(){var formID=$(this).closest("#lfb_form").attr("data-form"),form=lfb_getForm(formID),stepID=parseInt($(this).attr("data-step"));(void 0===form.canGoprevious||form.canGoprevious)&&lfb_returnToStep(stepID,formID)})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary').is('[data-numberstep="1"]')&&$summaryClone.find(".lfb_summaryStep").each((function(i){var stepIndex=i+1;$(this).find("strong").html(stepIndex+". "+$(this).find("strong").html())})))}}function lfb_updateSummary(formID,dontUseCurrent){var form=lfb_getForm(formID);if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary').length>0||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary').length>0){var useCurrent=!0;dontUseCurrent&&(useCurrent=!1);var formContent,items=lfb_getFormContent(formID,useCurrent)[2],step=-1,hasValues=!1;$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody tr:not(.lfb_static)').remove();var priceClass="";if(1==form.summary_hidePrices&&(priceClass="lfb-hidden lfb_hidePrice"),jQuery.each(items,(function(){var item=this;if(null!=this.label&&""!=this.label&&"undefined"!=this.label&&"summary"!=this.type&&!$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+this.itemid+'"]').is(".lfb_disabled")&&0==$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+this.itemid+'"]').closest(".lfb_disabled").length&&0==$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody tr[data-item="'+this.itemid+'"]').length&&(isNaN(this.stepid)&&(this.stepid="final"),"final"!=this.stepid||"1"!=form.summary_hideFinalStep)){if(this.stepid!=step&&!$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is('[data-sumhidesteps="1"]')){var stepTitle=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_genSlide[data-stepid="'+this.stepid+'"]').attr("data-title");$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody #lfb_summaryDiscountTr').before('<tr><th colspan="4" class="lfb_summaryStep" data-step="'+this.stepid+'">'+stepTitle+"</th>")}step=this.stepid,isNaN(this.quantity)&&(this.quantity=1);var itemClass="";isNaN(this.price)&&(itemClass="lfb_noPriceRow",this.price=0);var value=this.value;void 0===this.value?value="":itemClass+=" lfb_infoRow",""!=value&&this.showInSummary&&(hasValues=!0);var itemPrice=this.price,itemQt=lfb_formatPrice(this.quantity,formID);if(""!=value&&0==itemPrice&&1==itemQt)itemQt="",itemPrice="";else{var isNegative=!1;parseFloat(itemPrice)<0&&(isNegative=!0,itemPrice*=-1),itemPrice="left"==form.currencyPosition?1==form.summary_hideZeroDecimals&&Number.isInteger(itemPrice)?form.currency+""+lfb_formatPrice(parseInt(itemPrice),formID):form.currency+""+lfb_formatPrice(parseFloat(itemPrice).toFixed(2),formID):1==form.summary_hideZeroDecimals&&Number.isInteger(itemPrice)?lfb_formatPrice(parseInt(itemPrice),formID)+""+form.currency:lfb_formatPrice(parseFloat(itemPrice).toFixed(2),formID)+""+form.currency,isNegative&&(itemPrice="- "+itemPrice)}var classIsFile="";this.isFile;var cssQt="";1==form.summary_hideQt&&(cssQt="lfb-hidden"),1==form.summary_hideZero&&0==this.price&&(itemPrice=""),1==form.summary_hideZeroQt&&0==this.quantity&&(itemQt="");var hideClass="";this.showInSummary||(hideClass="lfb-hidden"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+this.itemid+'"]').is('[data-hideqtsum="true"]')&&(itemQt=""),form.priceSingle>0&&!this.isSinglePrice&&(""!=itemPrice||itemPrice>0)&&(itemPrice+=" "+form.subscriptionText),form.price<=0?$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary .lfb_subTxt').addClass("lfb-hidden"):$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary .lfb_subTxt').removeClass("lfb-hidden"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+this.itemid+'"]').is('[data-hidepricesum="true"]')&&(itemPrice="");var itemDes="";1==form.summary_showDescriptions&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_itemContainer_'+this.itemid+" .lfb_itemDes").length>0&&""!=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_itemContainer_'+this.itemid+" .lfb_itemDes").html()?itemDes='<br/><span class="lfb_sumItemDes" style="font-size:12px;">'+$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_itemContainer_'+this.itemid+" .lfb_itemDes").html()+"</span>":$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_itemContainer_'+this.itemid+" .lfb_imageButtonDescription").length>0&&(itemDes='<br/><span class="lfb_sumItemDes">'+$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_itemContainer_'+this.itemid+" .lfb_imageButtonDescription").html()+"</span>"));var mustShow=!0;$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+this.itemid+'"]').is('[data-hidezeropricesum="true"]')&&0==this.price&&(mustShow=!1),mustShow&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_itemContainer_'+this.itemid).is('[data-itemtype="filefield"]')?$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody #lfb_summaryDiscountTr').before('<tr data-item="'+this.itemid+'" data-itemstep="'+this.stepid+'" class="'+itemClass+" "+hideClass+'"><td>'+this.label+itemDes+'</td><td class="lfb_valueTd ">'+value+'</td><td class="lfb_quantityTd '+cssQt+'">'+itemQt+'</td><td class="lfb_priceTd '+priceClass+'">'+itemPrice+"</td></tr>"):$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody #lfb_summaryDiscountTr').before('<tr data-item="'+this.itemid+'" data-itemstep="'+this.stepid+'" class="'+itemClass+" "+hideClass+'"><td>'+this.label+itemDes+'</td><td class="lfb_valueTd "><span class="lfb_value">'+value+'</span></td><td class="lfb_quantityTd '+cssQt+'">'+itemQt+'</td><td class="lfb_priceTd '+priceClass+'">'+itemPrice+"</td></tr>"))}})),form.reductionResult>0){var reduction=parseFloat(form.reductionResult).toFixed(2)+form.currency;if("left"==form.currencyPosition&&(reduction=form.currency+parseFloat(form.reductionResult).toFixed(2)),reduction="-"+reduction,$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_summaryDiscount>span').html(reduction),!form.discountCodeDisplayed){var discLabel=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_summaryDiscountTr th[colspan]').html();0==$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_summaryDiscountTr th[colspan] i').length&&(":"==discLabel.substr(discLabel.length-1,1)?$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_summaryDiscountTr th[colspan]').html(discLabel.substr(0,discLabel.length-1)+" <i>("+form.discountCode+")</i> :"):$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_summaryDiscountTr th[colspan]').html(discLabel+" <i>("+form.discountCode+")</i>"))}$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_summaryDiscountTr').css("display","table-row"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_floatingSummary #lfb_summaryDiscountTr').css("display","table-row")}if(1==form.useVAT){if(0==$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_vatRow').length){var $vatRow=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_summaryDiscountTr').clone();$vatRow.attr("id","lfb_vatRow"),$vatRow.find("#lfb_summaryDiscount").attr("id","lfb_summaryVat"),$vatRow.children("th").first().html(form.vatLabel+" "+form.vatAmount+"% :"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_summaryDiscountTr').after($vatRow)}var vatText=form.currency+lfb_formatPrice(parseFloat(form.vatPrice).toFixed(2),formID);1==form.summary_hideZeroDecimals&&Number.isInteger(form.price)&&(vatText=form.currency+lfb_formatPrice(parseInt(form.vatPrice),formID)),"left"!=form.currencyPosition&&(vatText=lfb_formatPrice(parseFloat(form.vatPrice).toFixed(2),formID)+form.currency,1==form.summary_hideZeroDecimals&&Number.isInteger(form.price)&&(vatText=lfb_formatPrice(parseInt(form.vatPrice),formID)+form.currency)),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_summaryVat').html(vatText)}(!form.price||form.price<0)&&(form.price=0),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tr th.lfb_summaryStep').each((function(){0==$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tr[data-itemstep="'+$(this).attr("data-step")+'"]:not(.lfb-hidden)').length&&$(this).parent().addClass("lfb-hidden")}));var summaryPrice=form.currency+""+lfb_formatPrice(parseFloat(form.price).toFixed(2),formID),summaryPriceSingle=form.currency+""+lfb_formatPrice(parseFloat(form.priceSingle).toFixed(2),formID);if(1==form.summary_hideZeroDecimals&&Number.isInteger(form.price)&&(summaryPrice=form.currency+""+lfb_formatPrice(parseInt(form.price),formID),summaryPriceSingle=form.currency+""+lfb_formatPrice(parseInt(form.priceSingle),formID)),"left"!=form.currencyPosition&&(1==form.summary_hideZeroDecimals&&Number.isInteger(form.price)?(summaryPrice=lfb_formatPrice(parseInt(form.price),formID)+""+form.currency,summaryPriceSingle=lfb_formatPrice(parseInt(form.priceSingle),formID)+""+form.currency):(summaryPrice=lfb_formatPrice(parseFloat(form.price).toFixed(2),formID)+""+form.currency,summaryPriceSingle=lfb_formatPrice(parseFloat(form.priceSingle).toFixed(2),formID)+""+form.currency)),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table #lfb_summaryTotal>span:eq(0)').html(summaryPrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is("[data-totalrange]")&&parseFloat(form.price)>0){var labelA=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-rangelabelbetween"),labelB=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-rangelabeland"),range=parseFloat($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-totalrange")),rangeMin=parseFloat(form.price)-range/2,rangeMax=parseFloat(form.price)+range/2;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-rangemode="percent"]')&&(rangeMin=parseFloat(form.price)-parseFloat(form.price)*range/100,rangeMax=parseFloat(form.price)+parseFloat(form.price)*range/100),rangeMin<0&&(rangeMin=0),rangeMax<0&&(rangeMax=0);var formatedPrice=labelA+" <strong>"+form.currency+lfb_formatPrice(rangeMin,formID)+"</strong> "+labelB+" <strong>"+form.currency+lfb_formatPrice(rangeMax,formID)+"</strong>";if("left"!=form.currencyPosition){var range=parseInt($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-totalrange"));formatedPrice=labelA+" <strong>"+lfb_formatPrice(rangeMin,formID)+form.currency+"</strong> "+labelB+" <strong>"+lfb_formatPrice(rangeMax,formID)+form.currency+"</strong>"}$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table #lfb_summaryTotal>span:eq(0)').html(formatedPrice)}var colspan=4;1==form.summary_hideQt&&(colspan-=1),1==form.summary_hidePrices&&(colspan-=1),hasValues?($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table thead th:eq(1)').show().removeClass("lfb-hidden"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody tr:eq(1)').show(),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody td.lfb_valueTd').show(),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody tr#lfb_summaryTotalTr th[colspan]').attr("colspan",colspan-1),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody tr#lfb_summaryDiscountTr th[colspan]').attr("colspan",colspan-1),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody tr th.lfb_summaryStep').attr("colspan",colspan)):(colspan-=1,$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table td.lfb_valueTd').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table thead th:eq(1)').hide().addClass("lfb-hidden"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody tr#lfb_summaryTotalTr th[colspan]').attr("colspan",colspan-1),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody tr#lfb_summaryDiscountTr th[colspan]').attr("colspan",colspan-1),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tbody tr th.lfb_summaryStep').attr("colspan",colspan))}$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_vatRow').length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_vatRow').children("th").first().attr("colspan",$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary #lfb_summaryDiscountTr').children("th").first().attr("colspan")),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is('[data-sumstepsclick="1"]')&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary .lfb_summaryStep:not([data-step="final"])').each((function(){$(this).css("cursor","pointer"),$(this).on("click",(function(){var formID=$(this).closest("#lfb_form").attr("data-form"),form=lfb_getForm(formID),stepID=parseInt($(this).attr("data-step"));(void 0===form.canGoprevious||form.canGoprevious)&&lfb_returnToStep(stepID,formID)}))})),setTimeout((function(){lfb_updateFloatingSummary(formID),lfb_updateOtherSummary(formID)}),300),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').trigger("summaryUpdated")}function lfb_changeStep(stepID,formID){var form=lfb_getForm(formID);if($("#lfb_form :not(.ui-slider-handle) > .tooltip").remove(),$("body > .tooltip").remove(),$('#lfb_form[data-form="'+form.formID+'"] > .tooltip').remove(),$('#lfb_form[data-form="'+form.formID+'"] .datetimepicker ').hide(),form.intro_enabled>0||form.step>0){var posTop=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]  #lfb_mainPanel').offset().top-100;1!=form.disableScroll&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is(".lfb_fullscreen")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is(".lfb_popup")?(posTop=0,form.intro_enabled>0&&(posTop=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #startInfos').height()+100),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').animate({scrollTop:posTop},250)):($("header").length>0&&lfb_isAnyParentFixed($("header"))&&(posTop-=$("header").height()),posTop-=48+parseInt(lfb_getScrollTopMargin(form)),"1"==form.scrollTopPage?$("body,html").animate({scrollTop:0},2*form.animationsSpeed):$("body,html").animate({scrollTop:posTop},250)))}$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .quantityBtns').removeClass("open"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .quantityBtns').fadeOut(form.animationsSpeed/4),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide').fadeOut(2*form.animationsSpeed),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_btn-next').fadeOut(form.animationsSpeed/2),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_btnNextContainer').fadeOut(form.animationsSpeed/2),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_linkPreviousCt').fadeOut(form.animationsSpeed/2),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_distanceError').fadeOut(form.animationsSpeed/2);var activatePaypal=!0;0==$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnPayStripe').length&&0==$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').length&&0==$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_razorPayCt').length&&(activatePaypal=!1),"final"==stepID&&(lfb_updateSummary(formID),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-activatePaypal="true"]:not(:checked):not(.checked)').each((function(){var cStepID=$(this).closest(".lfb_genSlide").attr("data-stepid");"final"!=cStepID&&(cStepID=parseInt(cStepID)),-1==jQuery.inArray(cStepID,lfb_lastSteps)||(activatePaypal=!1)})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').find('[data-dontactivatepaypal="true"].checked,[data-dontactivatepaypal="true"]:checked').length>0&&(activatePaypal=!1),activatePaypal?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paymentMethodBtns').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paymentMethodBtns').length>0?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_razorPayCt').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnPayStripe').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnPayStripe').closest(".lfb_btnNextContainer").hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').hide()):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnPayStripe').length>0&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnPayStripe').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_btnNextContainerStripe').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnOrder').closest(".lfb_btnNextContainer").hide()),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_razorPayCt').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').length>0&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnOrder').closest(".lfb_btnNextContainer").hide(),setTimeout((function(){$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm .lfb_btnNextContainer').fadeIn()}),2*form.animationsSpeed)))):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paymentMethodBtns').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_razorPayCt').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnPayStripe').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paypalForm').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_btnNextContainerStripe').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnPayStripe').closest(".lfb_btnNextContainer").hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnOrder').closest(".lfb_btnNextContainer").show()),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-emaillaststep="1"]')&&!form.emailSent&&setTimeout((function(){lfb_updatePrice(formID),setTimeout((function(){lfb_order(formID)}),1e3)}),1200));var $title=$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find(".lfb_stepTitle"),$des=$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find("p.lfb_stepDescription"),$content=$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find(".lfb_genContent"),totalBottom=$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find(".lfb_totalBottomContainer");if($content.find(".lfb_genContentSlide").removeClass("active"),$content.find(".lfb_genContentSlide").eq(0).addClass("active"),$content.animate({opacity:0},form.animationsSpeed),$des.animate({opacity:0},form.animationsSpeed),$title.removeClass("positioned"),$title.css({"-webkit-transition":"none",transition:"none"}),totalBottom.animate({opacity:0},form.animationsSpeed),"undefined"!=typeof ga)try{ga("set","page",location.pathname+"#"+encodeURIComponent($title.html()).replace(/%20/g,"+")),ga("send","pageview")}catch(e){}if("undefined"!=typeof gtag)try{gtag("event","page_view",{page_location:window.location.href,page_path:location.pathname+"#"+encodeURIComponent($title.html()).replace(/%20/g,"+"),page_title:document.title+" "+$title.html()}),gtag("set","page",location.pathname+"#"+encodeURIComponent($title.html()).replace(/%20/g,"+")),gtag("send","pageview")}catch(e){}$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').css("opacity",0).show(),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').hide().css("opacity",1);var animSpeed=4.5*form.animationsSpeed;if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').is('[data-start="1"]')?(lfb_initPanelResize(formID),animSpeed=2.5*form.animationsSpeed,$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').fadeIn(2*form.animationsSpeed)):$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').delay(2*form.animationsSpeed).fadeIn(2*form.animationsSpeed),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #finalSlide .estimation_project').length>0){var contentForm,content=lfb_getFormContent(formID)[3];$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #finalSlide .estimation_project textarea').val(content),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #finalSlide .estimation_total:not(.gfield_price) input').val(form.price),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #finalSlide .estimation_total.gfield_price .ginput_product_price').html(form.price),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #finalSlide .estimation_total.gfield_price input[id^="ginput_base_price"]').val(form.price)}0==animSpeed&&(animSpeed=100),setTimeout((function(){var deviceAgent,agentID;($title.css({"-webkit-transition":"all 0.3s ease-out",transition:"all 0.3s ease-out"}).addClass("positioned"),$content.css({paddingTop:lfb_zeroIfNan($des.height())+lfb_zeroIfNan($title.height())+70}),$content.delay(2*form.animationsSpeed).animate({opacity:1},form.animationsSpeed),$des.delay(form.animationsSpeed).animate({opacity:1,top:$des.closest(".lfb_genSlide").find(".lfb_stepTitle").height()+48},form.animationsSpeed),totalBottom.delay(2*form.animationsSpeed).animate({opacity:1},form.animationsSpeed),setTimeout((function(){var titleHeight=$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_stepTitle').height(),heightP=$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_genContent').outerHeight()+parseInt($(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel').css("padding-bottom"))+102+titleHeight;"final"==stepID&&(heightP-=80);var animMainPanelSpeed=300;0==form.animationsSpeed&&(animMainPanelSpeed=0),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel').animate({minHeight:heightP},animMainPanelSpeed),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel').css("max-height","none")}),2*form.animationsSpeed),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_btn-next').is(".lfb_disabledBtn")?$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_btn-next').hide():($(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_btn-next').css("display","inline-block").hide(),setTimeout((function(){$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_btn-next').is(".lfb_disabledBtn")||($(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_btn-next').fadeIn(500),setTimeout((function(){$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_btn-next').is(".lfb_disabledBtn")&&$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_btn-next').hide()}),550))}),2*form.animationsSpeed)),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]  #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .datetimepicker').hide(),"final"==stepID?(activatePaypal?0==$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paymentMethodBtns').length&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_razorPayCt').length>0&&$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_genContentSlide > .lfb_btnNextContainer').hide():($(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_btnNextContainer').fadeIn(500),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_btnNextContainerStripe').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_paymentMethodBtns').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeForm  .lfb_stripeContainer').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeForm .lfb_btnNextContainer').hide()),1==form.useSignature&&($('#lfb_form[data-form="'+form.formID+'"] #lfb_signature canvas').attr("width",$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_signature').width()),$('#lfb_form[data-form="'+form.formID+'"] #lfb_signature canvas').css("width",$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_signature').width()),form.signature.signature("clear"))):0==form.animationsSpeed?$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_btnNextContainer').show():$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_btnNextContainer').fadeIn(500),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-previousstepbtn="true"]')&&"final"==stepID?setTimeout((function(){var chkBtn=!1;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_genSlide[data-stepid="'+stepID+'"] ').find(".lfb_btn-next,#lfb_btnOrderPaypal,#lfb_btnPayStripe,#lfb_btnOrder,#btnOrderRazorpay").each((function(){"none"!=$(this).css("display")&&"none"!=$(this).closest(".lfb_btnNextContainer").css("display")&&(chkBtn=!0)})),chkBtn?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_genSlide[data-stepid="'+stepID+'"] ').find(".linkPrevious").css({marginTop:-15}):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_genSlide[data-stepid="'+stepID+'"] ').find(".linkPrevious").css({marginTop:24}),lfb_lastSteps.length>0&&($(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"][data-previousstepbtn="true"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_linkPreviousCt').delay(3*form.animationsSpeed).fadeIn(500),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"]:not([data-previousstepbtn="true"]) #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_linkPreviousCt').delay(3*form.animationsSpeed).css({opacity:0,display:"inline-block"}).animate({opacity:1},600))}),1e3):lfb_lastSteps.length>0&&($(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"][data-previousstepbtn="true"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_linkPreviousCt').delay(3*form.animationsSpeed).fadeIn(500),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"]:not([data-previousstepbtn="true"]) #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_linkPreviousCt').delay(3*form.animationsSpeed).css({opacity:0,display:"inline-block"}).animate({opacity:1},600)),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_distanceError').delay(3*form.animationsSpeed).fadeIn(500),0!=form.disableTipMobile&&lfb_is_touch_device())||(navigator.userAgent.toLowerCase().match(/(iPad|iPhone|iPod)/i)?$content.delay(750).find('[data-toggle="tooltip"]').tooltip({html:!0,container:'#lfb_form[data-form="'+formID+'"]',trigger:"manual"}).on("show.bs.tooltip",(function(){$(this).find(".tooltip-inner").css({maxWidth:$(window).width()})})):$content.delay(750).find('[data-toggle="tooltip"]').tooltip({html:!0,container:'#lfb_form[data-form="'+formID+'"]'}).on("show.bs.tooltip",(function(t,a){$('#lfb_form[data-form="'+formID+'"] .tooltip-inner').css({maxWidth:$(window).width()+"px"})})),$content.on("enter",(function(){"hover"==this.options.trigger&&document.documentElement})));setTimeout((function(){$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide.lfb_activeStep').removeClass("lfb_activeStep"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').addClass("lfb_activeStep"),$content.find(".lfb_itemQtField").each((function(){$(this).parent().next().is(".lfb_itemDes")&&$(this).css({marginTop:20+$(this).parent().next().outerHeight()})})),form.step=stepID,setTimeout((function(){lfb_updateStep(formID),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find('[data-usedistance="true"]').each((function(){lfb_removeDistanceError($(this).attr("data-itemid"),formID)}),100),$("#lfb_form :not(.ui-slider-handle) > .tooltip").remove(),$("body > .tooltip").remove(),$('#lfb_form[data-form="'+formID+'"] > .tooltip').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').attr("data-currentstep",stepID),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').trigger("stepChanged")}),2*form.animationsSpeed+550),lfb_updatePrice(formID),form.backFomFinal&&(form.backFomFinal=!1)}),300)}),animSpeed),0==form.animationsSpeed&&setTimeout(lfb_resizeAll,500),$("#lfb_form :not(.ui-slider-handle) > .tooltip").remove(),$("body > .tooltip").remove(),$('#lfb_form[data-form="'+formID+'"] > .tooltip').remove(),lfb_updatePrice(formID)}function lfb_zeroIfNan(value){return isNaN(value)?0:value}function lfb_findPotentialsSteps(originStepID,formID){var form=lfb_getForm(formID),potentialSteps=new Array,conditionsArray=new Array,noConditionsSteps=new Array,maxConditions=0;return jQuery.each(form.links,(function(){var link=this;if(this.originID==originStepID){var error=!1,errorOR=!0;if(this.conditions&&"[]"!=this.conditions){this.conditionsO=JSON.parse(this.conditions);var errors=lfb_checkConditions(this.conditionsO,formID,originStepID);error=errors.error,errorOR=errors.errorOR}else noConditionsSteps.push(this.destinationID),errorOR=!1;("OR"==this.operator&&!errorOR||"OR"!=this.operator&&!error)&&(this.conditionsO=JSON.parse(this.conditions),conditionsArray.push({stepID:parseInt(this.destinationID),nbConditions:this.conditionsO.length}),this.conditionsO.length>maxConditions&&(maxConditions=this.conditionsO.length),potentialSteps.push(parseInt(this.destinationID)))}})),0==originStepID&&potentialSteps.push(parseInt($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]  #lfb_mainPanel .lfb_genSlide[data-start="1"]').attr("data-stepid"))),0==potentialSteps.length?potentialSteps.push("final"):noConditionsSteps.length>0&&noConditionsSteps.length<potentialSteps.length&&(jQuery.each(noConditionsSteps,(function(){var removeItem=this;potentialSteps=jQuery.grep(potentialSteps,(function(value){return value!=removeItem}))})),maxConditions>0&&jQuery.each(potentialSteps,(function(stepID){jQuery.each(conditionsArray,(function(condition){condition.stepID==stepID&&condition.nbConditions<maxConditions&&(potentialSteps=jQuery.grep(potentialSteps,(function(value){return value!=stepID})))}))}))),potentialSteps}function lfb_checkConditions(conditions,formID,_stepID,onlyPastSteps){var error=!1,form=lfb_getForm(formID),errorOR=!0;void 0===onlyPastSteps&&(onlyPastSteps=!1);var lastAndCurrentSteps=JSON.parse(JSON.stringify(lfb_lastSteps));return"final"!=form.step&&-1==jQuery.inArray(parseInt(form.step),lastAndCurrentSteps)?lastAndCurrentSteps.push(parseInt(form.step)):"final"==form.step&&-1==jQuery.inArray("final",lastAndCurrentSteps)&&lastAndCurrentSteps.push("final"),jQuery.each(conditions,(function(){var condition=this;if("_"!=this.interaction.substr(0,1)&&"v_"!=this.interaction.substr(0,2)){var stepID;0==(stepID=this.interaction.substr(0,this.interaction.indexOf("_")))&&(stepID="final");var chkStep=!0;if(onlyPastSteps&&-1==lastAndCurrentSteps.indexOf(parseInt(stepID))&&(error=!this.action||"unclicked"!=this.action,chkStep=!1),this.value&&"string"==typeof this.value&&(this.value=this.value.replace(/&lt;/g,"<"),this.value=this.value.replace(/&gt;/g,">")),chkStep){var itemID=this.interaction.substr(this.interaction.indexOf("_")+1,this.interaction.length);if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_genContent [data-itemid="'+itemID+'"]').length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_genContent [data-itemid="'+itemID+'"]');if($item.is(".lfb_disabled")||$item.closest(".lfb_genSlide").is(".lfb_disabled"))"unclicked"!=this.action?error=!0:errorOR=!1;else{if(this.value&&this.value.indexOf("_")>-1)if("_"!=this.value.substr(0,1)){var valueStepID=this.value.substr(0,this.value.indexOf("_")),attribute=this.value.substr(this.value.indexOf("-")+1,this.value.length);0==valueStepID&&(valueStepID="final");var valueItemID=this.value.substr(this.value.indexOf("_")+1,this.value.indexOf("-")-(this.value.indexOf("_")+1));if("v"==valueStepID)this.value=parseFloat(lfb_getVariableByID(form,valueItemID).value);else if("stepqt"==attribute)this.value=lfb_getStepQuantities(stepID,formID,itemID);else{var $valueItem;($valueItem=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+valueStepID+'"] .lfb_genContent [data-itemid="'+valueItemID+'"]')).length>0&&(""==attribute?void 0!==$valueItem.data("resprice")?this.value=parseFloat($valueItem.data("resprice")):$valueItem.is("[data-resqt]")&&(this.value=parseFloat($valueItem.attr("data-resqt"))):"quantity"==attribute?$valueItem.is(".lfb_disabled")?this.value=0:$valueItem.is('input[type="number"]')?this.value=$valueItem.val():$valueItem.find(".lfb_qtfield").length>0?this.value=parseInt($valueItem.find(".lfb_qtfield").val()):this.value=parseInt($valueItem.find(".icon_quantity").html()):"value"==attribute&&($valueItem.is(".lfb_disabled")?this.value="":(this.value=$valueItem.val(),$valueItem.is(".lfb_datepicker")&&(this.value=moment.utc($valueItem.datetimepicker("getDate")).format("YYYY-MM-DD")),this.value=this.value.replace(/\`/g,"'"))))}}else"_total"==this.value||"_total-"==this.value?this.value=form.price:"_total_qt"==this.value&&(this.value=lfb_getTotalQuantities(formID,_stepID,itemID));else this.value&&(this.value=this.value.replace(/\`/g,"'"));switch(this.action){case"clicked":$item.closest(".lfb_itemBloc").is(".lfb_disabled")?error=!0:$item.is('[type="checkbox"]')?($item.is(":checked")||(error=!0),$item.is(":checked")&&(errorOR=!1)):($item.is(".checked")||$item.is(":checked")||(error=!0),($item.is(".checked")||$item.is(":checked"))&&(errorOR=!1));break;case"unclicked":$item.closest(".lfb_itemBloc").is(".lfb_disabled")?(errorOR=!1,error=!1):(($item.is(':not([type="checkbox"]).checked')||$item.is(":checked"))&&(error=!0),$item.is(':not([type="checkbox"]).checked')||$item.is(":checked")||(errorOR=!1));break;case"filled":$item.is(".lfb_dropzone")?0==$item.find(".dz-preview[data-file].dz-success.dz-complete").length?error=!0:errorOR=!1:0==$item.val().length?error=!0:errorOR=!1;break;case"equal":$item.is(".lfb_datepicker")?$item.is('[data-datetype="date"]')?(moment.utc($item.datetimepicker("getDate")).format("YYYY-MM-DD")!=this.value&&(error=!0),moment.utc($item.datetimepicker("getDate")).format("YYYY-MM-DD")==this.value&&(errorOR=!1)):$item.is('[data-datetype="time"]')?(moment($item.datetimepicker("getDate")).format("HH:mm")!=this.value&&(error=!0),moment($item.datetimepicker("getDate")).format("HH:mm")==this.value&&(errorOR=!1)):(moment.utc($item.datetimepicker("getDate")).isSame(moment.utc(this.value).format("YYYY-MM-DD HH:mm"))||(error=!0),moment.utc($item.datetimepicker("getDate")).isSame(moment.utc(this.value).format("YYYY-MM-DD HH:mm"))&&(errorOR=!1)):$item.val()!=this.value?error=!0:errorOR=!1;break;case"different":$item.val()==this.value?error=!0:errorOR=!1;break;case"PriceSuperior":var price=parseFloat($item.data("resprice"));($item.is(".lfb_button:not(.checked)")||$item.is(".lfb_selectable:not(.checked)")||$item.is("input[type=checkbox]:not(:checked)")||price<=this.value)&&(error=!0),($item.is(".checked")||$item.is(":checked"))&&price>this.value&&(errorOR=!1);break;case"PriceInferior":var price=parseFloat($item.data("resprice"));($item.is(".lfb_button:not(.checked)")||$item.is(".lfb_selectable:not(.checked)")||$item.is("input[type=checkbox]:not(:checked)")||price>=this.value)&&(error=!0),($item.is(".checked")||$item.is(":checked"))&&price<this.value&&(errorOR=!1);break;case"PriceEqual":var price=parseFloat($item.data("resprice"));($item.is(".lfb_button:not(.checked)")||$item.is(".lfb_selectable:not(.checked)")||$item.is("input[type=checkbox]:not(:checked)")||price!=this.value)&&(error=!0),($item.is(".checked")||$item.is(":checked"))&&price==this.value&&(errorOR=!1);break;case"PriceDifferent":var price=parseFloat($item.data("resprice"));($item.is(".lfb_button:not(.checked)")||$item.is(".lfb_selectable:not(.checked)")||$item.is("input[type=checkbox]:not(:checked)")||price==this.value)&&(error=!0),($item.is(".checked")||$item.is(":checked"))&&price!=this.value&&(errorOR=!1);break;case"QtSuperior":($item.is(".lfb_selectable:not(.checked)")||$item.find(".icon_quantity").length>0&&parseInt($item.find(".icon_quantity").html())<=this.value||$item.find(".lfb_qtfield").length>0&&parseInt($item.find(".lfb_qtfield").val())<=this.value||$item.is('[data-type="slider"]')&&$item.is(".ui-slider")&&parseInt($item.slider("value"))<=this.value)&&(error=!0),$item.is(".lfb_selectable")?($item.is(".lfb_selectable.checked")&&parseInt($item.find(".icon_quantity").html())>this.value||parseInt($item.find(".lfb_qtfield").val())>this.value)&&(errorOR=!1):$item.is('[data-type="slider"]')&&$item.is(".ui-slider")&&parseInt($item.slider("value"))>this.value&&(errorOR=!1),$item.is("input")&&(parseInt($item.val())<=this.value&&(error=!0),parseInt($item.val())>this.value&&(errorOR=!1));break;case"QtInferior":($item.is(".lfb_selectable:not(.checked)")||$item.find(".icon_quantity").length>0&&parseInt($item.find(".icon_quantity").html())>=this.value||$item.find(".lfb_qtfield").length>0&&parseInt($item.find(".lfb_qtfield").val())>=this.value||$item.is('[data-type="slider"]')&&$item.is(".ui-slider")&&parseInt($item.slider("value"))>=this.value)&&(error=!0),$item.is(".lfb_selectable")?($item.is(".lfb_selectable.checked")&&parseInt($item.find(".icon_quantity").html())<this.value||parseInt($item.find(".lfb_qtfield").val())<this.value)&&(errorOR=!1):$item.is('[data-type="slider"]')&&$item.is(".ui-slider")&&parseInt($item.slider("value"))<this.value&&(errorOR=!1),$item.is("input")&&(parseInt($item.val())>=this.value&&(error=!0),parseInt($item.val())<this.value&&(errorOR=!1));break;case"QtEqual":($item.is(".lfb_selectable:not(.checked)")||$item.find(".icon_quantity").length>0&&parseInt($item.find(".icon_quantity").html())!=this.value||$item.find(".lfb_qtfield").length>0&&parseInt($item.find(".lfb_qtfield").val())!=this.value||$item.is('[data-type="slider"]')&&$item.is(".ui-slider")&&parseInt($item.slider("value"))!=this.value)&&(error=!0),$item.is(".lfb_selectable")?($item.is(".lfb_selectable.checked")&&parseInt($item.find(".icon_quantity").html())==this.value||parseInt($item.find(".lfb_qtfield").val())==this.value)&&(errorOR=!1):$item.is('[data-type="slider"]')&&$item.is(".ui-slider")&&parseInt($item.slider("value"))==this.value&&(errorOR=!1),$item.is("input")&&(parseInt($item.val())!=this.value&&(error=!0),parseInt($item.val())==this.value&&(errorOR=!1));break;case"QtDifferent":($item.is(".lfb_selectable:not(.checked)")||$item.find(".icon_quantity").length>0&&parseInt($item.find(".icon_quantity").html())==this.value||$item.find(".lfb_qtfield").length>0&&parseInt($item.find(".lfb_qtfield").val())==this.value||$item.is('[data-type="slider"]')&&$item.is(".ui-slider")&&parseInt($item.slider("value"))==this.value)&&(error=!0),$item.is(".lfb_selectable")?($item.is(".lfb_selectable.checked")&&parseInt($item.find(".icon_quantity").html())!=this.value||parseInt($item.find(".lfb_qtfield").val())!=this.value)&&(errorOR=!1):$item.is('[data-type="slider"]')&&$item.is(".ui-slider")&&parseInt($item.slider("value"))!=this.value&&(errorOR=!1),$item.is("input")&&(parseInt($item.val())==this.value&&(error=!0),parseInt($item.val())!=this.value&&(errorOR=!1));break;case"superior":if($item.is(".lfb_datepicker"))$item.is('[data-datetype="date"]')?(moment($item.datetimepicker("getDate")).format("YYYY-MM-DD 00:00")<=moment(this.value).format("YYYY-MM-DD 00:00")&&(error=!0),moment($item.datetimepicker("getDate")).format("YYYY-MM-DD 00:00")>moment(this.value).format("YYYY-MM-DD 00:00")&&(errorOR=!1)):$item.is('[data-datetype="time"]')?(moment($item.datetimepicker("getDate")).format("HH:mm")<=this.value&&(error=!0),moment.utc($item.datetimepicker("getDate")).format("HH:mm")>this.value&&(errorOR=!1)):(moment.utc($item.datetimepicker("getDate")).isSameOrBefore(moment.utc(this.value).format("YYYY-MM-DD HH:mm"))&&(error=!0),moment.utc($item.datetimepicker("getDate")).isAfter(moment.utc(this.value).format("YYYY-MM-DD HH:mm"))&&(errorOR=!1));else if($item.is(".lfb_timepicker")){var valueHour=parseInt(this.value.substr(0,this.value.indexOf(":"))),valueMins=parseInt(this.value.substr(this.value.indexOf(":")+1,2));this.value.indexOf("PM")>0&&12!=valueHour&&(valueHour+=12);var itemHour=parseInt($item.val().substr(0,$item.val().indexOf(":"))),itemMins=parseInt($item.val().substr($item.val().indexOf(":")+1,2));$item.val().indexOf("PM")>0&&12!=itemHour&&(itemHour+=12),(itemHour<valueHour||itemHour==valueHour&&itemMins<=valueMins)&&(error=!0),(itemHour>valueHour||itemHour==valueHour&&itemMins>valueMins)&&(errorOR=!1)}else $item.is('input[type="number"]')?(parseFloat($item.val())<=parseFloat(this.value)&&(error=!0),parseFloat($item.val())>parseFloat(this.value)&&(errorOR=!1)):$item.is('[data-itemtype="rate"]')&&(parseFloat($item.find(".lfb_rate").rate("getValue"))<=parseFloat(this.value)&&(error=!0),parseFloat($item.find(".lfb_rate").rate("getValue"))>parseFloat(this.value)&&(errorOR=!1));break;case"inferior":if($item.is(".lfb_datepicker"))$item.is('[data-datetype="date"]')?(moment.utc($item.datetimepicker("getDate")).format("YYYY-MM-DD")>=this.value&&(error=!0),moment.utc($item.datetimepicker("getDate")).format("YYYY-MM-DD")<this.value&&(errorOR=!1)):$item.is('[data-datetype="time"]')?(moment.utc($item.datetimepicker("getDate")).format("HH:mm")>=this.value&&(error=!0),moment.utc($item.datetimepicker("getDate")).format("HH:mm")<this.value&&(errorOR=!1)):(moment.utc($item.datetimepicker("getDate")).isSameOrAfter(moment.utc(this.value).format("YYYY-MM-DD HH:mm"))&&(error=!0),moment.utc($item.datetimepicker("getDate")).isBefore(moment.utc(this.value).format("YYYY-MM-DD HH:mm"))&&(errorOR=!1));else if($item.is(".lfb_timepicker")){var valueHour=parseInt(this.value.substr(0,this.value.indexOf(":"))),valueMins=parseInt(this.value.substr(this.value.indexOf(":")+1,2));this.value.indexOf("PM")>0&&12!=valueHour&&(valueHour+=12);var itemHour=parseInt($item.val().substr(0,$item.val().indexOf(":"))),itemMins=parseInt($item.val().substr($item.val().indexOf(":")+1,2));$item.val().indexOf("PM")>0&&12!=itemHour&&(itemHour+=12),(itemHour>valueHour||itemHour==valueHour&&itemMins>=valueMins)&&(error=!0),(itemHour<valueHour||itemHour==valueHour&&itemMins<valueMins)&&(errorOR=!1)}else $item.is('input[type="number"]')?(parseFloat($item.val())>=parseFloat(this.value)&&(error=!0),parseFloat($item.val())<parseFloat(this.value)&&(errorOR=!1)):$item.is('[data-itemtype="rate"]')&&(parseFloat($item.find(".lfb_rate").rate("getValue"))>=parseFloat(this.value)&&(error=!0),parseFloat($item.find(".lfb_rate").rate("getValue"))<parseFloat(this.value)&&(errorOR=!1));break;case"equal":if($item.is(".lfb_datepicker"))$item.is('[data-datetype="date"]')?(moment.utc($item.datetimepicker("getDate")).format("YYYY-MM-DD")!=this.value&&(error=!0),moment.utc($item.datetimepicker("getDate")).format("YYYY-MM-DD")==this.value&&(errorOR=!1)):$item.is('[data-datetype="time"]')?(moment.utc($item.datetimepicker("getDate")).format("HH:mm")!=this.value&&(error=!0),moment.utc($item.datetimepicker("getDate")).format("HH:mm")==this.value&&(errorOR=!1)):(moment.utc($item.datetimepicker("getDate")).isSame(moment.utc(this.value).format("YYYY-MM-DD HH:mm"))||(error=!0),moment.utc($item.datetimepicker("getDate")).isSame(moment.utc(this.value).format("YYYY-MM-DD HH:mm"))&&(errorOR=!1));else if($item.is(".lfb_timepicker")){var valueHour=parseInt(this.value.substr(0,this.value.indexOf(":"))),valueMins=parseInt(this.value.substr(this.value.indexOf(":")+1,2));this.value.indexOf("PM")>0&&12!=valueHour&&(valueHour+=12);var itemHour=parseInt($item.val().substr(0,$item.val().indexOf(":"))),itemMins=parseInt($item.val().substr($item.val().indexOf(":")+1,2));$item.val().indexOf("PM")>0&&12!=itemHour&&(itemHour+=12),itemHour!=valueHour&&(error=!0),itemHour==valueHour&&(errorOR=!1)}else $item.is('input[type="number"]')?(parseFloat($item.val())!=parseFloat(this.value)&&(error=!0),parseFloat($item.val())==parseFloat(this.value)&&(errorOR=!1)):$item.is('[data-itemtype="rate"]')&&(parseFloat($item.find(".lfb_rate").rate("getValue"))!=parseFloat(this.value)&&(error=!0),parseFloat($item.find(".lfb_rate").rate("getValue"))==parseFloat(this.value)&&(errorOR=!1));break;case"different":if($item.is(".lfb_datepicker"))$item.is('[data-datetype="date"]')?(moment.utc($item.datetimepicker("getDate")).format("YYYY-MM-DD")==this.value&&(error=!0),moment.utc($item.datetimepicker("getDate")).format("YYYY-MM-DD")!=this.value&&(errorOR=!1)):$item.is('[data-datetype="time"]')?(moment.utc($item.datetimepicker("getDate")).format("HH:mm")==this.value&&(error=!0),moment.utc($item.datetimepicker("getDate")).format("HH:mm")!=this.value&&(errorOR=!1)):(moment.utc($item.datetimepicker("getDate")).isSame(moment.utc(this.value).format("YYYY-MM-DD HH:mm"))&&(error=!0),moment.utc($item.datetimepicker("getDate")).isSame(moment.utc(this.value).format("YYYY-MM-DD HH:mm"))||(errorOR=!1));else if($item.is(".lfb_timepicker")){var valueHour=parseInt(this.value.substr(0,this.value.indexOf(":"))),valueMins=parseInt(this.value.substr(this.value.indexOf(":")+1,2));this.value.indexOf("PM")>0&&12!=valueHour&&(valueHour+=12);var itemHour=parseInt($item.val().substr(0,$item.val().indexOf(":"))),itemMins=parseInt($item.val().substr($item.val().indexOf(":")+1,2));$item.val().indexOf("PM")>0&&12!=itemHour&&(itemHour+=12),itemHour==valueHour&&(error=!0),itemHour!=valueHour&&(errorOR=!1)}else $item.is('input[type="number"]')?(parseFloat($item.val())==parseFloat(this.value)&&(error=!0),parseFloat($item.val())!=parseFloat(this.value)&&(errorOR=!1)):$item.is('[data-itemtype="rate"]')&&(parseFloat($item.find(".lfb_rate").rate("getValue"))==parseFloat(this.value)&&(error=!0),parseFloat($item.find(".lfb_rate").rate("getValue"))!=parseFloat(this.value)&&(errorOR=!1))}}}}}else{if("v_"==this.interaction.substr(0,2)){var valueItemID=this.interaction.substr(this.interaction.indexOf("_")+1,this.interaction.length-(this.interaction.indexOf("_")+1)),variableValue=parseFloat(lfb_getVariableByID(form,valueItemID).value);if("text"==lfb_getVariableByID(form,valueItemID).type&&(variableValue=lfb_getVariableByID(form,valueItemID).value),this.value&&this.value.indexOf("_")>-1)if("_"!=this.value.substr(0,1)){var valueStepID=this.value.substr(0,this.value.indexOf("_")),attribute=this.value.substr(this.value.indexOf("-")+1,this.value.length);0==valueStepID&&(valueStepID="final");var valueItemID=this.value.substr(this.value.indexOf("_")+1,this.value.indexOf("-")-(this.value.indexOf("_")+1));if("v"==valueStepID)this.value=parseFloat(lfb_getVariableByID(form,valueItemID).value);else if("stepqt"==attribute)this.value=lfb_getStepQuantities(stepID,formID,itemID);else{var $valueItem;($valueItem=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+valueStepID+'"] .lfb_genContent [data-itemid="'+valueItemID+'"]')).length>0&&(""==attribute?void 0!==$valueItem.data("resprice")?this.value=parseFloat($valueItem.data("resprice")):$valueItem.is("[data-resqt]")&&(this.value=parseFloat($valueItem.attr("data-resqt"))):"quantity"==attribute?$valueItem.is(".lfb_disabled")?this.value=0:$valueItem.is('input[type="number"]')?this.value=$valueItem.val():$valueItem.find(".lfb_qtfield").length>0?this.value=parseInt($valueItem.find(".lfb_qtfield").val()):this.value=parseInt($valueItem.find(".icon_quantity").html()):"value"==attribute&&($valueItem.is(".lfb_disabled")?this.value="":(this.value=$valueItem.val(),$valueItem.is(".lfb_datepicker")&&(this.value=moment.utc($valueItem.datetimepicker("getDate")).format("YYYY-MM-DD")),this.value=this.value.replace(/\`/g,"'"))))}}else"_total"==this.value||"_total-"==this.value?this.value=form.price:"_total_qt"==this.value&&(this.value=lfb_getTotalQuantities(formID,_stepID,itemID));else this.value&&(this.value=this.value.replace(/\`/g,"'"));switch(this.action){case"superior":variableValue<=this.value&&(error=!0),variableValue>this.value&&(errorOR=!1);break;case"inferior":variableValue>=this.value&&(error=!0),variableValue<this.value&&(errorOR=!1);break;case"equal":variableValue!=this.value&&(error=!0),variableValue==this.value&&(errorOR=!1);break;case"different":variableValue==this.value&&(error=!0),variableValue!=this.value&&(errorOR=!1)}}else if(this.interaction&&this.interaction.length>6&&"_step-"==this.interaction.substr(0,6)){var stepID;0==(stepID=this.interaction.substr(6,this.interaction.length))&&(stepID="final");var totalQt=lfb_getStepQuantities(formID,stepID,itemID);switch(this.action){case"superior":totalQt<=this.value&&(error=!0),totalQt>this.value&&(errorOR=!1);break;case"inferior":totalQt>=this.value&&(error=!0),totalQt<this.value&&(errorOR=!1);break;case"equal":totalQt!=this.value&&(error=!0),totalQt==this.value&&(errorOR=!1);break;case"different":totalQt==this.value&&(error=!0),totalQt!=this.value&&(errorOR=!1)}}if("_total"==this.interaction)switch(this.action){case"superior":parseFloat(form.price)<=parseFloat(this.value)&&(error=!0),parseFloat(form.price)>parseFloat(this.value)&&(errorOR=!1);break;case"inferior":parseFloat(form.price)>=parseFloat(this.value)&&(error=!0),parseFloat(form.price)<parseFloat(this.value)&&(errorOR=!1);break;case"equal":parseFloat(form.price)!=parseFloat(this.value)&&(error=!0),parseFloat(form.price)==parseFloat(this.value)&&(errorOR=!1);break;case"different":parseFloat(form.price)==this.value&&(error=!0),parseFloat(form.price)!=this.value&&(errorOR=!1)}else if("_total_qt"==this.interaction){var totalQt=lfb_getTotalQuantities(formID,_stepID);switch(this.action){case"superior":totalQt<=this.value&&(error=!0),totalQt>this.value&&(errorOR=!1);break;case"inferior":totalQt>=this.value&&(error=!0),totalQt<this.value&&(errorOR=!1);break;case"equal":totalQt!=this.value&&(error=!0),totalQt==this.value&&(errorOR=!1);break;case"different":totalQt==this.value&&(error=!0),totalQt!=this.value&&(errorOR=!1)}}}})),0==conditions.length&&(errorOR=!1),{error:error,errorOR:errorOR}}function lfb_scrollToItem($item,stepID,formID){var form=lfb_getForm(formID);1!=form.disableScroll&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is(".lfb_fullscreen")||$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is(".lfb_popup")?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').animate({scrollTop:$item.parent().offset().top-(80+parseInt(lfb_getScrollTopMargin(form)))},2*form.animationsSpeed):"1"==form.scrollTopPage?$("body,html").animate({scrollTop:0},2*form.animationsSpeed):$("body,html").animate({scrollTop:$item.parent().offset().top-(80+parseInt(lfb_getScrollTopMargin(form)))},2*form.animationsSpeed))}function lfb_checkStepItemsValid(stepID,formID){var chkSelectionitem=!0,chkError=!1,form=lfb_getForm(formID),jsonSign;($(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find(".has-error").removeClass("has-error"),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find(".icon_select.lfb_error").removeClass("lfb_error"),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find("input[type=text]:not(.lfb_disabled),input[type=password]:not(.lfb_disabled),select").each((function(){if(0==$(this).closest(".lfb_itemBloc.lfb_disabled").length&&0==$(this).closest("#lfb_stripeForm").length&&0==$(this).closest("#lfb_paypalForm").length)if($(this).is('[data-required="true"]')&&$(this).val().length<1&&(chkSelectionitem=!1,$(this).closest(".form-group").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID),chkError=!0),$(this).is('[data-validation="phone"]')&&$(this).val().length>0&&($(this).val().length<5||0==/^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \\\/]?)?((?:\(?\d{1,}\)?[\-\.\ \\\/]?){0,})(?:[\-\.\ \\\/]?(?:#|ext\.?|extension|x)[\-\.\ \\\/]?(\d+))?$/i.test($(this).val())))chkSelectionitem=!1,$(this).closest(".form-group").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID),chkError=!0;else if($(this).is('[data-validation="number"]')&&0==/^\d+$/.test($(this).val()))chkSelectionitem=!1,$(this).closest(".form-group").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID),chkError=!0;else if($(this).is('[data-validation="email"]')&&$(this).val().length>0&&!lfb_checkEmail($(this).val()))chkSelectionitem=!1,$(this).closest(".form-group").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID),chkError=!0;else if($(this).is('[data-validation="fill"]')&&0==$(this).val().length)chkSelectionitem=!1,$(this).closest(".form-group").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID),chkError=!0;else if($(this).is('[data-validation="custom"]')&&$(this).val().length>0){var error=!1;if(parseInt($(this).attr("data-validmin"))>0&&$(this).val().length<parseInt($(this).attr("data-validmin"))&&(error=!0),parseInt($(this).attr("data-validmax"))>0&&$(this).val().length>parseInt($(this).attr("data-validmax"))&&(error=!0),$(this).is("[data-validcar]")&&""!=$(this).attr("data-validcar")){var field=$(this);if($(this).attr("data-validcar").indexOf(",")>-1){var chars=$(this).attr("data-validcar").split(",");jQuery.each(chars,(function(){-1==field.val().indexOf(this)&&(error=!0)}))}else-1==field.val().indexOf($(this).attr("data-validcar"))&&(error=!0)}error&&(chkSelectionitem=!1,$(this).closest(".form-group").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID),chkError=!0)}})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find("input[type=text][minlength]:not(.lfb_disabled)").each((function(){0==$(this).closest(".lfb_row.lfb_disabled").length&&$(this).val().length<$(this).attr("minlength")&&(chkSelectionitem=!1,$(this).closest(".form-group").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID))})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find('select[data-required="true"]:not(.lfb_disabled)').each((function(){0==$(this).closest(".lfb_row.lfb_disabled").length&&$(this).is('[data-firstvaluedisabled="true"]')&&(!$(this).is(".lfb_selectpicker")&&0==$(this).find("option:selected").index()||$(this).is(".lfb_selectpicker")&&$(this).val()==$(this).find("option").first().attr("value"))&&(chkSelectionitem=!1,$(this).closest(".form-group").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID))})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find("input[type=text][minlength]:not(.lfb_disabled)").each((function(){0==$(this).closest(".lfb_row.lfb_disabled").length&&$(this).val().length<$(this).attr("minlength")&&(chkSelectionitem=!1,$(this).closest(".form-group").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID))})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find('input[type=number][data-required="true"]:not(.lfb_disabled)').each((function(){0==$(this).closest(".lfb_row.lfb_disabled").length&&(""!=$(this).val()&&0!=$(this).val()||(chkSelectionitem=!1,$(this).closest(".form-group").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID)))})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find(".lfb_dropzone:not(.lfb_disabled)").each((function(){0==$(this).closest(".lfb_row.lfb_disabled").length&&($(this).is('[data-required="true"]')&&0==$(this).find(".dz-preview[data-file].dz-success.dz-complete").length?(chkSelectionitem=!1,$(this).parent().addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID)):$(this).find(".dz-preview[data-file].dz-complete").length>parseInt($(this).attr("data-maxfiles"))&&(chkSelectionitem=!1,$(this).parent().addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID)))})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find('textarea[data-required="true"]:not(.lfb_disabled)').each((function(){0==$(this).closest(".lfb_row.lfb_disabled").length&&0==$(this).closest("#lfb_stripeForm").length&&0==$(this).closest("#lfb_paypalForm").length&&$(this).val().length<1&&(chkSelectionitem=!1,$(this).closest(".form-group").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID))})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find('input[type=checkbox][data-required="true"]:not(.lfb_disabled)').each((function(){$(this).is(":checked")||(!$(this).is("[data-group]")||""!=$(this).attr("data-group")&&0==$(' #lfb_form[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] [data-group="'+$(this).attr("data-group")+'"]:checked').length)&&0==$(this).closest(".lfb_row.lfb_disabled").length&&(chkSelectionitem=!1,$(this).closest(".form-group,p,.lfb_itemBloc").addClass("has-error"),chkError||lfb_scrollToItem($(this),stepID,formID))})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find('.lfb_selectable[data-required="true"]:not(.lfb_disabled)').each((function(){$(this).is(".checked")||(!$(this).is("[data-group]")||""!=$(this).attr("data-group")&&0==$(' #lfb_form[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] [data-group="'+$(this).attr("data-group")+'"].checked').length)&&0==$(this).closest(".lfb_row.lfb_disabled").length&&(chkSelectionitem=!1,$(this).find(".icon_select").addClass("lfb_error"),chkError||lfb_scrollToItem($(this),stepID,formID))})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').find('.lfb_button[data-required="true"]:not(.lfb_disabled)').each((function(){$(this).is(".checked")||(!$(this).is("[data-group]")||""!=$(this).attr("data-group")&&0==$(' #lfb_form[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] [data-group="'+$(this).attr("data-group")+'"].checked').length)&&0==$(this).closest(".lfb_row.lfb_disabled").length&&(chkSelectionitem=!1,$(this).find(".icon_select").addClass("lfb_error"),chkError||lfb_scrollToItem($(this),stepID,formID))})),"final"==stepID&&1==form.useSignature)&&(0==JSON.parse(form.signature.signature("toJSON")).lines.length&&(chkSelectionitem=!1,$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_signature').addClass("has-error"),chkError||lfb_scrollToItem($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_signature'),stepID,formID),chkError=!0));return chkSelectionitem}function lfb_nextStep(formID){var form=lfb_getForm(formID),deviceAgent,agentID;$("#lfb_bootstraped :not(.ui-slider-handle) > .tooltip").remove(),$('#lfb_form[data-form="'+form.formID+'"] > .tooltip').remove(),navigator.userAgent.toLowerCase().match(/(iPad|iPhone|iPod)/i)&&setTimeout((function(){$("#lfb_bootstraped :not(.ui-slider-handle) > .tooltip").remove()}),500),lfb_updateShowSteps(formID),$(".lfb_errorMsg").hide();var chkSelection=!0,chkSelectionitem=!0,maxConditions=0,potentialSteps=lfb_findPotentialsSteps(form.step,formID);if(form.step>0&&(1==$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').data("required")&&(chkSelection=!1,($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find('select:not(.lfb_disabled):not([data-firstvaluedisabled="true"])').length>0||$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find("div.lfb_selectable.checked:not(.lfb_disabled)").length>0||$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find("a.lfb_button.checked:not(.lfb_disabled)").length>0||$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find('input[data-toggle="switch"]:checked:not(.lfb_disabled)').length>0||$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find("input[type=text][data-title].checked:not(.lfb_disabled)").length>0||$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find('[data-itemtype="rate"][data-title].checked:not(.lfb_disabled)').length>0||$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find("input[type=number][data-itemid].checked:not(.lfb_disabled)").length>0||$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find("input[type=file].checked:not(.lfb_disabled)").length>0||$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find(".lfb_colorPreview:not(.lfb_disabled)").length>0||$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find(".dz-preview[data-file].dz-success.dz-complete").length>0)&&(chkSelection=!0),chkSelection||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find('select:not(.lfb_disabled)[data-firstvaluedisabled="true"]').each((function(){(!$(this).is(".lfb_selectpicker")&&$(this).find("option:selected").index()>0||$(this).is(".lfb_selectpicker")&&$(this).find("option:selected").index()>1)&&(chkSelection=!0)}))),chkSelectionitem=lfb_checkStepItemsValid(form.step,formID)),chkSelection&&chkSelectionitem&&lfb_checkUserEmail(form)){lfb_lastStepID=form.step,parseFloat(lfb_lastStepID)!=parseInt(lfb_lastStepID)||isNaN(lfb_lastStepID)||-1==jQuery.inArray(parseInt(form.step),lfb_lastSteps)&&lfb_lastSteps.push(parseInt(form.step));var title=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+lfb_lastStepID+'"] .lfb_stepTitle').html();$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is(".lfb_fullscreen")&&!$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is(".lfb_popup")&&history.pushState({id:lfb_lastStepID},"","");var nextStepID=potentialSteps[0];if("final"!=nextStepID&&-1==(nextStepID=lfb_getNextEnabledStep(formID,potentialSteps))&&(nextStepID="final"),1==form.sendContactASAP&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"] [data-fieldtype="email"]').length>0&&lfb_checkEmail($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"] [data-fieldtype="email"]').val())){form.contactSent=1;var infosCt=lfb_getContactInformations(formID);jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_sendCt",formID:formID,email:infosCt.email,lastName:infosCt.lastName,firstName:infosCt.firstName,phone:infosCt.phone,country:infosCt.country,zip:infosCt.zip,state:infosCt.state,city:infosCt.city,address:infosCt.address},success:function(rep){}})}lfb_changeStep(nextStepID,formID)}else chkSelection||($(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_errorMsg').slideDown(),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').trigger("stepError"))}function lfb_getNextEnabledStep(formID,potentialSteps){var rep=-1,stepID=potentialSteps[0];return"final"!=stepID&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is(".lfb_visualEditing")?rep=stepID:!$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]  #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"]').is(".lfb_disabled")&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_item:not(.lfb_row ):not(.lfb-hidden)').length>0||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+stepID+'"] .lfb_distanceError').length>0)?rep=stepID:(lfb_lastSteps.push(parseInt(stepID)),lfb_updatePrice(formID),rep=lfb_getNextEnabledStep(formID,lfb_findPotentialsSteps(parseInt(stepID),formID)))),rep}function lfb_openGenerator(formID){var form=lfb_getForm(formID);$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]  #startInfos').addClass("lfb_loaded"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]  #startInfos > p').slideDown(),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnFloatingSummary').css({display:"inline-block"}),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').css({display:"inline-block"}),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnStart').parent().fadeOut(form.animationsSpeed),setTimeout((function(){"2"!=form.showSteps&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').find(".genPrice,#lfb_stepper").fadeIn(form.animationsSpeed),form.autoStart||($(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel').show(),setTimeout((function(){lfb_nextStep(formID)}),form.animationsSpeed+form.animationsSpeed/2))}),form.animationsSpeed)}function lfb_initListeners(formID){var form=lfb_getForm(formID);$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').on("lfb_setAnimImmediate",lfb_setAnimImmediate),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').on("lfb_resizeAll",lfb_resizeAll),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide div.lfb_selectable .img,  #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide div.lfb_selectable .icon_select').on("click",(function(){lfb_isSelectionMode(formID)||lfb_itemClick($(this).parent(),!0,formID)})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide a.lfb_button').on("click",(function(){lfb_isSelectionMode(formID)||lfb_itemClick($(this),!0,formID)})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-callnextstep="1"]').on("click",(function(){!lfb_isSelectionMode(formID)&&$(this).is(".checked")&&lfb_nextStep(formID)})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel input[type=checkbox][data-price]').on("change",(function(){$(this).is('[data-usedistance="true"]')&&lfb_removeDistanceError($(this).attr("data-itemid"),formID);var $this=$(this);$this.data("group")&&$this.closest(".lfb_genSlide").find('a.lfb_button.checked[data-group="'+$this.data("group")+'"]:not([data-itemid="'+$this.attr("data-itemid")+'"])').each((function(){lfb_itemClick($(this),!1,formID),$(this).removeClass("checked")})),lfb_updatePrice(formID,$(this).attr("data-itemid"))})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel input[type=checkbox][data-group]').on("change",(function(e){var clickedInput=$(this),form;clickedInput.is(":checked")&&($(this).closest(".lfb_genSlide").find('div.lfb_selectable.checked[data-group="'+clickedInput.data("group")+'"]').each((function(){lfb_itemClick($(this),!1,formID)})),$(this).closest(".lfb_genSlide").find('input[type=checkbox][data-group="'+clickedInput.data("group")+'"]:checked').each((function(){$(this).is(clickedInput)||$(this).trigger("click.auto")})),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is('[data-autoclick="1"]')&&0==clickedInput.closest(".lfb_genSlide").find("[data-itemid]").not('[data-group="'+clickedInput.data("group")+'"]').not(".lfb_richtext").not(".lfb_disabled").length&&lfb_nextStep(lfb_getForm(formID).formID))})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide select[data-itemid]').on("change",(function(){var value=$(this).val(),price=0;$(this).find("option").each((function(){$(this).attr("value")==value&&(price=$(this).attr("data-price"))})),$(this).attr("data-price",price),$(this).data("price",price),lfb_updatePrice(formID)})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide select[data-itemid]').trigger("change"),$(' #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel input[type=checkbox][data-price]').on("change",(function(){})),$(' #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide input.lfb_qtfield').on("change",(function(){lfb_updatePrice(formID,$(this).attr("data-itemid"))})),$(' #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide').find("input[type=text][data-title],textarea[data-title],input[type=file][data-title],input[type=number][data-title]").on("change",(function(){$(this).val().length>0?($(this).addClass("checked"),$(this).addClass("lfb_changed")):$(this).removeClass("checked")})),$(' #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide div.lfb_selectable .icon_quantity').on("click",(function(){lfb_isSelectionMode(formID)||($(".quantityBtns").not($(this).parent().find(".quantityBtns")).removeClass("open"),$(".quantityBtns").not($(this).parent().find(".quantityBtns")).fadeOut(250),!$(this).parent().find(".quantityBtns").is(".open")&&$(this).parent().is(".checked")?($(this).parent().find(".quantityBtns .tooltip-inner").length>0&&$(this).parent().find(".quantityBtns .tooltip-inner").html(parseInt($(this).parent().find(".icon_quantity").html())),$(this).parent().find(".quantityBtns").addClass("open"),$(this).parent().find(".quantityBtns").fadeIn(250)):($(this).parent().find(".quantityBtns").removeClass("open"),$(this).parent().find(".quantityBtns").fadeOut(250)))})),$("#lfb_orderMessageCheck").on("change",(function(){$(this).is(":checked")?$("#lfb_orderMessage").slideDown(250):$("#lfb_orderMessage").slideUp(250)})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnOrder').on("click",(function(){lfb_isSelectionMode(formID)||lfb_order(formID)})),$("#gform_wrapper_"+form.gravityFormID+" form").on("submit",(function(e){var $this=$(this);if($(this).is(".submit"))$(this).removeClass("submit");else if(e.preventDefault(),$(this).addClass("submit"),form.save_to_cart){var products=new Array,lastAndCurrentSteps=JSON.parse(JSON.stringify(lfb_lastSteps));"final"!=form.step&&-1==jQuery.inArray(parseInt(form.step),lastAndCurrentSteps)?lastAndCurrentSteps.push(parseInt(form.step)):"final"==form.step&&-1==jQuery.inArray("final",lastAndCurrentSteps)&&lastAndCurrentSteps.push("final"),jQuery.each(lastAndCurrentSteps,(function(){var $panel;$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"]').find('div.lfb_selectable.checked:not(.lfb_disabled),a.lfb_button.checked:not(.lfb_disabled),input[type=checkbox]:checked:not(.lfb_disabled),[data-type="slider"]:not(.lfb_disabled)').each((function(){var quantity=1;parseInt($(this).data("resqt"))>0&&(quantity=parseInt($(this).data("resqt"))),$(this).is('[data-type="slider"]')&&(quantity=parseInt($(this).slider("value")),isNaN(parseInt($(this).find(".tooltip-inner").html()))||(quantity=parseInt($(this).find(".tooltip-inner").html()))),parseInt($(this).data("prodid"))>0&&products.push({quantity:quantity,product_id:parseInt($(this).data("prodid")),variation:parseInt($(this).attr("data-woovar"))})}))})),jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_cart_save",ref:form.current_ref,emptyWooCart:form.emptyWooCart,products:products},success:function(){form.timer_gFormSubmit=setInterval((function(){lfb_check_gform_response(form.formID)}),300),setTimeout((function(){$this.submit()}),700)}})}else form.timer_gFormSubmit=setInterval((function(){lfb_check_gform_response(form.formID)}),300),setTimeout((function(){$this.submit()}),700)}))}function lfb_checkItems(formID){var form=lfb_getForm(formID);$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide div.lfb_selectable img[data-tint="true"]').each((function(){$(this).css("opacity",0),$(this).show();var $canvas=$('<canvas class="img"></canvas>');$canvas.css({width:$(this).get(0).width,height:$(this).get(0).height}),$(this).hide(),$(this).after($canvas);var ctx=$canvas.get(0).getContext("2d"),img=new Image;img.onload=function(){ctx.fillStyle=form.colorA,ctx.fillRect(0,0,$canvas.get(0).width,$canvas.get(0).height),ctx.fill(),ctx.globalCompositeOperation="destination-in",ctx.drawImage(img,0,0,$canvas.get(0).width,$canvas.get(0).height)},$(this).is("[data-lazy-src]")?img.src=$(this).attr("data-lazy-src"):img.src=$(this).attr("src")})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide div.lfb_selectable img[data-tint="false"]').each((function(){$(this).is("[data-src]")&&$(this).attr("src",$(this).attr("data-src"))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide div.lfb_selectable.checked , #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide  input[type=checkbox]:checked').on("mouseenter",(function(){$(this).addClass("lfb_hover")})).on("mouseleave",(function(){$(this).removeClass("lfb_hover")}))}function lfb_getDistanceCalc(distanceCode,formID,itemID,depart,arrival,distanceType){var rep=0,distanceMode=google.maps.UnitSystem.METRIC,form;if("route"==lfb_getForm(formID).distancesMode)(lfb_gmapMatrixService=new google.maps.DistanceMatrixService).getDistanceMatrix({origins:[depart],destinations:[arrival],travelMode:google.maps.TravelMode.DRIVING,unitSystem:google.maps.UnitSystem.METRIC,avoidHighways:!1,avoidTolls:!1},(function(response,status){var error=!1;if(status==google.maps.DistanceMatrixStatus.OK){var distance=0,duration=0;response.rows[0].elements[0].distance?(distance=response.rows[0].elements[0].distance.value,distance/=1e3,"miles"==distanceType?distance*=.62:"mins"==distanceType?distance=Math.round(parseInt(response.rows[0].elements[0].duration.value)/60):"hours"==distanceType&&(distance=Math.round(parseInt(response.rows[0].elements[0].duration.value)/60/60))):error=!0;var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+itemID+'"]');$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+itemID+'"]').attr("data-distance",distance),lfb_updateSummary(formID),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tr[data-itemstep="'+itemID+'"] td:eq(2)').html(distance),lfb_updatePrice(formID),lfb_removeDistanceError(itemID,formID)}else error=!0;error&&lfb_showDistanceError(itemID,formID)}));else{var geocoder=new google.maps.Geocoder;geocoder.geocode({address:depart},(function(results,status){if(void 0!==results[0]){var pointA=results[0].geometry.location;geocoder.geocode({address:arrival},(function(results,status){if(void 0!==results[0]){var pointB=results[0].geometry.location,distance=google.maps.geometry.spherical.computeDistanceBetween(pointA,pointB);distance/=1e3,"miles"==distanceType&&(distance*=.62);var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+itemID+'"]');$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+itemID+'"]').attr("data-distance",distance),lfb_updateSummary(formID),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table tr[data-itemstep="'+itemID+'"] td:eq(2)').html(distance),lfb_updatePrice(formID),lfb_removeDistanceError(itemID,formID)}else lfb_showDistanceError(itemID,formID)}))}else lfb_showDistanceError(itemID,formID)}))}return 0}function lfb_executeCalculation(calculation,formID,targetID){calculation=calculation.replace(/\\/g,"");var form=lfb_getForm(formID),price=0,i=0,elementsToReplace=new Array,itemData=lfb_getItemData(form,targetID),_stepID=itemData.stepid,isVariable=!1;for(calculation.indexOf("[variable]")>-1&&(isVariable=!0),calculation=calculation.replace(/\[variable\]/g,"[price]"),calculation=calculation.replace(/\[quantity\]/g,"[price]"),calculation=calculation.replace(/\[value\]/g,"[price]");-1!=(i=calculation.indexOf("variable-",i+1));){var variableID=calculation.substr(i+9,calculation.indexOf("]",i)-(i+9)),value=0,variable=lfb_getVariableByID(form,variableID);variable&&(value=variable.value,"text"==variable.type?value='"'+variable.value+'"':isNaN(value)&&(value=0)),elementsToReplace.push({oldValue:calculation.substr(i-1,calculation.indexOf("]",i)+1-(i-1)),newValue:value})}for(;-1!=(i=calculation.indexOf("item-",i+1));){var itemID=calculation.substr(i+5,calculation.indexOf("_",i)-(i+5)),action=calculation.substr(calculation.indexOf("_",i)+1,calculation.indexOf("]",i)-1-calculation.indexOf("_",i)),value=0,calItemData=lfb_getItemData(form,itemID);if(void 0!==calItemData&&calItemData){if("isChecked"==action&&(value=calItemData?"1==1":"1==0"),"isUnchecked"==action&&(value=calItemData?"1==0":"1==1"),"isFilled"==action)if("filefield"==calItemData.type)value=calItemData.files.length>0?"1==1":"1==0";else{var value=0;void 0===calItemData.value?void 0!==calItemData.quantity&&(value=calItemData.quantity):value=calItemData.value,value=value.length>0?"1==1":"1==0"}if("price"==action&&(value=0,"total"==itemID?value=form.price:(value=0,void 0!==calItemData.price&&(value=calItemData.price))),"quantity"==action&&(value=0,void 0!==calItemData.quantity&&(value=calItemData.quantity)),"min"==action&&(value=0,"range"==calItemData.type&&void 0!==calItemData.minValue&&(value=calItemData.minValue)),"max"==action&&(value=0,"range"==calItemData.type&&void 0!==calItemData.maxValue&&(value=calItemData.maxValue)),"value"==action&&(value=0,"numberfield"==calItemData.type?(void 0!==calItemData.quantity?value=calItemData.quantity:void 0!==calItemData.value&&(value=calItemData.value),isNaN(value)&&(value=0)):value="'"+calItemData.value+"'"),"date"==action){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]');value=$item.is(".lfb_datepicker")&&null!=$item.datetimepicker("getDate")?"'"+moment($item.datetimepicker("getDate")).format("YYYY-MM-DD")+"'":"null"}}else"isUnchecked"==action&&(value="1==1");void 0===value&&(value=0),elementsToReplace.push({oldValue:calculation.substr(i-1,calculation.indexOf("]",i)+1-(i-1)),newValue:value})}for(;-1!=(i=calculation.indexOf("step-",i+1));){var stepID=calculation.substr(i+5,calculation.indexOf("_",i)-(i+5)),action=calculation.substr(calculation.indexOf("_",i)+1,calculation.indexOf("]",i)-1-calculation.indexOf("_",i));"quantity"==action&&(value=lfb_getStepQuantities(formID,stepID,targetID)),elementsToReplace.push({oldValue:calculation.substr(i-1,calculation.indexOf("]",i)+1-(i-1)),newValue:value})}var todayDate=new Date,month=todayDate.getMonth()+1;month<10&&(month="0"+month);var today=todayDate.getFullYear().toString()+month.toString()+todayDate.getDate().toString();if(calculation=calculation.replace(/\[currentDate\]/g,today),calculation.indexOf("dateDifference-")>-1)for(;-1!=(i=calculation.indexOf("dateDifference-",i+1));){var startDateAdPosEnd=calculation.indexOf("_",i+15)+1,startDate=calculation.substr(i+15,calculation.indexOf("_",i)-(i+15)),endDate=calculation.substr(startDateAdPosEnd,calculation.indexOf("]",startDateAdPosEnd)-startDateAdPosEnd);if("currentDate"==startDate)startDate=todayDate;else if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+startDate+'"]').length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+startDate+'"]').val().length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+startDate+'"]');startDate=$item.datetimepicker("getDate")}else startDate=todayDate;if("currentDate"==endDate)endDate=todayDate;else if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+endDate+'"]').length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+endDate+'"]').val().length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+endDate+'"]');endDate=$item.datetimepicker("getDate")}else endDate=todayDate;startDate.setMinutes(0),startDate.setHours(0),endDate.setMinutes(0),endDate.setHours(0);var timeDiff=Math.abs(endDate.getTime()-startDate.getTime()),result=Math.round(timeDiff/864e5);result<0&&(result=0),elementsToReplace.push({oldValue:calculation.substr(i-1,calculation.indexOf("]",i)+1-(i-1)),newValue:result})}if(calculation.indexOf("distance_")>-1){var $target=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+targetID+'"]');for($target.attr("data-usedistance","true");-1!=(i=calculation.indexOf("distance_",i+1));){var distanceType="km",departAdPosEnd=calculation.indexOf("-",i+9)+1,departAdress=calculation.substr(i+9,calculation.indexOf("-",i)-(i+9)),departCityPosEnd=calculation.indexOf("-",departAdPosEnd)+1,departCity=calculation.substr(departAdPosEnd,calculation.indexOf("-",departAdPosEnd)-departAdPosEnd),departZipPosEnd=calculation.indexOf("-",departCityPosEnd)+1,departZip=calculation.substr(departCityPosEnd,calculation.indexOf("-",departCityPosEnd)-departCityPosEnd),departCountryPosEnd=calculation.indexOf("_",departZipPosEnd)+1,departCountry=calculation.substr(departZipPosEnd,calculation.indexOf("_",departZipPosEnd)-departZipPosEnd),arrivalAdPosEnd=calculation.indexOf("-",departCountryPosEnd)+1,arrivalAdress=calculation.substr(departCountryPosEnd,calculation.indexOf("-",departCountryPosEnd)-departCountryPosEnd),arrivalCityPosEnd=calculation.indexOf("-",arrivalAdPosEnd)+1,arrivalCity=calculation.substr(arrivalAdPosEnd,calculation.indexOf("-",arrivalAdPosEnd)-arrivalAdPosEnd),arrivalZipPosEnd=calculation.indexOf("-",arrivalCityPosEnd)+1,arrivalZip=calculation.substr(arrivalCityPosEnd,calculation.indexOf("-",arrivalCityPosEnd)-arrivalCityPosEnd),arrivalCountryPosEnd=calculation.indexOf("_",arrivalZipPosEnd)+1,arrivalCountry=calculation.substr(arrivalZipPosEnd,calculation.indexOf("_",arrivalZipPosEnd)-arrivalZipPosEnd);if(distanceType=calculation.substr(arrivalCountryPosEnd,calculation.indexOf("]",arrivalCountryPosEnd)-arrivalCountryPosEnd),""!=departAdress)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departAdress+'"]').length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departAdress+'"]');departAdress=$item.val()}else departAdress=0;if(""!=departCity)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCity+'"]').length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCity+'"]');departCity=$item.val()}else departCity=0;if(""!=departZip)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departZip+'"]').length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departZip+'"]');departZip=$item.val()}else departZip=0;if(""!=departCountry)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCountry+'"]').length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCountry+'"]');departCountry=$item.val()}else departCountry=0;if(""!=arrivalAdress)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalAdress+'"]').length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalAdress+'"]');arrivalAdress=$item.val()}else arrivalAdress=0;if(""!=arrivalCity)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCity+'"]').length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCity+'"]');arrivalCity=$item.val()}else arrivalCity=0;if(""!=arrivalZip)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalZip+'"]').length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalZip+'"]');arrivalZip=$item.val()}else arrivalZip=0;if(""!=arrivalCountry)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCountry+'"]').length>0){var $item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCountry+'"]');arrivalCountry=$item.val()}else arrivalCountry=0;$target.closest(".lfb_genSlide").find(".lfb_distanceError").length>0&&lfb_removeDistanceError(targetID,formID);var distanceCode=calculation.substr(i-1,calculation.indexOf("]",i)+1-(i-1)),distance=0;if(""!=$target.attr("data-distance")&&(distance=parseFloat($target.attr("data-distance"))),""==departAdress&&""==departCity&&""==departCountry&&""==arrivalAdress&&""==arrivalCity&&""==arrivalCountry&&""==departZip&&""==arrivalZip)lfb_showDistanceError(targetID,formID);else if(""==form.gmap_key)lfb_showDistanceError(targetID,formID),console.log("invalid gmap api key");else{var depart=departAdress+" "+departZip+" "+departCity+" "+departCountry,arrival=arrivalAdress+" "+arrivalZip+" "+arrivalCity+" "+arrivalCountry;$target.attr("data-departure")==depart&&arrival==$target.attr("data-arrival")||($target.attr("data-departure",depart),$target.attr("data-arrival",arrival),lfb_getDistanceCalc(distanceCode,formID,targetID,depart,arrival,distanceType))}elementsToReplace.push({oldValue:calculation.substr(i-1,calculation.indexOf("]",i)+1-(i-1)),newValue:distance})}}if(jQuery.each(elementsToReplace,(function(){calculation=calculation.replace(this.oldValue,this.newValue)})),calculation=calculation.replace(/\[total_single\]/g,form.priceSingle),calculation=calculation.replace(/\[total_default\]/g,form.price),calculation=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is("[data-isSubs]")&&(itemData&&itemData.isSinglePrice||$('[data-itemid="'+targetID+'"]').is('[data-singleprice="true"]'))?calculation.replace(/\[total\]/g,form.priceSingle):calculation.replace(/\[total\]/g,form.price),calculation.indexOf("[total_quantity]")>-1&&(calculation=calculation.replace(/\[total_quantity\]/g,lfb_getTotalQuantities(formID,_stepID,targetID))),-1==calculation.indexOf("[price]")){for(i=0;-1!=(i=calculation.indexOf("{",i+1));){var charsToEnd=calculation.substr(i+1,calculation.indexOf("}",i+1)-(i+1));/\S/.test(charsToEnd)&&(calculation=calculation.substr(0,i+1)+" price ="+calculation.substr(i+1,calculation.length),i+=8)}if(calculation.indexOf("if")<0)calculation="price = "+calculation;else{var charsToStart=calculation.substr(0,calculation.indexOf("if"));/\S/.test(charsToStart)&&(calculation="price = "+calculation)}calculation=lfb_removeDoubleSpaces(calculation),calculation=calculation.replace(/price =\n if/g,"\nif"),calculation=calculation.replace(/price = if/g,"if"),calculation=calculation.replace(/price = \nif/g,"\nif"),calculation=calculation.replace(/price = \n if/g,"\n if")}else calculation=calculation.replace(/\[price\]/g,"price"),calculation=calculation.replace(/\[quantity\]/g,"price"),calculation=calculation.replace(/\[variable\]/g,"price"),calculation=lfb_removeDoubleSpaces(calculation);if("price ="!=calculation.trim())try{eval(calculation)}catch(e){console.log("wrong calculation : "+calculation)}return isVariable?price:parseFloat(price)}function lfb_parseDate(input){var rep=input;if("string"==typeof input){var parts=input.match(/(\d+)/g);rep=new Date(parts[0],parts[1]-1,parts[2])}return rep}function lfb_removeDoubleSpaces(string){return(string=(string=string.replace(/\t/g,"")).replace(/  /g," ")).indexOf("  ")>-1&&lfb_removeDoubleSpaces(string),string}function lfb_removeDistanceError(itemID,formID){var $target=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]');if(0==$target.closest(".lfb_genSlide").find('[data-itemid][data-usedistance="true"]:not([data-distance]):not([type="checkbox"]).checked,[data-itemid][data-usedistance="true"]:not([data-distance]):checked,[data-itemid][data-usedistance="true"]:not([data-distance])[data-type="slider"]').length&&0==$target.closest(".lfb_genSlide").find('[data-itemid][data-usedistance="true"][data-distance="0"]:not([type="checkbox"]).checked,[data-itemid][data-usedistance="true"][data-distance="0"]:checked,[data-itemid][data-usedistance="true"][data-distance="0"][data-type="slider"]').length){$target.closest(".lfb_genSlide").find(".lfb_btn-next").fadeIn(),$target.closest(".lfb_genSlide").find(".lfb_btnNextContainer").fadeIn(),$target.closest(".lfb_genSlide").find(".lfb_btn-next").removeClass("lfb_disabledBtn");var errorMsg=$target.closest(".lfb_genSlide").find(".lfb_distanceError");errorMsg.fadeOut(),setTimeout((function(){errorMsg.remove()}),300)}}function lfb_showDistanceError(itemID,formID){var form=lfb_getForm(formID),$target=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]');$target.closest(".lfb_genSlide").find(".lfb_btn-next").addClass("lfb_disabledBtn"),$target.closest(".lfb_genSlide").find(".lfb_btn-next").hide(),0==$target.closest(".lfb_genSlide").find(".lfb_distanceError").length&&$target.closest(".lfb_genSlide").find(".lfb_btnNextContainer").before('<div class="lfb_distanceError alert alert-danger"><p>'+form.txtDistanceError+"</p></div>");var stepID=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-itemid="'+itemID+'"]').closest(".lfb_genSlide").attr("data-stepid");"final"!=form.step||form.backFomFinal||(form.backFomFinal=!0,lfb_changeStep(stepID,formID)),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').trigger("lfb_distanceError")}function lfb_updateLabelItem($item,formID){var form=lfb_getForm(formID);$item.is(".dropzone")||($item.closest(".lfb_itemBloc").find("label").each((function(){$(this).html().indexOf(":")>-1&&0==$(this).closest(".switch").length&&$(this).html($item.attr("data-original-label"))})),$item.parent().children(".lfb_imgTitle").length>0&&$item.is("[data-bs-original-title]")&&$item.parent().children(".lfb_imgTitle").html($item.attr("data-bs-original-title")),$item.is('[type="checkbox"]')&&$item.closest(".lfb_itemBloc").find("div > label").first().html($item.attr("data-original-label")),$item.find(".lfb_buttonTitle").length>0&&$item.is("[data-bs-original-title]")&&$item.find(".lfb_buttonTitle").html($item.attr("data-bs-original-title")))}function getItemCalculation(form,itemID,calculationType){var rep="";if(1==form.debugCalculations){var attribute="calculation";"calculationQt"==calculationType?attribute="calculationqt":"variableCalculation"==calculationType?attribute="calculationvar":"distanceQt"==calculationType&&(attribute="distanceqt"),rep=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').attr("data-"+attribute)}else form.usingCalculationItems.forEach(item=>{item.id==itemID&&(rep=item[calculationType])});return rep}function lfb_updatePrice(formID,fromItemID){var hasSinglePrice=!1,form=lfb_getForm(formID);lfb_updatePlannedSteps(formID),lfb_updateStep(formID),lfb_updateShowItems(formID),form.lastPrice=form.price,form.price=form.initialPrice,form.priceSingle=0;for(var lastAndCurrentSteps=JSON.parse(JSON.stringify(lfb_lastSteps)),pricePreviousStep=0,singlePricePreviousStep=0,i=0;i<form.variables.length;i++)form.variables[i].value=form.variables[i].defaultValue;"final"!=form.step&&-1==jQuery.inArray(parseInt(form.step),lastAndCurrentSteps)?lastAndCurrentSteps.push(parseInt(form.step)):"final"==form.step&&-1==jQuery.inArray("final",lastAndCurrentSteps)&&lastAndCurrentSteps.push("final");for(var i=0;i<lastAndCurrentSteps.length;i++){var step=lastAndCurrentSteps[i],$panel;if(("final"==step||0!=parseInt(step))&&!$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+step+'"]').is(".lfb_disabled"))$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+step+'"]').find("[data-itemid]").each((function(){if($(this).is("div.lfb_selectable.checked")||$(this).is('div[data-type="slider"]')||$(this).is("a.lfb_button.checked")||$(this).is("input[type=checkbox]:checked")||$(this).is("select[data-itemid][data-price]")||$(this).is('input[type=number][data-valueasqt="1"]')){if(!$(this).is(".lfb_disabled")&&0==$(this).closest(".lfb_itemBloc.lfb_disabled").length&&!$(this).is(".lfb_disabled"))if($(this).is('[data-singleprice="true"]')&&(hasSinglePrice=!0),$(this).is("[data-usecalculation]")||$(this).data("price",$(this).attr("data-price")),$(this).is("[data-usecalculation]")&&(step!=form.step&&$(this).is(".lfb_executed")?$(this).attr("data-price",$(this).data("price")):$(this).data("price",lfb_executeCalculation(getItemCalculation(form,$(this).attr("data-itemid"),"calculation"),formID,$(this).attr("data-itemid")))),$(this).find(".icon_quantity").length>0||$(this).find(".lfb_qtfield").length>0||$(this).is('[data-type="slider"]')||$(this).is('input[type=number][data-valueasqt="1"]')){var quantityA="",min=0,max=99999999999999;if($(this).find(".icon_quantity").length>0?(quantityA=$(this).find(".icon_quantity").html(),min=parseFloat($(this).find(".quantityBtns").attr("data-min")),max=parseFloat($(this).find(".quantityBtns").attr("data-max"))):$(this).find(".lfb_qtfield").length>0?(quantityA=$(this).find(".lfb_qtfield").val(),min=$(this).find(".lfb_qtfield").attr("min"),max=$(this).find(".lfb_qtfield").attr("max")):$(this).is('[data-type="slider"]')?(quantityA=parseFloat($(this).slider("value")),min=$(this).attr("data-min"),max=$(this).attr("data-max")):$(this).is('input[type=number][data-valueasqt="1"]')&&(quantityA=parseFloat($(this).val()),min=$(this).attr("min"),max=$(this).is("[max]")?$(this).attr("max"):1e17),!$(this).is("[data-usecalculationqt]")||$(this).is(".lfb_changed")||void 0!==fromItemID&&$(this).attr("data-itemid")==fromItemID||(quantityA=lfb_executeCalculation(getItemCalculation(form,$(this).attr("data-itemid"),"calculationQt"),formID,$(this).attr("data-itemid")),isNaN(quantityA)&&(quantityA=0),quantityA>max&&(quantityA=max),quantityA<min&&(quantityA=min),$(this).find(".icon_quantity").length>0?($(this).find(".icon_quantity").html(quantityA),$(this).find(".lfb_sliderQt").length>0&&$(this).find(".lfb_sliderQt").slider("value",parseFloat(quantityA)),$(this).find(".quantityBtns").addClass("lfb-hidden")):$(this).find(".lfb_qtfield").length>0?$(this).find(".lfb_qtfield").val(quantityA):$(this).is('[data-type="slider"]')?$(this).slider("value",parseFloat(quantityA)):$(this).is('input[type="number"]')&&$(this).val(quantityA)),$(this).is("[data-distanceqt]")&&(lfb_executeCalculation(getItemCalculation(form,$(this).attr("data-itemid"),"distanceQt"),formID,$(this).attr("data-itemid")),$(this).is("[data-distance]")&&(quantityA=parseFloat($(this).attr("data-distance")).toFixed(2)),quantityA<min?quantityA=min:quantityA>max&&(quantityA=max),$(this).find(".lfb_qtfield").length>0?$(this).find(".lfb_qtfield").val(quantityA):$(this).find(".lfb_sliderQt").length>0?($(this).find(".lfb_sliderQt").slider("value",quantityA),$(this).find(".icon_quantity").html(quantityA)):$(this).find(".quantityBtns").length>0?$(this).find(".icon_quantity").html(quantityA):$(this).is('[data-type="slider"]')&&$(this).slider("value",quantityA),$(this).is("[data-usecalculation]")&&$(this).data("price",lfb_executeCalculation(getItemCalculation(form,$(this).attr("data-itemid"),"calculation"),formID,$(this).attr("data-itemid")))),$(this).attr("data-resqt",quantityA),$(this).is("[data-price]"))if("-"==$(this).data("operation"))$(this).data("resprice",0-parseFloat($(this).data("price"))*parseFloat(quantityA)),$(this).is('[data-singleprice="true"]')?form.priceSingle-=parseFloat($(this).data("price"))*parseFloat(quantityA):form.price-=parseFloat($(this).data("price"))*parseFloat(quantityA);else if("x"==$(this).data("operation"))for(var i=0;i<parseFloat(quantityA);i++)0==i?(form.price=form.price,$(this).data("resprice",form.price)):$(this).is('[data-singleprice="true"]')?($(this).is('[data-addtototal!="no"]')&&(form.priceSingle+=singlePricePreviousStep*parseFloat($(this).data("price"))/100),$(this).data("resprice",singlePricePreviousStep*parseFloat($(this).data("price"))/100)):($(this).is('[data-addtototal!="no"]')&&(form.price+=pricePreviousStep*parseFloat($(this).data("price"))/100),$(this).data("resprice",form.price*parseFloat($(this).data("price"))/100));else if("/"==$(this).data("operation"))for(var i=0;i<parseFloat(quantityA);i++)$(this).data("resprice",0-form.price*parseFloat($(this).data("price"))/100),$(this).is('[data-singleprice="true"]')?$(this).is('[data-addtototal!="no"]')&&(form.priceSingle=form.price-form.price*parseFloat($(this).data("price"))/100):$(this).is('[data-addtototal!="no"]')&&(form.price=form.price-form.price*parseFloat($(this).data("price"))/100);else{var reducIndex=-2;if($(this).data("reduc")&&$(this).data("reducqt").length>0){var self=this,reducsTab=$(this).data("reducqt");reducsTab=reducsTab.split("*");var valuesTab=new Array,minQtReduc=0;jQuery.each(reducsTab,(function(i){var reduc=reducsTab[i].split("|");valuesTab.push(reduc[1]),parseFloat(reduc[0])<=parseFloat(quantityA)&&(reducIndex=i),(parseFloat(reduc[0])<minQtReduc||0==minQtReduc)&&(minQtReduc=parseFloat(reduc[0]))}))}if(reducIndex>=0){var calculatedPrice=parseFloat(valuesTab[reducIndex])*parseFloat(quantityA);"0"==$(this).attr("data-price")&&(calculatedPrice=parseFloat(valuesTab[reducIndex])*(parseFloat(quantityA)-minQtReduc)),$(this).data("resprice",calculatedPrice),$(this).is('[data-singleprice="true"]')?$(this).is('[data-addtototal!="no"]')&&(form.priceSingle+=parseFloat(calculatedPrice)):$(this).is('[data-addtototal!="no"]')&&(form.price+=parseFloat(calculatedPrice)),"left"==form.currencyPosition?($(this).is('[data-showprice="1"]')?"+"==$(this).data("operation")?($(this).attr("title",$(this).data("originaltitle")+" : "+form.currency+lfb_formatPrice(valuesTab[reducIndex],formID)),$(this).attr("data-original-label",$(this).data("originallabel")+" : "+form.currency+lfb_formatPrice(valuesTab[reducIndex],formID)),$(this).attr("data-bs-original-title",$(this).data("originaltitle")+" : "+form.currency+lfb_formatPrice(valuesTab[reducIndex],formID)),0==form.disableTipMobile||lfb_is_touch_device(),lfb_updateLabelItem($(this),formID)):"-"==$(this).data("operation")?($(this).attr("title",$(this).data("originaltitle")+" : -"+form.currency+lfb_formatPrice(valuesTab[reducIndex],formID)),0==form.disableTipMobile||lfb_is_touch_device(),$(this).attr("data-original-label",$(this).data("originallabel")+" : -"+form.currency+lfb_formatPrice(valuesTab[reducIndex],formID)),$(this).attr("data-bs-original-title",$(this).data("originaltitle")+" : -"+form.currency+lfb_formatPrice(valuesTab[reducIndex],formID)),0==form.disableTipMobile||lfb_is_touch_device(),lfb_updateLabelItem($(this),formID)):"x"==$(this).data("operation")?($(this).attr("title",$(this).data("originaltitle")+" : +"+lfb_formatPrice(valuesTab[reducIndex],formID)+"%"),0==form.disableTipMobile||lfb_is_touch_device(),$(this).attr("data-original-label",$(this).data("originallabel")+" : +"+form.currency+lfb_formatPrice(valuesTab[reducIndex],formID)),$(this).attr("data-bs-original-title",$(this).data("originaltitle")+" : +"+lfb_formatPrice(valuesTab[reducIndex],formID)+"%"),0==form.disableTipMobile||lfb_is_touch_device(),lfb_updateLabelItem($(this),formID)):($(this).attr("title",$(this).data("originaltitle")+" : -"+lfb_formatPrice(valuesTab[reducIndex],formID)+"%"),0==form.disableTipMobile||lfb_is_touch_device(),$(this).attr("data-original-label",$(this).data("originallabel")+" : -"+form.currency+lfb_formatPrice(valuesTab[reducIndex],formID)),$(this).attr("data-bs-original-title",$(this).data("originaltitle")+" : -"+lfb_formatPrice(valuesTab[reducIndex],formID)+"%"),0==form.disableTipMobile||lfb_is_touch_device(),lfb_updateLabelItem($(this),formID)):($(this).attr("data-original-label",$(this).data("originallabel")),$(this).is("[data-tooltiptext]")?$(this).attr("data-bs-original-title",$(this).attr("data-tooltiptext")):$(this).attr("data-bs-original-title",$(this).data("originaltitle"))),$(this).find(".quantityBtns").is(".open")&&""==form.imgTitlesStyle&&(0!=form.disableTipMobile&&lfb_is_touch_device()||$(this).tooltip("show"))):($(this).is('[data-showprice="1"]')?"+"==$(this).attr("data-operation")?($(this).attr("title",$(this).data("originaltitle")+" : "+lfb_formatPrice(valuesTab[reducIndex],formID)+form.currency),$(this).attr("data-original-label",$(this).data("originallabel")+" : "+lfb_formatPrice(valuesTab[reducIndex],formID)+form.currency),$(this).attr("data-bs-original-title",$(this).data("originaltitle")+" : "+lfb_formatPrice(valuesTab[reducIndex],formID)+form.currency),0==form.disableTipMobile||lfb_is_touch_device(),lfb_updateLabelItem($(this),formID)):"-"==$(this).attr("data-operation")?($(this).attr("title",$(this).data("originaltitle")+" : -"+lfb_formatPrice(valuesTab[reducIndex],formID)),$(this).attr("data-original-label",$(this).data("originallabel")+" : -"+lfb_formatPrice(valuesTab[reducIndex],formID)+form.currency),$(this).attr("data-bs-original-title",$(this).data("originaltitle")+" : -"+lfb_formatPrice(valuesTab[reducIndex],formID)+form.currency),0==form.disableTipMobile||lfb_is_touch_device(),lfb_updateLabelItem($(this),formID)):"x"==$(this).attr("data-operation")?($(this).attr("data-original-label",$(this).data("originallabel")+" : +"+lfb_formatPrice(valuesTab[reducIndex],formID)+form.currency),$(this).attr("title",$(this).data("originaltitle")+" : +"+lfb_formatPrice(valuesTab[reducIndex],formID)+"%"),0==form.disableTipMobile||lfb_is_touch_device(),$(this).attr("data-original-label",$(this).data("originallabel")+" : +"+lfb_formatPrice(valuesTab[reducIndex],formID)+form.currency),$(this).attr("data-bs-original-title",$(this).data("originaltitle")+" : +"+lfb_formatPrice(valuesTab[reducIndex],formID)+"%"),0==form.disableTipMobile||lfb_is_touch_device(),lfb_updateLabelItem($(this),formID)):($(this).attr("data-original-label",$(this).data("originallabel")+" : -"+lfb_formatPrice(valuesTab[reducIndex],formID)+form.currency),$(this).attr("title",$(this).data("originaltitle")+" : --"+lfb_formatPrice(valuesTab[reducIndex],formID)+"%"),0==form.disableTipMobile||lfb_is_touch_device(),$(this).attr("data-bs-original-title",$(this).data("originaltitle")+" : -"+lfb_formatPrice(valuesTab[reducIndex],formID)+"%"),0==form.disableTipMobile||lfb_is_touch_device(),lfb_updateLabelItem($(this),formID)):($(this).attr("data-original-label",$(this).data("originallabel")),$(this).is("[data-tooltiptext]")?$(this).attr("data-bs-original-title",$(this).attr("data-tooltiptext")):$(this).attr("data-bs-original-title",$(this).data("originaltitle"))),$(this).find(".quantityBtns").is(".open")&&""==form.imgTitlesStyle&&(0!=form.disableTipMobile&&lfb_is_touch_device()||$(this).tooltip("show")))}else $(this).data("resprice",parseFloat($(this).data("price"))*parseFloat(quantityA)),form.price=parseFloat(form.price),form.priceSingle=parseFloat(form.priceSingle),$(this).is('[data-singleprice="true"]')?$(this).is('[data-addtototal!="no"]')&&(form.priceSingle+=parseFloat($(this).data("price"))*parseFloat(quantityA)):$(this).is('[data-addtototal!="no"]')&&(form.price+=parseFloat($(this).data("price"))*parseFloat(quantityA)),lfb_updateItemTitleNoReduc($(this),form),$(this).find(".quantityBtns").is(".open")&&""==form.imgTitlesStyle&&(0!=form.disableTipMobile&&lfb_is_touch_device()||$(this).tooltip("show"))}else $(this).data("resprice","0")}else $(this).data("resqt","0"),$(this).data("price")?("-"==$(this).data("operation")?($(this).data("resprice",0-parseFloat($(this).data("price"))),$(this).is('[data-singleprice="true"]')?$(this).is('[data-addtototal!="no"]')&&(form.priceSingle-=parseFloat($(this).data("price"))):$(this).is('[data-addtototal!="no"]')&&(form.price-=parseFloat($(this).data("price")))):"x"==$(this).data("operation")?$(this).is('[data-singleprice="true"]')?($(this).data("resprice",form.priceSingle*parseFloat($(this).data("price"))/100),$(this).is('[data-addtototal!="no"]')&&(form.priceSingle=form.priceSingle+form.priceSingle*parseFloat($(this).data("price"))/100)):($(this).data("resprice",form.price*parseFloat($(this).data("price"))/100),$(this).is('[data-addtototal!="no"]')&&(form.price=form.price+form.price*parseFloat($(this).data("price"))/100)):"/"==$(this).attr("data-operation")?$(this).is('[data-singleprice="true"]')?($(this).data("resprice",0-form.priceSingle*parseFloat($(this).data("price"))/100),$(this).is('[data-addtototal!="no"]')&&(form.priceSingle=form.priceSingle-form.priceSingle*parseFloat($(this).data("price"))/100)):($(this).data("resprice",0-form.price*parseFloat($(this).data("price"))/100),$(this).is('[data-addtototal!="no"]')&&(form.price=form.price-form.price*parseFloat($(this).data("price"))/100)):($(this).data("resprice",$(this).data("price")),$(this).is('[data-singleprice="true"]')?$(this).is('[data-addtototal!="no"]')&&(form.priceSingle+=parseFloat($(this).data("price"))):$(this).is('[data-addtototal!="no"]')&&(form.price=parseFloat(form.price)+parseFloat($(this).data("price")))),lfb_updateItemTitleNoReduc($(this),form)):$(this).data("resprice","0");$(this).is("[data-usecalculationvar]")&&!$(this).is('[data-usecalculationvar="0"]')&&lfb_updateVariable(form,$(this).attr("data-usecalculationvar"),getItemCalculation(form,$(this).attr("data-itemid"),"variableCalculation"),$(this).attr("data-itemid"))}$(this).is('input[type!="checkbox"][data-usecalculationvar]')&&!$(this).is('[data-usecalculationvar="0"]')&&lfb_updateVariable(form,$(this).attr("data-usecalculationvar"),getItemCalculation(form,$(this).attr("data-itemid"),"variableCalculation"),$(this).attr("data-itemid")),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').trigger("priceUpdated",[$(this).attr("data-itemid")]),lfb_updateItemData(form,$(this).attr("data-itemid"))}));pricePreviousStep=form.price,singlePricePreviousStep=form.priceSingle}form.reduction>0&&(form.reductionType&&"%"==form.reductionType?form.priceSingle>0?form.reductionResult=form.priceSingle*form.reduction/100:form.reductionResult=form.price*form.reduction/100:form.reductionResult=form.reduction,form.reductionResult=parseFloat(form.reductionResult),0==form.priceSingle?form.price-=form.reductionResult:form.priceSingle-=form.reductionResult),lfb_updateVAT(formID),(!form.price||form.price<0)&&(form.price=0),(!hasSinglePrice||!form.priceSingle||form.priceSingle<0)&&(form.priceSingle=0);var pattern=/^\d+(\.\d{2})?$/;pattern.test(form.price)||(form.price=parseFloat(form.price).toFixed(2));try{pattern.test(form.priceSingle)||(form.priceSingle=parseFloat(form.priceSingle).toFixed(2))}catch(e){}var formatedSinglePrice=form.currency+""+lfb_formatPrice(parseFloat(form.priceSingle),formID),formatedPrice=form.currency+""+lfb_formatPrice(parseFloat(form.price),formID),labelA=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-rangelabelbetween"),labelB=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-rangelabeland");if($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is("[data-totalrange]")&&parseFloat(form.price)>0){$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').is(".lfb_notNull")||$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').addClass("lfb_notNull");var range=parseInt($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-totalrange")),rangeMin=parseFloat(form.price)-range/2,rangeMax=parseFloat(form.price)+range/2;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-rangemode="percent"]')&&(rangeMin=parseFloat(form.price)-parseFloat(form.price)*range/100,rangeMax=parseFloat(form.price)+parseFloat(form.price)*range/100),rangeMin<0&&(rangeMin=0),formatedPrice=labelA+"<br/><strong>"+form.currency+lfb_formatPrice(rangeMin,formID)+"</strong><br/>"+labelB+"<br/><strong>"+form.currency+lfb_formatPrice(rangeMax,formID)+"</strong>"}else $('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').removeClass("lfb_notNull");if("left"!=form.currencyPosition)if(formatedPrice=lfb_formatPrice(form.price,formID)+""+form.currency,formatedSinglePrice=lfb_formatPrice(form.priceSingle,formID)+""+form.currency,$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is("[data-totalrange]")&&parseFloat(form.price)>0){$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').is(".lfb_notNull")||$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').addClass("lfb_notNull");var range=parseInt($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-totalrange")),rangeMin=parseFloat(form.price)-range/2,rangeMax=parseFloat(form.price)+range/2;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-rangemode="percent"]')&&(rangeMin=parseFloat(form.price)-parseFloat(form.price)*range/100,rangeMax=parseFloat(form.price)+parseFloat(form.price)*range/100),rangeMin<0&&(rangeMin=0),formatedPrice=labelA+"<br/><strong>"+lfb_formatPrice(rangeMin,formID)+form.currency+"</strong><br/>"+labelB+"<br/><strong>"+lfb_formatPrice(rangeMax,formID)+form.currency+"</strong>"}else $('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').removeClass("lfb_notNull");if(1==form.showTotalBottom&&(hasSinglePrice&&form.priceSingle>0?form.price<0?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom').removeClass("lfb_priceSingle"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom>span.lfb_subPrice').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom>br').remove()):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom').addClass("lfb_priceSingle"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom').each((function(){0==$(this).find(".lfb_subPrice").length&&$(this).find(">span:eq(0)").after('<br/><span class="lfb_subPrice">+ '+formatedPrice+"</span>")}))):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom').removeClass("lfb_priceSingle"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom>span.lfb_subPrice').remove(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom>br').remove()),hasSinglePrice&&form.priceSingle>0?form.price<=0?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom> span:first-child').html(formatedSinglePrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom> span.lfb_subPrice').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom> span:eq(2)').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom .lfb_subTxtBottom').hide()):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom> span.lfb_subPrice').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom> span:eq(2)').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom> span:first-child').html(formatedSinglePrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom> span.lfb_subPrice').html("+ "+formatedPrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom .lfb_subTxtBottom').show()):(form.price<=0?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom .lfb_subTxtBottom').hide():$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom .lfb_subTxtBottom').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_totalBottom> span:first-child').html(formatedPrice))),0==form.showSteps){hasSinglePrice&&form.priceSingle>0?form.price<0?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').removeClass("lfb_priceSingle"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price>span.lfb_subPrice').remove()):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').addClass("lfb_priceSingle"),0==$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span.lfb_subPrice').length&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price>span:eq(0)').after('<span class="lfb_subPrice">+ '+formatedPrice+"</span>")):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').removeClass("lfb_priceSingle"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price>span.lfb_subPrice').remove()),hasSinglePrice&&form.priceSingle>0?form.price<=0?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:first-child').css("top","6px"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:first-child').html(formatedSinglePrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span.lfb_subPrice').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:eq(2)').hide()):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:first-child').css("top","-5px"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span.lfb_subPrice').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:eq(2)').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:first-child').html(formatedSinglePrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span.lfb_subPrice').html("+ "+formatedPrice)):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-isSubs="true"]')?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:first-child').css("position","relative").css("top","6px"):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:first-child').css("position","relative").css("top","0px"),form.price>0?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:first-child').css("position","relative").css("top","0px"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:eq(1)').show()):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:eq(1)').hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:first-child').html(formatedPrice)),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:first-child').length>0&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price> span:first-child').html().length>8?parseInt($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').css("font-size"))>=16&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').css("font-size","16px"):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').css("font-size","18px"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price > span:first-child').html().length>9&&parseInt($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').css("font-size"))>=14&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').css("font-size","14px"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price > span:first-child').html().length>10&&parseInt($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').css("font-size"))>=11&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').css("font-size","11px"));var formPrice=form.price;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-isSubs="true"]')&&"single"==form.progressBarPriceType&&(formPrice=form.priceSingle);var percent=100*formPrice/form.priceMax;1==form.showInitialPrice&&(percent=100*(formPrice-parseFloat(form.initialPrice))/form.priceMax),percent>100&&(percent=100),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar').css("width",percent+"%"),$("body").is(".rtl")?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').animate({right:percent+"%"},70):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .genPrice .progress .progress-bar-price').animate({left:percent+"%"},70)}var summaryPrice=form.currency+""+lfb_formatPrice(parseFloat(form.price).toFixed(2),formID),summaryPriceSingle=form.currency+""+lfb_formatPrice(parseFloat(form.priceSingle).toFixed(2),formID);if("left"!=form.currencyPosition&&(summaryPrice=lfb_formatPrice(parseFloat(form.price).toFixed(2),formID)+""+form.currency,summaryPriceSingle=lfb_formatPrice(parseFloat(form.priceSingle).toFixed(2),formID)+""+form.currency),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table #lfb_summaryTotal>span:eq(0)').html(summaryPrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is("[data-totalrange]")&&parseFloat(form.price)>0){var labelA=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-rangelabelbetween"),labelB=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-rangelabeland"),range=parseInt($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-totalrange")),rangeMin=parseFloat(form.price)-range/2,rangeMax=parseFloat(form.price)+range/2;if($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-rangemode="percent"]')&&(rangeMin=parseFloat(form.price)-parseFloat(form.price)*range/100,rangeMax=parseFloat(form.price)+parseFloat(form.price)*range/100),rangeMin<0&&(rangeMin=0),formatedPrice=labelA+"<br/><strong>"+form.currency+lfb_formatPrice(rangeMin,formID)+"</strong><br/>"+labelB+"<br/><strong>"+form.currency+lfb_formatPrice(rangeMax,formID)+"</strong>","left"!=form.currencyPosition){var range=parseInt($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-totalrange"));formatedPrice=labelA+"<br/><strong>"+lfb_formatPrice(rangeMin,formID)+form.currency+"</strong><br/>"+labelB+"<br/><strong>"+lfb_formatPrice(rangeMax,formID)+form.currency+"</strong>"}$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table #lfb_summaryTotal>span:eq(0)').html(formatedPrice.replace(/<br\/>/g," "))}lfb_updateSummary(formID),hasSinglePrice&&form.priceSingle>0?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(0)').html(formatedSinglePrice),form.price<=0?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(1)').css("display","none"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(2)').css("display","none"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table #lfb_summaryTotal>span:eq(0)').html("<strong>"+summaryPriceSingle+"</strong>")):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(2)').css("display","inline-block"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(1)').html("+"+formatedPrice+form.subscriptionText),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(1)').css("display","block"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_summary table #lfb_summaryTotal>span:eq(0)').html("<strong>"+summaryPriceSingle+"</strong> <br/>+"+summaryPrice))):0==form.priceSingle&&0==form.price?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(1)').css("display","none"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(2)').css("display","none"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(0)').html(formatedPrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(1)').html(form.subscriptionText)):0==form.priceSingle&&form.price>0?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(0)').html(formatedPrice),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(1)').html(form.subscriptionText),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(2)').css("display","inline-block"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(1)').css("display","inline-block")):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(2)').css("display","inline-block"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(1)').css("display","inline-block"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice span:eq(0)').html(formatedPrice)),lfb_updateShowSteps(formID),lfb_updateShowItems(formID),lfb_updateLayerImages(formID),lfb_updateStep(formID),lfb_updateRichTextValues(formID)}function lfb_updateItemTitleNoReduc($item,form){var formID=form.formID;"left"==form.currencyPosition?$item.is('[data-showprice="1"]')?"+"==$item.data("operation")?($item.attr("title",$item.data("originaltitle")+" : "+form.currency+lfb_formatPrice($item.data("price"),formID)),$item.attr("data-original-label",$item.data("originallabel")+" : "+form.currency+lfb_formatPrice($item.data("price"),formID)),$item.attr("data-bs-original-title",$item.data("originaltitle")+" : "+form.currency+lfb_formatPrice($item.data("price"),formID)),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,lfb_updateLabelItem($item,formID)):"-"==$item.data("operation")?($item.attr("data-original-label",$item.data("originallabel")+" : -"+form.currency+lfb_formatPrice($item.data("price"),formID)),$item.attr("title",$item.data("originaltitle")+" : -"+form.currency+lfb_formatPrice($item.data("price"),formID)),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,$item.attr("data-original-label",$item.data("originallabel")+" : -"+form.currency+lfb_formatPrice($item.data("price"),formID)),$item.attr("data-bs-original-title",$item.data("originaltitle")+" : -"+form.currency+lfb_formatPrice($item.data("price"),formID)),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,lfb_updateLabelItem($item,formID)):"x"==$item.data("operation")?($item.attr("title",$item.data("originaltitle")+" : +"+lfb_formatPrice($item.data("price"),formID)+"%"),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,$item.attr("data-original-label",$item.data("originallabel")+" : +"+lfb_formatPrice($item.data("price"),formID)+"%"),$item.attr("data-bs-original-title",$item.data("originaltitle")+" : +"+lfb_formatPrice($item.data("price"),formID)+"%"),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,lfb_updateLabelItem($item,formID)):($item.attr("title",$item.data("originaltitle")+" : -"+lfb_formatPrice($item.data("price"),formID)+"%"),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,$item.attr("data-original-label",$item.data("originallabel")+" : -"+lfb_formatPrice($item.data("price"),formID)+"%"),$item.attr("data-bs-original-title",$item.data("originaltitle")+" : -"+lfb_formatPrice($item.data("price"),formID)+"%"),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,lfb_updateLabelItem($item,formID)):$item.is("[data-tooltiptext]")?$item.attr("data-bs-original-title",$(this).attr("data-tooltiptext")):$item.attr("data-bs-original-title",$item.data("originaltitle")):$item.is('[data-showprice="1"]')?"+"==$item.attr("data-operation")?($item.attr("title",$item.data("originaltitle")+" : "+lfb_formatPrice($item.data("price"),formID)+form.currency),$item.attr("data-bs-original-title",$item.data("originaltitle")+" : "+lfb_formatPrice($item.data("price"),formID)+form.currency),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,lfb_updateLabelItem($item,formID)):"-"==$item.attr("data-operation")?($item.attr("title",$item.data("originaltitle")+" : -"+lfb_formatPrice($item.data("price"),formID)),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,$item.attr("data-bs-original-title",$item.data("originaltitle")+" : -"+lfb_formatPrice($item.data("price"),formID)+form.currency),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,lfb_updateLabelItem($item,formID)):"x"==$item.attr("data-operation")?($item.attr("title",$item.data("originaltitle")+" : +"+lfb_formatPrice($item.data("price"),formID)+"%"),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,$item.attr("data-bs-original-title",$item.data("originaltitle")+" : +"+lfb_formatPrice($item.data("price"),formID)+"%"),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,lfb_updateLabelItem($item,formID)):($item.attr("title",$item.data("originaltitle")+" : -"+lfb_formatPrice($item.data("price"),formID)+"%"),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,$item.attr("data-bs-original-title",$item.data("originaltitle")+" : -"+lfb_formatPrice($item.data("price"),formID)+"%"),0!=form.disableTipMobile&&lfb_is_touch_device()||!$item.is('[data-type="slider"]')&&!$item.is(".lfb_button")&&form.imgTitlesStyle,lfb_updateLabelItem($item,formID)):$item.is("[data-tooltiptext]")?$item.attr("data-bs-original-title",$(this).attr("data-tooltiptext")):$item.attr("data-bs-original-title",$item.data("originaltitle")),$item.parent().children(".lfb_imgTitle").length>0&&$item.is("[data-bs-original-title]")&&$item.parent().children(".lfb_imgTitle").html($item.attr("data-bs-original-title"))}function lfb_isDecimal(n){if(""==n)return!1;var strCheck="0123456789",i;for(i in n)if(-1==strCheck.indexOf(n[i]))return!1;return!0}function lfb_changeContentSlide(dir,formID){var index=$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find(".lfb_genContent").find(".lfb_genContentSlide.active").index();"left"==dir?index>0?index--:index=$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find(".lfb_genContent").find(".lfb_genContentSlide").length:index<$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find(".lfb_genContent").find(".lfb_genContentSlide").length-1?index++:index=0,$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find(".lfb_genContent").find(".lfb_genContentSlide.active").fadeOut(500,(function(){$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find(".lfb_genContent").find(".lfb_genContentSlide.active").removeClass("active"),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find(".lfb_genContent").find(".lfb_genContentSlide").eq(index).delay(200).fadeIn(500,(function(){$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"]').find(".lfb_genContent").find(".lfb_genContentSlide").eq(index).delay(250).addClass("active")}))}))}function lfb_toggleField(fieldID,formID){var form=lfb_getForm(formID);$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #field_'+fieldID+"_cb").is(":checked")?($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #field_'+fieldID).addClass("opened"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #field_'+fieldID).slideDown(250)):($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #field_'+fieldID).removeClass("opened"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #field_'+fieldID).slideUp(250)),setTimeout((function(){var titleHeight=$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"] .lfb_stepTitle').height(),heightP=$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid='+form.step+"] .lfb_genContent").outerHeight()+parseInt($(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel').css("padding-bottom"))+102+titleHeight;"final"==form.step&&(heightP-=80);var animSpeed=300;0==form.animationsSpeed&&(animSpeed=0),$(' #lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel').animate({minHeight:heightP},animSpeed)}),300)}function lfb_finalStep(formID){var form=lfb_getForm(formID);if(form.step++,1==form.enablePdfDownload){var win=window.open(form.homeUrl+"/index.php?EPFormsBuilder=downloadMyOrder","_blank");"null"!=typeof win&&null!=win&&(win.focus(),setTimeout((function(){win.close()}),400))}$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').trigger("formSent"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_loader').delay(800).fadeOut(2*form.animationsSpeed),0==form.redirectionDelay&&(form.redirectionDelay=1),setTimeout((function(){var redirUrl=lfb_getRedirectionURL(formID);""!=redirUrl&&"#"!=redirUrl&&" "!=redirUrl&&(""!=form.urlVariables&&redirUrl.indexOf("?")>-1&&form.urlVariables.replace("?","&"),document.location.href=redirUrl+form.urlVariables)}),1e3*form.redirectionDelay)}function lfb_updateStep(formID){var form=lfb_getForm(formID);if(1==form.showSteps){var realPlannedSteps=new Array,noHideBtn=!1;jQuery.each(lfb_plannedSteps,(function(){noHideBtn||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"]').is(".lfb_disabled")||!($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"] .lfb_item:not(.lfb-hidden)').length>0||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"] .lfb_distanceError').length>0)||realPlannedSteps.push(this)}));var disp_step=0;jQuery.each(realPlannedSteps,(function(i,v){parseInt(v)==parseInt(form.step)&&(disp_step=i)})),0==++disp_step&&(disp_step=1),"final"==form.step&&(disp_step=realPlannedSteps.length+1);var totalStep=realPlannedSteps.length+1;disp_step>totalStep&&(disp_step=totalStep);var percent=100*disp_step/totalStep;$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .genPrice .progress .progress-bar-price> span:first-child').html(disp_step+"/"+totalStep),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .genPrice .progress .progress-bar').css("width",percent+"%")}else if(3==form.showSteps){$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_stepper *:not(#lfb_stepperBar)').remove();var noHideBtn=!1,realPlannedSteps=new Array;jQuery.each(lfb_plannedSteps,(function(){noHideBtn||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"]').is(".lfb_disabled")||!($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"] .lfb_item:not(.lfb-hidden)').length>0||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"] .lfb_distanceError').length>0)||realPlannedSteps.push(this)}));var chkCurrentStep=!1,currentStepID=parseInt($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_genSlide.lfb_activeStep').attr("data-stepid"));jQuery.each(realPlannedSteps,(function(i){var stepTitle=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+this+'"] .lfb_stepTitle').html(),point=$('<a href="javascript:"  class="lfb_stepperPoint" data-stepid="'+this+'" title="'+stepTitle+'"></a>');$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_stepper').append(point),point.tooltip({html:!0,container:'#lfb_form[data-form="'+formID+'"]',placement:"bottom"}),chkCurrentStep?point.addClass("lfb_disabledPoint"):parseInt(this)==currentStepID?(point.addClass("lfb_currentPoint"),chkCurrentStep=!0):point.on("click",(function(){var stepID;lfb_returnToStep(parseInt($(this).attr("data-stepid")),formID)}));var posX=100/realPlannedSteps.length*i;100!=posX&&0!=posX||1!=realPlannedSteps.length?posX+=100/realPlannedSteps.length/2:posX=50,point.css({left:posX+"%"}),parseInt(this)==currentStepID&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_stepper #lfb_stepperBar').css({width:posX+"%"})})),"final"==form.step&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_stepper #lfb_stepperBar').css({width:"100%"})}}function lfb_initPanelResize(formID){var form=lfb_getForm(formID);$(window).resize((function(){lfb_resize(form)}))}function lfb_resizeAll(){$(window).trigger("resize")}function lfb_resize(form){var titleHeight=$(' #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"] .lfb_stepTitle').height(),heightP=$(' #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"] .lfb_genContent').outerHeight()+parseInt($(' #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel').css("padding-bottom"))+102+titleHeight;"final"==form.step&&(heightP-=80);var animSpeed=300;0==form.animationsSpeed&&(animSpeed=0),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel').animate({minHeight:heightP},animSpeed),1==form.useSignature&&$('#lfb_form[data-form="'+form.formID+'"] #lfb_signature canvas').attr("width",$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_signature').width())}function lfb_rgb2hex(rgb){if(!(rgb.indexOf("rgb")>-1))return rgb;try{function hex(x){return("0"+parseInt(x).toString(16)).slice(-2)}return"#"+hex((rgb=rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/))[1])+hex(rgb[2])+hex(rgb[3])}catch(e){return rgb}}function lfb_formatPriceWithCurrency(price,formID){var form=lfb_getForm(formID);return price=lfb_formatPrice(price,formID),"left"==form.currencyPosition?price=form.currency+price:price+=form.currency,price}function lfb_formatPrice(price,formID,forceDecimals){if(price||(price=0),void 0===forceDecimals)var forceDecimals=!1;var formatedPrice=price.toString();formatedPrice.indexOf(".")>-1&&(formatedPrice=parseFloat(price).toFixed(2).toString());var form=lfb_getForm(formID);"1"==form.summary_noDecimals&&(formatedPrice=Math.round(formatedPrice).toString());var decSep=form.decimalsSeparator,thousSep=form.thousandsSeparator,priceNoDecimals=formatedPrice,millionSep=form.millionSeparator,billionSep=form.billionsSeparator,decimals="";return formatedPrice.indexOf(".")>-1?(priceNoDecimals=formatedPrice.substr(0,formatedPrice.indexOf(".")),decimals=formatedPrice.substr(formatedPrice.indexOf(".")+1,2),formatedPrice=formatedPrice.replace(".",form.decimalsSeparator),1==decimals.toString().length&&(decimals=decimals.toString()+"0"),priceNoDecimals.length>9?formatedPrice=priceNoDecimals.substr(0,priceNoDecimals.length-9)+billionSep+priceNoDecimals.substr(priceNoDecimals.length-9,3)+millionSep+priceNoDecimals.substr(priceNoDecimals.length-6,3)+thousSep+priceNoDecimals.substr(priceNoDecimals.length-3,priceNoDecimals.length)+form.decimalsSeparator+decimals:priceNoDecimals.length>6?formatedPrice=priceNoDecimals.substr(0,priceNoDecimals.length-6)+millionSep+priceNoDecimals.substr(priceNoDecimals.length-6,3)+thousSep+priceNoDecimals.substr(priceNoDecimals.length-3,priceNoDecimals.length)+form.decimalsSeparator+decimals:priceNoDecimals.length>3&&(formatedPrice=priceNoDecimals.substr(0,priceNoDecimals.length-3)+thousSep+priceNoDecimals.substr(priceNoDecimals.length-3,priceNoDecimals.length)+form.decimalsSeparator+decimals)):(priceNoDecimals.length>9?formatedPrice=formatedPrice=priceNoDecimals.substr(0,priceNoDecimals.length-9)+billionSep+priceNoDecimals.substr(priceNoDecimals.length-9,3)+millionSep+priceNoDecimals.substr(priceNoDecimals.length-6,3)+thousSep+priceNoDecimals.substr(priceNoDecimals.length-3,priceNoDecimals.length):priceNoDecimals.length>6?formatedPrice=priceNoDecimals.substr(0,priceNoDecimals.length-6)+millionSep+priceNoDecimals.substr(priceNoDecimals.length-6,3)+thousSep+priceNoDecimals.substr(priceNoDecimals.length-3,priceNoDecimals.length):priceNoDecimals.length>3&&(formatedPrice=priceNoDecimals.substr(0,priceNoDecimals.length-3)+thousSep+priceNoDecimals.substr(priceNoDecimals.length-3,priceNoDecimals.length)),forceDecimals&&(formatedPrice+=decSep+"00")),formatedPrice}function lfb_applyCouponCode(formID){var form=lfb_getForm(formID),code=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_couponField').val();$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_couponField').closest(".form-group").removeClass("has-error"),code.length<3?$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_couponField').closest(".form-group").addClass("has-error"):jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_applyCouponCode",formID:formID,code:code},success:function(rep){setTimeout((function(){if("0"==rep||""==rep)$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_couponField').closest(".form-group").addClass("has-error");else{$('#lfb_form[data-form="'+formID+'"] #lfb_couponContainer').length>0&&$('#lfb_form[data-form="'+formID+'"] #lfb_couponContainer').slideUp();var reduction=rep;rep.indexOf("%")>0&&(reduction=rep.substr(0,rep.length-1),form.reductionType="%"),form.discountCode=code,form.reduction=parseFloat(reduction),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #finalSlide .lfb_genContent').animate({opacity:0},form.animationsSpeed),setTimeout((function(){lfb_updatePrice(formID),lfb_changeStep("final",formID)}),form.animationsSpeed+100)}}),200)}})}function lfb_getRedirectionURL(formID){var form=lfb_getForm(formID),rep=form.close_url;return 1==form.useRedirectionConditions&&jQuery.each(form.redirections,(function(){var conditions=this.conditions.replace(/'/g,'"');conditions=conditions.replace(/\\"/g,'"');var errors=lfb_checkConditions(conditions=JSON.parse(conditions),formID,"final"),error=errors.error,errorOR=errors.errorOR;("OR"==this.conditionsOperator&&!errorOR||"OR"!=this.conditionsOperator&&!error)&&(rep=this.url)})),rep}function lfb_formatQuantity(value){return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g," ")}function lfb_isSelectionMode(formID){return formID>0?$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').is(".lfb_tldSelection"):$("#lfb_form.lfb_bootstraped[data-form]").is(".lfb_tldSelection")}function lfb_startFormIntro(formID){lfb_isSelectionMode(formID)||lfb_openGenerator(formID)}function lfb_initRichTextValues(formID){var form=lfb_getForm(formID);$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_richtext[data-itemid]:not(.lfb_shortcode)').each((function(){var i=0,elementsToReplace=new Array,_stepID=parseInt($(this).closest(".lfb_genSlide").attr("data-stepid"));if(void 0!==form.richtextsContent[$(this).attr("data-itemid").toString()]){for(var content=form.richtextsContent[$(this).attr("data-itemid").toString()];-1!=(i=content.indexOf("[variable-",i+1));){var variableID,value='<span class="lfb_richVariable" data-varvariableid="'+content.substr(i+10,content.indexOf("]",i)-(i+10))+'"></span>';elementsToReplace.push({oldValue:content.substr(i,content.indexOf("]",i)+1-i),newValue:value})}for(i=0;-1!=(i=content.indexOf("item-",i+1));){var itemID,action,value='<span class="lfb_richVariable" data-varitemid="'+(itemID=content.substr(i+5,content.indexOf("_",i)-(i+5)))+'" data-action="'+(action=content.substr(content.indexOf("_",i)+1,content.indexOf("]",i)-1-content.indexOf("_",i)))+'"></span>';elementsToReplace.push({oldValue:content.substr(i-1,content.indexOf("]",i)+1-(i-1)),newValue:value})}if(content.indexOf("dateDifference-")>-1)for(;-1!=(i=content.indexOf("dateDifference-",i+1));){var startDateAdPosEnd=content.indexOf("_",i+15)+1,startDate,endDate,itemID,action,value='<span class="lfb_richVariable" data-varitemid="'+(itemID=content.substr(i+15,content.indexOf("_",i)-(i+15)))+'" data-action="'+(action="dateDifference")+'" data-enddateid="'+content.substr(startDateAdPosEnd,content.indexOf("]",startDateAdPosEnd)-startDateAdPosEnd)+'"></span>';elementsToReplace.push({oldValue:content.substr(i-1,content.indexOf("]",i)+1-(i-1)),newValue:value})}if(content.indexOf("distance_")>-1)for($target.attr("data-usedistance","true");-1!=(i=content.indexOf("distance_",i+1));){var distanceType="km",departAdPosEnd=content.indexOf("-",i+9)+1,departAdress=content.substr(i+9,content.indexOf("-",i)-(i+9)),departCityPosEnd=content.indexOf("-",departAdPosEnd)+1,departCity=content.substr(departAdPosEnd,content.indexOf("-",departAdPosEnd)-departAdPosEnd),departZipPosEnd=content.indexOf("-",departCityPosEnd)+1,departZip=content.substr(departCityPosEnd,content.indexOf("-",departCityPosEnd)-departCityPosEnd),departCountryPosEnd=content.indexOf("_",departZipPosEnd)+1,departCountry=content.substr(departZipPosEnd,content.indexOf("_",departZipPosEnd)-departZipPosEnd),arrivalAdPosEnd=content.indexOf("-",departCountryPosEnd)+1,arrivalAdress=content.substr(departCountryPosEnd,content.indexOf("-",departCountryPosEnd)-departCountryPosEnd),arrivalCityPosEnd=content.indexOf("-",arrivalAdPosEnd)+1,arrivalCity=content.substr(arrivalAdPosEnd,content.indexOf("-",arrivalAdPosEnd)-arrivalAdPosEnd),arrivalZipPosEnd=content.indexOf("-",arrivalCityPosEnd)+1,arrivalZip=content.substr(arrivalCityPosEnd,content.indexOf("-",arrivalCityPosEnd)-arrivalCityPosEnd),arrivalCountryPosEnd=content.indexOf("_",arrivalZipPosEnd)+1,arrivalCountry=content.substr(arrivalZipPosEnd,content.indexOf("_",arrivalZipPosEnd)-arrivalZipPosEnd),action,value='<span class="lfb_richVariable" data-action="'+(action="distance")+'" data-distancetype="'+(distanceType=content.substr(arrivalCountryPosEnd,content.indexOf("]",arrivalCountryPosEnd)-arrivalCountryPosEnd))+'" data-departadress="'+departAdress+'" data-departcity="'+departCity+'" data-departzip="'+departZip+'" data-departcountry="'+departCountry+'" data-arrivaladress="'+arrivalAdress+'" data-arrivalcity="'+arrivalCity+'" data-arrivalzip="'+arrivalZip+'" data-arrivalcountry="'+arrivalCountry+'" ></span>';elementsToReplace.push({oldValue:content.substr(i-1,content.indexOf("]",i)+1-(i-1)),newValue:value})}var todayDate=new Date,month=todayDate.getMonth()+1;month<10&&(month="0"+month);var today=todayDate.getFullYear().toString()+month.toString()+todayDate.getDate().toString(),dateFormat=lfb_forms[0].dateFormat.toUpperCase();dateFormat=(dateFormat=(dateFormat=dateFormat.replace(/\\\//g,"/")).replace(/d /g,"DD ")).replace(/yyyy/g,"YYYY"),content=(content=(content=content.replace(/\[currentDate\]/g,moment(todayDate).format(dateFormat))).replace(/\[total\]/g,'<span class="lfb_richVariable" data-action="total"></span>')).replace(/\[total_quantity\]/g,'<span class="lfb_richVariable" data-action="total_quantity"></span>'),jQuery.each(elementsToReplace,(function(){content=content.replace(this.oldValue,this.newValue)})),$(this).html(content)}}))}function lfb_updateRichTextValues(formID){var form=lfb_getForm(formID),todayDate=new Date,month=todayDate.getMonth()+1;month<10&&(month="0"+month);var today=todayDate.getFullYear().toString()+month.toString()+todayDate.getDate().toString();$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_genSlide[data-stepid="'+form.step+'"] .lfb_richtext[data-itemid]:not(.lfb_shortcode) .lfb_richVariable[data-varvariableid]').each((function(){var variableID=$(this).attr("data-varvariableid"),variable=lfb_getVariableByID(form,variableID),value=0;variable&&(value="float"==variable.type?lfb_formatPrice(parseFloat(variable.value),formID):variable.value),$(this).html(value)}));var lastAndCurrentSteps=JSON.parse(JSON.stringify(lfb_lastSteps));"final"!=form.step&&-1==jQuery.inArray(parseInt(form.step),lastAndCurrentSteps)?lastAndCurrentSteps.push(parseInt(form.step)):"final"==form.step&&lastAndCurrentSteps.push("final"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_genSlide[data-stepid="'+form.step+'"] .lfb_richtext[data-itemid]:not(.lfb_shortcode) .lfb_richVariable:not([data-varvariableid])').each((function(){var i=0,_stepID=parseInt($(this).closest(".lfb_genSlide").attr("data-stepid")),targetID=$(this).closest(".lfb_richtext").attr("data-itemid"),itemID=$(this).attr("data-varitemid"),action=$(this).attr("data-action"),value=0,$item,itemStepID=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]')).closest(".lfb_genSlide").attr("data-stepid");if("final"!=itemStepID&&(itemStepID=parseInt(itemStepID)),"price"==action&&(value=0,jQuery.inArray(itemStepID,lastAndCurrentSteps)>-1&&("total"==itemID?value=form.price:($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is(".checked")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is(":checked")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is("select")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is('[data-type="slider"]'))&&(value=parseFloat($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').data("resprice")),isNaN(value)&&(value=0)),value=lfb_formatPrice(parseFloat(value),formID,!0),"left"==form.currencyPosition?value=form.currency+value:value+=form.currency)),"title"!=action&&"label"!=action||(value=jQuery.inArray(itemStepID,lastAndCurrentSteps)>-1&&!$item.is(".lfb_disabled")&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is(".checked")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is(":checked")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is("select")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is('[type="text"]')||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is('[type="number"]')||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is("textarea")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is(".lfb_colorPreview")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is("lfb_layeredImage")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is('[data-type="slider"]')||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is(".lfb_dropzone")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is('[data-type="slider"]'))?$item.attr("data-originallabel"):""),"quantity"==action&&jQuery.inArray(itemStepID,lastAndCurrentSteps)>-1&&($item.is("input")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is(".checked")||$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is(":checked")?(value=$item.is("input")?$item.val():$item.find(".icon_quantity").length>0?parseFloat($item.find(".icon_quantity").html()):$item.find(".lfb_qtfield").val(),isNaN(value)&&(value=0)):$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is('[data-type="slider"]')&&(value=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').slider("value")),value=lfb_formatPrice(parseFloat(value),formID)),"image"==action&&(value=jQuery.inArray(itemStepID,lastAndCurrentSteps)>-1&&!$item.is(".lfb_disabled")&&$item.is(".checked")?'<img src="'+$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"] img').attr("src")+'" alt=""/>':""),"value"==action&&(value=jQuery.inArray(itemStepID,lastAndCurrentSteps)>-1&&!$item.is(".lfb_disabled")?($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').is("select"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+itemID+'"]').val()):""),"date"==action&&(value=jQuery.inArray(itemStepID,lastAndCurrentSteps)>-1&&$item.is(".lfb_datepicker")&&null!=$item.datetimepicker("getDate")?moment.utc($item.datetimepicker("getDate")).format("YYYY-MM-DD"):"null"),"dateDifference"==action){var startDate=itemID,endDate=$(this).attr("data-enddateid");if("currentDate"==startDate)startDate=todayDate;else if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+startDate+'"]').length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+startDate+'"]').val().length>0){var $item;startDate=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+startDate+'"]')).datetimepicker("getDate")}else startDate=todayDate;if("currentDate"==endDate)endDate=today;else if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+endDate+'"]').length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+endDate+'"]').val().length>0){var $item;endDate=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+endDate+'"]')).datetimepicker("getDate")}else endDate=todayDate;var timeDiff=Math.abs(endDate.getTime()-startDate.getTime()),result=Math.ceil(timeDiff/864e5);result<0&&(result=0),value=result}if("distance"==action){var departAdress=$(this).attr("data-departadress"),departCity=$(this).attr("data-departcity"),departZip=$(this).attr("data-departzip"),departCountry=$(this).attr("data-departcountry"),arrivalAdress=$(this).attr("data-arrivaladress"),arrivalCity=$(this).attr("data-arrivalcity"),arrivalZip=$(this).attr("data-arrivalzip"),arrivalCountry=$(this).attr("data-arrivalcountry"),distanceType=$(this).attr("data-distancetype"),$item,$item,$item,$item,$item,$item,$item,$item;if(""!=departAdress)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departAdress+'"]').length>0)departAdress=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departAdress+'"]')).val();else departAdress=0;if(""!=departCity)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCity+'"]').length>0)departCity=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCity+'"]')).val();else departCity=0;if(""!=departZip)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departZip+'"]').length>0)departZip=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departZip+'"]')).val();else departZip=0;if(""!=departCountry)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCountry+'"]').length>0)departCountry=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCountry+'"]')).val();else departCountry=0;if(""!=arrivalAdress)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalAdress+'"]').length>0)arrivalAdress=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalAdress+'"]')).val();else arrivalAdress=0;if(""!=arrivalCity)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCity+'"]').length>0)arrivalCity=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCity+'"]')).val();else arrivalCity=0;if(""!=arrivalZip)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalZip+'"]').length>0)arrivalZip=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalZip+'"]')).val();else arrivalZip=0;if(""!=arrivalCountry)if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCountry+'"]').length>0)arrivalCountry=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCountry+'"]')).val();else arrivalCountry=0;$target.closest(".lfb_genSlide").find(".lfb_distanceError").length>0&&lfb_removeDistanceError(targetID,formID);var distanceCode=content.substr(-1,content.indexOf("]",0)+1- -1),distance=0;if(""!=$target.attr("data-distance")&&(distance=parseFloat($target.attr("data-distance"))),""==departAdress&&""==departCity&&""==departCountry&&""==arrivalAdress&&""==arrivalCity&&""==arrivalCountry&&""==departZip&&""==arrivalZip)lfb_showDistanceError(targetID,formID);else if(""==form.gmap_key)lfb_showDistanceError(targetID,formID),console.log("invalid gmap api key");else{var depart=departAdress+" "+departZip+" "+departCity+" "+departCountry,arrival=arrivalAdress+" "+arrivalZip+" "+arrivalCity+" "+arrivalCountry;$target.attr("data-departure")==depart&&arrival==$target.attr("data-arrival")||($target.attr("data-departure",depart),$target.attr("data-arrival",arrival),lfb_getDistanceCalc(distanceCode,formID,targetID,depart,arrival,distanceType))}value=distance}"total"==action?value=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]  #lfb_finalPrice').html():"total_quantity"==action&&(value=lfb_getTotalQuantities(formID,_stepID,targetID)),$(this).html(value)}))}function lfb_saveForLater(formID){var form=lfb_getForm(formID);if("0"!=form.step)if(null!==localStorage.getItem("lfb_savedFormID")&&parseInt(localStorage.getItem("lfb_savedFormID"))==formID&&null!==localStorage.getItem("lfb_savedForm"))localStorage.removeItem("lfb_savedFormID"),localStorage.removeItem("lfb_formsession"),localStorage.removeItem("lfb_savedForm"),localStorage.removeItem("lfb_savedFormPastSteps"),localStorage.removeItem("lfb_savedFormStep"),localStorage.removeItem("lfb_savedFormTime"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fa,.fas,.fab").attr("class","fas "+$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-originalicon")),""!=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-defaulttext")&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm span:not(.fa):not(.fas):not(.fab)').html($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-defaulttext"));else{var selection=lfb_getFormContent(formID,!0)[2];localStorage.setItem("lfb_savedFormID",formID),localStorage.setItem("lfb_formsession",$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').attr("data-formsession")),localStorage.setItem("lfb_savedForm",JSON.stringify(selection)),localStorage.setItem("lfb_savedFormPastSteps",JSON.stringify(lfb_lastSteps)),localStorage.setItem("lfb_savedFormStep",form.step),localStorage.setItem("lfb_savedFormTime",Date.now());var defaultIconClass="";$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fa,.fab,.fas").length>0&&(defaultIconClass=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fa,.fas,.fab").attr("class"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fa,.fas,.fab").attr("class","fas fa-check")),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').removeClass("btn-default").addClass("btn-primary"),""!=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-defaulttext")&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm span:not(.fa):not(.fas):not(.fab)').html($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-deltext")),setTimeout((function(){$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fas,.fa,.fab").length>0&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fas,.fa,.fab").attr("class","fas fa-redo"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').removeClass("btn-primary").addClass("btn-default")}),1500)}}function lfb_getStoredSelectionItemID(selection,itemID){var rep=!1;return jQuery.each(selection,(function(){this.itemid==itemID&&(rep=this)})),rep}function lfb_loadStoredForm(formID){var form=lfb_getForm(formID),dateS=new Date(parseInt(form.lastS)),dateSave;if($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').length>0)if(null!==localStorage.getItem("lfb_savedFormID")&&parseInt(localStorage.getItem("lfb_savedFormID"))==formID&&null!==localStorage.getItem("lfb_savedForm"))if(new Date(parseInt(localStorage.getItem("lfb_savedFormTime")))>dateS){$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fas,.fa,.fab").attr("class","fas fa-redo"),""!=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-defaulttext")&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm span:not(.fas):not(.fa):not(.fab)').html($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-deltext")),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').attr("data-formsession",localStorage.getItem("lfb_formsession"));var selection=JSON.parse(localStorage.getItem("lfb_savedForm")),pastSteps=JSON.parse(localStorage.getItem("lfb_savedFormPastSteps")),currentStep=localStorage.getItem("lfb_savedFormStep");-1==jQuery.inArray(currentStep,pastSteps)&&pastSteps.push(currentStep),pastSteps.length>0&&(form.autoStart=!0,jQuery.each(pastSteps,(function(){var stepID=this.toString();$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-stepid="'+stepID+'"] [data-itemid]').each((function(){var $item=$(this),storedItem=lfb_getStoredSelectionItemID(selection,parseInt($item.attr("data-itemid")));if($item.is(".lfb_selectable"))0!=storedItem?($item.find(".icon_quantity").length>0?($item.find(".icon_quantity").html(storedItem.quantity),$item.find(".lfb_sliderQt").length>0&&$item.find(".lfb_sliderQt").slider("value",parseInt(storedItem.quantity))):$item.find(".lfb_qtfield").length>0?$item.find(".lfb_qtfield").val(parseInt(storedItem.quantity)):$item.is('[data-type="slider"]')&&$item.slider("value",parseInt(storedItem.quantity)),$item.is(".checked")||lfb_itemClick($(this),!1,formID)):$item.is(".checked")&&lfb_itemClick($(this),!1,formID);else if($item.is(".lfb_button"))0!=storedItem?$item.is(".checked")||lfb_itemClick($(this),!1,formID):$item.is(".checked")&&lfb_itemClick($(this),!1,formID);else if($item.is('[data-toggle="switch"]'))0!=storedItem?$item.is(":checked")||$item.trigger("click"):$item.is(".checked")&&lfb_itemClick($(this),!1,formID);else if($item.is(".lfb_colorPreview"))0!=storedItem&&$item.closest(".lfb_itemBloc").find(".lfb_colorpicker").val(storedItem.value);else if($item.is(".lfb_datepicker"))0!=storedItem&&$item.val(storedItem.value);else if($item.is(".lfb_dropzone")){if(0!=storedItem){var dropzoneField=Dropzone.forElement("#"+$item.attr("id")),fileName=storedItem.value,preloadedFile={name:fileName=(fileName=(fileName=(fileName=fileName.replace('- <span class="lfb_file">',"")).replace(" ","")).replace("</span>","")).replace("<br/>",""),size:12345,accepted:!0,kind:"image"};dropzoneField.emit("addedfile",preloadedFile),dropzoneField.files.push(preloadedFile),dropzoneField.createThumbnailFromUrl(preloadedFile,form.imgPreview,(function(){dropzoneField.emit("complete",preloadedFile)}),"anonymous")}}else $item.is('[data-type="numberfield"]')?0!=storedItem&&($item.is('[data-valueasqt="1"]')?$item.val(storedItem.quantity):$item.val(storedItem.value)):$item.is("select")?0!=storedItem&&$item.val(storedItem.value):$item.is('[data-type="slider"]')?0!=storedItem&&$item.slider("value",parseInt(storedItem.quantity)):$item.is("textarea")?0!=storedItem&&$item.val(storedItem.value):$item.is('input[type="text"]')&&0!=storedItem&&$item.val(storedItem.value)})),stepID!=currentStep?lfb_lastSteps.push(parseInt(stepID)):($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] [data-stepid="'+stepID+'"] .lfb_errorMsg').hide(),"1"==form.intro_enabled?($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]  #startInfos > p').slideDown(),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnFloatingSummary').css({display:"inline-block"}),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').css({display:"inline-block"}),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_btnStart').parent().fadeOut(form.animationsSpeed,(function(){"2"!=form.showSteps&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"]').find(".genPrice,#lfb_stepper").fadeIn(form.animationsSpeed),$(' #lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel').fadeIn(form.animationsSpeed+form.animationsSpeed/2,(function(){lfb_changeStep(currentStep,formID)}))}))):lfb_changeStep(currentStep,formID))}))),setTimeout((function(){$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_genSlide.lfb_activeStep').css("opacity",1)}),2e3)}else localStorage.removeItem("lfb_formsession"),localStorage.removeItem("lfb_savedFormID"),localStorage.removeItem("lfb_savedForm"),localStorage.removeItem("lfb_savedFormPastSteps"),localStorage.removeItem("lfb_savedFormStep"),localStorage.removeItem("lfb_savedFormTime"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fa").attr("class","fa "+$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-originalicon")),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fab").attr("class","fab "+$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-originalicon")),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fas").attr("class","fas "+$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-originalicon")),""!=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-defaulttext")&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm span:not(.fas):not(.fab):not(.fa)').html($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-defaulttext"));else $('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fa").attr("class","fa "+$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-originalicon")),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fab").attr("class","fab "+$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-originalicon")),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').children(".fas").attr("class","fas "+$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-originalicon")),""!=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-defaulttext")&&$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm span:not(.fas):not(.fab):not(.fa)').html($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .lfb_btnSaveForm').attr("data-defaulttext"))}function lfb_getCalendarByID(calendarID){var rep=!1;return jQuery.each(lfb_calendars,(function(){this.id==calendarID&&(rep=this)})),rep}function lfb_getDisabledHours(calendarID,day,eventDuration,eventDurationType){var disabledHours=new Array,calendar=lfb_getCalendarByID(calendarID);if(0!=calendar){var enabledMins=$('#lfb_form .lfb_datepicker[data-calendarid="'+calendar.id+'"]').is('[data-disableminutes="0"]'),maxEvents=parseInt($('#lfb_form .lfb_datepicker[data-calendarid="'+calendar.id+'"]').attr("data-maxevents"));(isNaN(maxEvents)||0==maxEvents)&&(maxEvents=1);var durationToSub=eventDurationType;"mins"==eventDurationType&&(durationToSub="minutes");var selDate=new Date(day),daysWeek=new Array;if($('#lfb_form .lfb_datepicker[data-calendarid="'+calendar.id+'"]').attr("data-daysweek").indexOf(",")>-1&&(daysWeek=$('#lfb_form .lfb_datepicker[data-calendarid="'+calendar.id+'"]').attr("data-daysweek").split(",")),""!=selDate.getDay()&&($('#lfb_form .lfb_datepicker[data-calendarid="'+calendar.id+'"]').attr("data-daysweek")==selDate.getDay()||daysWeek.indexOf(selDate.getDay())>-1))for(var i=0;i<24;i++)disabledHours.push(parseInt(i));else{if(""!=$('#lfb_form .lfb_datepicker[data-calendarid="'+calendar.id+'"][data-hoursdisabled]').attr("data-hoursdisabled")){var hoursDisabledData=$('#lfb_form .lfb_datepicker[data-calendarid="'+calendar.id+'"]').attr("data-hoursdisabled");hoursDisabledData.indexOf(",")>-1?jQuery.each(hoursDisabledData.split(","),(function(){var hour=parseInt(this);if(disabledHours.push(hour),"hours"==eventDurationType)for(var i=0;i<parseInt(eventDuration);i++)-1==jQuery.inArray(hour-i,disabledHours)&&disabledHours.push(hour-i);else if("mins"==eventDurationType)for(var i=0;i<=Math.floor(eventDuration/60);i++)-1==jQuery.inArray(hour-i,disabledHours)&&disabledHours.push(hour-i)})):disabledHours.push(parseInt(hoursDisabledData))}for(var nbEventsHours=[],i=0;i<24;i++)nbEventsHours[i]=0;jQuery.each(calendar.events,(function(){var startDate=moment(this.startDate);startDate=(startDate=startDate.subtract(parseInt(eventDuration),durationToSub)).add(5,"minute");for(var i=0;i<24;i++){var formatedI=i;i<10&&(formatedI="0"+i);var currentDate=moment(day+" "+formatedI+":00");(!enabledMins&&currentDate.isSameOrAfter(startDate,"hour")||enabledMins&&currentDate.isAfter(startDate,"hour"))&&currentDate.isBefore(moment(this.endDate),"hour")&&(nbEventsHours[i]++,nbEventsHours[i]>=maxEvents&&-1==jQuery.inArray(i,disabledHours)&&disabledHours.push(parseInt(i)))}}))}}return disabledHours}function lfb_getDisabledMinutes(calendarID,day,hour,eventDuration,eventDurationType){var disabledMinutes=new Array,calendar=lfb_getCalendarByID(calendarID);if(0!=calendar){var maxEvents=parseInt($('#lfb_form .lfb_datepicker[data-calendarid="'+calendar.id+'"]').attr("data-maxevents"));(isNaN(maxEvents)||0==maxEvents)&&(maxEvents=1);var disabledHours=lfb_getDisabledHours(calendarID,day,eventDuration,eventDurationType),durationToSub=eventDurationType;"mins"==eventDurationType&&(durationToSub="minutes");var hoursDisabledData=$('#lfb_form .lfb_datepicker[data-calendarid="'+calendar.id+'"]').attr("data-hoursdisabled");if(hoursDisabledData.indexOf(",")>-1&&jQuery.each(hoursDisabledData.split(","),(function(){for(var hourD=parseInt(this),maxTime=moment(new Date(day+" "+hourD+":00")).subtract(parseInt(eventDuration),durationToSub).add(1,"minute").format("YYYY-MM-DD HH:mm"),i=0;i<=11;i++)moment(new Date(day+" "+hour+":"+5*i)).isAfter(moment(new Date(maxTime)))&&moment(new Date(day+" "+hour+":"+5*i)).isBefore(moment(new Date(moment(new Date(day+" "+hourD+":00")))))&&-1==jQuery.inArray(5*i,disabledMinutes)&&disabledMinutes.push(parseInt(5*i))})),jQuery.inArray(parseInt(hour),disabledHours)>-1)for(var i=0;i<=11;i++)-1==jQuery.inArray(5*i,disabledMinutes)&&disabledMinutes.push(parseInt(5*i));for(var nbEventsMins=[],i=0;i<=11;i++)nbEventsMins[parseInt(5*i)]=0;jQuery.each(calendar.events,(function(){var startDate=moment(this.startDate);startDate=(startDate=startDate.subtract(parseInt(eventDuration),durationToSub)).add(5,"minute");var formatedHour=parseInt(hour);formatedHour<10&&(formatedHour="0"+formatedHour);var currentDate=moment(day+" "+formatedHour+":00");if(currentDate.isAfter(startDate,"hour")&&currentDate.isBefore(moment(this.endDate),"hour"))for(var i=0;i<=11;i++)nbEventsMins[parseInt(5*i)]++,nbEventsMins[parseInt(5*i)]>=maxEvents&&-1==jQuery.inArray(5*i,disabledMinutes)&&disabledMinutes.push(parseInt(5*i));else if(currentDate.isSame(startDate,"hour"))for(var i=0;i<=11;i++)startDate.isSame(moment(this.endDate),"hour")?5*i>=startDate.format("mm")&&5*i<moment(this.endDate).format("mm")&&(nbEventsMins[parseInt(5*i)]++,nbEventsMins[parseInt(5*i)]>=maxEvents&&-1==jQuery.inArray(5*i,disabledMinutes)&&disabledMinutes.push(parseInt(5*i))):5*i>=startDate.format("mm")&&(nbEventsMins[parseInt(5*i)]++,nbEventsMins[parseInt(5*i)]>=maxEvents&&-1==jQuery.inArray(5*i,disabledMinutes)&&disabledMinutes.push(parseInt(5*i)));else if(currentDate.isSame(moment(this.endDate),"hour"))for(var i=0;i<=11;i++)5*i<moment(this.endDate).format("mm")&&(nbEventsMins[parseInt(5*i)]++,nbEventsMins[parseInt(5*i)]>=maxEvents&&-1==jQuery.inArray(5*i,disabledMinutes)&&disabledMinutes.push(parseInt(5*i)))}))}return disabledMinutes}function lfb_setAnimImmediate(e,formID){var form;lfb_getForm(formID).animationsSpeed=0}function lfb_getCalendarEventsAtDate(calendar,date){var rep=0;return jQuery.each(calendar.events,(function(){var startDate=moment.utc(this.startDate),endDate=moment.utc(this.endDate);date.isSameOrAfter(startDate)&&(this.fullDay||date.isSameOrBefore(endDate))&&rep++})),rep}function lfb_getBusyDates(formID,calendarsIDs){var form=lfb_getForm(formID);jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_getBusyDates",formID:formID,calendarsIDs:calendarsIDs},success:function(rep){rep=rep.trim(),rep=JSON.parse(rep,!0),lfb_calendars=rep.calendars,jQuery.each(rep.calendars,(function(){var _calendar=this;$('#lfb_form .lfb_datepicker[data-calendarid="'+this.id+'"]').each((function(){var _datepicker=$(this),disabledDates=new Array;jQuery.each(_calendar.events,(function(){if(1==this.fullDay){var startDate=moment.utc(this.startDate),endDate;(endDate=moment.utc(this.endDate)).subtract(1,"minutes");var startDateSt=startDate.format("YYYY-MM-DD");lfb_getCalendarEventsAtDate(_calendar,startDate)>=_datepicker.attr("data-maxevents")&&disabledDates.push(startDateSt);for(var i=1;i<=endDate.diff(startDate,"days");i++){var date=startDate.add(i,"days");lfb_getCalendarEventsAtDate(_calendar,date)>=_datepicker.attr("data-maxevents")&&disabledDates.push(date.format("YYYY-MM-DD"))}}else{var startDate=moment.utc(this.startDate),durationToSub=_datepicker.attr("data-eventdurationtype");"mins"==_datepicker.attr("data-eventdurationtype")&&(durationToSub="minutes"),this.startDate=startDate.format("YYYY-MM-DD HH:mm");var endDate=moment.utc(this.endDate),startDateSt=startDate.format("YYYY-MM-DD");if(endDate.diff(startDate,"hours")>24){var startI=1;0==startDate.format("m")&&(startI=0);for(var i=startI;i<=endDate.diff(startDate,"days");i++){var date=startDate.clone().add(i,"days");lfb_getCalendarEventsAtDate(_calendar,date)>=_datepicker.attr("data-maxevents")&&disabledDates.push(date.format("YYYY-MM-DD"))}}}})),_datepicker.datetimepicker("setDatesDisabled",disabledDates)}))}))}})}function lfb_showWinStripePayment(form){var isOK=lfb_checkStepItemsValid("final",form.formID);1==form.legalNoticeEnable&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_legalCheckbox').is(":checked")||($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_legalCheckbox').closest(".form-group").addClass("has-error"),isOK=!1)),isOK&&lfb_checkCaptcha(form,(function(){var activatePaypal=!0;if($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-activatePaypal="true"]:not(:checked):not(.checked)').each((function(){var cStepID=$(this).closest(".lfb_genSlide").attr("data-stepid");"final"!=cStepID&&(cStepID=parseInt(cStepID)),-1==jQuery.inArray(cStepID,lfb_lastSteps)||(activatePaypal=!1)})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('[data-dontactivatepaypal="true"].checked,[data-dontactivatepaypal="true"]:checked').length>0&&(activatePaypal=!1),!activatePaypal||0==form.price&&0==form.priceSingle)lfb_order(form.formID);else{$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-info="amount"]').html($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_finalPrice').html()),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal [data-panel]").hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-panel="loading"]').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal .modal-footer").hide(),lfb_stripe=Stripe(form.stripePubKey);var singleTotal=parseFloat(form.price),subTotal=0;if($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-isSubs="true"]')&&(singleTotal=parseFloat(form.priceSingle),subTotal=parseFloat(form.price)),"percent"==form.payMode){var amountToShow="<span>"+lfb_formatPriceWithCurrency(singleTotal=parseFloat(singleTotal)*(parseFloat(form.percentToPay)/100),form.formID)+"</span>";$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-info="amount"]').html(amountToShow)}else if("fixed"==form.payMode){var amountToShow="<span>"+lfb_formatPriceWithCurrency(singleTotal=parseFloat(form.fixedToPay),form.formID)+"</span>";$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-info="amount"]').html(amountToShow)}if(""==form.stripeToken||void 0!==form.stripeAmountSingle&&form.stripeAmountSingle!=singleTotal||void 0!==form.stripeAmountSingle&&form.stripeAmountSub!=subTotal)jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_getStripePaymentIntent",singleTotal:singleTotal,subTotal:subTotal,formID:form.formID,customerInfos:lfb_getContactInformations(form.formID,!0)},success:function(rep){rep=JSON.parse(rep),form.stripeToken=rep.token,form.stripeCustomerID=rep.customerID,form.stripeAmountSingle=singleTotal,form.stripeAmountSub=subTotal;var elements=lfb_stripe.elements();form.cardElement=elements.create("cardNumber"),form.cardElement.mount('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-element'),form.cardExp=elements.create("cardExpiry"),form.cardExp.mount('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_expiration-element'),form.cardExp.addEventListener("change",(function(event){event.error?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html(event.error.message):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html("")})),form.cardCvc=elements.create("cardCvc"),form.cardCvc.mount('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_cvc-element'),form.cardCvc.addEventListener("change",(function(event){event.error?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html(event.error.message):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html("")})),form.cardElement.addEventListener("change",(function(event){event.error?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html(event.error.message):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html("")})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal [data-panel]").hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-panel="form"]').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal .modal-footer").slideDown()}});else{var elements=lfb_stripe.elements();form.cardElement=elements.create("cardNumber"),form.cardElement.mount('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-element'),form.cardElement.addEventListener("change",(function(event){event.error?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html(event.error.message):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html("")})),form.cardExp=elements.create("cardExpiry"),form.cardExp.mount('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_expiration-element'),form.cardExp.addEventListener("change",(function(event){event.error?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html(event.error.message):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html("")})),form.cardCvc=elements.create("cardCvc"),form.cardCvc.mount('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_cvc-element'),form.cardCvc.addEventListener("change",(function(event){event.error?$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html(event.error.message):$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripe_card-error').html("")}));var singleTotal=parseFloat(form.price),subTotal=0;if($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').is('[data-isSubs="true"]')&&(singleTotal=parseFloat(form.priceSingle),subTotal=parseFloat(form.price)),"percent"==form.payMode){var amountToShow="<span>"+lfb_formatPriceWithCurrency(singleTotal=parseFloat(singleTotal)*(parseFloat(form.percentToPay)/100),form.formID)+"</span>";$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-info="amount"]').html(amountToShow)}else if("fixed"==form.payMode){var amountToShow="<span>"+lfb_formatPriceWithCurrency(singleTotal=parseFloat(form.fixedToPay),form.formID)+"</span>";$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-info="amount"]').html(amountToShow)}$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal [data-panel]").hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-panel="form"]').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal .modal-footer").slideDown()}$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeModal a[data-action="pay"]').unbind("click"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeModal a[data-action="pay"]').on("click",(function(){var error=!1;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeModal .has-error').removeClass("has-error"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeModal [name="ownerName"]').val().length<3&&($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeModal [name="ownerName"]').closest(".form-group").addClass("has-error"),error=!0),error||($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal [data-panel]").hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-panel="loading"]').show(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal .modal-footer").hide(),lfb_stripe.createSource(form.cardElement).then((function(result){result.error?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-info="error"]').html(result.error.message),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal [data-panel]").hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-panel="fail"]').show()):(form.stripeSrc=result.source.id,subTotal>0?jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_processStripeSubscription",formID:form.formID,stripeSrc:form.stripeSrc,customerID:form.stripeCustomerID,singleTotal:singleTotal,subTotal:subTotal},success:function(rep){1==(rep=rep.trim())?singleTotal>0?lfb_stripe.handleCardPayment(form.stripeToken,form.cardElement,{payment_method_data:{billing_details:{name:$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeModal [name="ownerName"]').val()}}}).then((function(result){result.error?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-info="error"]').html(result.error),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal [data-panel]").hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-panel="fail"]').show()):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal").modal("hide"),form.stripePaid=!0,lfb_order(form.formID))})):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal").modal("hide"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal").modal("hide"),form.stripePaid=!0,lfb_order(form.formID)):rep.indexOf("pi_")>-1&&lfb_stripe.handleCardPayment(rep,form.cardElement,{payment_method_data:{billing_details:{name:$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeModal [name="ownerName"]').val()}}}).then((function(result){result.error?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-info="error"]').html(result.error),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal [data-panel]").hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-panel="fail"]').show()):singleTotal>0?lfb_stripe.handleCardPayment(form.stripeToken,form.cardElement,{payment_method_data:{billing_details:{name:$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeModal [name="ownerName"]').val()}}}).then((function(result){result.error?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-info="error"]').html(result.error),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal [data-panel]").hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-panel="fail"]').show()):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal").modal("hide"),form.stripePaid=!0,lfb_order(form.formID))})):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal").modal("hide"),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal").modal("hide"),form.stripePaid=!0,lfb_order(form.formID))}))}}):lfb_stripe.handleCardPayment(form.stripeToken,form.cardElement,{payment_method_data:{billing_details:{name:$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_stripeModal [name="ownerName"]').val()}}}).then((function(result){result.error?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] [data-info="error"]').html(result.error),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal [data-panel]").hide(),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find('#lfb_stripeModal [data-panel="fail"]').show()):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal").modal("hide"),form.stripePaid=!0,lfb_order(form.formID))})))})))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"]').find("#lfb_stripeModal").modal("show")}}))}function lfb_checkCaptcha(form,callback){1==form.useCaptcha&&""!=form.recaptcha3Key?grecaptcha.ready((function(){grecaptcha.execute(form.recaptcha3Key,{action:"sending_form"}).then((function(token){form.captcha=token,callback(form)})).catch((function(error){console.log("Erreur lors de l'exécution de reCAPTCHA: ",error),callback(form)}))})):callback(form)}function lfb_updateVariable(form,variableID,calculation,targetID){for(var i=0;i<form.variables.length;i++)if(form.variables[i].id==variableID){var variable=form.variables[i];variable.value=lfb_executeCalculation(calculation,form.formID,targetID),"integer"==variable.type?variable.value=Math.round(variable.value):"float"==variable.type&&(variable.value=variable.value);break}}function lfb_getVariableByID(form,variableID){for(var rep=!1,i=0;i<form.variables.length;i++)if(form.variables[i].id==variableID){rep=form.variables[i];break}return rep}function lfb_initVerificationCodeModal(form){const formID=form.formID;$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_verification-char').on("input",(function(){1==$(this).val().length&&($(this).next().length>0?$(this).next().focus():lfb_checkVerificationCode(form))})),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] .lfb_verification-char').on("keydown",(function(e){8==e.which&&$(this).prev().focus()})),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_verificationModal .lfb_verification-code-inputs .lfb_verification-char').first().on("paste",(function(e){e.preventDefault();for(var pastedText=(e.originalEvent.clipboardData||window.clipboardData).getData("text"),verificationInputs=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_verificationModal .lfb_verification-code-inputs .lfb_verification-char'),i=0;i<Math.min(pastedText.length,verificationInputs.length);i++)$(verificationInputs[i]).val(pastedText[i]);pastedText.length>0&&$(verificationInputs[Math.min(pastedText.length,verificationInputs.length)-1]).focus(),lfb_checkVerificationCode(form)}))}function lfb_checkVerificationCode(form){var verificationCode="";$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_verificationModal .lfb_verification-code-inputs .lfb_verification-char').each((function(){verificationCode+=$(this).val()})),$.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_checkVerificationCode",formID:form.formID,code:verificationCode,email:form.emailProposed},success:function(rep){(rep=JSON.parse(rep)).success?($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_verificationModal').modal("hide"),form.verifiedEmail=form.emailProposed,lfb_nextStep(form.formID)):($('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_verificationModal .lfb_verification-code-inputs .lfb_verification-char').val(""),$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_verificationModal .lfb_verification-code-inputs .lfb_verification-char').first().focus())}})}function lfb_checkUserEmail(form){var rep=!0,formID=form.formID;if(1==form.verifyEmail&&void 0===form.stripePaid&&(void 0===form.verifiedEmail||!form.verifiedEmail)&&$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"] [data-fieldtype="email"][data-required="true"]').length>0){rep=!1;var emailField,targetEmail=$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_mainPanel .lfb_genSlide[data-stepid="'+form.step+'"] [data-fieldtype="email"][data-required="true"]').last().val();form.emailProposed=targetEmail,$.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_sendVerificationCode",formID:formID,email:targetEmail},success:function(rep){rep=JSON.parse(rep),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_verificationModal').modal("show"),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_verificationModal .lfb_verification-code-inputs .lfb_verification-char').val(""),$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_verificationModal .lfb_verification-code-inputs .lfb_verification-char').first().focus(),rep.success||alert(rep.message)}})}return rep}function lfb_decodeCalculation(value){var chars=new Array;chars[0]=9,chars[1]=3,chars[2]=5,chars[3]=8,chars[4]=2,chars[5]=6,chars[6]=4,chars[7]=1,chars[8]=0,chars[9]=7;for(var result="",i=0;i<value.length;i++)chars.indexOf(parseInt(value[i]))>-1?result+=chars[parseInt(value[i])]:result+=value[i];return result}function lfb_downloadAsPDF(formID){var form=lfb_getForm(formID),$summaryClone=lfb_cloneSummary(!1,formID),summaryData=$summaryClone.html();$summaryClone.remove();var contentForm=lfb_getFormContent(formID),content=contentForm[0];content=content.replace(/<br\/>/g,"[n]");var totalTxt=contentForm[1],items=contentForm[2],infosCt=lfb_getContactInformations(formID);email=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] .emailField').val(),lfb_checkEmail(infosCt.email)&&(email=infosCt.email);var informations="";$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #finalSlide').find('.lfb_item input:not([type="checkbox"])[data-itemid],.lfb_item textarea[data-itemid],.lfb_item select[data-itemid]').each((function(){if(0==$(this).closest("#lfb_paypalForm").length)if($(this).is(".lfb_disabled"));else if($(this).is("#lfb_couponField"));else if($(this).is("#lfb_captchaField"));else{var dbpoints=":";$(this).closest(".lfb_item").find("label").html().lastIndexOf(":")==$(this).closest(".lfb_item").find("label").html().length-1&&(dbpoints=""),$("body").is(".rtl")?informations+='<p><b><span class="lfb_value">'+$(this).val()+"</span></b>"+dbpoints+" "+$(this).closest(".lfb_item").find("label").html()+"</p>":informations+="<p>"+$(this).closest(".lfb_item").find("label").html()+" "+dbpoints+' <b><span class="lfb_value">'+$(this).val()+"</span></b></p>"}})),jQuery.ajax({url:form.ajaxurl,type:"post",data:{action:"lfb_downloadOrderPDF",formID:form.formID,informations:informations,email:email,customerInfos:lfb_getContactInformations(form.formID,!0),summary:summaryData,totalTxt:totalTxt,formSession:$('#lfb_form.lfb_bootstraped[data-form="'+form.formID+'"] #lfb_formSession').val(),items:items,useRtl:$("body").is(".rtl"),variables:JSON.stringify(form.variables)},success:function(rep){var win=window.open(form.homeUrl+"/index.php?EPFormsBuilder=downloadMyOrder","_blank");"null"!=typeof win&&null!=win&&(win.focus(),setTimeout((function(){win.close()}),300))}})}function lfb_updateVAT(formID){var form=lfb_getForm(formID);form.vatPrice=0,1==form.useVAT&&(form.singlePrice>0?(form.vatPrice=form.singlePrice*form.vatAmount/100,form.singlePrice=form.singlePrice+form.vatPrice):(form.vatPrice=form.price*form.vatAmount/100,form.price=form.price+form.vatPrice))}function lfb_updateGmapItinerary($mapItem,formID){var itinerary=$mapItem.attr("data-itinerary"),directionRenderer=$mapItem.data("directionRenderer"),map=$mapItem.data("gmap"),init=!1;$mapItem.is(".lfb_gmapInit")||(init=!0,$mapItem.addClass("lfb_gmapInit"));var i=1,departAdPosEnd=itinerary.indexOf("-",10)+1,departAdress=itinerary.substr(10,itinerary.indexOf("-",1)-10),departCityPosEnd=itinerary.indexOf("-",departAdPosEnd)+1,departCity=itinerary.substr(departAdPosEnd,itinerary.indexOf("-",departAdPosEnd)-departAdPosEnd),departZipPosEnd=itinerary.indexOf("-",departCityPosEnd)+1,departZip=itinerary.substr(departCityPosEnd,itinerary.indexOf("-",departCityPosEnd)-departCityPosEnd),departCountryPosEnd=itinerary.indexOf("_",departZipPosEnd)+1,departCountry=itinerary.substr(departZipPosEnd,itinerary.indexOf("_",departZipPosEnd)-departZipPosEnd),arrivalAdPosEnd=itinerary.indexOf("-",departCountryPosEnd)+1,arrivalAdress=itinerary.substr(departCountryPosEnd,itinerary.indexOf("-",departCountryPosEnd)-departCountryPosEnd),arrivalCityPosEnd=itinerary.indexOf("-",arrivalAdPosEnd)+1,arrivalCity=itinerary.substr(arrivalAdPosEnd,itinerary.indexOf("-",arrivalAdPosEnd)-arrivalAdPosEnd),arrivalZipPosEnd=itinerary.indexOf("-",arrivalCityPosEnd)+1,arrivalZip=itinerary.substr(arrivalCityPosEnd,itinerary.indexOf("-",arrivalCityPosEnd)-arrivalCityPosEnd),arrivalCountryPosEnd=itinerary.indexOf("_",arrivalZipPosEnd)+1,arrivalCountry=itinerary.substr(arrivalZipPosEnd,itinerary.indexOf("_",arrivalZipPosEnd)-arrivalZipPosEnd),$item,$item,$item,$item,$item,$item,$item,$item;""!=departAdress&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departAdress+'"]').length>0?(departAdress=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departAdress+'"]')).val(),init&&$item.on("focusout change",(function(){lfb_updateGmapItinerary($mapItem,formID)}))):departAdress=0);""!=departCity&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCity+'"]').length>0?(departCity=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCity+'"]')).val(),init&&$item.on("focusout change",(function(){lfb_updateGmapItinerary($mapItem,formID)}))):departCity=0);""!=departZip&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departZip+'"]').length>0?(departZip=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departZip+'"]')).val(),init&&$item.on("focusout change",(function(){lfb_updateGmapItinerary($mapItem,formID)}))):departZip=0);""!=departCountry&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCountry+'"]').length>0?(departCountry=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+departCountry+'"]')).val(),init&&$item.on("focusout change",(function(){lfb_updateGmapItinerary($mapItem,formID)}))):departCountry=0);""!=arrivalAdress&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalAdress+'"]').length>0?(arrivalAdress=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalAdress+'"]')).val(),init&&$item.on("focusout change",(function(){lfb_updateGmapItinerary($mapItem,formID)}))):arrivalAdress=0);""!=arrivalCity&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCity+'"]').length>0?(arrivalCity=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCity+'"]')).val(),init&&$item.on("focusout change",(function(){lfb_updateGmapItinerary($mapItem,formID)}))):arrivalCity=0);""!=arrivalZip&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalZip+'"]').length>0?(arrivalZip=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalZip+'"]')).val(),init&&$item.on("focusout change",(function(){lfb_updateGmapItinerary($mapItem,formID)}))):arrivalZip=0);""!=arrivalCountry&&($('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCountry+'"]').length>0?(arrivalCountry=($item=$('#lfb_form.lfb_bootstraped[data-form="'+formID+'"] #lfb_mainPanel .lfb_genSlide [data-itemid="'+arrivalCountry+'"]')).val(),init&&$item.on("focusout change",(function(){lfb_updateGmapItinerary($mapItem,formID)}))):arrivalCountry=0);var depart=departAdress+" "+departZip+" "+departCity+" "+departCountry,arrival=arrivalAdress+" "+arrivalZip+" "+arrivalCity+" "+arrivalCountry;depart.replaceAll(" ","").length>2&&arrival.replaceAll(" ","").length>2&&(new google.maps.DirectionsService).route({origin:{query:depart},destination:{query:arrival},travelMode:google.maps.TravelMode.DRIVING},(response,status)=>{"OK"===status&&directionRenderer.setDirections(response)})}function lfb_getMapStyle(mapStyle){for(var rep=lfb_mapStyles[0],i=0;i<lfb_mapStyles.length;i++)if(lfb_mapStyles[i].name==mapStyle){rep=lfb_mapStyles[i].styles;break}return rep}function lfb_getScrollTopMargin(form){return $(window).width()<=480?form.scrollTopMarginMobile:form.scrollTopMargin}lfb_initMapStyles(),$(document).ready((function(){initComboBox(),lfb_initDocReady(),$("body").on("lfb_initDocReady",(function(e){lfb_initDocReady()})),$("body").on("lfb_initWinReady",(function(e){lfb_initWinReady()})),$("body").on("lfb_resize",(function(e){lfb_onResize()})),$("#lfb_signature").length>0&&(document.addEventListener("touchstart",touchHandler,!0),document.addEventListener("touchmove",touchHandler,!0),document.addEventListener("touchend",touchHandler,!0),document.addEventListener("touchcancel",touchHandler,!0))})),$(window).on("load",(function(){lfb_initWinReady()}))}(jQuery);
// source --> https://www.signal-wrapping.com/wp-content/plugins/WP_Estimation_Form/assets/js/lfb_frontend.min.js?ver=10.24 
(function(k){function g(){var a=0,c=jQuery(this).attr("class");c=c.split(" ");var d="";jQuery.each(c,function(b){b=c[b];-1<b.indexOf("form-")&&(a=b.substr(b.indexOf("form-")+5,b.length));-1<b.indexOf("step-")&&(d=b.substr(b.indexOf("step-")+5,b.length))});e=jQuery("body").css("overflow-y");f=jQuery("html").css("overflow-y");jQuery("body,html").css("overflow-y","hidden");""!=d&&(jQuery('#lfb_form[data-form="'+a+'"] .lfb_genSlide').attr("data-start",0),jQuery('#lfb_form[data-form="'+a+'"] .lfb_genSlide[data-stepid="'+
d+'"]').attr("data-start",1),jQuery('#lfb_form[data-form="'+a+'"]').trigger("lfb_changeStep",d,a));jQuery('#lfb_form[data-form="'+a+'"]').show().animate({left:0,top:0,width:"100%",height:"100%",opacity:1},500,function(){jQuery('#lfb_form[data-form="'+a+'"] #lfb_close_btn').delay(500).fadeIn(500);jQuery('#lfb_form[data-form="'+a+'"] #lfb_close_btn').click(function(){h(a)});jQuery('#lfb_form[data-form="'+a+'"] #lfb_mainPanel').show();setTimeout(function(){jQuery("body").trigger("lfb_resize")},250)})}
function h(a){jQuery('#lfb_form[data-form="'+a+'"]').animate({top:"50%",left:"50%",width:"0px",height:"0px",opacity:0},500,function(){jQuery("body").css("overflow-y",e);jQuery("html").css("overflow-y",f);location.reload()})}jQuery(window).on("load",function(){jQuery(".open-estimation-form").click(g)});var e="auto",f="auto"})(jQuery);