function mediaLibraryOrganizerDefaultsReindexRulesets(e){(function(t){t("div.wpzinc-option",t(e)).each(function(e){t("div.number a.count ",t(this)).html("#"+(e+1));t("table tbody tr",t(this)).each(function(i){t("label",t(this)).each(function(i){if(typeof t(this).data("for")!=="undefined"){t(this).attr("for",t(this).data("for").replace("index",e))}});t("input, select",t(this)).each(function(i){if(typeof t(this).data("id")!=="undefined"){t(this).attr("id",t(this).data("id").replace("index",e))}if(typeof t(this).data("name")!=="undefined"){t(this).attr("name",t(this).data("name").replace("index",e))}})});if(e==0){t(this).addClass("first")}else{t(this).removeClass("first")}})})(jQuery)}jQuery(document).ready(function(e){e("body").on("click","div#defaults-container button.add-ruleset",function(e){e.preventDefault();mediaLibraryOrganizerSelectizeDestroy("#defaults-container");mediaLibraryOrganizerSelectizeInit("#defaults-container")});e("body").on("click","div.rulesets a.delete",function(t){t.preventDefault();var i=confirm(media_library_organizer_defaults_settings.delete_ruleset_message);if(!i){return}var a=e(this).closest("div.wpzinc-option"),n=e(a).closest("div.rulesets");e(a).remove();mediaLibraryOrganizerDefaultsReindexRulesets(e(n))})});