/*
 Themify Builder - Asynchronous Script and Styles Loader */
'use strict';((b,k,a)=>{let n,M=!1;const R=()=>{const q=new FormData;q.append("action","tb_load_editor");b.fetch(q,"text").then(d=>{var f=a.createElement("div");const u={},x={},c=a.createDocumentFragment();a.createDocumentFragment();const y=b.body[0],l=function(){u[this.src]=!0;n.ui&&n.fn.mouse&&n.fn.sortable&&b.trigger("tb_load_iframe");for(var e in x)if(!0!==u[e])return!1;e=a.createDocumentFragment();for(let z=0,r=m.length;z<r;++z)e.appendChild(m[z]);y.appendChild(e);k.tinymce&&tinyMCE&&(tinyMCEPreInit.mceInit.tb_lb_hidden_editor.schema=
"html5",tinyMCEPreInit.mceInit.tb_lb_hidden_editor.element_format="html",tinyMCEPreInit.mceInit.tb_lb_hidden_editor.wp_autoresize_on=!1,tinyMCEPreInit.mceInit.tb_lb_hidden_editor.plugins="charmap,colorpicker,hr,lists,media,paste,tabfocus,textcolor,fullscreen,wordpress,wpautoresize,wpeditimage,wpemoji,wpgallery,wpdialogs,wptextpattern,wpview,wplink",tinyMCEPreInit.mceInit.tb_lb_hidden_editor.indent="simple",tinyMCEPreInit.mceInit.tb_lb_hidden_editor.ie7_compat=!1,tinyMCEPreInit.mceInit.tb_lb_hidden_editor.root_name=
"div",tinyMCEPreInit.mceInit.tb_lb_hidden_editor.relative_urls=!0,tinyMCE.execCommand("mceRemoveEditor",!0,"tb_lb_hidden_editor"),n("#wp-tb_lb_hidden_editor-editor-container,#wp-tb_lb_hidden_editor-editor-tools").remove())};f.innerHTML=d;d=f.querySelector("#tb_tinymce_wrap").children;const m=[];for(let e=0,z=d.length;e<z;++e)if("SCRIPT"!==d[0].tagName||d[0].getAttribute("type")&&"text/javascript"!==d[0].getAttribute("type"))c.appendChild(d[0]);else{f=a.createElement("script");for(let r=d[0].attributes,
p=r.length-1;-1<p;--p)f.setAttribute(r[p].name,r[p].value);var g=d[0].getAttribute("src");g?void 0===x[g]&&-1===g.indexOf("themify/js/main")&&null===a.querySelector('script[src="'+g+'"]')&&(f.async=!1,x[g]=!0,f.addEventListener("load",l,{once:!0,passive:!0}),f.addEventListener("error",l,{once:!0,passive:!0}),c.appendChild(f)):(g=d[0].id,g&&-1!==g.indexOf("themify-main-script")||(g=d[0].innerHTML,f.innerHTML=g,-1===g.indexOf("tinyMCEPreInit.")&&-1===g.indexOf(".addI18n")&&-1===g.indexOf(".i18n")&&
-1===g.indexOf("wp.editor")?c.appendChild(f):m.push(f)));d[0].remove()}try{y.appendChild(c)}catch(e){}})},Q=()=>{let q;n=jQuery;if(!k.wp||!wp.customize){var d=a.getElementsByClassName("themify_builder_content");let c=a.getElementsByClassName("toggle_tb_builder")[0],y=!1;q=c?c.getElementsByClassName("tb_front_icon")[0].getAttribute("data-id"):!1;for(let l=d.length-1;-1<l;--l){var f=d[l].getAttribute("data-postid");let m=a.createElement("a");var u=a.createElement("span");f===q&&(y=!0);m.href="javascript:void(0);";
m.className="tb_turn_on js-turn-on-builder";u.className="dashicons dashicons-edit";u.setAttribute("data-id",f);m.appendChild(u);f=d[l].dataset.label||d[l].parentNode.dataset.label;u=a.createElement("span");u.innerHTML=f?f:tbLoaderVars.turnOnBuilder;m.appendChild(u);d[l].insertAdjacentElement(f?"beforeBegin":"afterEnd",m)}c||(c=a.getElementsByClassName("js-turn-on-builder")[0],c||(d=a.getElementsByClassName("dashicons-edit"),q=d[0]?d[0].getAttribute("data-id"):null));c&&(!1===y?(q=null,c.classList.add("tb_disabled_turn_on")):
c.classList.remove("tb_disabled_turn_on"))}let x=0<k.location.href.indexOf("?")?"&":"?";x=k.location.href.replace(k.location.hash,"").replace("#","")+x+"tb-preview=1&ver="+k.themify_vars.version;b.body.on("click.tb_loading",".toggle_tb_builder:not(.tb_disabled_turn_on) > a, a.js-turn-on-builder",function(c){c.preventDefault();c.stopPropagation();M=!0;const y=this.classList.contains("tb_restriction");b.LoadAsync(tbLocalScript.builder_url+"/js/editor/themify-ticks.js",()=>{y&&(TB_Ticks.init(tbLocalScript.ticks).show(),
init())},null,null,()=>!!k.TB_Ticks);b.body.off("click.tb_loading");if(!y){var l=this.classList.contains("js-turn-on-builder")?this.childNodes[0].getAttribute("data-id"):q;if(l&&!this.parentNode.classList.contains("tb_disabled_turn_on")){b.lazyDisable=b.lazyScrolling=!0;null!==b.observer&&b.observer.disconnect();var m=[],g=n(a).scrollTop(),e=b.convert(a.head.getElementsByTagName("link")).concat(b.convert(a.head.getElementsByTagName("style"))),z=b.body.children(),r=a.createElement("div"),p=a.createElement("div"),
I=a.createElement("div"),J=a.createElement("div"),N=a.createElement("div"),A=a.createElement("iframe");r.className="tb_workspace_container";p.className="tb_vertical_bars";I.id="tb_left_bar";J.id="tb_right_bar";I.className=J.className="tb_middle_bar";N.className="tb_vertical_change_tooltip";A.className="tb_iframe";A.id=A.name="tb_iframe";A.scrolling=b.isTouch?"no":"yes";A.src=x+"&tb-id="+l;b.off("builder_load_module_partial");n(a).off("ajaxComplete");if(null!==tbLoaderVars.styles)for(var v in tbLoaderVars.styles)""!==
tbLoaderVars.styles[v]&&(b.LoadCss(v,tbLoaderVars.styles[v]),m[v+"?ver="+tbLoaderVars.styles[v]]=1);var E=a.createElement("div");c=a.createElement("div");v=a.createElement("div");var O=a.getElementsByClassName("tb_front_icon")[0];E.id="tb_alert";E.className="tb_busy";c.id="tb_fixed_bottom_scroll";c.className="tb_fixed_scroll";v.id="builder_progress";v.appendChild(a.createElement("div"));a.body.insertAdjacentElement("afterbegin",c);a.body.appendChild(E);O&&O.parentNode.appendChild(v);b.on("tb_load_iframe",
()=>{p.appendChild(I);p.appendChild(A);p.appendChild(J);p.appendChild(N);r.appendChild(p);A.addEventListener("load",function(){const t=this.contentWindow;let F;b.on("themify_builder_ready",()=>{n(E).fadeOut(100,function(){this.classList.remove("tb_busy")});var C=b.body[0].classList.contains("archive");let G="themify_builder_active builder-breakpoint-desktop page-loaded";b.isTouch&&(G+=" tb_touch");C&&(G+=" archive");"1"===tbLoaderVars.isGlobalStylePost&&(G+=" gs_post");b.body[0].className=G;b.body[0].removeAttribute("style");
r.style.display="block";C=t.tb_app.Instances.Builder[0].$el.offset().top;C>g&&(g=C);t.scrollTo(0,g);b.iframe=A;b.is_builder_active=!0;setTimeout(()=>{z.hide();for(var h=e.length-1;-1<h;--h)if(e[h]&&e[h].parentNode){var D=e[h].href,H=e[h].id;D?m[D]&&"tf_base-css"!==e[h].id||-1!==D.indexOf("wp-includes")||-1!==D.indexOf("admin-bar")||(e[h].setAttribute("disabled",!0),e[h].parentNode.removeChild(e[h])):"tf_fonts_style"!==H&&"tf_lazy_common"!==H&&e[h].parentNode.removeChild(e[h])}e=m=tbLoaderVars=E=null;
n(".themify_builder_content,#wpadminbar,header").remove();z.filter("ul,a,video,audio").filter(":not(:has(link))").remove();h="scroll tfsmartresize debouncedresize throttledresize resize mouseenter keydown keyup mousedown assignVideo".split(" ");D=n(k);H=n(a);for(let w=h.length-1;-1<w;--w)D.off(h[w]),H.off(h[w]),b.body.off(h[w]);a.documentElement.removeAttribute("style");a.documentElement.removeAttribute("class");const K=t.tbLocalScript.ticks;K.postID=l;F.hasClass("tb_restriction")?setTimeout(()=>
{a.body.appendChild(F.find("#tmpl-builder-restriction")[0]);TB_Ticks.init(K,t).show()},1E3):setTimeout(()=>{TB_Ticks.init(K,t).ticks()},5E3);setTimeout(()=>{const w="ThemifyBuilderModuleJs c _wpemojiSettings twemoji themifyScript tbLocalScript tbScrollHighlight google ThemifyGallery Animation $f Froogaloop SliderProSlide SliderProUtils ThemifySlider FixedHeader LayoutAndFilter WOW Waypoint $slidernav google Microsoft Rellax module$contents$MapsEvent_MapsEvent module$contents$mapsapi$overlay$OverlayView_OverlayView wc_add_to_cart_params woocommerce_params wc_cart_fragments_params wc_single_product_params tf_mobile_menu_trigger_point themifyMobileMenuTrigger".split(" ");
for(let B=w.length-1;-1<B;--B)k[w[B]]&&(k[w[B]]=null);b.events={};k.wp.emoji=null;k.ajaxurl=themify_vars.ajax_url;b.cssLazy=[];for(let B=t.document.querySelectorAll("[data-lazy]"),L=B.length-1;-1<L;--L)B[L].removeAttribute("data-lazy")},3E3)},800)});const P=()=>{t.themifyBuilder.post_ID=l;F=t.jQuery("body");F.trigger("builderiframeloaded.themify",this)};if("__rocketLoaderLoadProgressSimulator"in t){const C=setInterval(()=>{"complete"===t.__rocketLoaderLoadProgressSimulator.simulatedReadyState&&(clearInterval(C),
P())},10)}else P()},{once:!0,passive:!0});a.body.appendChild(r)},!0);R()}}});b.body[0].classList.contains("tb_restriction")||-1!==k.location.href.indexOf("tb-id")||("#builder_active"===k.location.hash?(n(".toggle_tb_builder > a").first().click(),k.location.hash=""):setTimeout(()=>{if(!1===M){const c=a.createElement("link");c.href=x+(q?"&tb-id="+q:"");c.rel="prefetch";c.setAttribute("as","doc");a.head.appendChild(c)}},2E3))};if(!0===k.loaded)Q();else b.on("tf_init",Q,!0)})(Themify,window,document);
