import{h as d,$ as j,g as b,k as _,i as w,j as e,_ as o,q as C}from"./main.2.9.0.js";import{u as I,e as v,b as n}from"./react-router.DMwpH23k.js";import{S as y}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as F,I as D,s as N}from"./Integrations.DL8wqGct.js";import{h as k,c as m}from"./SuiteDashCommonFunc.DxALnLRi.js";import{S as R}from"./SuiteDashIntegLayout.eLl0zQkJ.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";function K({allIntegURL:l}){const c=I(),{id:E}=v(),[a,L]=d(j),[t,i]=d(b),[f,p]=n.useState(!1),[g,u]=n.useState({}),[x,s]=n.useState({show:!1}),r=_(w),h=()=>{if(!m(t)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}if(!t.selectedRole){C.error("Please select a Role");return}N({flow:a,allIntegURL:l,conf:t,navigate:c,edit:1,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(y,{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:S=>k(S,t,i),name:"name",value:t.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(F,{entity:a.triggered_entity,setSnackbar:s}),e.jsx(R,{formID:a.triggered_entity_id,formFields:r,suiteDashConf:t,setSuiteDashConf:i,loading:g,setLoading:u,setIsLoading:p,setSnackbar:s}),e.jsx(D,{edit:!0,saveConfig:h,disabled:!m(t),isLoading:f,dataConf:t,setDataConf:i,formFields:r}),e.jsx("br",{})]})}export{K as default};
