(()=>{function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var t=function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,a,r;return n=t,(a=[{key:"init",value:function(){$(document).on("click",".answer-trigger-button",(function(e){e.preventDefault(),e.stopPropagation();var t=$(".answer-wrapper");t.is(":visible")?t.fadeOut():t.fadeIn(),window.EDITOR=(new EditorManagement).init()})),$(document).on("click",".answer-send-button",(function(e){e.preventDefault(),e.stopPropagation();var t=$(e.currentTarget);Botble.showButtonLoading(t);var n=$("#message").val();"undefined"!=typeof tinymce&&(n=tinymce.get("message").getContent()),$httpClient.make().post(t.data("url"),{message:n}).then((function(e){var t=e.data;if($(".answer-wrapper").fadeOut(),"undefined"!=typeof tinymce)tinymce.get("message").setContent("");else{$("#message").val("");var n=document.querySelector(".answer-wrapper .ck-editor__editable");if(n){var a=n.ckeditorInstance;a&&a.setData("")}}Botble.showSuccess(t.message),$("#reply-wrapper").load(window.location.href+" #reply-wrapper > *")})).finally((function(){Botble.hideButtonLoading($(e.currentTarget))}))}))}}])&&e(n.prototype,a),r&&e(n,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();$((function(){(new t).init()}))})();