(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function r(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(e,r,o){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}wp.apiFetch.use((function(t,e){if(!t.path||"PUT"!==t.method&&"POST"!==t.method)return e(t);var o=wp.data.select("core/editor");if(!o)return e(t);var n=o.getCurrentPost();if(!n.hasOwnProperty("type"))return e(t);var i=wp.data.select("core").getPostType(n.type);if(!i.hasOwnProperty("rest_base"))return e(t);var a="/wp/v2/"+i.rest_base+"/"+n.id;return t.path.startsWith(a)&&"PUT"===t.method||t.path.startsWith(a+"/autosaves")&&"POST"===t.method?n.hasOwnProperty("qtx_editor_lang")?e(r(r({},t),{},{data:r(r({},t.data),{},{qtx_editor_lang:n.qtx_editor_lang})})):(console.log("QT-XT API: missing field [qtx_editor_lang] in post id="+n.id),e(t)):e(t)}))})();