import{h as d,$ as w,g as j,k as b,i as I,j as t,_ as i}from"./main.2.9.0.js";import{u as N,b as r}from"./react-router.DMwpH23k.js";import{S as _}from"./SnackMsg.DYSD96P4.js";import{S as C,I as S,s as y}from"./Integrations.DL8wqGct.js";import{h as l,c as F}from"./NewsletterCommonFunc.BmwQNvkW.js";import{N as v}from"./NewsletterIntegLayout.DhWAW-Gr.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function H({allIntegURL:c}){const f=N(),[n,k]=d(w),[e,a]=d(j),[p,E]=r.useState(!1),[g,u]=r.useState({auth:!1}),[x,s]=r.useState({show:!1}),m=b(I),h=()=>{if(!F(e)){s({show:!0,msg:i("Please map mandatory fields","bit-integrations")});return}y({flow:n,allIntegURL:c,conf:e,navigate:f,edit:1,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(_,{snack:x,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:i("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>l(o,e,a),name:"name",defaultValue:e.name||"",type:"text",placeholder:i("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(C,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(v,{formID:n.triggered_entity_id,formFields:m,handleInput:o=>l(o,e,a),newsletterConf:e,setNewsletterConf:a,loading:g,setLoading:u,setSnackbar:s}),t.jsx(S,{edit:!0,saveConfig:h,isLoading:p,dataConf:e,setDataConf:a,formFields:m}),t.jsx("br",{})]})}export{H as default};
