import{h as d,$ as j,g as b,k as y,i as I,j as t,_ as o}from"./main.2.8.10.js";import{u as _,e as w,b as r}from"./react-router.DMwpH23k.js";import{S as C}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as v,I as F,s as N}from"./Integrations.BFhED4ck.js";import{h as l,c}from"./SmailyCommonFunc.MDX9uQzb.js";import{S as k}from"./SmailyIntegLayout.34vWIMko.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";function J({allIntegURL:f}){const p=_(),{id:E}=w(),[i,L]=d(j),[e,a]=d(b),[g,$]=r.useState(!1),[u,x]=r.useState({auth:!1}),[h,s]=r.useState({show:!1}),m=y(I),S=()=>{if(!c(e)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}N({flow:i,allIntegURL:f,conf:e,navigate:p,edit:1,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(C,{snack:h,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:n=>l(n,e,a),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(v,{entity:i.triggered_entity,setSnackbar:s}),t.jsx(k,{formID:i.triggered_entity_id,formFields:m,handleInput:n=>l(n,e,a),smailyConf:e,setSmailyConf:a,loading:u,setLoading:x,setSnackbar:s}),t.jsx(F,{edit:!0,saveConfig:S,disabled:!c(e),isLoading:g,dataConf:e,setDataConf:a,formFields:m}),t.jsx("br",{})]})}export{J as default};
