(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function n(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var i=o.call(e,n||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:String(n)}var o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,o,i;return n=t,(o=[{key:"init",value:function(){$(".toggle-payment-item").off("click").on("click",(function(t){$(t.currentTarget).closest("tbody").find(".payment-content-item").toggleClass("hidden")})),$(".disable-payment-item").off("click").on("click",(function(t){t.preventDefault();var e=$(t.currentTarget);$("#confirm-disable-payment-method-modal").modal("show"),$("#confirm-disable-payment-method-button").on("click",(function(t){t.preventDefault(),$httpClient.make().withButtonLoading($(t.currentTarget)).post($("div[data-disable-payment-url]").data("disable-payment-url"),{type:e.closest("form").find(".payment_type").val()}).then((function(t){var n=t.data;n.error?Botble.showError(n.message):(e.closest("tbody").find(".payment-name-label-group").addClass("hidden"),e.closest("tbody").find(".edit-payment-item-btn-trigger").addClass("hidden"),e.closest("tbody").find(".save-payment-item-btn-trigger").removeClass("hidden"),e.closest("tbody").find(".btn-text-trigger-update").addClass("hidden"),e.closest("tbody").find(".btn-text-trigger-save").removeClass("hidden"),e.addClass("hidden"),$("#confirm-disable-payment-method-modal").modal("hide"),Botble.showSuccess(n.message))}))}))})),$(".save-payment-item").off("click").on("click",(function(t){t.preventDefault();var e=$(t.currentTarget);$httpClient.make().withButtonLoading(e).post($("div[data-update-payment-url]").data("update-payment-url"),e.closest("form").serialize()).then((function(t){var n=t.data;n.error?Botble.showError(n.message):(e.closest("tbody").find(".payment-name-label-group").removeClass("hidden"),e.closest("tbody").find(".method-name-label").text(e.closest("form").find("input[name=name]").val()),e.closest("tbody").find(".disable-payment-item").removeClass("hidden"),e.closest("tbody").find(".edit-payment-item-btn-trigger").removeClass("hidden"),e.closest("tbody").find(".save-payment-item-btn-trigger").addClass("hidden"),e.closest("tbody").find(".btn-text-trigger-update").removeClass("hidden"),e.closest("tbody").find(".btn-text-trigger-save").addClass("hidden"),Botble.showSuccess(n.message))}))}))}}])&&e(n.prototype,o),i&&e(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();$((function(){(new o).init()}))})();