$(function(){function e(e,o){o.addClass("button-loading"),$.ajax({type:"POST",cache:!1,url:e.prop("action"),data:e.serialize(),success:function(e){e.error?Botble.showNotice("error",e.message):(Botble.showNotice("success",e.message),o.closest(".modal").modal("hide"),window.LaravelDataTables&&Object.keys(window.LaravelDataTables).map(function(e){window.LaravelDataTables[e].draw()}),e.data&&e.data.balance&&$(".vendor-balance").text(e.data.balance))},error:function(e){Botble.handleError(e)},complete:function(){o.removeClass("button-loading")}})}$(document).on("click","#confirm-update-amount-button",function(o){o.preventDefault();var t=$(o.currentTarget);e($("#update-balance-modal .modal-body form"),t)}),$(document).on("submit","#update-balance-modal .modal-body form",function(o){o.preventDefault(),e($(o.currentTarget),$("#confirm-update-amount-button"))}),$(document).on("click","#confirm-verify-button",function(e){e.preventDefault();var o=$(e.currentTarget),t=$("#verify-store-modal form");o.addClass("button-loading"),$.ajax({type:"POST",cache:!1,url:t.prop("action"),data:t.serialize(),success:function(e){e.error?Botble.showNotice("error",e.message):(Botble.showNotice("success",e.message),$("#verify-store-modal").modal("hide"),setTimeout(function(){window.location.reload()},1e3))},error:function(e){Botble.handleError(e)},complete:function(){o.removeClass("button-loading")}})}),$(document).on("click","#confirm-unverify-button",function(e){e.preventDefault();var o=$(e.currentTarget),t=$("#unverify-store-modal form");o.addClass("button-loading"),$.ajax({type:"POST",cache:!1,url:t.prop("action"),data:t.serialize(),success:function(e){e.error?Botble.showNotice("error",e.message):(Botble.showNotice("success",e.message),$("#unverify-store-modal").modal("hide"),setTimeout(function(){window.location.reload()},1e3))},error:function(e){Botble.handleError(e)},complete:function(){o.removeClass("button-loading")}})}),$(document).on("submit","#verify-store-modal form, #unverify-store-modal form",function(e){e.preventDefault()})});