import{b as d,$ as j,h as _,k as v,i as w,j as e,_ as a,q as C}from"./main.2.8.1.js";import{u as I,d as n}from"./react-router-dom.9mCuUg3q.js";import{S}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as y,I as F,s as D}from"./Integrations.D2bgBas2.js";import{h as E,c as l}from"./DemioCommonFunc.CwhlkKok.js";import{D as N}from"./DemioIntegLayout.B-RDcOy3.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function J({allIntegURL:c}){const f=I(),[i,k]=d(j),[t,o]=d(_),[p,r]=n.useState(!1),[g,x]=n.useState({}),[u,s]=n.useState({show:!1}),m=v(w),h=()=>{if(!l(t)){s({show:!0,msg:a("Please map mandatory fields","bit-integrations")});return}if(!t.selectedEvent){C.error(a("Please select a Event","bit-integrations"));return}D({flow:i,allIntegURL:c,conf:t,navigate:f,edit:1,setIsLoading:r,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(S,{snack:u,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:a("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:b=>E(b,t,o),name:"name",value:t.name,type:"text",placeholder:a("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(y,{entity:i.triggered_entity,setSnackbar:s}),e.jsx(N,{formID:i.triggered_entity_id,formFields:m,demioConf:t,setDemioConf:o,loading:g,setLoading:x,setIsLoading:r,setSnackbar:s}),e.jsx(F,{edit:!0,saveConfig:h,disabled:!l(t),isLoading:p,dataConf:t,setDataConf:o,formFields:m}),e.jsx("br",{})]})}export{J as default};
