Liferay.Loader.define("style-book-web@2.0.76/js/style-book-editor/saveDraft",["module","exports","require","frontend-js-web","./config"],(function(e,o,t){window;Object.defineProperty(o,"__esModule",{value:!0}),o.default=function saveDraft(e){const o=(0,r.objectToFormData)({["".concat(n.config.namespace,"frontendTokensValues")]:JSON.stringify(e),["".concat(n.config.namespace,"styleBookEntryId")]:n.config.styleBookEntryId});return(0,r.fetch)(n.config.saveDraftURL,{body:o,method:"post"}).then((e=>e.clone().json().catch((()=>e.text())).then((o=>[e,o])))).then((([e,o])=>{if(e.status>=400||"object"!=typeof o)throw new Error(Liferay.Language.get("an-unexpected-error-occurred"));if(o.error)throw new Error(o.error);return o}))};var r=t("frontend-js-web"),n=t("./config")}));
//# sourceMappingURL=saveDraft.js.map