jQuery(document).ready((function(e){var t=1,o=!1;e(".loadMoreBtn").on("click",(function(){!function(){let a=e(".loadMoreBtn").data("control-attributes");if(a=JSON.parse(atob(a)),!o){o=!0;const n=a&&a.dictionary_loadmore_button_text?a.dictionary_loadmore_button_text:"Load More";e(".loadMoreBtn").html(`${n} <span class="spinner"></span>`);const c=e(".loadMoreBtn").data("total-section-pages");e.ajax({url:betterdocsEncyclopedia.ajax_url,type:"POST",data:{action:"load_more_docs_section",page:t,doc_style:a?.doc_style,doc_per_page:a?.dictionary_docs_per_page,section_per_page:a?.shown_sections,current_letter:a?.current_letter,start_letter_style:a?.start_letter_style,learn_more_text:a?.dictionary_learn_more_text,explore_more_text:a?.dictionary_explore_more_text,_nonce:betterdocsEncyclopedia._nonce},success:function(a){a.data?setTimeout((()=>{e("#encyclopedia-container").append(a.data),o=!1,e(".loadMoreBtn").html(n),++t>c&&e(".loadMoreBtn").remove()}),300):e(".loadMoreBtn").remove()},complete:function(){o=!1}})}}()}))})),jQuery(document).ready((function(e){var t=0,o=!1;e(".loadMoreDocsBtn").on("click",(function(){!function(){const a=new URL(window.location.href).searchParams.get("encyclopedia_prefix"),n=e(".loadMoreDocsBtn").data("total-doc-pages");let c=e(".loadMoreDocsBtn").data("control-attributes");if(c=JSON.parse(atob(c)),!o){o=!0;const r=c&&c.dictionary_loadmore_button_text?c.dictionary_loadmore_button_text:"Load More";e(".loadMoreDocsBtn").html(`${r} <span class="spinner"></span>`),e.ajax({url:betterdocsEncyclopedia.ajax_url,type:"post",data:{action:"load_more_docs",page:t,encyclopedia_prefix:a,doc_style:c?.doc_style,doc_per_page:c?.dictionary_docs_per_page,current_letter:c?.current_letter,_nonce:betterdocsEncyclopedia._nonce},success:function(a){a.data?setTimeout((()=>{e("#encyclopedia-container .section-item").append(a.data),o=!1,t++,e(".loadMoreDocsBtn").html(r),t>n&&e(".loadMoreDocsBtn").remove()}),300):e(".loadMoreDocsBtn").remove()},complete:function(){o=!1}})}}()}))}));