!function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;this.copyTemplateUI(),this.setLanguages(e)}},{key:"copyTemplateUI",value:function(){var e=this;this.UI=this.content.find(".js-select-languages:last").clone().show(),this.UI.appendTo(this.pairsUI),this.fromLanguageSelect=this.UI.find(".js-from-language-select"),this.fromLanguageSelect.on("change",function(t){return e.fromLanguageChanged()}),this.toLanguageCheckboxes=this.UI.find(":checkbox"),this.toLanguageCheckboxes.on("change",function(t){e.toLangChangeCallback()}),this.trashIcon=this.UI.find(".js-delete-language-pair")}},{key:"setLanguages",value:function(e){var t=this;this.fromLang&&this.fromLanguageSelect.val(this.fromLang),this.disableFromLanguages(e),this.UI.find(".js-to-languages").show(),this.toLangs.forEach(function(e){return t.UI.find(":checkbox[value="+e+"]").prop("checked",!0)}),this.hideToLanguage(this.fromLang)}},{key:"disableFromLanguages",value:function(e){var t=this;this.fromLanguageSelect.find("option").prop("disabled",!1),e&&e.forEach(function(e){return t.fromLanguageSelect.find("option[value="+e+"]").prop("disabled",e!==t.fromLang)})}},{key:"disableFromLanguageSelect",value:function(e){this.fromLanguageSelect.prop("disabled",e)}},{key:"hideToLanguage",value:function(e){this.toLanguageCheckboxes.closest("label").show(),this.UI.find(":checkbox[value="+e+"]").prop("checked",!1).closest("label").hide()}},{key:"getFromLanguage",value:function(){return this.fromLanguageSelect.val()}},{key:"getToLanguages",value:function(){var e=[];return this.UI.find(":checkbox:checked").each(function(t,n){return e.push(n.value)}),e}},{key:"fromLanguageChanged",value:function(){this.fromLang=this.getFromLanguage(),this.hideToLanguage(this.getFromLanguage()),this.fromLangChangeCallback()}},{key:"hideTrashIcon",value:function(e){e?this.trashIcon.hide():this.trashIcon.show()}},{key:"addTrashHook",value:function(e){var t=this;this.trashIcon.off("click").on("click",function(n){return t.onTrash(e)})}},{key:"onTrash",value:function(e){e(this),this.UI.remove()}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,i=function(){function e(e,t){for(var n=0;n0)}},{key:"toLanguageChanged",value:function(){this.isAnyLanguagePairOKCallback(Object.keys(this.getLanguagePairs()).length>0)}}]),e}();t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n4&&void 0!==arguments[4]?arguments[4]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.$=t,this.content=n,this.nonce=a,this.editTranslatorLanguageDialog=i,this.translatorRemovedCallback=o}return a(e,[{key:"init",value:function(){var e=this;this.content.find(".js-remove-translator").off("click").on("click",function(t){return e.removeTranslator(t)}),this.content.find(".js-edit-languages").off("click").on("click",function(t){return e.editTranslatorLanguages(t)})}},{key:"addRow",value:function(e){this.content.find("tbody").append(e),this.init(),this.showOrHideList()}},{key:"removeTranslator",value:function(e){var t=this,n=this.getEventRow(e),a=n.data("user-id");this.$.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"wpml_remove_translation_translator",nonce:this.nonce,user_id:a},success:function(e){return t.translatorRemoved(e,n)}})}},{key:"translatorRemoved",value:function(e,t){e.success&&(t.remove(),this.showOrHideList(),this.translatorRemovedCallback&&this.translatorRemovedCallback())}},{key:"showOrHideList",value:function(){this.getNumberOfTranslators()?this.content.show():this.content.hide()}},{key:"editTranslatorLanguages",value:function(e){var t=this,n=this.getEventRow(e),a=n.data("user-id"),i=n.data("language-pairs");this.editTranslatorLanguageDialog.open(a,i,function(e){return t.updateTranslator(n,e)})}},{key:"getEventRow",value:function(e){return this.$(e.target).closest("tr")}},{key:"updateTranslator",value:function(e,t){e.replaceWith(t),this.init(),this.editTranslatorLanguageDialog.close()}},{key:"getNumberOfTranslators",value:function(){return this.content.find("tbody > tr").length}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n