function disableScrolling(){var e=window.scrollX,t=window.scrollY;window.onscroll=function(){window.scrollTo(e,t)}}function enableScrolling(){ezTocSettingsTabsFixed()}jQuery(document).ready((function(e){var t=e(".ez-toc-color-picker");t.length&&t.wpColorPicker();var s=document.getElementById("ez-toc-settings[width]"),c=document.getElementById("ez-toc-settings[width_custom]");c&&("custom"!=s.value&&(c.parentNode.parentNode.style.display="none"),s.addEventListener("change",(function(){"custom"==document.getElementById("ez-toc-settings[width]").value?c.parentNode.parentNode.style.display="revert":c.parentNode.parentNode.style.display="none"}))),e("#reset-options-to-default-button").click((function(){1==confirm("Do you want reset settings to default options?")&&e.post(ajaxurl,{action:"eztoc_reset_options_to_default",eztoc_security_nonce:cn_toc_admin_data.eztoc_security_nonce},(function(e){alert("Default Options Reset Now!"),window.location.reload()}))})),e("#subscribe-newsletter-form").on("submit",(function(t){t.preventDefault();var s=e("#subscribe-newsletter-form"),c=s.find('input[name="name"]').val(),a=s.find('input[name="email"]').val(),o=s.find('input[name="company"]').val();e.post(ajaxurl,{action:"eztoc_subscribe_newsletter",name:c,email:a,website:o,eztoc_security_nonce:cn_toc_admin_data.eztoc_security_nonce},(function(e){if("security_nonce_not_verified"===e)return alert("Security nonce not verified"),!1}))}));let a=e("#eztoc-general").find("select[name='ez-toc-settings[position]']"),o=e("#eztoc-general").find("input[name='ez-toc-settings[custom_para_number]']"),n=e("#eztoc-general").find("input[name='ez-toc-settings[custom_img_number]']"),i=e("#eztoc-general").find("input[name='ez-toc-settings[blockqoute_checkbox]']");"aftercustompara"==e(a).val()?e(o).parents("tr").show():e(o).parents("tr").hide(),"afterpara"==e(a).val()||"aftercustompara"==e(a).val()?e(i).parents("tr").show():e(i).parents("tr").hide(),"aftercustomimg"==e(a).val()?e(n).parents("tr").show():e(n).parents("tr").hide(),e(document).on("change","select[name='ez-toc-settings[position]']",(function(){"aftercustompara"==e(this).val()?e(o).parents("tr").show(500):e(o).parents("tr").hide(500),"afterpara"==e(this).val()||"aftercustompara"==e(this).val()?e(i).parents("tr").show(500):e(i).parents("tr").hide(500),"aftercustomimg"==e(this).val()?e(n).parents("tr").show(500):e(n).parents("tr").hide(500)}));let r=e("#eztoc-general").find("select[name='ez-toc-settings[toc_loading]']"),l=e("#eztoc-general").find("input[name='ez-toc-settings[smooth_scroll]']"),v=e("#eztoc-general").find("input[name='ez-toc-settings[avoid_anch_jump]']"),d=e("#eztoc-advanced").find("select[name='ez-toc-settings[load_js_in]']");"js"==e(r).val()?(e(l).parents("tr").show(),e(v).parents("tr").show(),e(d).parents("tr").show()):(e(l).parents("tr").hide(),e(v).parents("tr").hide(),e(d).parents("tr").hide()),e(document).on("change","select[name='ez-toc-settings[toc_loading]']",(function(){"js"==e(this).val()?(e(l).parents("tr").show(500),e(v).parents("tr").show(500),e(d).parents("tr").show(500)):(e(l).parents("tr").hide(500),e(v).parents("tr").hide(500),e(d).parents("tr").hide(500))}));let m=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky_highlight_heading]']"),u=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky_highlight_bg_colour]']"),p=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky_highlight_title_colour]']");1==e(m).prop("checked")?(e(u).parents("tr").show(),e(p).parents("tr").show()):(e(u).parents("tr").hide(),e(p).parents("tr").hide()),e(document).on("change","input[name='ez-toc-settings[sticky_highlight_heading]']",(function(){1==e(this).prop("checked")?(e(u).parents("tr").show(500),e(p).parents("tr").show(500)):(e(u).parents("tr").hide(500),e(p).parents("tr").hide(500))}))}));const unsecuredCopyToClipboard=e=>{const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(e){console.error("Unable to copy to clipboard",e)}document.body.removeChild(t)};function ez_toc_clipboard(e,t,s,c){c.preventDefault(),disableScrolling();var a=s.parentNode.parentNode.querySelectorAll("#"+e)[0];a.select(),a.setSelectionRange(0,99999),unsecuredCopyToClipboard(a.value),s.querySelectorAll("span."+t)[0].innerHTML="Copied: "+a.value}function ez_toc_outFunc(e,t,s){s.preventDefault(),t.querySelectorAll("span."+e)[0].innerHTML="Copy to clipboard",enableScrolling()}function ezTocSettingsTabsFixed(){var e=document.querySelector("#general #eztoc-tabs"),t=document.querySelector("#general form");window.onscroll=null!==e?function(){var s=window.scrollY,c=document.getElementsByClassName("ez-toc-pro-settings-link-paid"),a=document.getElementsByClassName("general-pro-settings-container"),o=document.querySelector("#general #eztoc-tabs #eztoc-link-general"),n=document.querySelector("#general #eztoc-tabs #eztoc-link-appearance"),i=document.querySelector("#general #eztoc-tabs #eztoc-link-advanced"),r=document.querySelector("#general #eztoc-tabs #eztoc-link-shortcode"),l=document.querySelector("#general #eztoc-tabs #eztoc-link-sticky"),v=document.querySelector("#general #eztoc-tabs #eztoc-link-compatibility"),d=document.querySelector("#general #eztoc-tabs #eztoc-link-iesettings"),m=document.querySelector("#general #eztoc-tabs #eztoc-link-prosettings"),u=100,p=document.querySelector("#general div#eztoc-general").offsetTop-u,g=document.querySelector("#general div#eztoc-appearance").offsetTop-u,h=document.querySelector("#general div#eztoc-advanced").offsetTop-u,L=document.querySelector("#general div#eztoc-shortcode").offsetTop-u,f=document.querySelector("#general div#eztoc-compatibility").offsetTop-u,z=document.querySelector("#general div#eztoc-iesettings").offsetTop-u,y=document.querySelector("#eztoc-sticky").offsetTop-u;if(null!==c&&c.length>0)var _=document.querySelector("#general div#eztoc-prosettings").offsetTop-u-150;else f-=150,z-=150;o.classList.add("active"),n.classList.remove("active"),i.classList.remove("active"),r.classList.remove("active"),v.classList.remove("active"),d.classList.remove("active"),l.classList.remove("active"),a.length>0&&null!==m&&m.classList.remove("active"),s>=100?(e.classList.remove("stay"),e.classList.add("moving"),t.classList.add("moving"),null!==c&&c.length>0&&0==a.length&&(e.innerHTML+=' | Pro Settings')):(e.classList.remove("moving"),e.classList.add("stay"),t.classList.remove("moving"),null!==c&&c.length>0&&a.length>0&&document.querySelector(".general-pro-settings-container").remove()),s>=p&&(o.classList.add("active"),n.classList.remove("active"),i.classList.remove("active"),r.classList.remove("active"),v.classList.remove("active"),d.classList.remove("active"),l.classList.remove("active"),null!==c&&c.length>0&&a.length>0&&null!==m&&m.classList.remove("active")),s>=g&&(o.classList.remove("active"),n.classList.add("active"),i.classList.remove("active"),r.classList.remove("active"),v.classList.remove("active"),d.classList.remove("active"),l.classList.remove("active"),null!==c&&c.length>0&&a.length>0&&null!==m&&m.classList.remove("active")),s>=h&&(o.classList.remove("active"),n.classList.remove("active"),i.classList.add("active"),r.classList.remove("active"),v.classList.remove("active"),d.classList.remove("active"),l.classList.remove("active"),null!==c&&c.length>0&&a.length>0&&null!==m&&m.classList.remove("active")),s>=L&&(o.classList.remove("active"),n.classList.remove("active"),i.classList.remove("active"),r.classList.add("active"),v.classList.remove("active"),d.classList.remove("active"),l.classList.remove("active"),null!==c&&c.length>0&&a.length>0&&null!==m&&m.classList.remove("active")),s>=y&&(o.classList.remove("active"),n.classList.remove("active"),i.classList.remove("active"),r.classList.remove("active"),v.classList.remove("active"),d.classList.remove("active"),l.classList.add("active"),null!==c&&c.length>0&&a.length>0&&null!==m&&m.classList.remove("active")),s>=f&&(o.classList.remove("active"),n.classList.remove("active"),i.classList.remove("active"),r.classList.remove("active"),v.classList.add("active"),d.classList.remove("active"),l.classList.remove("active"),null!==c&&c.length>0&&a.length>0&&null!==m&&m.classList.remove("active")),s>=z&&(o.classList.remove("active"),n.classList.remove("active"),i.classList.remove("active"),r.classList.remove("active"),v.classList.remove("active"),d.classList.add("active"),l.classList.remove("active"),null!==c&&c.length>0&&a.length>0&&null!==m&&m.classList.remove("active")),a.length>0&&s>=_&&(o.classList.remove("active"),n.classList.remove("active"),i.classList.remove("active"),r.classList.remove("active"),v.classList.remove("active"),d.classList.remove("active"),l.classList.remove("active"),null!==c&&c.length>0&&a.length>0&&null!==m&&m.classList.add("active"))}:function(){}}ezTocSettingsTabsFixed();