function awbTableOfContentsRefreshAllElements(){var e,t,n=(e=[],document.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(function(t){t.matches(".awb-toc-el__title")||e.push(t)}),e),o=document.querySelectorAll(".awb-toc-el"),i=".fusion-builder-module-controls-container *, .fusion-builder-modal-top-container *",r=document.body.classList.contains("fusion-builder-live-preview"),l={};function a(e,t,n=0){var o=0,i="awb-toc-el__list awb-toc-el__list--"+n,l="",c="";if("custom_icon"===t.counter_type&&t.icon&&(l='<span class="awb-toc-el__item-icon '+t.icon+'"></span>'),c+='<ul class="'+i+'">',r&&0===e.length&&window.awbTOCDummyContent1&&0===n){var s="object"==typeof t.allowed_heading_tags?Object.keys(t.allowed_heading_tags).length:3;3<s&&(s=3),e=window["awbTOCDummyContent"+s]}for(o=0;o<e.length;o++)c+='<li class="awb-toc-el__list-item">',e[o].title&&(c+='<a class="awb-toc-el__item-anchor" href="#'+e[o].id+'">'+l+e[o].title+"</a>"),Array.isArray(e[o].children)&&e[o].children.length&&(c+=a(e[o].children,t,n+1)),c+="</li>";return c+="</ul>"}function c(e){var t,o,a,c,s,u,d,w=[],f=n,h="";for("post_content"===e.limit_container?h=".fusion-content-tb *":"page_content"===e.limit_container?h="#content *":"custom"===e.limit_container&&e.select_custom_headings&&(h=e.select_custom_headings),e.ignore_headings||(e.ignore_headings=".awb-exclude-from-toc, .awb-exclude-from-toc *"),d=0;d<f.length;d++)if(t=f[d],void 0!==e.allowed_heading_tags[t.tagName.toLowerCase()]&&(!h||t.matches(h))&&(!e.ignore_headings||!t.matches(e.ignore_headings))&&(!r||!t.matches(i))&&!t.matches(".awb-off-canvas *")&&("yes"!==e.hide_hidden_titles||jQuery(t).is(":visible"))){if(e.ignore_headings_words&&"string"==typeof e.ignore_headings_words){for(o=t.textContent.toLowerCase(),a=e.ignore_headings_words.split("|"),c=!1,u=0;u<a.length;u++)a[u]&&o.includes(a[u].toLowerCase())&&(c=!0);if(c)continue}0===(s=e.allowed_heading_tags[t.tagName.toLowerCase()])&&w.push(_(t)),0<s&&g(w,t,s)}return w;function _(e){var t="",n="";return e&&(t=function(e){var t,n=e.getAttribute("id"),o=0;n||(function n(i){l[i]?l[i]!==e&&(o&&(i=i.replace(/__\d+/,"")),n(i=i+"__"+ ++o)):(l[i]=e,t=i)}(t=function(e){var t,n,o,i="toc",r=e.split(" ");for(n=8,o=0;o<r.length&&0<n;o++)(t=r[o].normalize("NFKD").replaceAll(/[^a-zA-Z0-9_]/g,""))&&(n--,i+="_"+t);return i}(e.textContent)),e.setAttribute("id",t),n=t);return n}(e),n=function(e){var t,n,o,i,r=e.cloneNode(!0);for(t=r.querySelectorAll("*"),i=0;i<t.length;i++)jQuery(t[d]).is(":visible")||t[i].remove();for(n=r.querySelectorAll("a"),i=0;i<n.length;i++)n[i].insertAdjacentHTML("beforebegin",n[i].innerHTML),n[i].remove();for(o=r.querySelectorAll("i"),i=0;i<o.length;i++)o[i].insertAdjacentHTML("beforebegin",o[i].innerHTML),o[i].remove();return r.innerHTML.trim()}(e)),{title:n,children:[],id:t}}function g(e,t,n){0===n?e.push(_(t)):(0===e.length&&e.push(_("")),n--,g(e[e.length-1].children,t,n))}}function s(e,t){var n=e.getAttribute("data-awb-toc-id");window.awbTocScrollSpies||(window.awbTocScrollSpies={}),n&&(setTimeout(function(){window.awbTocScrollSpies[n]&&(window.awbTocScrollSpies[n].stopListening(),delete window.awbTocScrollSpies[n]),"yes"===t.highlight_current_heading&&(window.awbTocScrollSpies[n]=new window.awbScrollSpy(document.body,{target:"."+e.className.replace(/ /g,"."),currentItemClass:"awb-toc-el__list-item--highlighted",offset:fusionGetScrollOffset()}))},10),jQuery(window).on("load fusion-sticky-change fusion-sticky-scroll-change",function(){"object"==typeof window.awbTocScrollSpies[n]&&(window.awbTocScrollSpies[n].options.offset=fusionGetScrollOffset())}),jQuery(window).on("fusion-sticky-transition-change",function(){setTimeout(function(){"object"==typeof window.awbTocScrollSpies[n]&&(window.awbTocScrollSpies[n].options.offset=fusionGetScrollOffset())},300)}))}!function(){var e,t,n,i,r,l,u,d,w,f={},h=!1;for(e=0;e<o.length;e++)t=o[e],n=t.getAttribute("data-awb-toc-options"),l=t.getAttribute("data-awb-toc-id"),n&&(n=JSON.parse(n),d="yes"===n.enable_cache,i=c(n),w=a(i,n),d&&(f[l]=i),(r=t.querySelector(".awb-toc-el__content"))&&(!d&&r.childElementCount&&(h=!0),u=!r.innerHTML&&-1===w.indexOf("</li"),r.innerHTML===w||u||(r.innerHTML="",r.insertAdjacentHTML("beforeend",w),d&&(h=!0)),s(o[e],n)));h&&function(e){var t=fusion.getCurrentPostID();if(!t)return;if(document.body.classList.contains("fusion-builder-live-preview"))return;jQuery.ajax({type:"POST",url:awbTOCElementVars.ajaxUrl,data:{action:"awb_save_toc_tree",postId:t,trees:e},dataType:"json"})}(f)}(),0===(t=window.location.hash).indexOf("#toc_")&&jQuery('[href*="'+t+'"]').fusion_scroll_to_anchor_target()}jQuery(document).ready(awbTableOfContentsRefreshAllElements);