var F=Object.defineProperty;var o=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var h=(a,t,e)=>t in a?F(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,n=(a,t)=>{for(var e in t||(t={}))_.call(t,e)&&h(a,e,t[e]);if(o)for(var e of o(t))p.call(t,e)&&h(a,e,t[e]);return a};import{b as d,z as c,_ as f}from"./main.2.8.10.js";const y=(a,t,e,r,i,s)=>{const l=n({},t),{name:u,value:m}=a.target;l[u]=m,u==="mainAction"&&m!==""&&b(l,e,r),e(n({},l))},b=(a,t,e,r)=>{e(!0),d(null,"fetch_all_mail_mint_custom_fields").then(i=>{if(i&&i.success){t(s=>{const l=n({},s);return l.default||(l.default={}),i.data&&(l.mailMintContactFields=i.data),l}),e(!1),c.success(f("All custom field fetched successfully","bit-integrations"));return}e(!1),c.error(f("Mail Mint custom field fetch failed. please try again","bit-integrations"))}).catch(()=>e(!1))},k=(a,t,e,r)=>{e(!0),d(null,"fetch_all_mail_mint_list").then(i=>{if(i&&i.success){t(s=>{const l=n({},s);return l.default||(l.default={}),i.data&&(l.default.allLists=i.data),l}),e(!1),c.success(f("All list fetched successfully","bit-integrations"));return}e(!1),c.error(f("Mail mint list fetch failed. please try again","bit-integrations"))}).catch(()=>e(!1))},A=(a,t,e,r)=>{e(!0),d(null,"fetch_all_mail_mint_tags").then(i=>{if(i&&i.success){t(s=>{const l=n({},s);return l.default||(l.default={}),i.data&&(l.default.allTags=i.data),l}),e(!1),c.success(f("All tags fetched successfully","bit-integrations"));return}e(!1),c.error(f("Mail Mint fetch failed. please try again","bit-integrations"))}).catch(()=>e(!1))},w=a=>{const t=a==null?void 0:a.mailMintContactFields.filter(e=>e.required===!0);return t.length>0?t.map(e=>({formField:"",mailMintFormField:e.key})):[{formField:"",mailMintFormField:""}]},S=a=>!((a.field_map?a.field_map.filter(e=>!e.formField&&!e.mailMintFormField):[]).length>0);export{k as a,A as b,S as c,w as g,y as h,b as m};
