!function(e){var r={};function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,r,t){o.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,r){if(1&r&&(e=o(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)o.d(t,n,function(r){return e[r]}.bind(null,n));return t},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,"a",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p="/",o(o.s=13)}({13:function(e,r,o){e.exports=o("HWX2")},HWX2:function(e,r){$("#editProfileForm").submit((function(e){e.preventDefault();var r=jQuery(this).find("#btnPrEditSave");r.button("loading"),$.ajax({url:usersUrl+"profile-update",type:"post",data:new FormData($(this)[0]),processData:!1,contentType:!1,success:function(e){e.success&&($("#EditProfileModal").modal("hide"),location.reload())},error:function(e){manageAjaxErrors(e,"editProfileValidationErrorsBox")},complete:function(){r.button("reset")}})})),$("#changePasswordForm").submit((function(e){if(e.preventDefault(),isValidate=function(){var e=$("#pfCurrentPassword").val().trim(),r=$("#pfNewPassword").val().trim(),o=$("#pfNewConfirmPassword").val().trim();if(""==e||""==r||""==o)return $("#editPasswordValidationErrorsBox").show().html("Please fill all the required fields."),!1;return!0}(),!isValidate)return!1;var r=jQuery(this).find("#btnPrPasswordEditSave");r.button("loading"),$.ajax({url:usersUrl+"change-password",type:"post",data:new FormData($(this)[0]),processData:!1,contentType:!1,success:function(e){e.success&&($("#ChangePasswordModal").modal("hide"),location.reload())},error:function(e){manageAjaxErrors(e,"editPasswordValidationErrorsBox")},complete:function(){r.button("reset")}})})),$("#EditProfileModal").on("hidden.bs.modal",(function(){resetModalForm("#editProfileForm","#editProfileValidationErrorsBox")})),$("#ChangePasswordModal").on("hidden.bs.modal",(function(){resetModalForm("#changePasswordForm","#editPasswordValidationErrorsBox")})),$(document).on("click",".edit-profile",(function(e){var r=$(e.currentTarget).data("id");renderProfileData(usersUrl+r+"/edit")})),$(document).on("change","#pfImage",(function(){var e=$(this).val().split(".").pop().toLowerCase();-1==$.inArray(e,["gif","png","jpg","jpeg"])?($(this).val(""),$("#editProfileValidationErrorsBox").html("The profile image must be a file of type: jpeg, jpg, png.").show()):displayPhoto(this,"#edit_preview_photo")})),window.renderProfileData=function(e){$.ajax({url:e,type:"GET",success:function(e){if(e.success){var r=e.data;$("#pfUserId").val(r.id),$("#pfName").val(r.name),$("#pfEmail").val(r.email),$("#pfPhone").val(r.phone),$("#edit_preview_photo").attr("src",r.image_path),$("#EditProfileModal").modal("show")}}})},window.displayPhoto=function(e,r){var o=!0;if(e.files&&e.files[0]){var t=new FileReader;t.onload=function(e){var t=new Image;t.src=e.target.result,t.onload=function(){$(r).attr("src",e.target.result),o=!0}},o&&(t.readAsDataURL(e.files[0]),$(r).show())}},$(document).on("keyup","#name",(function(e){var r=$(this).val().trim();(8===e.charCode||e.charCode>=65&&e.charCode<=90||e.charCode>=95&&e.charCode<=122||0===e.charCode||e.charCode>=48&&e.charCode<=57)&&r.length<=4&&$("#prefix").val(r.toLocaleUpperCase())})),$(".confirm-pwd").hide(),$(document).on("blur","#pfCurrentPassword",(function(){var e=$("#pfCurrentPassword").val();if(""==e||""==e.trim())return $(".confirm-pwd").hide(),!1;$(".confirm-pwd").show()})),$(".confirm-pwd").hide(),$(document).on("blur","#pfNewPassword",(function(){var e=$("#pfNewPassword").val();if(""==e||""==e.trim())return $(".confirm-pwd").hide(),!1;$(".confirm-pwd").show()})),$(document).on("blur","#pfNewConfirmPassword",(function(){var e=$("#pfNewConfirmPassword").val();if(""==e||""==e.trim())return $(".confirm-pwd").hide(),!1;$(".confirm-pwd").show()})),$(".changeType").click((function(){var e=$(this).parent().siblings();"password"==e.attr("type")?($(this).children().addClass("icon-eye"),$(this).children().removeClass("icon-ban"),e.attr("type","text")):($(this).children().removeClass("icon-eye"),$(this).children().addClass("icon-ban"),e.attr("type","password"))}))}});