var n=Object.defineProperty,F=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;var f=(e,l,r)=>l in e?n(e,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[l]=r,t=(e,l)=>{for(var r in l||(l={}))y.call(l,r)&&f(e,r,l[r]);if(d)for(var r of d(l))c.call(l,r)&&f(e,r,l[r]);return e},u=(e,l)=>F(e,b(l));import{_ as o,b as p,c as m,B as k}from"./bi.394.85.js";const C=(e,l,r)=>{const a=k(l,i=>{const{name:s}=e.target;e.target.value!==""?i[s]=e.target.value:delete i[s]});r(a)},h=e=>{const l=e==null?void 0:e.staticFields.filter(r=>r.required===!0);return l.length>0?l.map(r=>({formField:"",newsletterFormField:r.key})):[{formField:"",newsletterFormField:""}]},g=e=>!((e!=null&&e.field_map?e.field_map.filter(r=>!r.formField||!r.newsletterFormField||!r.formField==="custom"&&!r.customValue):[]).length>0),v=(e,l,r,a,i)=>{if(!e.name){l({name:e.name?"":o("Name can't be empty","bit-integrations")});return}i(u(t({},a),{auth:!0})),p({},"newsletter_authentication").then(s=>{if(s.success){r(!0),m.success(o("Connected Successfully","bit-integrations")),i(u(t({},a),{auth:!1}));return}i(u(t({},a),{auth:!1})),m.error(o("Connection failed: install and active Newsletter plugin first!","bit-integrations"))})},N=[{key:"email",label:"Email",required:!0},{key:"name",label:"First Name",required:!1},{key:"surname",label:"Last Name",required:!1},{key:"status",label:"Status",required:!1},{key:"gender",label:"Gender",required:!1},{key:"country",label:"Country Code",required:!1},{key:"region",label:"Region",required:!1},{key:"city",label:"City",required:!1},{key:"profile_1",label:"Custom Field 1",required:!1},{key:"profile_2",label:"Custom Field 2",required:!1},{key:"profile_3",label:"Custom Field 3",required:!1},{key:"profile_4",label:"Custom Field 4",required:!1},{key:"profile_5",label:"Custom Field 5",required:!1},{key:"profile_6",label:"Custom Field 6",required:!1},{key:"profile_7",label:"Custom Field 7",required:!1},{key:"profile_8",label:"Custom Field 8",required:!1},{key:"profile_9",label:"Custom Field 9",required:!1},{key:"profile_10",label:"Custom Field 10",required:!1},{key:"profile_11",label:"Custom Field 11",required:!1},{key:"profile_12",label:"Custom Field 12",required:!1},{key:"profile_13",label:"Custom Field 13",required:!1},{key:"profile_14",label:"Custom Field 14",required:!1},{key:"profile_15",label:"Custom Field 15",required:!1},{key:"profile_16",label:"Custom Field 16",required:!1},{key:"profile_17",label:"Custom Field 17",required:!1},{key:"profile_18",label:"Custom Field 18",required:!1},{key:"profile_19",label:"Custom Field 19",required:!1},{key:"profile_20",label:"Custom Field 20",required:!1}],S=()=>{const e=[];for(let l=1;l<=40;l++)e.push({label:"List "+l,value:l.toString()});return e};export{g as c,h as g,C as h,S as l,v as n,N as s};
