Liferay.Loader.define("commerce-frontend-js@4.0.75/utilities/forms/formsHelper",["module","exports","require"],(function(e,r,t){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.isFormElement=function isFormElement(e){return e instanceof HTMLFormElement},r.toJSON=function toJSON(r){const t={};for(const[u,i]of r.entries())if(n=u,!e.includes(n)){if(!(u in t)){t[u]=i;continue}Array.isArray(t[u])||(t[u]=[t[u]]),t[u].push(i)}var n;return t},r.getDefaultFieldsShape=function getDefaultFieldsShape(e){try{const r=e.pages[0].rows;return r.map((e=>e.columns[0].fields[0])).map((e=>{const{fieldName:r,predefinedValue:t,required:n}=e;return{key:r,required:n,value:toArray(t)}}))}catch(e){return[]}},r.updateFields=function updateFields(e,r){return e.reduce(((e,t)=>{const{key:n}=t,{fieldInstance:u,value:i}=r,{fieldName:o}=u;return o===n?e.push({key:o,required:t.required,value:toArray(i)}):e.push(t),e}),[])};const e=["formDate","p_auth"];function toArray(e){return Array.isArray(e)?[...e]:[e]}}}));
//# sourceMappingURL=formsHelper.js.map