(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,o){for(var r=0;r<o.length;r++){var n=o[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(a=n.key,i=void 0,i=function(t,o){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,o||"default");if("object"!==e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===o?String:Number)(t)}(a,"string"),"symbol"===e(i)?i:String(i)),n)}var a,i}var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var o,r,n;return o=e,(r=[{key:"init",value:function(){$(document).on("click",".btn-trigger-active-theme",(function(e){e.preventDefault();var t=$(e.currentTarget);t.addClass("button-loading"),$.ajax({url:route("theme.active"),data:{theme:t.data("theme")},type:"POST",success:function(e){e.error?Botble.showError(e.message):(Botble.showSuccess(e.message),window.location.reload()),t.removeClass("button-loading")},error:function(e){Botble.handleError(e),t.removeClass("button-loading")}})})),$(document).on("click",".btn-trigger-remove-theme",(function(e){e.preventDefault(),$("#confirm-remove-theme-button").data("theme",$(e.currentTarget).data("theme")),$("#remove-theme-modal").modal("show")})),$(document).on("click","#confirm-remove-theme-button",(function(e){e.preventDefault();var t=$(e.currentTarget);t.addClass("button-loading"),$.ajax({url:route("theme.remove",{theme:t.data("theme")}),type:"POST",success:function(e){e.error?Botble.showError(e.message):(Botble.showSuccess(e.message),window.location.reload()),t.removeClass("button-loading"),$("#remove-theme-modal").modal("hide")},error:function(e){Botble.handleError(e),t.removeClass("button-loading"),$("#remove-theme-modal").modal("hide")}})}))}}])&&t(o.prototype,r),n&&t(o,n),Object.defineProperty(o,"prototype",{writable:!1}),e}();$(document).ready((function(){(new o).init()}))})();