function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _createForOfIteratorHelper(e,o){var t,n,i,r,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return i=!(n=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return n=e.done,e},e:function(e){i=!0,t=e},f:function(){try{n||null==a.return||a.return()}finally{if(i)throw t}}};if(Array.isArray(e)||(a=_unsupportedIterableToArray(e))||o&&e&&"number"==typeof e.length)return a&&(e=a),r=0,{s:o=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,o){var t;if(e)return"string"==typeof e?_arrayLikeToArray(e,o):"Map"===(t="Object"===(t={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:t)||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,o):void 0}function _arrayLikeToArray(e,o){(null==o||o>e.length)&&(o=e.length);for(var t=0,n=Array(o);t{window.bhfb={init:function(){this.builderGridContentFlag=!1,this.updateGridDelay=200,this.currentDevice="desktop",this.currentArea="header",this.currentRowInput="",this.currentRow="",this.currentColumn="",this.currentColumnPos="",this.currentComponent="",this.currentBuilder="",this.currentBuilderType="",this.componentsOrder="",this.addBodyClass(),this.preventEmptyRowValues(),this.customizeNavigation(),this.elementsPopup(),this.elementsButton(),this.storeGlobals(),this.devicesSwitcher(),this.elementsPopupContent(),this.builderGridContent(),this.elementsSortable(),this.builderCustomColumns(),this.builderColumnsLayout(),this.footerCustomizerOptions(),this.headerPresets(),this.extraNavigation(),this.showHideBuilder(),this.showHideBuilderTop()},jsonDecode:function(e){return JSON.parse(e.replace(/'/g,'"').replace(";",""))},addBodyClass:function(){O("body").addClass("has-bhfb-builder")},preventEmptyRowValues:function(){for(var e=["above","main","below"],o=0,t=["header","footer"];o{var o=s.value;e=e.filter(function(e){return!o.includes(e.id)})})()}catch(e){c.e(e)}finally{c.f()}}}}catch(e){a.e(e)}finally{a.f()}var l=_createForOfIteratorHelper(t);try{for(l.s();!l.n().done;){var b=this.jsonDecode(O(r).val());if(b.mobile.length){var u,d=_createForOfIteratorHelper(b.mobile);try{for(d.s();!(u=d.n()).done;)(()=>{var o=u.value;t=t.filter(function(e){return!o.includes(e.id)})})()}catch(e){d.e(e)}finally{d.f()}}if(-1!==r.indexOf("row__mobile_offcanvas")&&b.mobile_offcanvas.length){var h,m=_createForOfIteratorHelper(b.mobile_offcanvas);try{for(m.s();!(h=m.n()).done;)(()=>{var o=h.value;t=t.filter(function(e){return!o.includes(e.id)})})()}catch(e){m.e(e)}finally{m.f()}}}}catch(e){l.e(e)}finally{l.f()}}return{desktop:e,mobile:t}},elementsPopup:function(){var i=this;O(document).on("click",".botiga-bhfb-area:not(.bhfb-available-components)",function(e){var o=i.currentBuilder.find("#botiga-bhfb-elements"),t=O(this)[0].getBoundingClientRect(),n=O(this).data("bhfb-row");setTimeout(function(){if(o.css("top",0),o.css("left",t.left),o.css("top",t.top-(o.height()+50)),i.isElementInViewport(o)?(o.css("left",t.left),o.css("right","auto")):(o.css("left","auto"),o.css("right",25)),e.target.classList.contains("bhfb-remove-element")||e.target.classList.contains("bhfb-button"))return!1;o.addClass("show")},200),i.elementsPopupContent(n),i.builderGridContent()}),O("#customize-preview iframe").on("mouseup",function(e){i.currentBuilder&&i.closeElementsPopup(e)}),O(document).on("mouseup",function(e){i.currentBuilder&&i.closeElementsPopup(e)})},closeElementsPopup:function(e){var o=this.currentBuilder.find("#botiga-bhfb-elements");null===e.target.closest("#botiga-bhfb-elements")&&o.removeClass("show")},isElementInViewport:function(e){e=(e="function"==typeof jQuery&&e instanceof jQuery?e[0]:e).getBoundingClientRect();return 0<=e.top&&0<=e.left&&e.bottom<=(window.innerHeight||O(window).height())&&e.right<=(window.innerWidth||O(window).width())},elementsPopupContent:function(){var e=0'+_.label+"")}}catch(e){a.e(e)}finally{a.f()}}else t.append('

'+botiga_hfb.i18n.elementsMessage+"

");if(o.mobile="mobile_offcanvas"!==e?o.mobile.filter(function(e){return"mobile_offcanvas_menu"!==e.id}):o.mobile.filter(function(e){return"secondary_menu"!==e.id&&"mobile_hamburger"!==e.id}),o.mobile.length){var s,c=_createForOfIteratorHelper(o.mobile);try{for(c.s();!(s=c.n()).done;){var l=s.value;n.append('")}}catch(e){c.e(e)}finally{c.f()}}else n.append('

'+botiga_hfb.i18n.elementsMessage+"

");this.addUpsellComponents()},updateAvailableComponents:function(){if("header"===this.currentBuilderType){var e=this.getElementsUnused(),o="";if(e.desktop.length){var t,n=_createForOfIteratorHelper(e.desktop);try{for(n.s();!(t=n.n()).done;){var i=t.value;o+='"}}catch(e){n.e(e)}finally{n.f()}}else o='

'+botiga_hfb.i18n.elementsMessage+"

";O(".botiga-header-builder-available-components").html(o);var r="";if(e.mobile.length){var a,_=_createForOfIteratorHelper(e.mobile);try{for(_.s();!(a=_.n()).done;){var s=a.value;r+='"}}catch(e){_.e(e)}finally{_.f()}}else r='

