!function(e){function t(t){for(var r,o,u=t[0],l=t[1],c=t[2],p=0,f=[];p<u.length;p++)o=u[p],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&f.push(a[o][0]),a[o]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(i&&i(t);f.length;)f.shift()();return s.push.apply(s,c||[]),n()}function n(){for(var e,t=0;t<s.length;t++){for(var n=s[t],r=!0,u=1;u<n.length;u++){var l=n[u];0!==a[l]&&(r=!1)}r&&(s.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={26:0},s=[];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,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var u=window.webpackWPML=window.webpackWPML||[],l=u.push.bind(u);u.push=t,u=u.slice();for(var c=0;c<u.length;c++)t(u[c]);var i=l;s.push([1285,0]),n()}({1285:function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r),s=n(38),o=n.n(s),u=n(3),l=n.n(u),c=n(7),i=n.n(c),p=n(9),f=n.n(p),m=n(1),d=function(){return a.a.createElement("img",{src:wpmlLanguageSettings.loaderImage,alt:"loading",width:"16",height:"16"})},g=function(){var e=Object(r.useState)(null),t=f()(e,2),n=t[0],a=t[1];return Object(r.useEffect)((function(){n&&setTimeout((function(){a(null)}),3e3)}),[n,a]),{confirmation:n,setSuccess:function(e){return a({message:e,type:"success"})},setError:function(e){return a({message:e,type:"error"})}}},v=n(17),b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=Object(r.useState)(!1),n=f()(t,2),a=n[0],s=n[1];e||(e=wpmlLanguageSettings.endpoints.setFileType);var o=function(){var t=i()(l.a.mark((function t(n,r,a){var o,u;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s(!0),t.prev=1,t.next=4,Object(v.a)(e,{format:n});case 4:if(!(u=t.sent).success||null==u||null===(o=u.data)||void 0===o||!o.success){t.next=9;break}r(Object(m.a)("The new format has been saved.","sitepress")),t.next=10;break;case 9:throw new Error;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(1),a(Object(m.a)("Failed to save the new format","sitepress"));case 15:s(!1);case 16:case"end":return t.stop()}}),t,null,[[1,12]])})));return function(e,n,r){return t.apply(this,arguments)}}();return{isSaving:a,save:o}},y=function(e){var t=e.message,n=e.type,r=void 0===n?"success":n;return a.a.createElement("span",{className:"icl_ajx_response",style:{display:"inline",color:"error"===r?"red":"auto"}},t)},h=function(e){var t=e.initialFormat,n=e.allowedFormats,s=Object(r.useState)(t),o=f()(s,2),u=o[0],c=o[1],p=b(),v=p.isSaving,h=p.save,w=g(),O=w.confirmation,j=w.setSuccess,E=w.setError,S=function(){var e=i()(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",h(u,j,E));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return a.a.createElement(a.a.Fragment,null,a.a.createElement("h4",null,Object(m.a)("Choose the image file type for flags","sitepress")),a.a.createElement("p",{className:"explanation-text"},Object(m.a)("This option affects only the built-in WPML flags, not the custom uploaded ones.","sitepress")),a.a.createElement("ul",{onChange:function(e){c(e.target.value)}},n.map((function(e){return a.a.createElement("li",{key:e},a.a.createElement("label",null,a.a.createElement("input",{type:"radio",name:"flags_format",value:e,defaultChecked:u===e}),sprintf(Object(m.a)("%s format","sitepress"),e.toUpperCase())))}))),a.a.createElement("p",{className:"buttons-wrap"},v&&a.a.createElement(y,{message:a.a.createElement(d,null)}),O&&a.a.createElement(y,{message:O.message,type:O.type}),a.a.createElement("input",{className:"button button-primary",name:"save",value:Object(m.a)("Save","sitepress"),type:"submit",onClick:S,disabled:v})))};document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("wpml-default-flag-format");e&&o.a.render(a.a.createElement(h,{initialFormat:wpmlLanguageSettings.flagsDefaultType.selectedFormat,allowedFormats:wpmlLanguageSettings.flagsDefaultType.allowedFormats}),e)}))}});