(()=>{"use strict";var e;(e=jQuery)(".dokan-report-abuse-admin-single-product-delete-item").on("click",(async function(s){s.preventDefault();const t=e(this),a=t.data("id"),n=t.parents("tr"),o=t.parents("fieldset"),r=await dokan_sweetalert(dokanReportAbuse.i18n.confirmDelete,{action:"confirm",icon:"warning"});("undefined"===r||r.isConfirmed)&&(o.prop("disabled",!0),t.html(`<i class="fas fa-sync-alt fa-spin"></i> ${dokanReportAbuse.i18n.deleting}...`),e.ajax({url:`${dokanReportAbuse.rest.root}dokan/v1/abuse-reports/${a}`,method:"post",beforeSend(e){e.setRequestHeader("X-WP-Nonce",dokanReportAbuse.rest.nonce),e.setRequestHeader("X-HTTP-Method-Override","DELETE")}}).done((e=>{n.remove(),dokan_sweetalert(dokanReportAbuse.i18n.deletedSuccessfully,{icon:"success"})})).fail((e=>{t.html(`<i class="far fa-trash-alt"></i> ${dokanReportAbuse.i18n.delete}`),e.responseJSON&&e.responseJSON.message&&dokan_sweetalert(e.responseJSON.message,{icon:"error"})})).always((()=>{o.prop("disabled",!1)})))}))})();