Liferay.Loader.define("data-engine-js-components-web@1.0.79/js/core/hooks/useForm.es",["module","exports","require","@liferay/frontend-js-react-web","liferay!frontend-js-react-web$react","../reducers/createReducer.es","./useConfig.es","./useDataView.es"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.FormNoopProvider=function({children:t,initialState:r,onAction:a,value:u}){const[,c]=(0,n.useThunk)([{},a]);return o.default.createElement(e.Provider,{value:c},o.default.createElement(p.Provider,{value:f(f({},r),u)},t))},t.FormProvider=d,t.useForm=function(){return(0,o.useContext)(e)},t.useFormState=function({schema:e}={}){return(0,c.useDataView)((0,o.useContext)(p),e)};var n=r("@liferay/frontend-js-react-web"),o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),a=r("../reducers/createReducer.es"),u=r("./useConfig.es"),c=r("./useDataView.es");function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e=o.default.createContext((()=>{}));e.displayName="FormDispatchContext";const p=o.default.createContext({editingLanguageId:"en_US"});p.displayName="FormStateContext";const b=([e,t],r)=>[e,(0,o.useCallback)((e=>{t(e),null==r||r(e)}),[t,r])];function d({children:t,init:r=(e=>e),initialState:c={},onAction:i,reducers:s,value:l}){const d=(0,u.useConfig)(),[y,O]=(0,n.useThunk)(b((0,o.useReducer)((0,a.createReducer)(s,d),f(f({},c),l),(e=>r(e,d))),i));return o.default.createElement(e.Provider,{value:O},o.default.createElement(p.Provider,{value:y},"function"==typeof t?t(y):t))}d.displayName="FormProvider"}}));
//# sourceMappingURL=useForm.es.js.map