jQuery(document).ready(function(t){t(".filr").DataTable({paging:filr_shortcode.pagination,searching:filr_shortcode.search,order:[filr_shortcode.default_sort,filr_shortcode.default_sort_type],pageLength:filr_shortcode.default_number_rows,autoWidth:!1,responsive:!0,language:{decimal:"",emptyTable:filr_shortcode.translations.no_files,info:filr_shortcode.translations.count_files,infoEmpty:filr_shortcode.translations.no_files,infoFiltered:filr_shortcode.translations.filtered_files,lengthMenu:filr_shortcode.translations.available_files,loadingRecords:filr_shortcode.translations.loading_files,searchPlaceholder:filr_shortcode.translations.search_files,search:"",zeroRecords:filr_shortcode.translations.no_files_found,paginate:{first:filr_shortcode.translations.first_page_files,last:filr_shortcode.translations.last_page_files,next:filr_shortcode.translations.next_page_files,previous:filr_shortcode.translations.previous_page_files}}}),t(".filr-button").on("click",function(e){var i=t(this).attr("data-download"),a=t(this).attr("data-expire"),s=t(this);"∞"!==a&&t.ajax({type:"post",dataType:"json",url:filr_shortcode.ajax_url,data:{action:"decrease_downloads",post_id:i,nonce:filr_shortcode.nonce},success:function(e){var i=t(s).parent().parent();0===e.remaining?t(i).remove():t(i).find(".remaining").text(e.remaining)}})}),t(".filr-folder-table").DataTable({paging:filr_shortcode.pagination,searching:filr_shortcode.search,order:[filr_shortcode.default_sort,filr_shortcode.default_sort_type],pageLength:filr_shortcode.default_number_rows,autoWidth:!1,responsive:!0,language:{decimal:"",emptyTable:filr_shortcode.translations.no_files,info:filr_shortcode.translations.count_files,infoEmpty:filr_shortcode.translations.no_files,infoFiltered:filr_shortcode.translations.filtered_files,lengthMenu:filr_shortcode.translations.available_files,loadingRecords:filr_shortcode.translations.loading_files,searchPlaceholder:filr_shortcode.translations.search_files,search:"",zeroRecords:filr_shortcode.translations.no_files_found,paginate:{first:filr_shortcode.translations.first_page_files,last:filr_shortcode.translations.last_page_files,next:filr_shortcode.translations.next_page_files,previous:filr_shortcode.translations.previous_page_files}}}),t(".dataTables_wrapper").each(function(){"hidden"==t(this).css("visibility")?t(this).css("position","absolute"):t(this).css("position","relative")}),t(document).on("click",".filr-folder-button",function(){var e=t(this).attr("id"),i=t("#filr-"+e+"_wrapper");t(this).toggleClass("filr-folder-button-close"),t(this).text(filr_shortcode.translations.close_folder_text),"hidden"==t(i).css("visibility")?(t(i).css("visibility","visible"),t(i).css("position","relative")):(t(this).text(filr_shortcode.translations.open_folder_text),t(i).css("visibility","hidden"),t(i).css("position","absolute"))}),t(".filr-preview").length>0&&"on"===filr_shortcode.use_preview&&t(".filr-preview").each(function(){var e,i=t(this).attr("href");e=i,/\.(jpg|jpeg|png|webp|avif|gif|svg)$/.test(e)&&(t(this).on("click",function(t){t.preventDefault()}),console.log(i),t(".filr-preview").anarchytip())})});