/
home
/
vianto5
/
cititower.mx
/
wp-content
/
plugins
/
sitepress-multilingual-cms
/
dist
/
js
/
settings
/
/home/vianto5/cititower.mx/wp-content/plugins/sitepress-multilingual-cms/dist/js/settings
mkdir
upload
Name
Size
Mode
Actions
app.js
36010
0644
edit
dl
rm
Edit:
/home/vianto5/cititower.mx/wp-content/plugins/sitepress-multilingual-cms/dist/js/settings/app.js
(36010B)
!function(t){function e(e){for(var i,s,o=e[0],u=e[1],l=e[2],h=0,d=[];h<o.length;h++)s=o[h],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&d.push(r[s][0]),r[s]=0;for(i in u)Object.prototype.hasOwnProperty.call(u,i)&&(t[i]=u[i]);for(c&&c(e);d.length;)d.shift()();return a.push.apply(a,l||[]),n()}function n(){for(var t,e=0;e<a.length;e++){for(var n=a[e],i=!0,o=1;o<n.length;o++){var u=n[o];0!==r[u]&&(i=!1)}i&&(a.splice(e--,1),t=s(s.s=n[0]))}return t}var i={},r={13:0},a=[];function s(e){if(i[e])return i[e].exports;var n=i[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=t,s.c=i,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)s.d(n,i,function(e){return t[e]}.bind(null,i));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="";var o=window.webpackWPML=window.webpackWPML||[],u=o.push.bind(o);o.push=e,o=o.slice();for(var l=0;l<o.length;l++)e(o[l]);var c=u;a.push([1291,0]),n()}({108:function(t,e,n){},109:function(t,e,n){},110:function(t,e,n){"use strict";var i=n(3),r=n.n(i),a=n(7),s=n.n(a),o=n(9),u=n.n(o),l=n(0),c=n(16);e.a=function(t){var e=Object(l.useState)(!1),n=u()(e,2),i=n[0],a=n[1],o=Object(l.useState)(""),h=u()(o,2),d=h[0],p=h[1];return[i,function(){var e=s()(r.a.mark((function e(n,i){var s,o,u,l;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p(""),a(!0),e.next=4,Object(c.a)(t,n);case 4:s=e.sent,o=s.data,u=o.success,l=o.data,a(!1),u?i():p(l);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),d,function(){return p("")}]}},1291:function(t,e,n){"use strict";n.r(e);var i=n(0),r=n.n(i),a=n(35),s=n.n(a),o=n(15),u=n.n(o),l=n(19),c=n.n(l),h=n(38),d=n.n(h),p=n(46),f=n.n(p),v=n(41),m=n.n(v),g=n(82);function y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=m()(t);if(e){var r=m()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var S=function(t){d()(n,t);var e=y(n);function n(t){var i;return u()(this,n),(i=e.call(this)).ateControls=t,i.translationMethodForm=document.getElementById("icl_doc_translation_method"),i}return c()(n,[{key:"init",value:function(){this.updateSelectedOption(),this.initEventHandlers(),this.ateControls.init(),this.currentOptionIsATE()?(this.ateControls.visibility(!0),this.ateControls.updateControlsStatus()):this.ateControls.visibility(!1)}},{key:"updateSelectedOption",value:function(){var t=this;this.translationMethodForm&&(this.translationMethodOptions=this.translationMethodForm.querySelectorAll('[type="radio"][name="t_method"]'),Array.from(this.translationMethodOptions).map((function(e){e.checked&&(t.selectedOptionValue=e.value)})))}},{key:"currentOptionIsATE",value:function(){return"ATE"===this.selectedOptionValue}},{key:"initEventHandlers",value:function(){var t=this;if(this.translationMethodOptions)for(var e=0;e<this.translationMethodOptions.length;e++)this.translationMethodOptions[e].onchange=function(e){t.updateSelectedOption(),t.ateControls.visibility(t.currentOptionIsATE()),t.ateControls.updateControlsStatus(),"ATE"===e.target.value&&t.maybeLoadAteScript()}}},{key:"maybeLoadAteScript",value:function(){var t=this;document.querySelector("#eate_dashboard-js")||this.ateControls.ATERequiresActivation()||document.addEventListener("icl-save-form-icl_doc_translation_method",(function(){t.ateControls.loadAteScript()}))}}]),n}(g.a),b={registerClient:"/wpml/tm/v1/ams/register_manager",checkStatus:"/wpml/tm/v1/ams/status",synchronizeTranslators:"/wpml/tm/v1/ams/synchronize/translators",synchronizeManagers:"/wpml/tm/v1/ams/synchronize/managers",consoleURL:"/wpml/tm/v1/ams/console",engines:"/wpml/tm/v1/ams/engines"},k=function(){function t(e){u()(this,t),this.request=e}return c()(t,[{key:"registerClient",value:function(){return this.request.post(b.registerClient)}},{key:"checkStatus",value:function(){return this.request.get(b.checkStatus)}},{key:"synchronize",value:function(){var t=this;return this.request.get(b.synchronizeTranslators).then((function(){return t.request.get(b.synchronizeManagers)}))}},{key:"updateConsoleURL",value:function(){return this.request.get(b.consoleURL).then((function(t){return t}))}},{key:"getEngines",value:function(){return this.request.get(b.engines).then((function(t){return t}))}},{key:"updateEngines",value:function(t){return this.request.post(b.engines,t).then((function(t){return t}))}}]),t}(),E=n(90),w=n(3),C=n.n(w),O=n(7),T=n.n(O),_=n(369),A=n.n(_),L=n(13),P=n.n(L),j={nonActive:"non-active",enabled:"enabled",active:"active"},M=n(29),R=n.n(M),x=n(150),q=n(65),I=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.preventReload,i=void 0!==n&&n;u()(this,t),this.preventReload=i,this.tools=new x.a}return c()(t,[{key:"clearCache",value:function(){this.ateControls=null,this.synchronizeWithAMS=null,this.status=null,this.errors=null,this.spinner=null}},{key:"initEventHandlers",value:function(){var t=this;this.getAteConsoleLink()&&(this.getAteConsoleLink().onclick=function(e){if(!t.preventReload)return window.location.reload(!0);t.tools.hide(e.currentTarget)})}},{key:"isStatusOnly",value:function(){return this.getAteControls()&&this.getAteControls().hasAttribute("data-status-only")}},{key:"getAteControls",value:function(){return this.ateControls||(this.ateControls=document.getElementById("ate-controls")),this.ateControls}},{key:"getStatus",value:function(){return this.getAteControls()&&!this.status&&(this.status=this.getAteControls().querySelector(".otgs-notice__status")),this.status}},{key:"getErrors",value:function(){return this.getAteControls()&&!this.errors&&(this.errors=this.getAteControls().querySelector(".otgs-notice__errors")),this.errors}},{key:"getSpinner",value:function(){return this.getAteControls()&&!this.spinner&&(this.spinner=this.getAteControls().querySelector(".spinner")),this.spinner}},{key:"getAteConsoleLink",value:function(){return this.getAteControls()?this.getAteControls().querySelector(".js-ate-console"):null}},{key:"updateAteConsoleLink",value:function(t){this.getAteConsoleLink()&&(this.getAteConsoleLink().href=t)}},{key:"showStatus",value:function(t){var e,n=t.status,i=t.statusTypes;this.getStatus()&&this.tools.show(this.getStatus()),this.getStatus().querySelector("p").innerHTML=this.getStatusHTML(n.message),(e=this.getStatus().classList).remove.apply(e,R()(i)),this.getStatus().classList.add(n.type)}},{key:"updateErrors",value:function(t){if(this.getErrors())if(t){var e="<strong>"+q.a("WPML's Advanced Translation Editor is not working","header",t)+"</strong>";e+="<br/>",e+="<p>"+q.a("","description",t),this.getErrors().querySelector(".message").innerHTML=e,this.showErrors()}else this.hideErrors()}},{key:"setControlsVisibility",value:function(t){t?this.showAteControls():this.hideAteControls()}},{key:"showAteControls",value:function(){this.getAteControls()&&this.tools.show(this.getAteControls()),this.updateActions()}},{key:"hideAteControls",value:function(){this.getAteControls()&&this.tools.hide(this.getAteControls())}},{key:"hideAteConsoleLink",value:function(){this.getAteConsoleLink()&&this.tools.hide(this.getAteConsoleLink())}},{key:"getStatusHTML",value:function(t){var e=t.status,n=t.text;return"<strong>".concat(e,"</strong> ").concat(n)}},{key:"hideStatus",value:function(){this.getStatus()&&this.tools.hide(this.getStatus())}},{key:"hideErrors",value:function(){this.getErrors()&&this.tools.hide(this.getErrors())}},{key:"showSpinner",value:function(){this.getSpinner()&&this.getSpinner().classList.add("is-active")}},{key:"hideSpinner",value:function(){this.getSpinner()&&this.getSpinner().classList.remove("is-active")}},{key:"showErrors",value:function(){this.getErrors()&&this.tools.show(this.getErrors())}},{key:"updateActions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(this.isStatusOnly()||t)&&(this.clearCache(),this.hideAteConsoleLink())}}]),t}(),N=n(16),U=!1,z=null,D=function(){var t=T()(C.a.mark((function t(e){return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!U){t.next=2;break}return t.abrupt("return",!0);case 2:if(!z){t.next=6;break}return t.next=5,z;case 5:return t.abrupt("return",t.sent);case 6:return t.prev=6,z=T()(C.a.mark((function t(){var n,i,r,a;return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(N.a)(e,{});case 2:if(n=t.sent,i=n.data,r=i.data,i.success&&r){t.next=8;break}throw new Error("Failed to load ATE dashboard script: Empty or invalid response");case 8:return(a=document.createElement("script")).type="text/javascript",a.text=r,document.body.appendChild(a),t.next=14,new Promise((function(t){return setTimeout(t,2e3)}));case 14:return U=!0,t.abrupt("return",!0);case 16:case"end":return t.stop()}}),t)})))(),t.next=10,z;case 10:return t.abrupt("return",t.sent);case 13:throw t.prev=13,t.t0=t.catch(6),console.error("Error loading ATE dashboard script:",t.t0),z=null,t.t0;case 18:case"end":return t.stop()}}),t,null,[[6,13]])})));return function(e){return t.apply(this,arguments)}}();function H(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=m()(t);if(e){var r=m()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var B=function(t){d()(i,t);var e,n=H(i);function i(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.preventReload,s=void 0!==a&&a;return u()(this,i),e=n.call(this),P()(A()(e),"loadAteScript",T()(C.a.mark((function t(){return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,D(wpmlSettingsUI.endpoints.ateDashboardScript);case 2:case"end":return t.stop()}}),t)})))),e.visible=!1,e.ui=new I({preventReload:s}),e.amsAPI=t,e.statusTypes=Object.keys(e.ateSettings.statuses).map((function(t){return e.ateSettings.statuses[t].type})),e}return c()(i,[{key:"init",value:function(){this.initUI(),this.checkActivation(),this.initEventHandlers()}},{key:"initUI",value:function(){this.ui.hideStatus(),this.ui.hideErrors()}},{key:"show",value:function(){this.visibility(!0)}},{key:"hide",value:function(){this.visibility(!1)}},{key:"visibility",value:function(t){this.visible=t,this.ui.setControlsVisibility(t)}},{key:"updateControlsStatus",value:function(){this.visible&&(this.ATERequiresActivation()?this.enableATE():(this.ATEIsActive()&&this.initEventHandlers(),this.updateStatusMessage())),this.initEventHandlers()}},{key:"updateStatusMessage",value:function(){this.ateSettings.currentStatus!==j.active?(this.ui.showAteControls(),this.ui.showStatus({status:this.getStatus(),statusTypes:this.statusTypes})):this.ui.hideAteControls()}},{key:"getStatus",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===t&&(t=this.ateSettings.currentStatus),this.ateSettings.statuses[t]}},{key:"ATERequiresActivation",value:function(){return this.ateSettings.currentStatus===j.nonActive}},{key:"ATEIsActive",value:function(){return this.ateSettings.currentStatus===j.active}},{key:"initEventHandlers",value:function(){this.ui.initEventHandlers()}},{key:"checkActivation",value:function(){var t=this;this.ui.clearCache(),this.ateSettings.currentStatus===j.enabled?(this.ui.updateErrors(),this.ui.showSpinner(),this.amsAPI.checkStatus().then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{activated:!1},n=e.activated;n&&(t.ateSettings.currentStatus=j.active,t.handleSynchronize())})).then((function(){t.loadAteScript()})).finally((function(){t.updateControlsStatus(),t.ui.updateActions(!0),t.ui.hideSpinner()}))):this.updateControlsStatus()}},{key:"enableATE",value:function(t,e){var n=this;if(!this.enablingATE){this.enablingATE=!0;var i=!1;this.ui.clearCache(),this.ui.updateErrors(),this.ui.showSpinner(),this.visibility(!0),this.updateControlsStatus(),this.amsAPI.registerClient().then((function(t){if(!t.enabled)throw q.a([],"error",t);return t})).then((function(){n.ateSettings.currentStatus=j.enabled,n.checkActivation(),n.updateConsoleURL(),t&&t()})).catch((function(t){i=!0,n.ui.updateErrors(t),e&&e()})).finally((function(){n.ui.hideSpinner(),n.enablingATE=!1,i||(n.checkActivation(),n.ui.updateActions())}))}}},{key:"enableATEWithoutUI",value:(e=T()(C.a.mark((function t(){var e=this;return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.amsAPI.registerClient().then((function(t){return t.enabled&&(e.ateSettings.currentStatus=j.enabled),t})));case 1:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"updateConsoleURL",value:function(){var t=this;return this.amsAPI.updateConsoleURL().catch((function(e){t.ui.updateErrors(e)})).then((function(e){t.ui.updateAteConsoleLink(e)}))}},{key:"handleSynchronize",value:function(){return this.amsAPI.synchronize()}},{key:"isStatusOnly",value:function(){return this.ui.isStatusOnly()}}]),i}(g.a),F=n(387),W=n(67),V=n(151),G=n(1);function J(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=m()(t);if(e){var r=m()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}var Y=function(t){d()(n,t);var e=J(n);function n(){var t;return u()(this,n),(t=e.call(this)).translationMethodOptions=[],t.oldJobsMethodOptions=[],t.form=document.getElementById("icl_doc_translation_method"),t.form&&(t.translationMethodOptions=t.form.querySelectorAll('[type="radio"][name="t_method"]'),t.submitButton=t.form.querySelector(".button-primary"),t.initEventHandlers()),t}return c()(n,[{key:"initEventHandlers",value:function(){for(var t=this,e=0;e<this.translationMethodOptions.length;++e){this.translationMethodOptions[e].onclick=function(e){var n=e.currentTarget;t.saveForm(),Object(F.a)("editor-mode",n.value)}}Object(F.b)("auto-translation-method").then(Object(W.a)("automatic")).then(this.disableClassicEditor.bind(this))}},{key:"disableClassicEditor",value:function(t){this.translationMethodOptions.forEach((function(e){if("1"===e.value){e.disabled=t;var n=t?Object(G.a)("You must use the Advanced Translation Editor if you want to translate your content automatically.","sitepress"):"",i=e.parentNode;i.setAttribute("title",n),i._tippy||Object(V.a)(i,"otgs")}}))}},{key:"updateOldJobsMethods",value:function(t){for(var e=0;e<this.oldJobsMethodOptions.length;++e){var n=this.oldJobsMethodOptions[e];n.disabled="ATE"!==t,n.disabled&&(n.checked="ATE"!==n.value.toUpperCase())}}},{key:"saveForm",value:function(){this.submitButton&&this.submitButton.click()}}]),n}(g.a),Z=function(){function t(e,n){var i=n.minSearchLength,r=n.searchTimeOutValue;u()(this,t),this.minSearchLength=i,this.searchTimeOutValue=r,this.timeout=null,this.onUpdateRequired=null,this.tools=new x.a,this.filterContainer=e,this.initData()}return c()(t,[{key:"initData",value:function(){this.searchField=this.filterContainer.querySelector(".wpml_tm_search"),this.prevSearch=this.searchField.value,this.spinner=this.filterContainer.querySelector(".spinner")}},{key:"bindEvents",value:function(){var t=this;this.searchField.onkeydown=function(e){if(13!==e.keyCode)return!0;e.preventDefault(),t.getSearchText().length>=t.minSearchLength&&(clearTimeout(t.timeout),t.maybeDoSearch())},this.searchField.onkeyup=function(e){if(13===e.keyCode)return!1;t.updateSearch()}}},{key:"getSearchText",value:function(){return this.searchField.value.trim()}},{key:"updateSearch",value:function(){var t=this;this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){t.maybeDoSearch()}),this.searchTimeOutValue)}},{key:"maybeDoSearch",value:function(){var t=this.getSearchText();this.mustUpdate(t)&&(this.prevSearch=t,this.updateFilter())}},{key:"mustUpdate",value:function(t){return(0===t.length||t.length>=this.minSearchLength)&&this.prevSearch!==t}},{key:"updateFilter",value:function(){this.tools.showSpinner(this.spinner),this.onUpdateRequired()}},{key:"onUpdated",value:function(){this.tools.hideSpinner(this.spinner),this.initData(),this.bindEvents()}}]),t}(),$=function(){function t(e,n){u()(this,t),this.default_page_size=n,this.onUpdateRequired=null,this.tools=new x.a,this.navigatorContainer=e,this.initData()}return c()(t,[{key:"initData",value:function(){this.pageSize=this.default_page_size,this.currentPage=1,this.pagesContainer=this.navigatorContainer.querySelector(".tablenav-pages"),this.pageNumbers=this.pagesContainer.querySelectorAll(".page-numbers"),this.displayLess=this.pagesContainer.querySelector(".display-less"),this.displayAll=this.pagesContainer.querySelector(".display-all"),this.next=this.pagesContainer.querySelector(".next"),this.previous=this.pagesContainer.querySelector(".prev"),this.spinner=this.navigatorContainer.querySelector(".spinner"),this.pageSizeSelect=this.navigatorContainer.querySelector('select[name="wpml_tm_per_page"]'),this.currentPageButton=this.navigatorContainer.querySelector(".current"),this.customFieldsType=this.navigatorContainer.dataset.type,this.pageSizeSelect&&this.setPageSize(this.pageSizeSelect.value),this.currentPageButton&&this.setCurrentPage(this.currentPageButton.innerText)}},{key:"bindEvents",value:function(){var t=this;if(this.previous&&(this.previous.onclick=function(e){return t.onPreviousClick(e)}),this.next&&(this.next.onclick=function(e){return t.onNextClick(e)}),this.displayAll&&(this.displayAll.onclick=function(e){return t.onDisplayAllClick(e)}),this.displayLess&&(this.displayLess.onclick=function(e){return t.onDisplayLessClick(e)}),this.pageNumbers)for(var e=0;e<this.pageNumbers.length;e++){var n=this.pageNumbers[e],i=n.classList;i.contains("dots")||i.contains("current")||i.contains("prev")||i.contains("next")||(n.onclick=function(e){e.preventDefault(),t.setCurrentPage(e.currentTarget.innerText),t.updateNavigator()})}this.pageSizeSelect&&(this.pageSizeSelect.onchange=function(){return t.onPageSizeChange()})}},{key:"onPreviousClick",value:function(t){t.preventDefault(),this.goToPrevious(),this.updateNavigator()}},{key:"onNextClick",value:function(t){t.preventDefault(),this.goToNext(),this.updateNavigator()}},{key:"onDisplayAllClick",value:function(t){t.preventDefault(),this.setCurrentPage(-1),this.updateNavigator()}},{key:"onDisplayLessClick",value:function(t){t.preventDefault(),this.setCurrentPage(1),this.setPageSize(this.default_page_size),this.updateNavigator()}},{key:"onPageSizeChange",value:function(){this.setPageSize(this.pageSizeSelect.value),this.updateNavigator()}},{key:"getCurrentPage",value:function(){return this.currentPage}},{key:"setCurrentPage",value:function(e){this.currentPage=t.getInt(e)}},{key:"goToPrevious",value:function(){this.currentPage--}},{key:"goToNext",value:function(){this.currentPage++}},{key:"getPageSize",value:function(){return this.pageSize}},{key:"setPageSize",value:function(e){this.pageSize=t.getInt(e)}},{key:"updateNavigator",value:function(){this.tools.showSpinner(this.spinner),this.onUpdateRequired()}},{key:"onUpdated",value:function(){this.tools.hideSpinner(this.spinner),this.initData(),this.bindEvents()}}],[{key:"getInt",value:function(t){return Number.isInteger(t)?t:parseInt(t.trim().replace(/\D+/g,""))}}]),t}(),K=function(){function t(e,n){var i=this;u()(this,t),this.DEFAULT_PAGE_SIZE=20,this.SCROLL_DURATION=1200,this.MIN_SEARCH_LENGTH=1,this.SEARCH_TIMEOUT_VALUE=500,this.form=e,this.tools=n,this.lastSearch="",this.initData(),this.customFieldsType=this.form.dataset.type,this.highestPageLoaded=1,document.addEventListener("icl-save-form-"+this.form.id,(function(){i.saveFormCallback()}))}return c()(t,[{key:"initData",value:function(){this.filterContainer=this.form.querySelector(".wpml_tm_search_container"),delete this.filter,this.filterContainer&&(this.filter=new Z(this.filterContainer,{minSearchLength:this.MIN_SEARCH_LENGTH,searchTimeOutValue:this.SEARCH_TIMEOUT_VALUE})),this.navigatorContainer=this.form.querySelector(".wpml_tm_pagination_container"),delete this.navigator,this.navigatorContainer&&(this.navigator=new $(this.navigatorContainer,this.DEFAULT_PAGE_SIZE)),this.form&&(this.errors=this.form.querySelector(".otgs-notice__errors")),this.values=this.getValues()}},{key:"bindEvents",value:function(){var t=this;this.filter&&(this.filter.bindEvents(),this.filter.onUpdateRequired=function(){return t.updateCustomFields()}),this.navigator&&(this.navigator.bindEvents(),this.navigator.onUpdateRequired=function(){return t.updateCustomFields()}),wpmlCustomEvent("icl-bind-locks",{detail:this.form.id})}},{key:"getValues",value:function(){return{checked:R()(this.form.querySelectorAll('input[type="radio"]')).map((function(t){return t.checked})),locked:R()(this.form.querySelectorAll('input[name*="cf_unlocked"]')).map((function(t){return t.value}))}}},{key:"saveFormCallback",value:function(){this.values=this.getValues(),this.updateCustomFields()}},{key:"updateError",value:function(t){t?(this.errors.querySelector("p").innerHTML=t,this.tools.show(this.errors)):this.tools.hide(this.errors)}},{key:"updateCustomFields",value:function(){var t=this;if(JSON.stringify(this.values)===JSON.stringify(this.getValues())){var e=this.form.querySelector("#show_cf_meta_box"),n=this.filter.getSearchText(),i=this.navigator.getCurrentPage();n===this.lastSearch?this.highestPageLoaded=this.highestPageLoaded<i?i:this.highestPageLoaded:(i=1,this.highestPageLoaded=1);var r={action:"wpml_update_mcs_cf",type:this.customFieldsType,nonce:this.form.querySelector("#_icl_nonce").value,show_cf_meta_box:!!e&&e.checked,items_per_page:this.navigator.getPageSize(),search:n,paged:i,highest_page_loaded:this.highestPageLoaded,show_system_fields:Boolean(new URL(document.location).searchParams.get("show_system_fields"))},a=Object.keys(r).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(r[t])})).join("&");return this.updateError(),fetch(ajaxurl,{method:"POST",body:a,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},credentials:"same-origin"}).then((function(t){if(!t.ok)throw new Error(t.statusText);return t.json()})).then((function(e){if(!e.success)throw new Error(e.data.message);t.lastSearch=n,t.form.querySelector(".wpml-flex-table-body").innerHTML=e.data.body,t.navigatorContainer.outerHTML=e.data.pagination})).then((function(){t.initData(),t.bindEvents(),t.tools.scrollTo(t.form.parentElement,t.tools.SCROLL_TO_BOTTOM,t.SCROLL_DURATION),t.filter.onUpdated(),t.navigator.onUpdated()})).catch((function(e){return t.updateError(e),t.filter.onUpdated(),t.navigator.onUpdated(),e}))}this.form.querySelector('input[type="submit"]').click()}}]),t}(),X=n(9),Q=n.n(X),tt=function(t){var e=t.ateControls,n=Object(i.useState)(""),a=Q()(n,2),s=a[0],o=a[1],u=Object(i.useState)(!1),l=Q()(u,2),c=l[0],h=l[1];return r.a.createElement("div",null,r.a.createElement("button",{disabled:c,className:"button-secondary",onClick:function(){return h(!0),void e.handleSynchronize().catch((function(t){return o(t)})).finally((function(){return h(!1)}))}},Object(G.a)("Synchronize translators and translation managers with ATE","sitepress"),c&&r.a.createElement("span",{className:"spinner",style:{visibility:"visible"}})),s&&r.a.createElement(et,{message:s}))},et=function(t){var e=t.message,n=Object(G.c)(Object(G.a)("Please try again in a few minutes. If the problem persists, please contact %sWPML support%s.","sitepress"),'<a target="_blank" rel="noopener" href="https://wpml.org/forums/forum/english-support/">',"</a>");return r.a.createElement("div",{className:"otgs-notice otgs-notice__errors error inline"},r.a.createElement("p",{className:"message"},e),r.a.createElement("p",{className:"help",dangerouslySetInnerHTML:{__html:sanitizeHtml(n,{allowedTags:["a"]})}}))},nt=n(51),it=n(39),rt=n(116),at=n(134),st=n(854),ot=n(383),ut=n(535),lt=(n(108),n(148),n(397)),ct=(n(72),n(147)),ht=n(75),dt=(n(59),n(88)),pt=(n(109),n(81)),ft=n(517),vt=(n(189),function(t){var e=t.hasCurrentData,n=t.visible,a=t.onCancel,s=t.onSend,o=t.title,u=t.content,l=t.yes,c=t.no,h=t.fetching,d=Object(i.useState)(!0),p=Q()(d,2),f=p[0],v=p[1],m=function(t){var e=t.children;return h?r.a.createElement(lt.a,null,e):e};return r.a.createElement(ut.a,{visible:n,onCancel:a,footer:null,closable:!1,width:600,className:"wpml-wizard__modal",closeIcon:r.a.createElement(pt.a,null)},r.a.createElement("h3",null,o),r.a.createElement(m,null,u,e&&r.a.createElement(ct.a,{className:"wpml-row-spacing"},r.a.createElement(ht.a,null,r.a.createElement(ft.a,{checked:!f,onChange:function(){v(!1)},value:"automatic"},r.a.createElement("span",{dangerouslySetInnerHTML:{__html:Object(G.a)("Yes, translate <b>existing</b> and <b>future</b> content automatically","sitepress")}})))),r.a.createElement(ct.a,{className:"wpml-row-spacing"},r.a.createElement(ht.a,null,r.a.createElement(ft.a,{checked:f,onChange:function(){v(!0)},value:"automaticOnlyNew"},r.a.createElement("span",{dangerouslySetInnerHTML:{__html:e?Object(G.a)("Yes, but only translate <b>future</b> content automatically","sitepress"):Object(G.a)("Yes, translate <b>future</b> content automatically","sitepress")}}))))),r.a.createElement(ct.a,{className:"ant-modal-body__footer"},r.a.createElement(ht.a,{span:4},r.a.createElement(dt.a,{className:"wpml-antd-button wpml-antd-button-secondary wpml-no-do-not-send",type:"Secondary",onClick:a},c)),r.a.createElement(ht.a,{span:20,className:"text-right"},r.a.createElement(dt.a,{className:"wpml-antd-button wpml-antd-button-primary wpml-yes-send-to-translation",type:"primary",onClick:function(){return s(f)},disabled:h},l))))}),mt=n(110),gt=n(1325),yt=n(441);function St(t,e){return(e=function(t){return Object(yt.a)(window.wpmlStore)||Object(yt.a)(window.wpmlStore[t])?null:window.wpmlStore[t]}(e))?e.getState()[t]:null}var bt=function(){return document.getElementById("wpml_post_type_save_legacy").click()},kt="undefined"!=typeof wpmlSettingsUI?wpmlSettingsUI.existingPostTypes:[],Et=Object(nt.a)(Object(it.a)("slug"),Object(rt.a)(at.a,kt),st.a),wt=function(){return R()(document.querySelectorAll("#icl_custom_posts_sync_options input.js-custom-post-mode:checked")).filter((function(t){return"1"===t.value||"2"===t.value})).map(Object(it.a)("dataset")).filter(Et)},Ct=function(t){var e=t.postTypes;return r.a.createElement("strong",null,e.map(Object(it.a)("name")).reduce((function(t,e){return t+(t?", ":"")+e}),""))},Ot=function(){var t=Object(i.useState)(!1),e=Q()(t,2),n=e[0],a=e[1],s=function(t){var e=Object(i.useState)(!1),n=Q()(e,2),r=n[0],a=n[1],s=Object(i.useState)(0),o=Q()(s,2),u=o[0],l=o[1];return[r,u,function(){var e=T()(C.a.mark((function e(){var n,i,r,s,o,u=arguments;return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>0&&void 0!==u[0]?u[0]:null,a(!0),e.next=4,Object(N.a)(t,n?{postTypes:n}:{});case 4:i=e.sent,r=i.data,s=r.success,o=r.data,s&&o&&l(o),a(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()]}(wpmlSettingsUI.endpoints.getCount),o=Q()(s,3),u=o[0],l=o[1],c=o[2],h=Object(i.useState)([]),d=Q()(h,2),p=d[0],f=d[1],v=Object(mt.a)(wpmlSettingsUI.endpoints.setAutomatic),m=Q()(v,2),g=m[0],y=m[1];Object(i.useEffect)((function(){n&&c(Object(ot.a)("slug",p))}),[n]);var S=function(){a(!1),bt()},b=Object(G.a)("Please confirm this translation setting","sitepress"),k=l>0?Object(G.c)(Object(G.b)("Your site is set to translate all content automatically. When you make <PostTypesNames /> translatable, WPML will automatically translate the %1$d existing item.","Your site is set to translate all content automatically. When you make <PostTypesNames /> translatable, WPML will automatically translate the %1$d existing items.",parseInt(l),"sitepress"),l):Object(G.a)("Your site is set to translate all content automatically. When you make <PostTypesNames /> translatable, WPML will automatically translate all future content.","sitepress");k=Object(gt.a)(k,{PostTypesNames:r.a.createElement(Ct,{postTypes:p})});var E=Object(G.a)("Are you OK with paying for this?","sitepress"),w=Object(G.a)("Cancel","sitepress"),O=Object(G.a)("Make translatable","sitepress"),_=r.a.createElement("p",null,r.a.createElement("span",null,k),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("strong",null,E));return r.a.createElement(r.a.Fragment,null,r.a.createElement("button",{className:"button-primary wpml-button base-btn",onClick:function(t){t.preventDefault();var e=wt();e.length&&"automatic"===St("method","translationMethod")?(f(e),a(!0)):bt()}},Object(G.a)("Save","sitepress")),r.a.createElement(vt,{hasCurrentData:l>0,visible:n,onCancel:function(){return a(!1)},title:b,content:_,onSend:function(t){var e=wt().map(Object(it.a)("slug"));y({postTypes:e,onlyNew:t},S)},fetching:u||g,no:w,yes:O}))};document.addEventListener("DOMContentLoaded",(function(){if("undefined"!=typeof wpmlSettingsUI){var t=document.getElementById("wpml_post_type_save");if(t&&s.a.render(r.a.createElement(Ot,null),t),wpmlSettingsUI&&wpmlSettingsUI.isTMLoaded){var e=new E.a;new Y;var n=new k(e),i=new B(n);if(i.isStatusOnly())i.initEventHandlers();else new S(i).init();!function(t){var e=document.getElementById("synchronize-ate-ams");e&&s.a.render(r.a.createElement(tt,{ateControls:t}),e)}(i);var a=new x.a,o=document.querySelectorAll(".wpml-custom-fields-settings");Array.from(o).map((function(t){new K(t,a).bindEvents()}))}}}))},148:function(t,e,n){},150:function(t,e,n){"use strict";var i=n(15),r=n.n(i),a=n(19),s=n.n(a),o=function(){function t(){r()(this,t),this.SCROLL_TO_TOP=1,this.SCROLL_TO_BOTTOM=2}return s()(t,[{key:"show",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(t.style.display=null),t.classList.remove("hidden")}},{key:"hide",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e&&(t.style.display="none"),t.classList.add("hidden")}},{key:"showSpinner",value:function(t){t.classList.add("is-active")}},{key:"hideSpinner",value:function(t){t.classList.remove("is-active")}},{key:"enableElement",value:function(t){t.classList.remove("disabled")}},{key:"disableElement",value:function(t){t.classList.add("disabled")}},{key:"scrollTo",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.SCROLL_TO_TOP,i=arguments.length>2?arguments[2]:void 0,r=t.getBoundingClientRect();e=this.SCROLL_TO_BOTTOM===n?window.scrollY-window.innerHeight+r.top+r.height:window.scrollY+r.top;var a=document.scrollingElement||document.documentElement,s=a.scrollTop,o=e-s,u=+new Date,l=function(t,e,n,i){return(t/=i/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e},c=function t(){var n=+new Date-u;a.scrollTop=parseInt(l(n,s,o,i)),n<i?requestAnimationFrame(t):a.scrollTop=e};c()}}]),t}();e.a=o},151:function(t,e,n){"use strict";n.d(e,"b",(function(){return s}));var i=n(507),r=n.n(i),a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"wpml",n="rtl"===document.getElementsByTagName("html")[0].dir,i={arrow:!0,theme:e,animation:"fade",sticky:!0,interactive:!0,dynamicTitle:!0,placement:n?"top-end":"top-start"};r()(t,i)};e.a=a;var s=function(t,e){var n=t._tippy;n&&n.destroy(),t.setAttribute("title",e),a(t,"otgs")}},189:function(t,e,n){},387:function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return c}));var i=n(29),r=n.n(i),a=n(453),s=n(451),o=n(51),u=Object(a.a)("WPML-"),l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};document.dispatchEvent(new CustomEvent(u(t),{detail:e}))},c=function(t){var e=[],n={then:function(t){return e=Object(s.a)(t,e),this}};return document.addEventListener(u(t),(function(t){o.a.apply(void 0,r()(e))(t.detail)})),n}},59:function(t,e,n){},72:function(t,e,n){},81:function(t,e,n){"use strict";var i=n(0);function r(){return(r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}var a=i.createElement("path",{d:"M11.778 13.743l1.965-1.965a.871.871 0 000-1.235L10.2 7l3.543-3.543a.871.871 0 000-1.235L11.778.257a.871.871 0 00-1.235 0L7 3.8 3.457.257a.871.871 0 00-1.235 0L.257 2.222a.871.871 0 000 1.235L3.8 7 .257 10.543a.871.871 0 000 1.235l1.965 1.965a.871.871 0 001.235 0L7 10.2l3.543 3.543a.878.878 0 001.235 0z",fill:"#555"});e.a=function(t){return i.createElement("svg",r({width:14,height:14,fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),a)}},82:function(t,e,n){"use strict";var i=n(15),r=n.n(i),a=function t(e){r()(this,t),this.ID=e.ID,this.caps=e.caps,this.roles=e.roles,this.user_email=e.data,this.user_login=e.data.user_email,this.user_nicename=e.data.user_login};e.a=function t(){r()(this,t),this.restUrl=WPML_TM_SETTINGS.restUrl,this.restNonce=WPML_TM_SETTINGS.restNonce,this.ateSettings=WPML_TM_SETTINGS.ate,this.currentUser=new a(WPML_TM_SETTINGS.currentUser)}},90:function(t,e,n){"use strict";var i=n(3),r=n.n(i),a=n(7),s=n.n(a),o=n(15),u=n.n(o),l=n(19),c=n.n(l),h=n(38),d=n.n(h),p=n(46),f=n.n(p),v=n(41),m=n.n(v),g=n(82),y=n(85);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=m()(t);if(e){var r=m()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return f()(this,n)}}Object(y.a)();var b=function(t){d()(i,t);var e,n=S(i);function i(){return u()(this,i),n.apply(this,arguments)}return c()(i,[{key:"get",value:function(t){return this.request(t,"GET")}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.request(t,"POST",e)}},{key:"download",value:(e=s()(r.a.mark((function t(e){var n=this;return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",fetch(e,this.generateArgs("GET")).then((function(t){return t.ok?t.blob():n.buildError(t)})));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"request",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=this.generateArgs(e,n);return this.restUrl.includes("?")&&(t=t.replace("?","&")),this.handleRequest(this.restUrl+t,i)}},{key:"handleRequest",value:function(t,e){var n=this;return fetch(t,e).then((function(t){return t.ok?t.json():n.buildError(t)}))}},{key:"generateArgs",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n={method:t.toUpperCase(),headers:{Accept:"application/json","Content-Type":"application/json","X-WP-Nonce":this.restNonce},credentials:"same-origin"};return"GET"!==n.method&&e&&(n.body="string"==typeof e?e:JSON.stringify(e)),n}},{key:"buildError",value:function(t){return t.json().then((function(e){var n=new Error(e.message||t.statusText);return Promise.reject(Object.assign(n,{response:t}))}))}}]),i}(g.a);e.a=b}});
Save
cmd:
run