(()=>{function o(o,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(o,t.key,t)}}var e=function(){function e(){!function(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,t,r;return n=e,(t=[{key:"init",value:function(){$(document).on("click",".approve-product-for-selling-button",(function(o){o.preventDefault(),$("#confirm-approve-product-for-selling-button").data("action",$(o.currentTarget).prop("href")),$("#approve-product-for-selling-modal").modal("show")})),$(document).on("click","#confirm-approve-product-for-selling-button",(function(o){o.preventDefault();var e=$(o.currentTarget);e.addClass("button-loading"),$.ajax({type:"POST",cache:!1,url:e.data("action"),success:function(o){o.error?Botble.showError(o.message):(Botble.showSuccess(o.message),$(".approve-product-warning").fadeOut(500),window.location.reload()),e.removeClass("button-loading"),e.closest(".modal").modal("hide")},error:function(o){Botble.handleError(o),e.removeClass("button-loading")}})}))}}])&&o(n.prototype,t),r&&o(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();$(document).ready((function(){(new e).init()}))})();