var c=Object.defineProperty;var n=Object.getOwnPropertySymbols;var m=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;var r=(e,a,s)=>a in e?c(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,o=(e,a)=>{for(var s in a||(a={}))m.call(a,s)&&r(e,s,a[s]);if(n)for(var s of n(a))u.call(a,s)&&r(e,s,a[s]);return e};import"./main-343.js";const h=(e,a,s,i,t,l,p)=>{const f=[...e];if(p)f[l]=o(o({},e[l]),i),f.push({editItegration:!0}),a([...f]),t(s);else{const d=[...f];d.push(i),d.push({newItegration:!0}),a(d),t(s)}},w=e=>{const a={},i=window.location.href.replace(`${window.opener.location.href}?redirect`,"").split("&");i&&i.forEach(t=>{const l=t.split("=");l[1]&&(a[l[0]]=l[1])}),localStorage.setItem(`__bitforms_${e}`,JSON.stringify(a)),window.close()},C=(e,a,s,i,t)=>{const l=o({},a);t?i?l.relatedlists[t-1].upload_field_map.splice(e,0,{}):l.relatedlists[t-1].field_map.splice(e,0,{}):i?l.upload_field_map.splice(e,0,{}):l.field_map.splice(e,0,{}),s(o({},l))},V=(e,a,s,i,t)=>{const l=o({},a);t?i?l.relatedlists[t-1].upload_field_map.length>1&&l.relatedlists[t-1].upload_field_map.splice(e,1):l.relatedlists[t-1].field_map.length>1&&l.relatedlists[t-1].field_map.splice(e,1):i?l.upload_field_map.length>1&&l.upload_field_map.splice(e,1):l.field_map.length>1&&l.field_map.splice(e,1),s(o({},l))},I=(e,a,s,i,t,l)=>{const p=o({},s);l?t?p.relatedlists[l-1].upload_field_map[a][e.target.name]=e.target.value:p.relatedlists[l-1].field_map[a][e.target.name]=e.target.value:t?p.upload_field_map[a][e.target.name]=e.target.value:p.field_map[a][e.target.name]=e.target.value,e.target.value==="custom"&&(l?p.relatedlists[l-1].field_map[a].customValue="":p.field_map[a].customValue=""),i(o({},p))},M=(e,a,s,i,t)=>{const l=o({},s);t?l.relatedlists[t-1].field_map[a].customValue=e.target.value:l.field_map[a].customValue=e.target.value,i(o({},l))};export{M as a,C as b,w as c,V as d,I as h,h as s};