'+botiga_hfb.i18n.elementsMessage+"

";O(".botiga-header-builder-available-mobile-components").html(r)}if("footer"===this.currentBuilderType){var e=this.getElementsUnused(),c="";if(e.desktop.length){var l,b=_createForOfIteratorHelper(e.desktop);try{for(b.s();!(l=b.n()).done;){var u=l.value;c+='"}}catch(e){b.e(e)}finally{b.f()}}else c='

'+botiga_hfb.i18n.elementsMessage+"

";O(".botiga-footer-builder-available-footer-components").html(c)}},addUpsellComponents:function(){if(!botiga_hfb.upsell_components.enable)return!1;var e,o="",t=_createForOfIteratorHelper("header"===this.currentBuilderType?botiga_hfb.upsell_components.header:botiga_hfb.upsell_components.footer);try{for(t.s();!(e=t.n()).done;)o+='\n \n ")}catch(e){t.e(e)}finally{t.f()}var n='\n
\n

'.concat(botiga_hfb.upsell_components.title,'

\n
').concat(o,"
\n

").concat(botiga_hfb.upsell_components.total,'

\n ').concat(botiga_hfb.upsell_components.button,"\n
\n ");O("#botiga-bhfb-elements .botiga-bhfb-elements-wrapper .botiga-bhfb-upsell-components-wrapper").remove(),O("#botiga-bhfb-elements .botiga-bhfb-elements-wrapper").append(n)},elementsButton:function(){var n=this;O(document).on("click",".botiga-bhfb-element > a",function(e){e.preventDefault(),e.stopPropagation();var o=O(this).data("bhfb-id"),t=O(this).data("bhfb-focus-section");if(O(this).closest("#botiga-bhfb-elements").length)n.elementsButtonAdd(o),n.currentBuilder.find("#botiga-bhfb-elements").removeClass("show");else if(e.target.classList.contains("bhfb-remove-element"))return n.elementsButtonRemove(o),!1;setTimeout(function(){wp.customize.section(t).focus()},n.updateGridDelay)})},elementsButtonAdd:function(e){var o=1 .bhfb-button").data("bhfb-id"),n=o.item.closest(".botiga-bhfb-area").data("bhfb-row"),i=o.item.closest(".botiga-bhfb-area").index()-1,r=null!==o.sender?o.sender.data("bhfb-row"):null,a=null!==o.sender?o.sender.index()-1:null;if(null===o.sender)return _.elementsButtonAdd("",!0),!1;o.sender.hasClass("bhfb-available-components")||(_.currentRowInput=O("#_customize-input-botiga_"+_.currentBuilderType+"_row__"+r)),_.currentColumnPos=a,_.elementsButtonRemove(t,!0),o.sender.hasClass("bhfb-available-components")||(_.currentRowInput=O("#_customize-input-botiga_"+_.currentBuilderType+"_row__"+n)),_.currentColumnPos=i,_.elementsButtonAdd(t,!0)}}}),O(this).disableSelection()})},builderGridContent:function(){var C=this,B=["#_customize-input-botiga_header_row__above_header_row","#_customize-input-botiga_header_row__main_header_row","#_customize-input-botiga_header_row__below_header_row","#_customize-input-botiga_header_row__mobile_offcanvas"],T="hb";if(C.currentBuilderType&&"footer"===C.currentBuilderType&&(B=["#_customize-input-botiga_footer_row__above_footer_row","#_customize-input-botiga_footer_row__main_footer_row","#_customize-input-botiga_footer_row__below_footer_row"],T="fb"),C.builderGridContentFlag)return!1;C.builderGridContentFlag=!0,setTimeout(function(){for(var e=0,o=B;e'),O(".botiga-bhfb-"+i+"-row").find(".botiga-bhfb-area:last-child"));if(s.length){var l,b=_createForOfIteratorHelper(s);try{for(b.s();!(l=b.n()).done;){var u=l.value;"object"===_typeof(u=C.getElementData(u))&&c.append('')}}catch(e){b.e(e)}finally{b.f()}}a++}}catch(e){_.e(e)}finally{_.f()}}if("mobile"===C.currentDevice){var d,h=1,m=_createForOfIteratorHelper(n.mobile);try{for(m.s();!(d=m.n()).done;){var f=d.value,p=(O(".botiga-bhfb-"+i+"-row").append('
'),O(".botiga-bhfb-"+i+"-row").find(".botiga-bhfb-area:last-child"));if(f.length){var g,w=_createForOfIteratorHelper(f);try{for(w.s();!(g=w.n()).done;){var v=g.value;"object"===_typeof(v=C.getElementData(v))&&p.append('')}}catch(e){w.e(e)}finally{w.f()}}h++}}catch(e){m.e(e)}finally{m.f()}if(-1!==t.indexOf("mobile_offcanvas")&&(O(".botiga-bhfb-area-offcanvas").html(""),n.mobile_offcanvas.length)){var y,z=_createForOfIteratorHelper(n.mobile_offcanvas[0]);try{for(z.s();!(y=z.n()).done;){var k=y.value;"object"===_typeof(k=C.getElementData(k))&&O(".botiga-bhfb-area-offcanvas").append('')}}catch(e){z.e(e)}finally{z.f()}}}}if(!C.currentBuilder)return C.builderGridContentFlag=!1;C.currentBuilder.hasClass("show")&&!C.currentBuilder.hasClass("show-bottom")?(O(".botiga-bhfb").css("height",0),C.currentBuilder.css("height",C.currentBuilder.find(".botiga-bhfb-top").outerHeight()+47)):C.currentBuilder.css("height",0),C.updateAvailableComponents(),C.elementsSortable(),O(window).trigger("bhfb.grid.ready"),C.builderGridContentFlag=!1},C.updateGridDelay)},getElementData:function(e){var o,t=[].concat(_toConsumableArray(botiga_hfb.components.desktop),_toConsumableArray(botiga_hfb.components.mobile)),n=_createForOfIteratorHelper(t="footer"===this.currentBuilderType?botiga_hfb.components.footer:t);try{for(n.s();!(o=n.n()).done;){var i=o.value;if(i.id===e)return i}}catch(e){n.e(e)}finally{n.f()}return""},showHideBuilder:function(){for(var t=this,e=["botiga_section_hb_wrapper","botiga_section_hb_presets","botiga_section_hb_above_header_row","botiga_section_hb_main_header_row","botiga_section_hb_below_header_row","botiga_section_hb_mobile_offcanvas","header_image","botiga_section_hb_component__logo","botiga_section_hb_component__search","botiga_section_hb_component__social","botiga_section_hb_component__menu","botiga_section_hb_component__secondary_menu","botiga_section_hb_component__contact_info","botiga_section_hb_component__button","botiga_section_hb_component__button2","botiga_section_hb_component__html","botiga_section_hb_component__html2","botiga_section_hb_component__shortcode","botiga_section_hb_component__shortcode2","botiga_section_hb_component__shortcode3","botiga_section_hb_component__login_register","botiga_section_hb_component__woo_icons","botiga_section_hb_component__pll_switcher","botiga_section_hb_component__wpml_switcher","botiga_section_hb_component__mobile_offcanvas_menu","botiga_section_hb_component__mobile_hamburger","botiga_section_fb_wrapper","botiga_section_fb_above_footer_row","botiga_section_fb_main_footer_row","botiga_section_fb_below_footer_row","botiga_section_fb_component__social","botiga_section_fb_component__footer_menu","botiga_section_fb_component__copyright","botiga_section_fb_component__button","botiga_section_fb_component__button2","botiga_section_fb_component__html","botiga_section_fb_component__html2","botiga_section_fb_component__shortcode","botiga_section_fb_component__widget1","botiga_section_fb_component__widget2","botiga_section_fb_component__widget3","botiga_section_fb_component__widget4"],o=0,n=["above","main","below"];o iframe"),e=e?e.contentWindow.document.getElementsByTagName("html")[0]:null,o="header"===this.currentBuilderType?0:99999;if(null===e)return!1;O(e).animate({scrollTop:o},"fast")},getCurrentBuilderByComponent:function(e){return-1!==e.indexOf("_hb_")||-1!==e.indexOf("_header_")||-1!==e.indexOf("header_image")?O(".botiga-bhfb-header"):(-1!==e.indexOf("_fb_")||-1!==e.indexOf("_footer_"))&&O(".botiga-bhfb-footer")},showHideBuilderTop:function(){var o=this;O(".botiga-bhfb-bottom-display").on("click",function(e){e.preventDefault(),O("body").toggleClass("bhfb-active-bottom"),O(this).toggleClass("show"),O(".botiga-bhfb-top").toggleClass("show"),O(".botiga-bhfb").toggleClass("show-bottom"),o.builderGridContent()})},builderCustomColumns:function(){for(var b=this,e=(["botiga_header_row__above_header_row_columns","botiga_header_row__main_header_row_columns","botiga_header_row__below_header_row_columns","botiga_footer_row__above_footer_row_columns_desktop","botiga_footer_row__main_footer_row_columns_desktop","botiga_footer_row__below_footer_row_columns_desktop"].forEach(function(l){if(void 0!==wp.customize.control(l))for(var e=-1!==l.indexOf("header")?["desktop","tablet"]:["desktop"],o=0,t=e;o{var c=t[o],e=-1!==l.indexOf("header")?"_"+c:"";wp.customize(l+e,function(e){e.bind(function(e){for(var o="",t="",n=0,i=["above","main","below"];ne;)s[b.currentDevice].pop();else if(e>s[b.currentDevice].length)for(;s[b.currentDevice].length{var t=n[o];setTimeout(function(){var e="botiga-bhfb-"+i+"-row",o="botiga_"+b.currentBuilderType+"_row__"+i+"_"+b.currentBuilderType+"_row_columns_"+t;b.currentRow=i,b.currentRowInput=O("#_customize-input-botiga_"+b.currentBuilderType+"_row__"+i+"_"+b.currentBuilderType+"_row"),b.addBuilderRowColumnsClass(t,e,wp.customize(o).get()),b.updateColumnsLayoutOption(t,wp.customize(o).get()),b.updateAvailableColumnsArea(t,wp.customize(o).get())},50)})()}})};for(i.s();!(n=i.n()).done;)_()}catch(e){i.e(e)}finally{i.f()}}},addBuilderRowColumnsClass:function(e,o,t){"tablet"===e&&(e="mobile");for(var n=1;n<=6;n++)O(".botiga-bhfb-"+this.currentBuilderType+" .botiga-bhfb-"+e+" .botiga-bhfb-row."+o).removeClass("botiga-bhfb-row-"+n+"-columns");O(".botiga-bhfb-"+this.currentBuilderType+" .botiga-bhfb-"+e+" .botiga-bhfb-row."+o).addClass("botiga-bhfb-row-"+t+"-columns")},updateColumnsLayoutOption:function(e,o){var e="botiga_"+this.currentBuilderType+"_row__"+this.currentRow+"_"+this.currentBuilderType+"_row_columns_layout_"+e,t=e+"-"+wp.customize(e).get();if(O('label[for*="'+e+'"]').css("display","none"),O('label[for*="'+e+"-"+o+'col-"]').css("display","block"),O('label[for="'+t+'"]').parent().hasClass("bhfb-option-updated"))return!1;O('label[for="'+t+'"]').parent().addClass("bhfb-option-updated")},builderColumnsLayout:function(){var r=this;["botiga_header_row__above_header_row_columns_layout","botiga_header_row__main_header_row_columns_layout","botiga_header_row__below_header_row_columns_layout","botiga_footer_row__above_footer_row_columns_layout_desktop","botiga_footer_row__main_footer_row_columns_layout_desktop","botiga_footer_row__below_footer_row_columns_layout_desktop"].forEach(function(n){if(void 0!==wp.customize.control(n))for(var e=-1!==n.indexOf("header")?["desktop","tablet"]:["desktop"],o=0,i=e;o{var t=i[o],e=-1!==n.indexOf("header")?"_"+t:"";wp.customize(n+e,function(e){e.bind(function(e){var o="above",o=(-1!==n.indexOf("main")?o="main":-1!==n.indexOf("below")&&(o="below"),"tablet"===t&&(t="mobile"),r.currentRowInput=O("#_customize-input-botiga_"+r.currentBuilderType+"_row__"+o+"_"+r.currentBuilderType+"_row"),O(".botiga-bhfb-"+r.currentBuilderType+" .botiga-bhfb-"+t+" .botiga-bhfb-row.botiga-bhfb-"+o+"-row")),e=(o.removeClass("botiga-bhfb-row-columns-layout-equal"),o.removeClass("botiga-bhfb-row-columns-layout-bigleft"),o.removeClass("botiga-bhfb-row-columns-layout-bigright"),-1!==e.indexOf("equal")&&o.addClass("botiga-bhfb-row-columns-layout-equal"),-1!==e.indexOf("bigleft")&&o.addClass("botiga-bhfb-row-columns-layout-bigleft"),-1!==e.indexOf("bigright")&&o.addClass("botiga-bhfb-row-columns-layout-bigright"),r.currentRowInput.val());r.currentRowInput.val("").trigger("change"),r.currentRowInput.val(e).trigger("change"),"header"===r.currentBuilderType&&"mobile"===r.currentDevice&&r.currentRowInput.closest(".customize-control").next().find("input").val(Math.random()).trigger("change")})})})()})},updateAvailableColumnsArea:function(e,o){var t=this.currentRowInput.closest(".control-section").find(".bhfb-available-columns.bhfb-available-columns-"+e+" .bhfb-available-columns-item");t.addClass("hide");for(var n=1;n<=o;n++)t.eq(n-1).removeClass("hide")},footerCustomizerOptions:function(){for(var e=0,o=["above","main","below"];e