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