import{h as l,$ as S,g as j,k as I,i as _,j as e,_ as s,z as n}from"./main.2.9.0.js";import{u as C,b as m}from"./react-router.DMwpH23k.js";import{S as w}from"./SnackMsg.DYSD96P4.js";import{S as k,I as y,s as F}from"./Integrations.DL8wqGct.js";import{h as c,c as v}from"./SureMembersCommonFunc.DUZDornX.js";import{S as M}from"./SureMembersIntegLayout.1M9iLk8g.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 J({allIntegURL:f}){const p=C(),[i,N]=l(S),[t,a]=l(j),[u,E]=m.useState(!1),[g,x]=m.useState({auth:!1,groups:!1}),[b,r]=m.useState({show:!1}),d=I(_),h=()=>{if(!t.selectedTask){n.error(s("Please select a task!","bit-integrations"));return}if(!v(t)){n.error(s("Please map mandatory fields!","bit-integrations"));return}if(!t.selectedGroup){n.error(s("Please select a group!","bit-integrations"));return}F({flow:i,allIntegURL:f,conf:t,navigate:p,edit:1,setSnackbar:r})};return e.jsxs("div",{style:{width:900},children:[e.jsx(w,{snack:b,setSnackbar:r}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:s("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>c(o,t,a),name:"name",defaultValue:t.name||"",type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(k,{entity:i.triggered_entity,setSnackbar:r}),e.jsx(M,{formID:i.triggered_entity_id,formFields:d,handleInput:o=>c(o,t,a),sureMembersConf:t,setSureMembersConf:a,loading:g,setLoading:x,setSnackbar:r}),e.jsx(y,{edit:!0,saveConfig:h,isLoading:u,dataConf:t,setDataConf:a,formFields:d}),e.jsx("br",{})]})}export{J as default};
