Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.169/page_editor/app/contexts/StyleErrorsContext",["module","exports","require","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.StyleErrorsContextProvider=function StyleErrorsContextProvider({children:e,initialState:t={}}){const[r,n]=(0,o.useState)(t);return o.default.createElement(i.Provider,{value:{setState:n,state:r}},e)},t.useDeleteStyleError=function useDeleteStyleError(){const{setState:t,state:r}=(0,o.useContext)(i);return(0,o.useCallback)(((o,n=e)=>{var i;if(null===(i=r[n])||void 0===i?void 0:i[o]){const e={},{[n]:i}=r,c=function _objectWithoutProperties(e,t){if(null==e)return{};var r,o,n=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,o,n={},i=Object.keys(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(r,[n].map(_toPropertyKey));for(const t in i)t!==o&&(e[t]=i[t]);const u=_objectSpread(_objectSpread({},c),!!Object.keys(e).length&&{[n]:e});t(u)}}),[t,r])},t.useHasStyleErrors=function useHasStyleErrors(){const{state:e}=(0,o.useContext)(i);return!!Object.keys(e).length},t.useSetStyleError=function useSetStyleError(){const{setState:t,state:r}=(0,o.useContext)(i);return(0,o.useCallback)(((o,n,i=e)=>{t(_objectSpread(_objectSpread({},r),{},{[i]:_objectSpread(_objectSpread({},r[i]),{},{[o]:n})}))}),[t,r])},t.useStyleErrors=function useStyleErrors(){const{state:e}=(0,o.useContext)(i);return e};var o=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}const e="defaultId",n={setState:()=>{},state:{}},i=o.default.createContext(n)}}));
//# sourceMappingURL=StyleErrorsContext.js.map