define("admin/mail_config",["jquery","cla_select2"],function(n,e){return function(n){function e(t){if(s[t])return s[t].exports;var a=s[t]={i:t,l:!1,exports:{}};return n[t].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var s={};return e.m=n,e.c=s,e.i=function(n){return n},e.d=function(n,s,t){e.o(n,s)||Object.defineProperty(n,s,{configurable:!1,enumerable:!0,get:t})},e.n=function(n){var s=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(s,"a",s),s},e.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},e.p="/components/",e(e.s="./assets/js/admin/mail_config.js")}({"./assets/js/admin/mail_config.js":function(n,e,s){var t,a;t=[s(0),s(1)],void 0!==(a=function(n){return function(){n("#mailTabs a").click(function(e){e.preventDefault(),n(this).tab("show")});var e=document.location.toString();e.match("#")&&n('.nav-item a[href="#'+e.split("#")[1]+'"]').tab("show"),n("#mailTabs .nav-link").on("shown.bs.tab",function(n){window.location.hash=n.target.hash});var s=n(".js-mail-config-field"),t=n("#mail_send_driver");s.find("input:disabled").data("originally-disabled",!0);var a=function(e){s.addClass("d-none"),s.find("input").prop("disabled",!0);var t=n(".js-mail-driver-"+e);t.removeClass("d-none"),t.find("input").filter(function(){return!n(this).data("originally-disabled")}).prop("disabled",!1),n(".js-driver-desc").addClass("d-none"),n("#driver_desc_"+e).removeClass("d-none")};t.select2(),a(t.val()),t.on("change",function(){a(n(this).val())}),n("#test_connection").on("click",function(e){e.preventDefault();var s=n("#mail_send_driver").val(),t={driver:s,params:{}};n(".js-mail-driver-"+s).find("input").each(function(){for(var e="",s=/\|(.*)]/gm;null!==(matches=s.exec(n(this).prop("name")));)matches.index===s.lastIndex&&s.lastIndex++,matches.forEach(function(n,s){e=n});"radio"===n(this).prop("type")?n(this).prop("checked")&&(t.params[e]=n(this).val()):t.params[e]=n(this).val()}),n.post({method:"POST",url:"/api/sysadmin/v1/mail/test_connection",data:t,success:function(n,e,s){"boolean"==typeof n.result&&n.result?cla.showMessage(lmsg("panels.sysadmin.mail.config.test_success"),"",!1):"boolean"==typeof n.testOccurred&&n.testOccurred?cla.showMessage(lmsg("panels.sysadmin.mail.config.test_fail"),n.errorMessage,!0):cla.showMessage(lmsg("panels.sysadmin.mail.config.test_not_run"),n.errorMessage,"info")},error:function(n,e,s){cla.showMessage(lmsg("common.error"),lmsg("panels.sysadmin.mail.config.test_error"),!0)}})})}}.apply(e,t))&&(n.exports=a)},0:function(e,s){e.exports=n},1:function(n,s){n.exports=e}})});
//# sourceMappingURL=mail_config.js.map