!function(e){function t(t){for(var r,o,i=t[0],u=t[1],c=t[2],s=0,g=[];s<i.length;s++)o=i[s],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&g.push(a[o][0]),a[o]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);for(p&&p(t);g.length;)g.shift()();return l.push.apply(l,c||[]),n()}function n(){for(var e,t=0;t<l.length;t++){for(var n=l[t],r=!0,i=1;i<n.length;i++){var u=n[i];0!==a[u]&&(r=!1)}r&&(l.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={21:0},l=[];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 i=window.webpackWPML=window.webpackWPML||[],u=i.push.bind(i);i.push=t,i=i.slice();for(var c=0;c<i.length;c++)t(i[c]);var p=u;l.push([1293,0]),n()}({1293:function(e,t,n){"use strict";n.r(t);var r=n(9),a=n.n(r),l=n(27),o=n.n(l),i=n(15),u=n.n(i);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){u()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var s=wp.hooks.addFilter,g=wp.compose.createHigherOrderComponent,d=wp.blockEditor.InspectorControls,f=wp.components,b=f.PanelBody,v=f.SelectControl,_=wp.i18n.__,y=[{label:_("All"),value:"all"}],m=g((function(e){var t=[];return t.push({label:y[0].label,value:y[0].value}),t.push.apply(t,o()(Object.entries(wpml_active_and_selected_languages.active_languages).map((function(e){var t=a()(e,2),n=(t[0],t[1]);return{label:n.native_name,value:n.code}})))),function(n){var r=n.attributes.wpml_language;return void 0!==n.attributes.__internalWidgetId&&"core/legacy-widget"===n.name&&(y[0].value=wpml_active_and_selected_languages.legacy_widgets_languages[n.attributes.__internalWidgetId]),React.createElement(React.Fragment,null,React.createElement(e,n),React.createElement(d,null,React.createElement(b,{title:_("Display on language","sitepress"),initialOpen:!0},React.createElement(v,{value:r||y[0].value,options:t,onChange:function(e){if(n.setAttributes({wpml_language:e}),void 0!==n.attributes.__internalWidgetId&&"core/legacy-widget"===n.name){var r=t.find((function(t){return t.value===e}));void 0!==r&&w(n.attributes.__internalWidgetId,r)}}}))))}}),"languageControls"),w=function(e,t){var n=new FormData;n.append("action","wpml_change_selected_language_for_legacy_widget"),n.append("id",e),n.append("selected_language_value",t.value),n.append("nonce",wpml_active_and_selected_languages.nonce),fetch(ajaxurl,{method:"POST",body:n}).then((function(e){if(!e.ok)throw new Error("Changing selected language for legacy widgets action has failed!.")}))};s("blocks.registerBlockType","sitepress-multilingual-cms/attribute/wpml_language",(function(e){return e.attributes=p(p({},e.attributes),{},{wpml_language:{type:"string"}}),e})),s("editor.BlockEdit","sitepress-multilingual-cms/language-controls",m)}});