text: !function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=50)}({50:function(e,t,r){e.exports=r("ERc5")},ERc5:function(e,t,r){"use strict";var a="#noticeboardsTbl";$(a).DataTable({scrollX:!1,deferRender:!0,scroller:!0,processing:!0,serverSide:!0,order:[[0,"asc"]],ajax:{url:noticeboardUrl},columnDefs:[{targets:[0],width:"20%"},{targets:[1],render:function(e){return e.length>100?e.substr(0,100)+"...":e}},{targets:[2,3],orderable:!1,className:"text-center",width:"8%"}],columns:[{data:function(e){var t=document.createElement("textarea");return t.innerHTML=e.title,'<a href="#" class="show-btn" data-id="'+e.id+'">'+t.value+"</a>"},name:"title"},{data:function(e){if(isEmpty(e.description))return"N/A";var t=document.createElement("textarea");return t.innerHTML=e.description,t.value},name:"description"},{data:function(e){var t=0===e.is_active?"":"checked",r=[{id:e.id,checked:t}];return prepareTemplateRender("#isActive",r)},name:"is_active"},{data:function(e){var t=[{id:e.id}];return prepareTemplateRender("#noticeboardActionTemplate",t)},name:"id"}]}),$(document).on("click",".addNoticeboardModal",(function(){$("#addModal").appendTo("body").modal("show")})),$(document).on("submit","#addNewForm",(function(e){if(e.preventDefault(),!checkSummerNoteEmpty("#description","Description field is required.",1))return!0;processingBtn("#addNewForm","#btnSave","loading"),$.ajax({url:noticeboardSaveUrl,type:"POST",data:$(this).serialize(),success:function(e){e.success&&(displaySuccessMessage(e.message),$("#addModal").modal("hide"),$(a).DataTable().ajax.reload(null,!1))},error:function(e){displayErrorMessage(e.responseJSON.message)},complete:function(){processingBtn("#addNewForm","#btnSave")}})})),$(document).on("click",".edit-btn",(function(e){var t=$(e.currentTarget).data("id");renderData(t)})),window.renderData=function(e){$.ajax({url:noticeboardUrl+e+"/edit",type:"GET",success:function(e){if(e.success){var t=document.createElement("textarea");t.innerHTML=e.data.title,$("#noticeboardId").val(e.data.id),$("#editTitle").val(t.value),$("#editDescription").summernote("code",e.data.description),1==e.data.is_active?$("#editIsActive").prop("checked",!0):$("#editIsActive").prop("checked",!1),$("#editModal").appendTo("body").modal("show")}},error:function(e){displayErrorMessage(e.responseJSON.message)}})},$(document).on("submit","#editForm",(function(e){if(e.preventDefault(),!checkSummerNoteEmpty("#editDescription","Description field is required.",1))return!0;processingBtn("#editForm","#btnEditSave","loading");var t=$("#noticeboardId").val();$.ajax({url:noticeboardUrl+t,type:"put",data:$(this).serialize(),success:function(e){e.success&&(displaySuccessMessage(e.message),$("#editModal").modal("hide"),$(a).DataTable().ajax.reload(null,!1))},error:function(e){displayErrorMessage(e.responseJSON.message)},complete:function(){processingBtn("#editForm","#btnEditSave")}})})),$(document).on("click",".show-btn",(function(e){var t=$(e.currentTarget).data("id");$.ajax({url:noticeboardUrl+t,type:"GET",success:function(e){if(e.success){$("#showTitle").html(""),$("#showDescription").html(""),$("#showTitle").append(e.data.title);var t=document.createElement("textarea");t.innerHTML=isEmpty(e.data.description)?"N/A":e.data.description,$("#showDescription").append(t.value),1===e.data.is_active?$("#showIsActive").html("Active"):$("#showIsActive").html("Deactive"),$("#showModal").appendTo("body").modal("show")}},error:function(e){displayErrorMessage(e.responseJSON.message)}})})),$(document).on("click",".delete-btn",(function(e){var t=$(e.currentTarget).data("id");deleteItem(noticeboardUrl+t,a,"Noticeboard")})),$(document).on("change",".isActive",(function(e){var t=$(e.currentTarget).data("id");$.ajax({url:noticeboardUrl+t+"/change-status",method:"post",cache:!1,success:function(e){e.success&&$(a).DataTable().ajax.reload(null,!1)}})})),$("#addModal").on("hidden.bs.modal",(function(){resetModalForm("#addNewForm","#validationErrorsBox"),$("#description").summernote("code","")})),$("#editModal").on("hidden.bs.modal",(function(){resetModalForm("#editForm","#editValidationErrorsBox")})),$("#description, #editDescription").summernote({minHeight:200,height:200,toolbar:[["style",["bold","italic","underline","clear"]],["font",["strikethrough"]],["para",["paragraph"]]]})}});