(($,e,n,l)=>{"use strict";const o=ThemifyBuilderModuleJs.cssUrl+"menu_styles/",u=n.createElement("div"),i=e.is_builder_active,t=()=>e.loadCss(o+"mobile"),m=(e,n)=>{const l=e.nextElementSibling.style;l.display="none"===l.display||""===l.display?"block":"none",n.classList.toggle("menu-close"),e.closest("li").classList.toggle("tb_menu_open")},s=()=>{u.classList.remove("body-overlay-on"),n.body.classList.remove("menu-module-left","menu-module-right");const e=$(".mobile-menu-module.visible").removeClass("left right");l((()=>{e.removeClass("visible")}),300)},d=(u,t,m)=>{for(let n=t.length-1;n>-1;--n){let u=t[n],i=~~u.dataset.menuBreakpoint,s=u.tfClass("nav")[0];if(u.classList.contains("dropdown")&&e.loadCss(o+"dropdown","tb_menu_dropdown"),s){s.classList.contains("transparent")&&e.loadCss(o+"transparent","tb_menu_transparent");let n=s.classList.contains("fullwidth")?"fullwidth":s.classList.contains("vertical")?"vertical":"";""!==n&&(e.loadCss(o+n,"tb_menu_"+n),"vertical"!==n||u.tfClass("tf_acc_menu")[0]||e.loadCss(o+"accordion","tb_menu_accordion"))}i>0&&u.classList.toggle("module-menu-mobile-active",m<i),void 0===u.tfClass("tf_acc_menu")[0]&&l((()=>{e.edgeMenu(u)}),1500)}if(!i)if(!1===u){let e=$(".menu-module-burger"),l=e.parent().data("menu-breakpoint");"mobile-menu-dropdown"===e.parent().data("menu-style")&&e.length&&m<l&&n.body.tfOn("click",(n=>{const l=$(".module-menu-container");!n.target.closest(".module-menu-container,.menu-module-burger")&&l.is(":visible")&&e.is(":visible")&&(e.removeClass("is-open"),l.removeClass("is-open"))}))}else s()};if(e.on("builder_load_module_partial",((n,l)=>{if(!0===l&&!n.classList.contains("module-menu"))return;const o=e.selectWithParent("module-menu",n);d(!1,o,e.w)})),!i){const i=n.createElement("div"),d=n.createElement("link");let r=o+"mobile.css?ver="+e.v;null!==e.urlArgs&&(r+=e.urlArgs),d.rel="prefetch",d.setAttribute("as","style"),d.href=r,i.className="themify_builder",u.classList.add("body-overlay"),i.appendChild(u),n.body.append(i,d),e.body.on("click",".menu-module-burger",(function(o){o.preventDefault(),t().then((()=>{const o=$(this).parent(),t=o.data("menu-style");if("mobile-menu-dropdown"===t)return void $(this).toggleClass("is-open").siblings(".module-menu-container").toggleClass("is-open");const m=o.data("menu-direction"),s=o.data("element-id"),d=i.dataset.id,r=o[0].closest(".themify_builder_content").dataset.postid;d&&r===d||(d&&i.classList.remove("themify_builder_content-"+d),i.dataset.id=r,i.className+=" themify_builder_content-"+r);let c=$('div[data-module="'+s+'"]',i);if(!c.length){let n=o.data("gs"),l=o.find('div[class*="-container"] > ul').clone(),u=l.prop("class").replace(/nav|menu-bar|fullwidth|vertical|with-sub-arrow/g,""),d=o.prop("class").match(/menu-[\d\-]+/g);n=n?" "+n:"",d=d?d[0]:"",c=$("<div/>"),c.addClass("mobile-menu-module  "+u+" "+d+" "+s+" "+t+n+" module-menu").attr("data-module",s).attr("data-dir",m).appendTo(i),l=l.removeAttr("id").removeAttr("class").addClass("nav"),l.find(".sub-menu").length&&l.find(".sub-menu").prev("a").append('<i class="toggle-menu"></i>'),e.lazyScroll(l[0].querySelectorAll("[data-lazy]"),!0),c.html(l).prepend('<a class="menu-close" href="#"><span class="menu-close-inner tf_close"></span><span class="screen-reader-text">&times</span></a>')}n.body.classList.add("menu-module-"+m),c.addClass("visible"),l((()=>{c.addClass(m)}),50),u.classList.add("body-overlay-on")}))})).on("click",".mobile-menu-module ul .toggle-menu",(function(e){e.preventDefault(),e.stopPropagation(),t().then((()=>{m(this.closest("a"),this)}))})).on("click",'.mobile-menu-module ul a[href="#"]',(function(e){e.preventDefault();const n=this.querySelector(".toggle-menu");null!==n&&t().then((()=>{m(this,n)}))})).on("click",".themify_builder .body-overlay,.mobile-menu-module .menu-close,.mobile-menu-module .menu-item a",(e=>{const n=e.target;n.classList.contains("toggle-menu")||"A"===n.tagName&&"#"===n.getAttribute("href")||((n.classList.contains("menu-close-inner")||n.parentNode.classList.contains("menu-close"))&&e.preventDefault(),t().then(s))}))}e.on("tfsmartresize",(e=>{e&&d(!0,n.querySelectorAll(".module-menu.module"),e.w)}))})(jQuery,Themify,document,setTimeout);