jQuery(function(t){var e={init:function(){t(document.body).on("click","a.help_tip, a.woocommerce-help-tip, woocommerce-product-type-tip",this.preventTipTipClick).on("click","a.debug-report",this.generateReport).on("click","#copy-for-support",this.copyReport).on("click","#copy-for-github",this.copyGithubReport).on("aftercopy","#copy-for-support, #copy-for-github",this.copySuccess).on("aftercopyfailure","#copy-for-support, #copy-for-github",this.copyFail).on("click","#download-for-support",this.downloadReport)},preventTipTipClick:function(){return!1},generateReport:function(){var e="";t(".wc_status_table thead, .wc_status_table tbody").each(function(){if(t(this).is("thead")){var o=t(this).find("th:eq(0)").data("exportLabel")||t(this).text();e=e+"\n### "+o.trim()+" ###\n\n"}else t("tr",t(this)).each(function(){var o=(t(this).find("td:eq(0)").data("exportLabel")||t(this).find("td:eq(0)").text()).trim().replace(/(<([^>]+)>)/gi,""),r=t(this).find("td:eq(2)").clone();r.find(".private").remove(),r.find(".dashicons-yes").replaceWith("✔"),r.find(".dashicons-no-alt, .dashicons-warning").replaceWith("❌");var i=r.text().trim(),n=i.split(", ");if(n.length>1){var a="";t.each(n,function(t,e){a=a+e+"\n"}),i=a}e=e+""+o+": "+i+"\n"})});try{return t("#debug-report").slideDown(),t("#debug-report").find("textarea").val("`"+e+"`").trigger("focus").trigger("select"),t(this).fadeOut(),!1}catch(o){console.log(o)}return!1},copyReport:function(e){wcClearClipboard(),wcSetClipboard(t("#debug-report").find("textarea").val(),t(this)),e.preventDefault()},applyRedactions:t=>([{regex:/(WordPress address \(URL\):)[^\n]*/,replacement:"$1 [Redacted]"},{regex:/(Site address \(URL\):)[^\n]*/,replacement:"$1 [Redacted]"},{regex:/(### Database ###\n)([\s\S]*?)(\n### Post Type Counts ###)/,replacement:"$1\n[REDACTED]\n$3"}].forEach(function(e){t=t.replace(e.regex,e.replacement)}),t),copyGithubReport:function(o){wcClearClipboard();var r=t("#debug-report").find("textarea").val(),i=e.applyRedactions(r);wcSetClipboard("System Status Report
\n\n``"+i+"``\n